]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20210323
[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 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         cat >>confdefs.h <<\EOF
3406 #define HAVE_STDNORETURN_H 1
3407 EOF
3408
3409 cat >>confdefs.h <<EOF
3410 #define STDC_NORETURN _Noreturn
3411 EOF
3412
3413         HAVE_STDNORETURN_H=1
3414 else
3415         HAVE_STDNORETURN_H=0
3416 fi
3417
3418 if test "$GCC" = yes || test "$GXX" = yes
3419 then
3420 cat > conftest.i <<EOF
3421 #ifndef GCC_PRINTF
3422 #define GCC_PRINTF 0
3423 #endif
3424 #ifndef GCC_SCANF
3425 #define GCC_SCANF 0
3426 #endif
3427 #ifndef GCC_NORETURN
3428 #define GCC_NORETURN /* nothing */
3429 #endif
3430 #ifndef GCC_UNUSED
3431 #define GCC_UNUSED /* nothing */
3432 #endif
3433 EOF
3434 if test "$GCC" = yes
3435 then
3436         { echo "$as_me:3436: checking for $CC __attribute__ directives..." >&5
3437 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3438 cat > "conftest.$ac_ext" <<EOF
3439 #line 3439 "${as_me:-configure}"
3440 #include "confdefs.h"
3441 #include "conftest.h"
3442 #include "conftest.i"
3443 #if     GCC_PRINTF
3444 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3445 #else
3446 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3447 #endif
3448 #if     GCC_SCANF
3449 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3450 #else
3451 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3452 #endif
3453 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3454 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3455 extern GCC_NORETURN void foo(void);
3456 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3457 EOF
3458         cf_printf_attribute=no
3459         cf_scanf_attribute=no
3460         for cf_attribute in scanf printf unused noreturn
3461         do
3462
3463 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3464
3465                 cf_directive="__attribute__(($cf_attribute))"
3466                 echo "checking for $CC $cf_directive" 1>&5
3467
3468                 case "$cf_attribute" in
3469                 (printf)
3470                         cf_printf_attribute=yes
3471                         cat >conftest.h <<EOF
3472 #define GCC_$cf_ATTRIBUTE 1
3473 EOF
3474                         ;;
3475                 (scanf)
3476                         cf_scanf_attribute=yes
3477                         cat >conftest.h <<EOF
3478 #define GCC_$cf_ATTRIBUTE 1
3479 EOF
3480                         ;;
3481                 (*)
3482                         cat >conftest.h <<EOF
3483 #define GCC_$cf_ATTRIBUTE $cf_directive
3484 EOF
3485                         ;;
3486                 esac
3487
3488                 if { (eval echo "$as_me:3488: \"$ac_compile\"") >&5
3489   (eval $ac_compile) 2>&5
3490   ac_status=$?
3491   echo "$as_me:3491: \$? = $ac_status" >&5
3492   (exit "$ac_status"); }; then
3493                         test -n "$verbose" && echo "$as_me:3493: result: ... $cf_attribute" >&5
3494 echo "${ECHO_T}... $cf_attribute" >&6
3495                         cat conftest.h >>confdefs.h
3496                         case "$cf_attribute" in
3497                         (noreturn)
3498
3499 cat >>confdefs.h <<EOF
3500 #define GCC_NORETURN $cf_directive
3501 EOF
3502
3503                                 ;;
3504                         (printf)
3505                                 cf_value='/* nothing */'
3506                                 if test "$cf_printf_attribute" != no ; then
3507                                         cf_value='__attribute__((format(printf,fmt,var)))'
3508
3509 cat >>confdefs.h <<\EOF
3510 #define GCC_PRINTF 1
3511 EOF
3512
3513                                 fi
3514
3515 cat >>confdefs.h <<EOF
3516 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3517 EOF
3518
3519                                 ;;
3520                         (scanf)
3521                                 cf_value='/* nothing */'
3522                                 if test "$cf_scanf_attribute" != no ; then
3523                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3524
3525 cat >>confdefs.h <<\EOF
3526 #define GCC_SCANF 1
3527 EOF
3528
3529                                 fi
3530
3531 cat >>confdefs.h <<EOF
3532 #define GCC_SCANFLIKE(fmt,var) $cf_value
3533 EOF
3534
3535                                 ;;
3536                         (unused)
3537
3538 cat >>confdefs.h <<EOF
3539 #define GCC_UNUSED $cf_directive
3540 EOF
3541
3542                                 ;;
3543                         esac
3544                 fi
3545         done
3546 else
3547         ${FGREP-fgrep} define conftest.i >>confdefs.h
3548 fi
3549 rm -rf ./conftest*
3550 fi
3551
3552 echo "$as_me:3552: checking if you want to work around bogus compiler/loader warnings" >&5
3553 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3554
3555 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3556 if test "${enable_string_hacks+set}" = set; then
3557   enableval="$enable_string_hacks"
3558   enable_string_hacks=$enableval
3559 else
3560   enable_string_hacks=no
3561 fi;
3562 echo "$as_me:3562: result: $enable_string_hacks" >&5
3563 echo "${ECHO_T}$enable_string_hacks" >&6
3564
3565 if test "x$enable_string_hacks" = "xyes"; then
3566
3567 cat >>confdefs.h <<\EOF
3568 #define USE_STRING_HACKS 1
3569 EOF
3570
3571         { echo "$as_me:3571: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3572 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3573         echo "$as_me:3573: checking for strlcat" >&5
3574 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3575 if test "${ac_cv_func_strlcat+set}" = set; then
3576   echo $ECHO_N "(cached) $ECHO_C" >&6
3577 else
3578   cat >"conftest.$ac_ext" <<_ACEOF
3579 #line 3579 "configure"
3580 #include "confdefs.h"
3581 #define strlcat autoconf_temporary
3582 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3583 #undef strlcat
3584
3585 #ifdef __cplusplus
3586 extern "C"
3587 #endif
3588
3589 /* We use char because int might match the return type of a gcc2
3590    builtin and then its argument prototype would still apply.  */
3591 char strlcat (void);
3592
3593 int
3594 main (void)
3595 {
3596
3597 /* The GNU C library defines stubs for functions which it implements
3598     to always fail with ENOSYS.  Some functions are actually named
3599     something starting with __ and the normal name is an alias.  */
3600 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3601 #error found stub for strlcat
3602 #endif
3603
3604         return strlcat ();
3605   ;
3606   return 0;
3607 }
3608 _ACEOF
3609 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3610 if { (eval echo "$as_me:3610: \"$ac_link\"") >&5
3611   (eval $ac_link) 2>&5
3612   ac_status=$?
3613   echo "$as_me:3613: \$? = $ac_status" >&5
3614   (exit "$ac_status"); } &&
3615          { ac_try='test -s "conftest$ac_exeext"'
3616   { (eval echo "$as_me:3616: \"$ac_try\"") >&5
3617   (eval $ac_try) 2>&5
3618   ac_status=$?
3619   echo "$as_me:3619: \$? = $ac_status" >&5
3620   (exit "$ac_status"); }; }; then
3621   ac_cv_func_strlcat=yes
3622 else
3623   echo "$as_me: failed program was:" >&5
3624 cat "conftest.$ac_ext" >&5
3625 ac_cv_func_strlcat=no
3626 fi
3627 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3628 fi
3629 echo "$as_me:3629: result: $ac_cv_func_strlcat" >&5
3630 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3631 if test "$ac_cv_func_strlcat" = yes; then
3632
3633 cat >>confdefs.h <<\EOF
3634 #define HAVE_STRLCAT 1
3635 EOF
3636
3637 else
3638
3639                 echo "$as_me:3639: checking for strlcat in -lbsd" >&5
3640 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3641 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3642   echo $ECHO_N "(cached) $ECHO_C" >&6
3643 else
3644   ac_check_lib_save_LIBS=$LIBS
3645 LIBS="-lbsd  $LIBS"
3646 cat >"conftest.$ac_ext" <<_ACEOF
3647 #line 3647 "configure"
3648 #include "confdefs.h"
3649
3650 /* Override any gcc2 internal prototype to avoid an error.  */
3651 #ifdef __cplusplus
3652 extern "C"
3653 #endif
3654 /* We use char because int might match the return type of a gcc2
3655    builtin and then its argument prototype would still apply.  */
3656 char strlcat ();
3657 int
3658 main (void)
3659 {
3660 strlcat ();
3661   ;
3662   return 0;
3663 }
3664 _ACEOF
3665 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3666 if { (eval echo "$as_me:3666: \"$ac_link\"") >&5
3667   (eval $ac_link) 2>&5
3668   ac_status=$?
3669   echo "$as_me:3669: \$? = $ac_status" >&5
3670   (exit "$ac_status"); } &&
3671          { ac_try='test -s "conftest$ac_exeext"'
3672   { (eval echo "$as_me:3672: \"$ac_try\"") >&5
3673   (eval $ac_try) 2>&5
3674   ac_status=$?
3675   echo "$as_me:3675: \$? = $ac_status" >&5
3676   (exit "$ac_status"); }; }; then
3677   ac_cv_lib_bsd_strlcat=yes
3678 else
3679   echo "$as_me: failed program was:" >&5
3680 cat "conftest.$ac_ext" >&5
3681 ac_cv_lib_bsd_strlcat=no
3682 fi
3683 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3684 LIBS=$ac_check_lib_save_LIBS
3685 fi
3686 echo "$as_me:3686: result: $ac_cv_lib_bsd_strlcat" >&5
3687 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3688 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3689
3690 cf_add_libs="$LIBS"
3691 # reverse order
3692 cf_add_0lib=
3693 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3694 # filter duplicates
3695 for cf_add_1lib in $cf_add_0lib; do
3696         for cf_add_2lib in $cf_add_libs; do
3697                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3698                         cf_add_1lib=
3699                         break
3700                 fi
3701         done
3702         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3703 done
3704 LIBS="$cf_add_libs"
3705
3706 for ac_header in bsd/string.h
3707 do
3708 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3709 echo "$as_me:3709: checking for $ac_header" >&5
3710 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3711 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3712   echo $ECHO_N "(cached) $ECHO_C" >&6
3713 else
3714   cat >"conftest.$ac_ext" <<_ACEOF
3715 #line 3715 "configure"
3716 #include "confdefs.h"
3717 #include <$ac_header>
3718 _ACEOF
3719 if { (eval echo "$as_me:3719: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3720   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3721   ac_status=$?
3722   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3723   rm -f conftest.er1
3724   cat conftest.err >&5
3725   echo "$as_me:3725: \$? = $ac_status" >&5
3726   (exit "$ac_status"); } >/dev/null; then
3727   if test -s conftest.err; then
3728     ac_cpp_err=$ac_c_preproc_warn_flag
3729   else
3730     ac_cpp_err=
3731   fi
3732 else
3733   ac_cpp_err=yes
3734 fi
3735 if test -z "$ac_cpp_err"; then
3736   eval "$as_ac_Header=yes"
3737 else
3738   echo "$as_me: failed program was:" >&5
3739   cat "conftest.$ac_ext" >&5
3740   eval "$as_ac_Header=no"
3741 fi
3742 rm -f conftest.err "conftest.$ac_ext"
3743 fi
3744 echo "$as_me:3744: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3745 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3746 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3747   cat >>confdefs.h <<EOF
3748 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3749 EOF
3750
3751 fi
3752 done
3753
3754 cat >>confdefs.h <<\EOF
3755 #define HAVE_STRLCAT 1
3756 EOF
3757
3758 fi
3759
3760 fi
3761
3762 for ac_func in strlcpy snprintf
3763 do
3764 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3765 echo "$as_me:3765: checking for $ac_func" >&5
3766 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3767 if eval "test \"\${$as_ac_var+set}\" = set"; then
3768   echo $ECHO_N "(cached) $ECHO_C" >&6
3769 else
3770   cat >"conftest.$ac_ext" <<_ACEOF
3771 #line 3771 "configure"
3772 #include "confdefs.h"
3773 #define $ac_func autoconf_temporary
3774 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3775 #undef $ac_func
3776
3777 #ifdef __cplusplus
3778 extern "C"
3779 #endif
3780
3781 /* We use char because int might match the return type of a gcc2
3782    builtin and then its argument prototype would still apply.  */
3783 char $ac_func (void);
3784
3785 int
3786 main (void)
3787 {
3788
3789 /* The GNU C library defines stubs for functions which it implements
3790     to always fail with ENOSYS.  Some functions are actually named
3791     something starting with __ and the normal name is an alias.  */
3792 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3793 #error found stub for $ac_func
3794 #endif
3795
3796         return $ac_func ();
3797   ;
3798   return 0;
3799 }
3800 _ACEOF
3801 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3802 if { (eval echo "$as_me:3802: \"$ac_link\"") >&5
3803   (eval $ac_link) 2>&5
3804   ac_status=$?
3805   echo "$as_me:3805: \$? = $ac_status" >&5
3806   (exit "$ac_status"); } &&
3807          { ac_try='test -s "conftest$ac_exeext"'
3808   { (eval echo "$as_me:3808: \"$ac_try\"") >&5
3809   (eval $ac_try) 2>&5
3810   ac_status=$?
3811   echo "$as_me:3811: \$? = $ac_status" >&5
3812   (exit "$ac_status"); }; }; then
3813   eval "$as_ac_var=yes"
3814 else
3815   echo "$as_me: failed program was:" >&5
3816 cat "conftest.$ac_ext" >&5
3817 eval "$as_ac_var=no"
3818 fi
3819 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3820 fi
3821 echo "$as_me:3821: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3822 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3823 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3824   cat >>confdefs.h <<EOF
3825 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3826 EOF
3827
3828 fi
3829 done
3830
3831 fi
3832
3833 echo "$as_me:3833: checking if the POSIX test-macros are already defined" >&5
3834 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3835 if test "${cf_cv_posix_visible+set}" = set; then
3836   echo $ECHO_N "(cached) $ECHO_C" >&6
3837 else
3838
3839 cat >"conftest.$ac_ext" <<_ACEOF
3840 #line 3840 "configure"
3841 #include "confdefs.h"
3842 #include <stdio.h>
3843 int
3844 main (void)
3845 {
3846
3847 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3848         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3849         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3850         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3851 #error conflicting symbols found
3852 #endif
3853
3854   ;
3855   return 0;
3856 }
3857 _ACEOF
3858 rm -f "conftest.$ac_objext"
3859 if { (eval echo "$as_me:3859: \"$ac_compile\"") >&5
3860   (eval $ac_compile) 2>&5
3861   ac_status=$?
3862   echo "$as_me:3862: \$? = $ac_status" >&5
3863   (exit "$ac_status"); } &&
3864          { ac_try='test -s "conftest.$ac_objext"'
3865   { (eval echo "$as_me:3865: \"$ac_try\"") >&5
3866   (eval $ac_try) 2>&5
3867   ac_status=$?
3868   echo "$as_me:3868: \$? = $ac_status" >&5
3869   (exit "$ac_status"); }; }; then
3870   cf_cv_posix_visible=no
3871 else
3872   echo "$as_me: failed program was:" >&5
3873 cat "conftest.$ac_ext" >&5
3874 cf_cv_posix_visible=yes
3875 fi
3876 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3877
3878 fi
3879 echo "$as_me:3879: result: $cf_cv_posix_visible" >&5
3880 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3881
3882 if test "$cf_cv_posix_visible" = no; then
3883
3884 cf_XOPEN_SOURCE=600
3885 cf_POSIX_C_SOURCE=199506L
3886 cf_xopen_source=
3887
3888 case "$host_os" in
3889 (aix[4-7]*)
3890         cf_xopen_source="-D_ALL_SOURCE"
3891         ;;
3892 (msys)
3893         cf_XOPEN_SOURCE=600
3894         ;;
3895 (darwin[0-8].*)
3896         cf_xopen_source="-D_APPLE_C_SOURCE"
3897         ;;
3898 (darwin*)
3899         cf_xopen_source="-D_DARWIN_C_SOURCE"
3900         cf_XOPEN_SOURCE=
3901         ;;
3902 (freebsd*|dragonfly*|midnightbsd*)
3903         # 5.x headers associate
3904         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3905         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3906         cf_POSIX_C_SOURCE=200112L
3907         cf_XOPEN_SOURCE=600
3908         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3909         ;;
3910 (hpux11*)
3911         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3912         ;;
3913 (hpux*)
3914         cf_xopen_source="-D_HPUX_SOURCE"
3915         ;;
3916 (irix[56].*)
3917         cf_xopen_source="-D_SGI_SOURCE"
3918         cf_XOPEN_SOURCE=
3919         ;;
3920 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3921
3922 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3923
3924 echo "$as_me:3924: checking if this is the GNU C library" >&5
3925 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3926 if test "${cf_cv_gnu_library+set}" = set; then
3927   echo $ECHO_N "(cached) $ECHO_C" >&6
3928 else
3929
3930 cat >"conftest.$ac_ext" <<_ACEOF
3931 #line 3931 "configure"
3932 #include "confdefs.h"
3933 #include <sys/types.h>
3934 int
3935 main (void)
3936 {
3937
3938         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3939                 return 0;
3940         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3941                 return 0;
3942         #else
3943         #       error not GNU C library
3944         #endif
3945   ;
3946   return 0;
3947 }
3948 _ACEOF
3949 rm -f "conftest.$ac_objext"
3950 if { (eval echo "$as_me:3950: \"$ac_compile\"") >&5
3951   (eval $ac_compile) 2>&5
3952   ac_status=$?
3953   echo "$as_me:3953: \$? = $ac_status" >&5
3954   (exit "$ac_status"); } &&
3955          { ac_try='test -s "conftest.$ac_objext"'
3956   { (eval echo "$as_me:3956: \"$ac_try\"") >&5
3957   (eval $ac_try) 2>&5
3958   ac_status=$?
3959   echo "$as_me:3959: \$? = $ac_status" >&5
3960   (exit "$ac_status"); }; }; then
3961   cf_cv_gnu_library=yes
3962 else
3963   echo "$as_me: failed program was:" >&5
3964 cat "conftest.$ac_ext" >&5
3965 cf_cv_gnu_library=no
3966 fi
3967 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3968
3969 fi
3970 echo "$as_me:3970: result: $cf_cv_gnu_library" >&5
3971 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3972
3973 if test x$cf_cv_gnu_library = xyes; then
3974
3975         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3976         # was changed to help a little.  newlib incorporated the change about 4
3977         # years later.
3978         echo "$as_me:3978: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3979 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3980 if test "${cf_cv_gnu_library_219+set}" = set; then
3981   echo $ECHO_N "(cached) $ECHO_C" >&6
3982 else
3983
3984                 cf_save="$CPPFLAGS"
3985
3986         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3987         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3988
3989                 cat >"conftest.$ac_ext" <<_ACEOF
3990 #line 3990 "configure"
3991 #include "confdefs.h"
3992 #include <sys/types.h>
3993 int
3994 main (void)
3995 {
3996
3997                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3998                                 return 0;
3999                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4000                                 return 0;
4001                         #else
4002                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4003                         #endif
4004   ;
4005   return 0;
4006 }
4007 _ACEOF
4008 rm -f "conftest.$ac_objext"
4009 if { (eval echo "$as_me:4009: \"$ac_compile\"") >&5
4010   (eval $ac_compile) 2>&5
4011   ac_status=$?
4012   echo "$as_me:4012: \$? = $ac_status" >&5
4013   (exit "$ac_status"); } &&
4014          { ac_try='test -s "conftest.$ac_objext"'
4015   { (eval echo "$as_me:4015: \"$ac_try\"") >&5
4016   (eval $ac_try) 2>&5
4017   ac_status=$?
4018   echo "$as_me:4018: \$? = $ac_status" >&5
4019   (exit "$ac_status"); }; }; then
4020   cf_cv_gnu_library_219=yes
4021 else
4022   echo "$as_me: failed program was:" >&5
4023 cat "conftest.$ac_ext" >&5
4024 cf_cv_gnu_library_219=no
4025 fi
4026 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4027                 CPPFLAGS="$cf_save"
4028
4029 fi
4030 echo "$as_me:4030: result: $cf_cv_gnu_library_219" >&5
4031 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4032
4033         if test "x$cf_cv_gnu_library_219" = xyes; then
4034                 cf_save="$CPPFLAGS"
4035                 echo "$as_me:4035: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4036 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4037 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4038   echo $ECHO_N "(cached) $ECHO_C" >&6
4039 else
4040
4041 cf_fix_cppflags=no
4042 cf_new_cflags=
4043 cf_new_cppflags=
4044 cf_new_extra_cppflags=
4045
4046 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4047 do
4048 case "$cf_fix_cppflags" in
4049 (no)
4050         case "$cf_add_cflags" in
4051         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4052                 case "$cf_add_cflags" in
4053                 (-D*)
4054                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4055
4056                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4057                                 && test -z "${cf_tst_cflags}" \
4058                                 && cf_fix_cppflags=yes
4059
4060                         if test "$cf_fix_cppflags" = yes ; then
4061
4062         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4063         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4064
4065                                 continue
4066                         elif test "${cf_tst_cflags}" = "\"'" ; then
4067
4068         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4069         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4070
4071                                 continue
4072                         fi
4073                         ;;
4074                 esac
4075                 case "$CPPFLAGS" in
4076                 (*$cf_add_cflags)
4077                         ;;
4078                 (*)
4079                         case "$cf_add_cflags" in
4080                         (-D*)
4081                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4082
4083 CPPFLAGS=`echo "$CPPFLAGS" | \
4084         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4085                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4086
4087                                 ;;
4088                         esac
4089
4090         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4091         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4092
4093                         ;;
4094                 esac
4095                 ;;
4096         (*)
4097
4098         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4099         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4100
4101                 ;;
4102         esac
4103         ;;
4104 (yes)
4105
4106         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4107         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4108
4109         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4110
4111         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4112                 && test -z "${cf_tst_cflags}" \
4113                 && cf_fix_cppflags=no
4114         ;;
4115 esac
4116 done
4117
4118 if test -n "$cf_new_cflags" ; then
4119
4120         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4121         CFLAGS="${CFLAGS}$cf_new_cflags"
4122
4123 fi
4124
4125 if test -n "$cf_new_cppflags" ; then
4126
4127         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4128         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4129
4130 fi
4131
4132 if test -n "$cf_new_extra_cppflags" ; then
4133
4134         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4135         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4136
4137 fi
4138
4139                         cat >"conftest.$ac_ext" <<_ACEOF
4140 #line 4140 "configure"
4141 #include "confdefs.h"
4142
4143                                 #include <limits.h>
4144                                 #include <sys/types.h>
4145
4146 int
4147 main (void)
4148 {
4149
4150                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4151                                         return 0;
4152                                 #else
4153                                 #       error GNU C library is too old
4154                                 #endif
4155   ;
4156   return 0;
4157 }
4158 _ACEOF
4159 rm -f "conftest.$ac_objext"
4160 if { (eval echo "$as_me:4160: \"$ac_compile\"") >&5
4161   (eval $ac_compile) 2>&5
4162   ac_status=$?
4163   echo "$as_me:4163: \$? = $ac_status" >&5
4164   (exit "$ac_status"); } &&
4165          { ac_try='test -s "conftest.$ac_objext"'
4166   { (eval echo "$as_me:4166: \"$ac_try\"") >&5
4167   (eval $ac_try) 2>&5
4168   ac_status=$?
4169   echo "$as_me:4169: \$? = $ac_status" >&5
4170   (exit "$ac_status"); }; }; then
4171   cf_cv_gnu_dftsrc_219=yes
4172 else
4173   echo "$as_me: failed program was:" >&5
4174 cat "conftest.$ac_ext" >&5
4175 cf_cv_gnu_dftsrc_219=no
4176 fi
4177 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4178
4179 fi
4180 echo "$as_me:4180: result: $cf_cv_gnu_dftsrc_219" >&5
4181 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4182                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4183         else
4184                 cf_cv_gnu_dftsrc_219=maybe
4185         fi
4186
4187         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4188
4189                 echo "$as_me:4189: checking if we must define _GNU_SOURCE" >&5
4190 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4191 if test "${cf_cv_gnu_source+set}" = set; then
4192   echo $ECHO_N "(cached) $ECHO_C" >&6
4193 else
4194
4195                 cat >"conftest.$ac_ext" <<_ACEOF
4196 #line 4196 "configure"
4197 #include "confdefs.h"
4198 #include <sys/types.h>
4199 int
4200 main (void)
4201 {
4202
4203                         #ifndef _XOPEN_SOURCE
4204                         #error  expected _XOPEN_SOURCE to be defined
4205                         #endif
4206   ;
4207   return 0;
4208 }
4209 _ACEOF
4210 rm -f "conftest.$ac_objext"
4211 if { (eval echo "$as_me:4211: \"$ac_compile\"") >&5
4212   (eval $ac_compile) 2>&5
4213   ac_status=$?
4214   echo "$as_me:4214: \$? = $ac_status" >&5
4215   (exit "$ac_status"); } &&
4216          { ac_try='test -s "conftest.$ac_objext"'
4217   { (eval echo "$as_me:4217: \"$ac_try\"") >&5
4218   (eval $ac_try) 2>&5
4219   ac_status=$?
4220   echo "$as_me:4220: \$? = $ac_status" >&5
4221   (exit "$ac_status"); }; }; then
4222   cf_cv_gnu_source=no
4223 else
4224   echo "$as_me: failed program was:" >&5
4225 cat "conftest.$ac_ext" >&5
4226 cf_save="$CPPFLAGS"
4227
4228 cf_fix_cppflags=no
4229 cf_new_cflags=
4230 cf_new_cppflags=
4231 cf_new_extra_cppflags=
4232
4233 for cf_add_cflags in -D_GNU_SOURCE
4234 do
4235 case "$cf_fix_cppflags" in
4236 (no)
4237         case "$cf_add_cflags" in
4238         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4239                 case "$cf_add_cflags" in
4240                 (-D*)
4241                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4242
4243                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4244                                 && test -z "${cf_tst_cflags}" \
4245                                 && cf_fix_cppflags=yes
4246
4247                         if test "$cf_fix_cppflags" = yes ; then
4248
4249         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4250         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4251
4252                                 continue
4253                         elif test "${cf_tst_cflags}" = "\"'" ; then
4254
4255         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4256         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4257
4258                                 continue
4259                         fi
4260                         ;;
4261                 esac
4262                 case "$CPPFLAGS" in
4263                 (*$cf_add_cflags)
4264                         ;;
4265                 (*)
4266                         case "$cf_add_cflags" in
4267                         (-D*)
4268                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4269
4270 CPPFLAGS=`echo "$CPPFLAGS" | \
4271         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4272                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4273
4274                                 ;;
4275                         esac
4276
4277         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4278         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4279
4280                         ;;
4281                 esac
4282                 ;;
4283         (*)
4284
4285         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4286         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4287
4288                 ;;
4289         esac
4290         ;;
4291 (yes)
4292
4293         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4294         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4295
4296         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4297
4298         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4299                 && test -z "${cf_tst_cflags}" \
4300                 && cf_fix_cppflags=no
4301         ;;
4302 esac
4303 done
4304
4305 if test -n "$cf_new_cflags" ; then
4306
4307         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4308         CFLAGS="${CFLAGS}$cf_new_cflags"
4309
4310 fi
4311
4312 if test -n "$cf_new_cppflags" ; then
4313
4314         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4315         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4316
4317 fi
4318
4319 if test -n "$cf_new_extra_cppflags" ; then
4320
4321         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4322         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4323
4324 fi
4325
4326                          cat >"conftest.$ac_ext" <<_ACEOF
4327 #line 4327 "configure"
4328 #include "confdefs.h"
4329 #include <sys/types.h>
4330 int
4331 main (void)
4332 {
4333
4334                                 #ifdef _XOPEN_SOURCE
4335                                 #error  expected _XOPEN_SOURCE to be undefined
4336                                 #endif
4337   ;
4338   return 0;
4339 }
4340 _ACEOF
4341 rm -f "conftest.$ac_objext"
4342 if { (eval echo "$as_me:4342: \"$ac_compile\"") >&5
4343   (eval $ac_compile) 2>&5
4344   ac_status=$?
4345   echo "$as_me:4345: \$? = $ac_status" >&5
4346   (exit "$ac_status"); } &&
4347          { ac_try='test -s "conftest.$ac_objext"'
4348   { (eval echo "$as_me:4348: \"$ac_try\"") >&5
4349   (eval $ac_try) 2>&5
4350   ac_status=$?
4351   echo "$as_me:4351: \$? = $ac_status" >&5
4352   (exit "$ac_status"); }; }; then
4353   cf_cv_gnu_source=no
4354 else
4355   echo "$as_me: failed program was:" >&5
4356 cat "conftest.$ac_ext" >&5
4357 cf_cv_gnu_source=yes
4358 fi
4359 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4360                         CPPFLAGS="$cf_save"
4361
4362 fi
4363 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4364
4365 fi
4366 echo "$as_me:4366: result: $cf_cv_gnu_source" >&5
4367 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4368
4369                 if test "$cf_cv_gnu_source" = yes
4370                 then
4371                 echo "$as_me:4371: checking if we should also define _DEFAULT_SOURCE" >&5
4372 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4373 if test "${cf_cv_default_source+set}" = set; then
4374   echo $ECHO_N "(cached) $ECHO_C" >&6
4375 else
4376
4377         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4378         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4379
4380                         cat >"conftest.$ac_ext" <<_ACEOF
4381 #line 4381 "configure"
4382 #include "confdefs.h"
4383 #include <sys/types.h>
4384 int
4385 main (void)
4386 {
4387
4388                                 #ifdef _DEFAULT_SOURCE
4389                                 #error  expected _DEFAULT_SOURCE to be undefined
4390                                 #endif
4391   ;
4392   return 0;
4393 }
4394 _ACEOF
4395 rm -f "conftest.$ac_objext"
4396 if { (eval echo "$as_me:4396: \"$ac_compile\"") >&5
4397   (eval $ac_compile) 2>&5
4398   ac_status=$?
4399   echo "$as_me:4399: \$? = $ac_status" >&5
4400   (exit "$ac_status"); } &&
4401          { ac_try='test -s "conftest.$ac_objext"'
4402   { (eval echo "$as_me:4402: \"$ac_try\"") >&5
4403   (eval $ac_try) 2>&5
4404   ac_status=$?
4405   echo "$as_me:4405: \$? = $ac_status" >&5
4406   (exit "$ac_status"); }; }; then
4407   cf_cv_default_source=no
4408 else
4409   echo "$as_me: failed program was:" >&5
4410 cat "conftest.$ac_ext" >&5
4411 cf_cv_default_source=yes
4412 fi
4413 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4414
4415 fi
4416 echo "$as_me:4416: result: $cf_cv_default_source" >&5
4417 echo "${ECHO_T}$cf_cv_default_source" >&6
4418                         if test "$cf_cv_default_source" = yes
4419                         then
4420
4421         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4422         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4423
4424                         fi
4425                 fi
4426         fi
4427
4428 fi
4429
4430         ;;
4431 (minix*)
4432         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4433         ;;
4434 (mirbsd*)
4435         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4436         cf_XOPEN_SOURCE=
4437
4438 if test "$cf_cv_posix_visible" = no; then
4439
4440 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4441
4442 cf_save_CFLAGS="$CFLAGS"
4443 cf_save_CPPFLAGS="$CPPFLAGS"
4444
4445 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4446         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4447                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4448
4449 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4450         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4451                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4452
4453 echo "$as_me:4453: checking if we should define _POSIX_C_SOURCE" >&5
4454 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4455 if test "${cf_cv_posix_c_source+set}" = set; then
4456   echo $ECHO_N "(cached) $ECHO_C" >&6
4457 else
4458
4459 echo "${as_me:-configure}:4459: testing if the symbol is already defined go no further ..." 1>&5
4460
4461         cat >"conftest.$ac_ext" <<_ACEOF
4462 #line 4462 "configure"
4463 #include "confdefs.h"
4464 #include <sys/types.h>
4465 int
4466 main (void)
4467 {
4468
4469 #ifndef _POSIX_C_SOURCE
4470 make an error
4471 #endif
4472   ;
4473   return 0;
4474 }
4475 _ACEOF
4476 rm -f "conftest.$ac_objext"
4477 if { (eval echo "$as_me:4477: \"$ac_compile\"") >&5
4478   (eval $ac_compile) 2>&5
4479   ac_status=$?
4480   echo "$as_me:4480: \$? = $ac_status" >&5
4481   (exit "$ac_status"); } &&
4482          { ac_try='test -s "conftest.$ac_objext"'
4483   { (eval echo "$as_me:4483: \"$ac_try\"") >&5
4484   (eval $ac_try) 2>&5
4485   ac_status=$?
4486   echo "$as_me:4486: \$? = $ac_status" >&5
4487   (exit "$ac_status"); }; }; then
4488   cf_cv_posix_c_source=no
4489 else
4490   echo "$as_me: failed program was:" >&5
4491 cat "conftest.$ac_ext" >&5
4492 cf_want_posix_source=no
4493          case .$cf_POSIX_C_SOURCE in
4494          (.[12]??*)
4495                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4496                 ;;
4497          (.2)
4498                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4499                 cf_want_posix_source=yes
4500                 ;;
4501          (.*)
4502                 cf_want_posix_source=yes
4503                 ;;
4504          esac
4505          if test "$cf_want_posix_source" = yes ; then
4506                 cat >"conftest.$ac_ext" <<_ACEOF
4507 #line 4507 "configure"
4508 #include "confdefs.h"
4509 #include <sys/types.h>
4510 int
4511 main (void)
4512 {
4513
4514 #ifdef _POSIX_SOURCE
4515 make an error
4516 #endif
4517   ;
4518   return 0;
4519 }
4520 _ACEOF
4521 rm -f "conftest.$ac_objext"
4522 if { (eval echo "$as_me:4522: \"$ac_compile\"") >&5
4523   (eval $ac_compile) 2>&5
4524   ac_status=$?
4525   echo "$as_me:4525: \$? = $ac_status" >&5
4526   (exit "$ac_status"); } &&
4527          { ac_try='test -s "conftest.$ac_objext"'
4528   { (eval echo "$as_me:4528: \"$ac_try\"") >&5
4529   (eval $ac_try) 2>&5
4530   ac_status=$?
4531   echo "$as_me:4531: \$? = $ac_status" >&5
4532   (exit "$ac_status"); }; }; then
4533   :
4534 else
4535   echo "$as_me: failed program was:" >&5
4536 cat "conftest.$ac_ext" >&5
4537 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4538 fi
4539 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4540          fi
4541
4542 echo "${as_me:-configure}:4542: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4543
4544          CFLAGS="$cf_trim_CFLAGS"
4545          CPPFLAGS="$cf_trim_CPPFLAGS"
4546
4547         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4548         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4549
4550 echo "${as_me:-configure}:4550: testing if the second compile does not leave our definition intact error ..." 1>&5
4551
4552          cat >"conftest.$ac_ext" <<_ACEOF
4553 #line 4553 "configure"
4554 #include "confdefs.h"
4555 #include <sys/types.h>
4556 int
4557 main (void)
4558 {
4559
4560 #ifndef _POSIX_C_SOURCE
4561 make an error
4562 #endif
4563   ;
4564   return 0;
4565 }
4566 _ACEOF
4567 rm -f "conftest.$ac_objext"
4568 if { (eval echo "$as_me:4568: \"$ac_compile\"") >&5
4569   (eval $ac_compile) 2>&5
4570   ac_status=$?
4571   echo "$as_me:4571: \$? = $ac_status" >&5
4572   (exit "$ac_status"); } &&
4573          { ac_try='test -s "conftest.$ac_objext"'
4574   { (eval echo "$as_me:4574: \"$ac_try\"") >&5
4575   (eval $ac_try) 2>&5
4576   ac_status=$?
4577   echo "$as_me:4577: \$? = $ac_status" >&5
4578   (exit "$ac_status"); }; }; then
4579   :
4580 else
4581   echo "$as_me: failed program was:" >&5
4582 cat "conftest.$ac_ext" >&5
4583 cf_cv_posix_c_source=no
4584 fi
4585 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4586          CFLAGS="$cf_save_CFLAGS"
4587          CPPFLAGS="$cf_save_CPPFLAGS"
4588
4589 fi
4590 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4591
4592 fi
4593 echo "$as_me:4593: result: $cf_cv_posix_c_source" >&5
4594 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4595
4596 if test "$cf_cv_posix_c_source" != no ; then
4597         CFLAGS="$cf_trim_CFLAGS"
4598         CPPFLAGS="$cf_trim_CPPFLAGS"
4599
4600 cf_fix_cppflags=no
4601 cf_new_cflags=
4602 cf_new_cppflags=
4603 cf_new_extra_cppflags=
4604
4605 for cf_add_cflags in $cf_cv_posix_c_source
4606 do
4607 case "$cf_fix_cppflags" in
4608 (no)
4609         case "$cf_add_cflags" in
4610         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4611                 case "$cf_add_cflags" in
4612                 (-D*)
4613                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4614
4615                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4616                                 && test -z "${cf_tst_cflags}" \
4617                                 && cf_fix_cppflags=yes
4618
4619                         if test "$cf_fix_cppflags" = yes ; then
4620
4621         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4622         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4623
4624                                 continue
4625                         elif test "${cf_tst_cflags}" = "\"'" ; then
4626
4627         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4628         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4629
4630                                 continue
4631                         fi
4632                         ;;
4633                 esac
4634                 case "$CPPFLAGS" in
4635                 (*$cf_add_cflags)
4636                         ;;
4637                 (*)
4638                         case "$cf_add_cflags" in
4639                         (-D*)
4640                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4641
4642 CPPFLAGS=`echo "$CPPFLAGS" | \
4643         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4644                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4645
4646                                 ;;
4647                         esac
4648
4649         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4650         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4651
4652                         ;;
4653                 esac
4654                 ;;
4655         (*)
4656
4657         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4658         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4659
4660                 ;;
4661         esac
4662         ;;
4663 (yes)
4664
4665         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4666         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4667
4668         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4669
4670         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4671                 && test -z "${cf_tst_cflags}" \
4672                 && cf_fix_cppflags=no
4673         ;;
4674 esac
4675 done
4676
4677 if test -n "$cf_new_cflags" ; then
4678
4679         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4680         CFLAGS="${CFLAGS}$cf_new_cflags"
4681
4682 fi
4683
4684 if test -n "$cf_new_cppflags" ; then
4685
4686         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4687         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4688
4689 fi
4690
4691 if test -n "$cf_new_extra_cppflags" ; then
4692
4693         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4694         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4695
4696 fi
4697
4698 fi
4699
4700 fi # cf_cv_posix_visible
4701
4702         ;;
4703 (netbsd*)
4704         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4705         ;;
4706 (openbsd[4-9]*)
4707         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4708         cf_xopen_source="-D_BSD_SOURCE"
4709         cf_XOPEN_SOURCE=600
4710         ;;
4711 (openbsd*)
4712         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4713         ;;
4714 (osf[45]*)
4715         cf_xopen_source="-D_OSF_SOURCE"
4716         ;;
4717 (nto-qnx*)
4718         cf_xopen_source="-D_QNX_SOURCE"
4719         ;;
4720 (sco*)
4721         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4722         ;;
4723 (solaris2.*)
4724         cf_xopen_source="-D__EXTENSIONS__"
4725         cf_cv_xopen_source=broken
4726         ;;
4727 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4728         cf_XOPEN_SOURCE=
4729         cf_POSIX_C_SOURCE=
4730         ;;
4731 (*)
4732
4733 echo "$as_me:4733: checking if we should define _XOPEN_SOURCE" >&5
4734 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4735 if test "${cf_cv_xopen_source+set}" = set; then
4736   echo $ECHO_N "(cached) $ECHO_C" >&6
4737 else
4738
4739         cat >"conftest.$ac_ext" <<_ACEOF
4740 #line 4740 "configure"
4741 #include "confdefs.h"
4742
4743 #include <stdlib.h>
4744 #include <string.h>
4745 #include <sys/types.h>
4746
4747 int
4748 main (void)
4749 {
4750
4751 #ifndef _XOPEN_SOURCE
4752 make an error
4753 #endif
4754   ;
4755   return 0;
4756 }
4757 _ACEOF
4758 rm -f "conftest.$ac_objext"
4759 if { (eval echo "$as_me:4759: \"$ac_compile\"") >&5
4760   (eval $ac_compile) 2>&5
4761   ac_status=$?
4762   echo "$as_me:4762: \$? = $ac_status" >&5
4763   (exit "$ac_status"); } &&
4764          { ac_try='test -s "conftest.$ac_objext"'
4765   { (eval echo "$as_me:4765: \"$ac_try\"") >&5
4766   (eval $ac_try) 2>&5
4767   ac_status=$?
4768   echo "$as_me:4768: \$? = $ac_status" >&5
4769   (exit "$ac_status"); }; }; then
4770   cf_cv_xopen_source=no
4771 else
4772   echo "$as_me: failed program was:" >&5
4773 cat "conftest.$ac_ext" >&5
4774 cf_save="$CPPFLAGS"
4775
4776         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4777         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4778
4779          cat >"conftest.$ac_ext" <<_ACEOF
4780 #line 4780 "configure"
4781 #include "confdefs.h"
4782
4783 #include <stdlib.h>
4784 #include <string.h>
4785 #include <sys/types.h>
4786
4787 int
4788 main (void)
4789 {
4790
4791 #ifdef _XOPEN_SOURCE
4792 make an error
4793 #endif
4794   ;
4795   return 0;
4796 }
4797 _ACEOF
4798 rm -f "conftest.$ac_objext"
4799 if { (eval echo "$as_me:4799: \"$ac_compile\"") >&5
4800   (eval $ac_compile) 2>&5
4801   ac_status=$?
4802   echo "$as_me:4802: \$? = $ac_status" >&5
4803   (exit "$ac_status"); } &&
4804          { ac_try='test -s "conftest.$ac_objext"'
4805   { (eval echo "$as_me:4805: \"$ac_try\"") >&5
4806   (eval $ac_try) 2>&5
4807   ac_status=$?
4808   echo "$as_me:4808: \$? = $ac_status" >&5
4809   (exit "$ac_status"); }; }; then
4810   cf_cv_xopen_source=no
4811 else
4812   echo "$as_me: failed program was:" >&5
4813 cat "conftest.$ac_ext" >&5
4814 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4815 fi
4816 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4817         CPPFLAGS="$cf_save"
4818
4819 fi
4820 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4821
4822 fi
4823 echo "$as_me:4823: result: $cf_cv_xopen_source" >&5
4824 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4825
4826 if test "$cf_cv_xopen_source" != no ; then
4827
4828 CFLAGS=`echo "$CFLAGS" | \
4829         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4830                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4831
4832 CPPFLAGS=`echo "$CPPFLAGS" | \
4833         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4834                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4835
4836         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4837
4838 cf_fix_cppflags=no
4839 cf_new_cflags=
4840 cf_new_cppflags=
4841 cf_new_extra_cppflags=
4842
4843 for cf_add_cflags in $cf_temp_xopen_source
4844 do
4845 case "$cf_fix_cppflags" in
4846 (no)
4847         case "$cf_add_cflags" in
4848         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4849                 case "$cf_add_cflags" in
4850                 (-D*)
4851                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4852
4853                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4854                                 && test -z "${cf_tst_cflags}" \
4855                                 && cf_fix_cppflags=yes
4856
4857                         if test "$cf_fix_cppflags" = yes ; then
4858
4859         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4860         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4861
4862                                 continue
4863                         elif test "${cf_tst_cflags}" = "\"'" ; then
4864
4865         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4866         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4867
4868                                 continue
4869                         fi
4870                         ;;
4871                 esac
4872                 case "$CPPFLAGS" in
4873                 (*$cf_add_cflags)
4874                         ;;
4875                 (*)
4876                         case "$cf_add_cflags" in
4877                         (-D*)
4878                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4879
4880 CPPFLAGS=`echo "$CPPFLAGS" | \
4881         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4882                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4883
4884                                 ;;
4885                         esac
4886
4887         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4888         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4889
4890                         ;;
4891                 esac
4892                 ;;
4893         (*)
4894
4895         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4896         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4897
4898                 ;;
4899         esac
4900         ;;
4901 (yes)
4902
4903         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4904         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4905
4906         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4907
4908         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4909                 && test -z "${cf_tst_cflags}" \
4910                 && cf_fix_cppflags=no
4911         ;;
4912 esac
4913 done
4914
4915 if test -n "$cf_new_cflags" ; then
4916
4917         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4918         CFLAGS="${CFLAGS}$cf_new_cflags"
4919
4920 fi
4921
4922 if test -n "$cf_new_cppflags" ; then
4923
4924         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4925         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4926
4927 fi
4928
4929 if test -n "$cf_new_extra_cppflags" ; then
4930
4931         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4932         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4933
4934 fi
4935
4936 fi
4937
4938 if test "$cf_cv_posix_visible" = no; then
4939
4940 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4941
4942 cf_save_CFLAGS="$CFLAGS"
4943 cf_save_CPPFLAGS="$CPPFLAGS"
4944
4945 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4946         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4947                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4948
4949 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4950         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4951                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4952
4953 echo "$as_me:4953: checking if we should define _POSIX_C_SOURCE" >&5
4954 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4955 if test "${cf_cv_posix_c_source+set}" = set; then
4956   echo $ECHO_N "(cached) $ECHO_C" >&6
4957 else
4958
4959 echo "${as_me:-configure}:4959: testing if the symbol is already defined go no further ..." 1>&5
4960
4961         cat >"conftest.$ac_ext" <<_ACEOF
4962 #line 4962 "configure"
4963 #include "confdefs.h"
4964 #include <sys/types.h>
4965 int
4966 main (void)
4967 {
4968
4969 #ifndef _POSIX_C_SOURCE
4970 make an error
4971 #endif
4972   ;
4973   return 0;
4974 }
4975 _ACEOF
4976 rm -f "conftest.$ac_objext"
4977 if { (eval echo "$as_me:4977: \"$ac_compile\"") >&5
4978   (eval $ac_compile) 2>&5
4979   ac_status=$?
4980   echo "$as_me:4980: \$? = $ac_status" >&5
4981   (exit "$ac_status"); } &&
4982          { ac_try='test -s "conftest.$ac_objext"'
4983   { (eval echo "$as_me:4983: \"$ac_try\"") >&5
4984   (eval $ac_try) 2>&5
4985   ac_status=$?
4986   echo "$as_me:4986: \$? = $ac_status" >&5
4987   (exit "$ac_status"); }; }; then
4988   cf_cv_posix_c_source=no
4989 else
4990   echo "$as_me: failed program was:" >&5
4991 cat "conftest.$ac_ext" >&5
4992 cf_want_posix_source=no
4993          case .$cf_POSIX_C_SOURCE in
4994          (.[12]??*)
4995                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4996                 ;;
4997          (.2)
4998                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4999                 cf_want_posix_source=yes
5000                 ;;
5001          (.*)
5002                 cf_want_posix_source=yes
5003                 ;;
5004          esac
5005          if test "$cf_want_posix_source" = yes ; then
5006                 cat >"conftest.$ac_ext" <<_ACEOF
5007 #line 5007 "configure"
5008 #include "confdefs.h"
5009 #include <sys/types.h>
5010 int
5011 main (void)
5012 {
5013
5014 #ifdef _POSIX_SOURCE
5015 make an error
5016 #endif
5017   ;
5018   return 0;
5019 }
5020 _ACEOF
5021 rm -f "conftest.$ac_objext"
5022 if { (eval echo "$as_me:5022: \"$ac_compile\"") >&5
5023   (eval $ac_compile) 2>&5
5024   ac_status=$?
5025   echo "$as_me:5025: \$? = $ac_status" >&5
5026   (exit "$ac_status"); } &&
5027          { ac_try='test -s "conftest.$ac_objext"'
5028   { (eval echo "$as_me:5028: \"$ac_try\"") >&5
5029   (eval $ac_try) 2>&5
5030   ac_status=$?
5031   echo "$as_me:5031: \$? = $ac_status" >&5
5032   (exit "$ac_status"); }; }; then
5033   :
5034 else
5035   echo "$as_me: failed program was:" >&5
5036 cat "conftest.$ac_ext" >&5
5037 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5038 fi
5039 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5040          fi
5041
5042 echo "${as_me:-configure}:5042: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5043
5044          CFLAGS="$cf_trim_CFLAGS"
5045          CPPFLAGS="$cf_trim_CPPFLAGS"
5046
5047         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5048         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5049
5050 echo "${as_me:-configure}:5050: testing if the second compile does not leave our definition intact error ..." 1>&5
5051
5052          cat >"conftest.$ac_ext" <<_ACEOF
5053 #line 5053 "configure"
5054 #include "confdefs.h"
5055 #include <sys/types.h>
5056 int
5057 main (void)
5058 {
5059
5060 #ifndef _POSIX_C_SOURCE
5061 make an error
5062 #endif
5063   ;
5064   return 0;
5065 }
5066 _ACEOF
5067 rm -f "conftest.$ac_objext"
5068 if { (eval echo "$as_me:5068: \"$ac_compile\"") >&5
5069   (eval $ac_compile) 2>&5
5070   ac_status=$?
5071   echo "$as_me:5071: \$? = $ac_status" >&5
5072   (exit "$ac_status"); } &&
5073          { ac_try='test -s "conftest.$ac_objext"'
5074   { (eval echo "$as_me:5074: \"$ac_try\"") >&5
5075   (eval $ac_try) 2>&5
5076   ac_status=$?
5077   echo "$as_me:5077: \$? = $ac_status" >&5
5078   (exit "$ac_status"); }; }; then
5079   :
5080 else
5081   echo "$as_me: failed program was:" >&5
5082 cat "conftest.$ac_ext" >&5
5083 cf_cv_posix_c_source=no
5084 fi
5085 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5086          CFLAGS="$cf_save_CFLAGS"
5087          CPPFLAGS="$cf_save_CPPFLAGS"
5088
5089 fi
5090 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5091
5092 fi
5093 echo "$as_me:5093: result: $cf_cv_posix_c_source" >&5
5094 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5095
5096 if test "$cf_cv_posix_c_source" != no ; then
5097         CFLAGS="$cf_trim_CFLAGS"
5098         CPPFLAGS="$cf_trim_CPPFLAGS"
5099
5100 cf_fix_cppflags=no
5101 cf_new_cflags=
5102 cf_new_cppflags=
5103 cf_new_extra_cppflags=
5104
5105 for cf_add_cflags in $cf_cv_posix_c_source
5106 do
5107 case "$cf_fix_cppflags" in
5108 (no)
5109         case "$cf_add_cflags" in
5110         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5111                 case "$cf_add_cflags" in
5112                 (-D*)
5113                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5114
5115                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5116                                 && test -z "${cf_tst_cflags}" \
5117                                 && cf_fix_cppflags=yes
5118
5119                         if test "$cf_fix_cppflags" = yes ; then
5120
5121         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5122         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5123
5124                                 continue
5125                         elif test "${cf_tst_cflags}" = "\"'" ; then
5126
5127         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5128         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5129
5130                                 continue
5131                         fi
5132                         ;;
5133                 esac
5134                 case "$CPPFLAGS" in
5135                 (*$cf_add_cflags)
5136                         ;;
5137                 (*)
5138                         case "$cf_add_cflags" in
5139                         (-D*)
5140                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5141
5142 CPPFLAGS=`echo "$CPPFLAGS" | \
5143         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5144                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5145
5146                                 ;;
5147                         esac
5148
5149         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5150         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5151
5152                         ;;
5153                 esac
5154                 ;;
5155         (*)
5156
5157         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5158         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5159
5160                 ;;
5161         esac
5162         ;;
5163 (yes)
5164
5165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5167
5168         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5169
5170         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5171                 && test -z "${cf_tst_cflags}" \
5172                 && cf_fix_cppflags=no
5173         ;;
5174 esac
5175 done
5176
5177 if test -n "$cf_new_cflags" ; then
5178
5179         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5180         CFLAGS="${CFLAGS}$cf_new_cflags"
5181
5182 fi
5183
5184 if test -n "$cf_new_cppflags" ; then
5185
5186         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5187         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5188
5189 fi
5190
5191 if test -n "$cf_new_extra_cppflags" ; then
5192
5193         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5194         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5195
5196 fi
5197
5198 fi
5199
5200 fi # cf_cv_posix_visible
5201
5202         ;;
5203 esac
5204
5205 if test -n "$cf_xopen_source" ; then
5206
5207 cf_fix_cppflags=no
5208 cf_new_cflags=
5209 cf_new_cppflags=
5210 cf_new_extra_cppflags=
5211
5212 for cf_add_cflags in $cf_xopen_source
5213 do
5214 case "$cf_fix_cppflags" in
5215 (no)
5216         case "$cf_add_cflags" in
5217         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5218                 case "$cf_add_cflags" in
5219                 (-D*)
5220                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5221
5222                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5223                                 && test -z "${cf_tst_cflags}" \
5224                                 && cf_fix_cppflags=yes
5225
5226                         if test "$cf_fix_cppflags" = yes ; then
5227
5228         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5229         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5230
5231                                 continue
5232                         elif test "${cf_tst_cflags}" = "\"'" ; then
5233
5234         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5235         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5236
5237                                 continue
5238                         fi
5239                         ;;
5240                 esac
5241                 case "$CPPFLAGS" in
5242                 (*$cf_add_cflags)
5243                         ;;
5244                 (*)
5245                         case "$cf_add_cflags" in
5246                         (-D*)
5247                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5248
5249 CPPFLAGS=`echo "$CPPFLAGS" | \
5250         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5251                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5252
5253                                 ;;
5254                         esac
5255
5256         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5257         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5258
5259                         ;;
5260                 esac
5261                 ;;
5262         (*)
5263
5264         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5265         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5266
5267                 ;;
5268         esac
5269         ;;
5270 (yes)
5271
5272         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5273         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5274
5275         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5276
5277         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5278                 && test -z "${cf_tst_cflags}" \
5279                 && cf_fix_cppflags=no
5280         ;;
5281 esac
5282 done
5283
5284 if test -n "$cf_new_cflags" ; then
5285         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5286
5287 echo "${as_me:-configure}:5287: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5288
5289         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5290         CFLAGS="${CFLAGS}$cf_new_cflags"
5291
5292 fi
5293
5294 if test -n "$cf_new_cppflags" ; then
5295         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5296
5297 echo "${as_me:-configure}:5297: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5298
5299         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5300         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5301
5302 fi
5303
5304 if test -n "$cf_new_extra_cppflags" ; then
5305         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5306
5307 echo "${as_me:-configure}:5307: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5308
5309         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5310         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5311
5312 fi
5313
5314 fi
5315
5316 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5317         echo "$as_me:5317: checking if _XOPEN_SOURCE really is set" >&5
5318 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5319         cat >"conftest.$ac_ext" <<_ACEOF
5320 #line 5320 "configure"
5321 #include "confdefs.h"
5322 #include <stdlib.h>
5323 int
5324 main (void)
5325 {
5326
5327 #ifndef _XOPEN_SOURCE
5328 make an error
5329 #endif
5330   ;
5331   return 0;
5332 }
5333 _ACEOF
5334 rm -f "conftest.$ac_objext"
5335 if { (eval echo "$as_me:5335: \"$ac_compile\"") >&5
5336   (eval $ac_compile) 2>&5
5337   ac_status=$?
5338   echo "$as_me:5338: \$? = $ac_status" >&5
5339   (exit "$ac_status"); } &&
5340          { ac_try='test -s "conftest.$ac_objext"'
5341   { (eval echo "$as_me:5341: \"$ac_try\"") >&5
5342   (eval $ac_try) 2>&5
5343   ac_status=$?
5344   echo "$as_me:5344: \$? = $ac_status" >&5
5345   (exit "$ac_status"); }; }; then
5346   cf_XOPEN_SOURCE_set=yes
5347 else
5348   echo "$as_me: failed program was:" >&5
5349 cat "conftest.$ac_ext" >&5
5350 cf_XOPEN_SOURCE_set=no
5351 fi
5352 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5353         echo "$as_me:5353: result: $cf_XOPEN_SOURCE_set" >&5
5354 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5355         if test "$cf_XOPEN_SOURCE_set" = yes
5356         then
5357                 cat >"conftest.$ac_ext" <<_ACEOF
5358 #line 5358 "configure"
5359 #include "confdefs.h"
5360 #include <stdlib.h>
5361 int
5362 main (void)
5363 {
5364
5365 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5366 make an error
5367 #endif
5368   ;
5369   return 0;
5370 }
5371 _ACEOF
5372 rm -f "conftest.$ac_objext"
5373 if { (eval echo "$as_me:5373: \"$ac_compile\"") >&5
5374   (eval $ac_compile) 2>&5
5375   ac_status=$?
5376   echo "$as_me:5376: \$? = $ac_status" >&5
5377   (exit "$ac_status"); } &&
5378          { ac_try='test -s "conftest.$ac_objext"'
5379   { (eval echo "$as_me:5379: \"$ac_try\"") >&5
5380   (eval $ac_try) 2>&5
5381   ac_status=$?
5382   echo "$as_me:5382: \$? = $ac_status" >&5
5383   (exit "$ac_status"); }; }; then
5384   cf_XOPEN_SOURCE_set_ok=yes
5385 else
5386   echo "$as_me: failed program was:" >&5
5387 cat "conftest.$ac_ext" >&5
5388 cf_XOPEN_SOURCE_set_ok=no
5389 fi
5390 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5391                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5392                 then
5393                         { echo "$as_me:5393: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5394 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5395                 fi
5396         else
5397
5398 echo "$as_me:5398: checking if we should define _XOPEN_SOURCE" >&5
5399 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5400 if test "${cf_cv_xopen_source+set}" = set; then
5401   echo $ECHO_N "(cached) $ECHO_C" >&6
5402 else
5403
5404         cat >"conftest.$ac_ext" <<_ACEOF
5405 #line 5405 "configure"
5406 #include "confdefs.h"
5407
5408 #include <stdlib.h>
5409 #include <string.h>
5410 #include <sys/types.h>
5411
5412 int
5413 main (void)
5414 {
5415
5416 #ifndef _XOPEN_SOURCE
5417 make an error
5418 #endif
5419   ;
5420   return 0;
5421 }
5422 _ACEOF
5423 rm -f "conftest.$ac_objext"
5424 if { (eval echo "$as_me:5424: \"$ac_compile\"") >&5
5425   (eval $ac_compile) 2>&5
5426   ac_status=$?
5427   echo "$as_me:5427: \$? = $ac_status" >&5
5428   (exit "$ac_status"); } &&
5429          { ac_try='test -s "conftest.$ac_objext"'
5430   { (eval echo "$as_me:5430: \"$ac_try\"") >&5
5431   (eval $ac_try) 2>&5
5432   ac_status=$?
5433   echo "$as_me:5433: \$? = $ac_status" >&5
5434   (exit "$ac_status"); }; }; then
5435   cf_cv_xopen_source=no
5436 else
5437   echo "$as_me: failed program was:" >&5
5438 cat "conftest.$ac_ext" >&5
5439 cf_save="$CPPFLAGS"
5440
5441         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5442         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5443
5444          cat >"conftest.$ac_ext" <<_ACEOF
5445 #line 5445 "configure"
5446 #include "confdefs.h"
5447
5448 #include <stdlib.h>
5449 #include <string.h>
5450 #include <sys/types.h>
5451
5452 int
5453 main (void)
5454 {
5455
5456 #ifdef _XOPEN_SOURCE
5457 make an error
5458 #endif
5459   ;
5460   return 0;
5461 }
5462 _ACEOF
5463 rm -f "conftest.$ac_objext"
5464 if { (eval echo "$as_me:5464: \"$ac_compile\"") >&5
5465   (eval $ac_compile) 2>&5
5466   ac_status=$?
5467   echo "$as_me:5467: \$? = $ac_status" >&5
5468   (exit "$ac_status"); } &&
5469          { ac_try='test -s "conftest.$ac_objext"'
5470   { (eval echo "$as_me:5470: \"$ac_try\"") >&5
5471   (eval $ac_try) 2>&5
5472   ac_status=$?
5473   echo "$as_me:5473: \$? = $ac_status" >&5
5474   (exit "$ac_status"); }; }; then
5475   cf_cv_xopen_source=no
5476 else
5477   echo "$as_me: failed program was:" >&5
5478 cat "conftest.$ac_ext" >&5
5479 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5480 fi
5481 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5482         CPPFLAGS="$cf_save"
5483
5484 fi
5485 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5486
5487 fi
5488 echo "$as_me:5488: result: $cf_cv_xopen_source" >&5
5489 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5490
5491 if test "$cf_cv_xopen_source" != no ; then
5492
5493 CFLAGS=`echo "$CFLAGS" | \
5494         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5495                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5496
5497 CPPFLAGS=`echo "$CPPFLAGS" | \
5498         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5499                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5500
5501         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5502
5503 cf_fix_cppflags=no
5504 cf_new_cflags=
5505 cf_new_cppflags=
5506 cf_new_extra_cppflags=
5507
5508 for cf_add_cflags in $cf_temp_xopen_source
5509 do
5510 case "$cf_fix_cppflags" in
5511 (no)
5512         case "$cf_add_cflags" in
5513         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5514                 case "$cf_add_cflags" in
5515                 (-D*)
5516                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5517
5518                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5519                                 && test -z "${cf_tst_cflags}" \
5520                                 && cf_fix_cppflags=yes
5521
5522                         if test "$cf_fix_cppflags" = yes ; then
5523
5524         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5525         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5526
5527                                 continue
5528                         elif test "${cf_tst_cflags}" = "\"'" ; then
5529
5530         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5531         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5532
5533                                 continue
5534                         fi
5535                         ;;
5536                 esac
5537                 case "$CPPFLAGS" in
5538                 (*$cf_add_cflags)
5539                         ;;
5540                 (*)
5541                         case "$cf_add_cflags" in
5542                         (-D*)
5543                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5544
5545 CPPFLAGS=`echo "$CPPFLAGS" | \
5546         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5547                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5548
5549                                 ;;
5550                         esac
5551
5552         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5553         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5554
5555                         ;;
5556                 esac
5557                 ;;
5558         (*)
5559
5560         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5561         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5562
5563                 ;;
5564         esac
5565         ;;
5566 (yes)
5567
5568         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5569         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5570
5571         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5572
5573         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5574                 && test -z "${cf_tst_cflags}" \
5575                 && cf_fix_cppflags=no
5576         ;;
5577 esac
5578 done
5579
5580 if test -n "$cf_new_cflags" ; then
5581
5582         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5583         CFLAGS="${CFLAGS}$cf_new_cflags"
5584
5585 fi
5586
5587 if test -n "$cf_new_cppflags" ; then
5588
5589         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5590         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5591
5592 fi
5593
5594 if test -n "$cf_new_extra_cppflags" ; then
5595
5596         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5597         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5598
5599 fi
5600
5601 fi
5602
5603         fi
5604 fi
5605 fi # cf_cv_posix_visible
5606
5607 echo "$as_me:5607: checking for signal global datatype" >&5
5608 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5609 if test "${cf_cv_sig_atomic_t+set}" = set; then
5610   echo $ECHO_N "(cached) $ECHO_C" >&6
5611 else
5612
5613         for cf_type in \
5614                 "volatile sig_atomic_t" \
5615                 "sig_atomic_t" \
5616                 "int"
5617         do
5618         cat >"conftest.$ac_ext" <<_ACEOF
5619 #line 5619 "configure"
5620 #include "confdefs.h"
5621
5622 #include <sys/types.h>
5623 #include <signal.h>
5624 #include <stdio.h>
5625
5626 extern $cf_type x;
5627 $cf_type x;
5628 static void handler(int sig)
5629 {
5630         (void)sig;
5631         x = 5;
5632 }
5633 int
5634 main (void)
5635 {
5636 signal(SIGINT, handler);
5637                  x = 1
5638   ;
5639   return 0;
5640 }
5641 _ACEOF
5642 rm -f "conftest.$ac_objext"
5643 if { (eval echo "$as_me:5643: \"$ac_compile\"") >&5
5644   (eval $ac_compile) 2>&5
5645   ac_status=$?
5646   echo "$as_me:5646: \$? = $ac_status" >&5
5647   (exit "$ac_status"); } &&
5648          { ac_try='test -s "conftest.$ac_objext"'
5649   { (eval echo "$as_me:5649: \"$ac_try\"") >&5
5650   (eval $ac_try) 2>&5
5651   ac_status=$?
5652   echo "$as_me:5652: \$? = $ac_status" >&5
5653   (exit "$ac_status"); }; }; then
5654   cf_cv_sig_atomic_t=$cf_type
5655 else
5656   echo "$as_me: failed program was:" >&5
5657 cat "conftest.$ac_ext" >&5
5658 cf_cv_sig_atomic_t=no
5659 fi
5660 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5661                 test "$cf_cv_sig_atomic_t" != no && break
5662         done
5663
5664 fi
5665
5666 echo "$as_me:5666: result: $cf_cv_sig_atomic_t" >&5
5667 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5668 test "$cf_cv_sig_atomic_t" != no &&
5669 cat >>confdefs.h <<EOF
5670 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5671 EOF
5672
5673 # Work around breakage on OS X
5674
5675 echo "$as_me:5675: checking if SIGWINCH is defined" >&5
5676 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5677 if test "${cf_cv_define_sigwinch+set}" = set; then
5678   echo $ECHO_N "(cached) $ECHO_C" >&6
5679 else
5680
5681         cat >"conftest.$ac_ext" <<_ACEOF
5682 #line 5682 "configure"
5683 #include "confdefs.h"
5684
5685 #include <sys/types.h>
5686 #include <sys/signal.h>
5687
5688 int
5689 main (void)
5690 {
5691 int x = SIGWINCH; (void)x
5692   ;
5693   return 0;
5694 }
5695 _ACEOF
5696 rm -f "conftest.$ac_objext"
5697 if { (eval echo "$as_me:5697: \"$ac_compile\"") >&5
5698   (eval $ac_compile) 2>&5
5699   ac_status=$?
5700   echo "$as_me:5700: \$? = $ac_status" >&5
5701   (exit "$ac_status"); } &&
5702          { ac_try='test -s "conftest.$ac_objext"'
5703   { (eval echo "$as_me:5703: \"$ac_try\"") >&5
5704   (eval $ac_try) 2>&5
5705   ac_status=$?
5706   echo "$as_me:5706: \$? = $ac_status" >&5
5707   (exit "$ac_status"); }; }; then
5708   cf_cv_define_sigwinch=yes
5709 else
5710   echo "$as_me: failed program was:" >&5
5711 cat "conftest.$ac_ext" >&5
5712 cat >"conftest.$ac_ext" <<_ACEOF
5713 #line 5713 "configure"
5714 #include "confdefs.h"
5715
5716 #undef _XOPEN_SOURCE
5717 #undef _POSIX_SOURCE
5718 #undef _POSIX_C_SOURCE
5719 #include <sys/types.h>
5720 #include <sys/signal.h>
5721
5722 int
5723 main (void)
5724 {
5725 int x = SIGWINCH; (void)x
5726   ;
5727   return 0;
5728 }
5729 _ACEOF
5730 rm -f "conftest.$ac_objext"
5731 if { (eval echo "$as_me:5731: \"$ac_compile\"") >&5
5732   (eval $ac_compile) 2>&5
5733   ac_status=$?
5734   echo "$as_me:5734: \$? = $ac_status" >&5
5735   (exit "$ac_status"); } &&
5736          { ac_try='test -s "conftest.$ac_objext"'
5737   { (eval echo "$as_me:5737: \"$ac_try\"") >&5
5738   (eval $ac_try) 2>&5
5739   ac_status=$?
5740   echo "$as_me:5740: \$? = $ac_status" >&5
5741   (exit "$ac_status"); }; }; then
5742   cf_cv_define_sigwinch=maybe
5743 else
5744   echo "$as_me: failed program was:" >&5
5745 cat "conftest.$ac_ext" >&5
5746 cf_cv_define_sigwinch=no
5747 fi
5748 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5749
5750 fi
5751 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5752
5753 fi
5754 echo "$as_me:5754: result: $cf_cv_define_sigwinch" >&5
5755 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5756
5757 if test "$cf_cv_define_sigwinch" = maybe ; then
5758 echo "$as_me:5758: checking for actual SIGWINCH definition" >&5
5759 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5760 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5761   echo $ECHO_N "(cached) $ECHO_C" >&6
5762 else
5763
5764 cf_cv_fixup_sigwinch=unknown
5765 cf_sigwinch=32
5766 while test "$cf_sigwinch" != 1
5767 do
5768         cat >"conftest.$ac_ext" <<_ACEOF
5769 #line 5769 "configure"
5770 #include "confdefs.h"
5771
5772 #undef _XOPEN_SOURCE
5773 #undef _POSIX_SOURCE
5774 #undef _POSIX_C_SOURCE
5775 #include <sys/types.h>
5776 #include <sys/signal.h>
5777
5778 int
5779 main (void)
5780 {
5781
5782 #if SIGWINCH != $cf_sigwinch
5783 make an error
5784 #endif
5785 int x = SIGWINCH; (void)x
5786   ;
5787   return 0;
5788 }
5789 _ACEOF
5790 rm -f "conftest.$ac_objext"
5791 if { (eval echo "$as_me:5791: \"$ac_compile\"") >&5
5792   (eval $ac_compile) 2>&5
5793   ac_status=$?
5794   echo "$as_me:5794: \$? = $ac_status" >&5
5795   (exit "$ac_status"); } &&
5796          { ac_try='test -s "conftest.$ac_objext"'
5797   { (eval echo "$as_me:5797: \"$ac_try\"") >&5
5798   (eval $ac_try) 2>&5
5799   ac_status=$?
5800   echo "$as_me:5800: \$? = $ac_status" >&5
5801   (exit "$ac_status"); }; }; then
5802   cf_cv_fixup_sigwinch=$cf_sigwinch
5803          break
5804 else
5805   echo "$as_me: failed program was:" >&5
5806 cat "conftest.$ac_ext" >&5
5807 fi
5808 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5809
5810 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
5811 done
5812
5813 fi
5814 echo "$as_me:5814: result: $cf_cv_fixup_sigwinch" >&5
5815 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5816
5817         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5818                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5819         fi
5820 fi
5821
5822 # Checks for CODESET support.
5823
5824 echo "$as_me:5824: checking for nl_langinfo and CODESET" >&5
5825 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5826 if test "${am_cv_langinfo_codeset+set}" = set; then
5827   echo $ECHO_N "(cached) $ECHO_C" >&6
5828 else
5829   cat >"conftest.$ac_ext" <<_ACEOF
5830 #line 5830 "configure"
5831 #include "confdefs.h"
5832 #include <langinfo.h>
5833 int
5834 main (void)
5835 {
5836 char* cs = nl_langinfo(CODESET); (void)cs
5837   ;
5838   return 0;
5839 }
5840 _ACEOF
5841 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5842 if { (eval echo "$as_me:5842: \"$ac_link\"") >&5
5843   (eval $ac_link) 2>&5
5844   ac_status=$?
5845   echo "$as_me:5845: \$? = $ac_status" >&5
5846   (exit "$ac_status"); } &&
5847          { ac_try='test -s "conftest$ac_exeext"'
5848   { (eval echo "$as_me:5848: \"$ac_try\"") >&5
5849   (eval $ac_try) 2>&5
5850   ac_status=$?
5851   echo "$as_me:5851: \$? = $ac_status" >&5
5852   (exit "$ac_status"); }; }; then
5853   am_cv_langinfo_codeset=yes
5854 else
5855   echo "$as_me: failed program was:" >&5
5856 cat "conftest.$ac_ext" >&5
5857 am_cv_langinfo_codeset=no
5858 fi
5859 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5860
5861 fi
5862 echo "$as_me:5862: result: $am_cv_langinfo_codeset" >&5
5863 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5864         if test "$am_cv_langinfo_codeset" = yes; then
5865
5866 cat >>confdefs.h <<\EOF
5867 #define HAVE_LANGINFO_CODESET 1
5868 EOF
5869
5870         fi
5871
5872 echo "$as_me:5872: checking if you want to use pkg-config" >&5
5873 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5874
5875 # Check whether --with-pkg-config or --without-pkg-config was given.
5876 if test "${with_pkg_config+set}" = set; then
5877   withval="$with_pkg_config"
5878   cf_pkg_config=$withval
5879 else
5880   cf_pkg_config=yes
5881 fi;
5882 echo "$as_me:5882: result: $cf_pkg_config" >&5
5883 echo "${ECHO_T}$cf_pkg_config" >&6
5884
5885 case "$cf_pkg_config" in
5886 (no)
5887         PKG_CONFIG=none
5888         ;;
5889 (yes)
5890
5891 if test -n "$ac_tool_prefix"; then
5892   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5893 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5894 echo "$as_me:5894: checking for $ac_word" >&5
5895 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5896 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5897   echo $ECHO_N "(cached) $ECHO_C" >&6
5898 else
5899   case $PKG_CONFIG in
5900   [\\/]* | ?:[\\/]*)
5901   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5902   ;;
5903   *)
5904   ac_save_IFS=$IFS; IFS=$ac_path_separator
5905 ac_dummy="$PATH"
5906 for ac_dir in $ac_dummy; do
5907   IFS=$ac_save_IFS
5908   test -z "$ac_dir" && ac_dir=.
5909   if $as_executable_p "$ac_dir/$ac_word"; then
5910    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5911    echo "$as_me:5911: found $ac_dir/$ac_word" >&5
5912    break
5913 fi
5914 done
5915
5916   ;;
5917 esac
5918 fi
5919 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5920
5921 if test -n "$PKG_CONFIG"; then
5922   echo "$as_me:5922: result: $PKG_CONFIG" >&5
5923 echo "${ECHO_T}$PKG_CONFIG" >&6
5924 else
5925   echo "$as_me:5925: result: no" >&5
5926 echo "${ECHO_T}no" >&6
5927 fi
5928
5929 fi
5930 if test -z "$ac_cv_path_PKG_CONFIG"; then
5931   ac_pt_PKG_CONFIG=$PKG_CONFIG
5932   # Extract the first word of "pkg-config", so it can be a program name with args.
5933 set dummy pkg-config; ac_word=$2
5934 echo "$as_me:5934: checking for $ac_word" >&5
5935 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5936 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5937   echo $ECHO_N "(cached) $ECHO_C" >&6
5938 else
5939   case $ac_pt_PKG_CONFIG in
5940   [\\/]* | ?:[\\/]*)
5941   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5942   ;;
5943   *)
5944   ac_save_IFS=$IFS; IFS=$ac_path_separator
5945 ac_dummy="$PATH"
5946 for ac_dir in $ac_dummy; do
5947   IFS=$ac_save_IFS
5948   test -z "$ac_dir" && ac_dir=.
5949   if $as_executable_p "$ac_dir/$ac_word"; then
5950    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5951    echo "$as_me:5951: found $ac_dir/$ac_word" >&5
5952    break
5953 fi
5954 done
5955
5956   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5957   ;;
5958 esac
5959 fi
5960 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5961
5962 if test -n "$ac_pt_PKG_CONFIG"; then
5963   echo "$as_me:5963: result: $ac_pt_PKG_CONFIG" >&5
5964 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5965 else
5966   echo "$as_me:5966: result: no" >&5
5967 echo "${ECHO_T}no" >&6
5968 fi
5969
5970   PKG_CONFIG=$ac_pt_PKG_CONFIG
5971 else
5972   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5973 fi
5974
5975         ;;
5976 (*)
5977         PKG_CONFIG=$withval
5978         ;;
5979 esac
5980
5981 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5982 if test "$PKG_CONFIG" != none ; then
5983
5984 if test "x$prefix" != xNONE; then
5985         cf_path_syntax="$prefix"
5986 else
5987         cf_path_syntax="$ac_default_prefix"
5988 fi
5989
5990 case ".$PKG_CONFIG" in
5991 (.\$\(*\)*|.\'*\'*)
5992         ;;
5993 (..|./*|.\\*)
5994         ;;
5995 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5996         ;;
5997 (.\$\{*prefix\}*|.\$\{*dir\}*)
5998         eval PKG_CONFIG="$PKG_CONFIG"
5999         case ".$PKG_CONFIG" in
6000         (.NONE/*)
6001                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6002                 ;;
6003         esac
6004         ;;
6005 (.no|.NONE/*)
6006         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6007         ;;
6008 (*)
6009         { { echo "$as_me:6009: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6010 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6011    { (exit 1); exit 1; }; }
6012         ;;
6013 esac
6014
6015 elif test "x$cf_pkg_config" != xno ; then
6016         { echo "$as_me:6016: WARNING: pkg-config is not installed" >&5
6017 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6018 fi
6019
6020 echo "$as_me:6020: checking if you want to see long compiling messages" >&5
6021 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6022
6023 # Check whether --enable-echo or --disable-echo was given.
6024 if test "${enable_echo+set}" = set; then
6025   enableval="$enable_echo"
6026   test "$enableval" != no && enableval=yes
6027         if test "$enableval" != "yes" ; then
6028
6029         ECHO_LT='--silent'
6030         ECHO_LD='@echo linking $@;'
6031         RULE_CC='@echo compiling $<'
6032         SHOW_CC='@echo compiling $@'
6033         ECHO_CC='@'
6034
6035         else
6036
6037         ECHO_LT=''
6038         ECHO_LD=''
6039         RULE_CC=''
6040         SHOW_CC=''
6041         ECHO_CC=''
6042
6043         fi
6044 else
6045   enableval=yes
6046
6047         ECHO_LT=''
6048         ECHO_LD=''
6049         RULE_CC=''
6050         SHOW_CC=''
6051         ECHO_CC=''
6052
6053 fi;
6054 echo "$as_me:6054: result: $enableval" >&5
6055 echo "${ECHO_T}$enableval" >&6
6056
6057 echo "$as_me:6057: checking for ncurses wrap-prefix" >&5
6058 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6059
6060 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6061 if test "${with_ncurses_wrap_prefix+set}" = set; then
6062   withval="$with_ncurses_wrap_prefix"
6063   NCURSES_WRAP_PREFIX=$withval
6064 else
6065   NCURSES_WRAP_PREFIX=_nc_
6066 fi;
6067 echo "$as_me:6067: result: $NCURSES_WRAP_PREFIX" >&5
6068 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6069
6070 echo "$as_me:6070: checking if you want to check for wide-character functions" >&5
6071 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6072
6073 # Check whether --enable-widec or --disable-widec was given.
6074 if test "${enable_widec+set}" = set; then
6075   enableval="$enable_widec"
6076   test "$enableval" != no && enableval=yes
6077         if test "$enableval" != "yes" ; then
6078     cf_enable_widec=no
6079         else
6080                 cf_enable_widec=yes
6081         fi
6082 else
6083   enableval=yes
6084         cf_enable_widec=yes
6085
6086 fi;
6087 echo "$as_me:6087: result: $cf_enable_widec" >&5
6088 echo "${ECHO_T}$cf_enable_widec" >&6
6089
6090 echo "$as_me:6090: checking for specific curses-directory" >&5
6091 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6092
6093 # Check whether --with-curses-dir or --without-curses-dir was given.
6094 if test "${with_curses_dir+set}" = set; then
6095   withval="$with_curses_dir"
6096   cf_cv_curses_dir=$withval
6097 else
6098   cf_cv_curses_dir=no
6099 fi;
6100 echo "$as_me:6100: result: $cf_cv_curses_dir" >&5
6101 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6102
6103 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6104 then
6105
6106 if test "x$prefix" != xNONE; then
6107         cf_path_syntax="$prefix"
6108 else
6109         cf_path_syntax="$ac_default_prefix"
6110 fi
6111
6112 case ".$withval" in
6113 (.\$\(*\)*|.\'*\'*)
6114         ;;
6115 (..|./*|.\\*)
6116         ;;
6117 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6118         ;;
6119 (.\$\{*prefix\}*|.\$\{*dir\}*)
6120         eval withval="$withval"
6121         case ".$withval" in
6122         (.NONE/*)
6123                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6124                 ;;
6125         esac
6126         ;;
6127 (.no|.NONE/*)
6128         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6129         ;;
6130 (*)
6131         { { echo "$as_me:6131: error: expected a pathname, not \"$withval\"" >&5
6132 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6133    { (exit 1); exit 1; }; }
6134         ;;
6135 esac
6136
6137         if test -d "$cf_cv_curses_dir"
6138         then
6139
6140 if test -n "$cf_cv_curses_dir/include" ; then
6141   for cf_add_incdir in $cf_cv_curses_dir/include
6142   do
6143         while test "$cf_add_incdir" != /usr/include
6144         do
6145           if test -d "$cf_add_incdir"
6146           then
6147                 cf_have_incdir=no
6148                 if test -n "$CFLAGS$CPPFLAGS" ; then
6149                   # a loop is needed to ensure we can add subdirs of existing dirs
6150                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6151                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6152                           cf_have_incdir=yes; break
6153                         fi
6154                   done
6155                 fi
6156
6157                 if test "$cf_have_incdir" = no ; then
6158                   if test "$cf_add_incdir" = /usr/local/include ; then
6159                         if test "$GCC" = yes
6160                         then
6161                           cf_save_CPPFLAGS=$CPPFLAGS
6162
6163         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6164         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6165
6166                           cat >"conftest.$ac_ext" <<_ACEOF
6167 #line 6167 "configure"
6168 #include "confdefs.h"
6169 #include <stdio.h>
6170 int
6171 main (void)
6172 {
6173 printf("Hello")
6174   ;
6175   return 0;
6176 }
6177 _ACEOF
6178 rm -f "conftest.$ac_objext"
6179 if { (eval echo "$as_me:6179: \"$ac_compile\"") >&5
6180   (eval $ac_compile) 2>&5
6181   ac_status=$?
6182   echo "$as_me:6182: \$? = $ac_status" >&5
6183   (exit "$ac_status"); } &&
6184          { ac_try='test -s "conftest.$ac_objext"'
6185   { (eval echo "$as_me:6185: \"$ac_try\"") >&5
6186   (eval $ac_try) 2>&5
6187   ac_status=$?
6188   echo "$as_me:6188: \$? = $ac_status" >&5
6189   (exit "$ac_status"); }; }; then
6190   :
6191 else
6192   echo "$as_me: failed program was:" >&5
6193 cat "conftest.$ac_ext" >&5
6194 cf_have_incdir=yes
6195 fi
6196 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6197                           CPPFLAGS=$cf_save_CPPFLAGS
6198                         fi
6199                   fi
6200                 fi
6201
6202                 if test "$cf_have_incdir" = no ; then
6203                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6204
6205 echo "${as_me:-configure}:6205: testing adding $cf_add_incdir to include-path ..." 1>&5
6206
6207                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6208
6209                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6210                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6211                   cf_add_incdir="$cf_top_incdir"
6212                 else
6213                   break
6214                 fi
6215           else
6216                 break
6217           fi
6218         done
6219   done
6220 fi
6221
6222 if test -n "$cf_cv_curses_dir/lib" ; then
6223         for cf_add_libdir in $cf_cv_curses_dir/lib
6224         do
6225                 if test "$cf_add_libdir" = /usr/lib ; then
6226                         :
6227                 elif test -d "$cf_add_libdir"
6228                 then
6229                         cf_have_libdir=no
6230                         if test -n "$LDFLAGS$LIBS" ; then
6231                                 # a loop is needed to ensure we can add subdirs of existing dirs
6232                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6233                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6234                                                 cf_have_libdir=yes; break
6235                                         fi
6236                                 done
6237                         fi
6238                         if test "$cf_have_libdir" = no ; then
6239                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6240
6241 echo "${as_me:-configure}:6241: testing adding $cf_add_libdir to library-path ..." 1>&5
6242
6243                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6244                         fi
6245                 fi
6246         done
6247 fi
6248
6249         fi
6250 fi
6251
6252 cf_cv_screen=curses
6253
6254 echo "$as_me:6254: checking for specified curses library type" >&5
6255 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6256
6257 # Check whether --with-screen or --without-screen was given.
6258 if test "${with_screen+set}" = set; then
6259   withval="$with_screen"
6260   cf_cv_screen=$withval
6261 else
6262
6263 # Check whether --with-ncursesw or --without-ncursesw was given.
6264 if test "${with_ncursesw+set}" = set; then
6265   withval="$with_ncursesw"
6266   cf_cv_screen=ncursesw
6267 else
6268
6269 # Check whether --with-ncurses or --without-ncurses was given.
6270 if test "${with_ncurses+set}" = set; then
6271   withval="$with_ncurses"
6272   cf_cv_screen=ncurses
6273 else
6274
6275 # Check whether --with-pdcurses or --without-pdcurses was given.
6276 if test "${with_pdcurses+set}" = set; then
6277   withval="$with_pdcurses"
6278   cf_cv_screen=pdcurses
6279 else
6280
6281 # Check whether --with-curses-colr or --without-curses-colr was given.
6282 if test "${with_curses_colr+set}" = set; then
6283   withval="$with_curses_colr"
6284   cf_cv_screen=curses_colr
6285 else
6286
6287 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6288 if test "${with_curses_5lib+set}" = set; then
6289   withval="$with_curses_5lib"
6290   cf_cv_screen=curses_5lib
6291 fi;
6292 fi;
6293 fi;
6294 fi;
6295 fi;
6296 fi;
6297
6298 echo "$as_me:6298: result: $cf_cv_screen" >&5
6299 echo "${ECHO_T}$cf_cv_screen" >&6
6300
6301 case $cf_cv_screen in
6302 (curses|curses_*)
6303
6304 echo "$as_me:6304: checking for extra include directories" >&5
6305 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6306 if test "${cf_cv_curses_incdir+set}" = set; then
6307   echo $ECHO_N "(cached) $ECHO_C" >&6
6308 else
6309
6310 cf_cv_curses_incdir=no
6311 case "$host_os" in
6312 (hpux10.*)
6313         if test "x$cf_cv_screen" = "xcurses_colr"
6314         then
6315                 test -d /usr/include/curses_colr && \
6316                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6317         fi
6318         ;;
6319 (sunos3*|sunos4*)
6320         if test "x$cf_cv_screen" = "xcurses_5lib"
6321         then
6322                 test -d /usr/5lib && \
6323                 test -d /usr/5include && \
6324                 cf_cv_curses_incdir="-I/usr/5include"
6325         fi
6326         ;;
6327 esac
6328
6329 fi
6330 echo "$as_me:6330: result: $cf_cv_curses_incdir" >&5
6331 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6332 if test "$cf_cv_curses_incdir" != no
6333 then
6334
6335         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6336         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6337
6338 fi
6339
6340 echo "$as_me:6340: checking if we have identified curses headers" >&5
6341 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6342 if test "${cf_cv_ncurses_header+set}" = set; then
6343   echo $ECHO_N "(cached) $ECHO_C" >&6
6344 else
6345
6346 cf_cv_ncurses_header=none
6347 for cf_header in \
6348         ncurses.h  \
6349         curses.h  ncurses/ncurses.h ncurses/curses.h
6350 do
6351 cat >"conftest.$ac_ext" <<_ACEOF
6352 #line 6352 "configure"
6353 #include "confdefs.h"
6354 #include <${cf_header}>
6355 int
6356 main (void)
6357 {
6358 initscr(); tgoto("?", 0,0)
6359   ;
6360   return 0;
6361 }
6362 _ACEOF
6363 rm -f "conftest.$ac_objext"
6364 if { (eval echo "$as_me:6364: \"$ac_compile\"") >&5
6365   (eval $ac_compile) 2>&5
6366   ac_status=$?
6367   echo "$as_me:6367: \$? = $ac_status" >&5
6368   (exit "$ac_status"); } &&
6369          { ac_try='test -s "conftest.$ac_objext"'
6370   { (eval echo "$as_me:6370: \"$ac_try\"") >&5
6371   (eval $ac_try) 2>&5
6372   ac_status=$?
6373   echo "$as_me:6373: \$? = $ac_status" >&5
6374   (exit "$ac_status"); }; }; then
6375   cf_cv_ncurses_header=$cf_header; break
6376 else
6377   echo "$as_me: failed program was:" >&5
6378 cat "conftest.$ac_ext" >&5
6379 fi
6380 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6381 done
6382
6383 fi
6384 echo "$as_me:6384: result: $cf_cv_ncurses_header" >&5
6385 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6386
6387 if test "$cf_cv_ncurses_header" = none ; then
6388         { { echo "$as_me:6388: error: No curses header-files found" >&5
6389 echo "$as_me: error: No curses header-files found" >&2;}
6390    { (exit 1); exit 1; }; }
6391 fi
6392
6393 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6394
6395 for ac_header in $cf_cv_ncurses_header
6396 do
6397 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6398 echo "$as_me:6398: checking for $ac_header" >&5
6399 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6400 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6401   echo $ECHO_N "(cached) $ECHO_C" >&6
6402 else
6403   cat >"conftest.$ac_ext" <<_ACEOF
6404 #line 6404 "configure"
6405 #include "confdefs.h"
6406 #include <$ac_header>
6407 _ACEOF
6408 if { (eval echo "$as_me:6408: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6409   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6410   ac_status=$?
6411   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6412   rm -f conftest.er1
6413   cat conftest.err >&5
6414   echo "$as_me:6414: \$? = $ac_status" >&5
6415   (exit "$ac_status"); } >/dev/null; then
6416   if test -s conftest.err; then
6417     ac_cpp_err=$ac_c_preproc_warn_flag
6418   else
6419     ac_cpp_err=
6420   fi
6421 else
6422   ac_cpp_err=yes
6423 fi
6424 if test -z "$ac_cpp_err"; then
6425   eval "$as_ac_Header=yes"
6426 else
6427   echo "$as_me: failed program was:" >&5
6428   cat "conftest.$ac_ext" >&5
6429   eval "$as_ac_Header=no"
6430 fi
6431 rm -f conftest.err "conftest.$ac_ext"
6432 fi
6433 echo "$as_me:6433: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6434 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6435 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6436   cat >>confdefs.h <<EOF
6437 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6438 EOF
6439
6440 fi
6441 done
6442
6443 echo "$as_me:6443: checking for terminfo header" >&5
6444 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6445 if test "${cf_cv_term_header+set}" = set; then
6446   echo $ECHO_N "(cached) $ECHO_C" >&6
6447 else
6448
6449 case "${cf_cv_ncurses_header}" in
6450 (*/ncurses.h|*/ncursesw.h)
6451         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6452         ;;
6453 (*)
6454         cf_term_header=term.h
6455         ;;
6456 esac
6457
6458 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6459 do
6460 cat >"conftest.$ac_ext" <<_ACEOF
6461 #line 6461 "configure"
6462 #include "confdefs.h"
6463 #include <stdio.h>
6464 #include <${cf_cv_ncurses_header:-curses.h}>
6465 #include <$cf_test>
6466
6467 int
6468 main (void)
6469 {
6470 int x = auto_left_margin; (void)x
6471   ;
6472   return 0;
6473 }
6474 _ACEOF
6475 rm -f "conftest.$ac_objext"
6476 if { (eval echo "$as_me:6476: \"$ac_compile\"") >&5
6477   (eval $ac_compile) 2>&5
6478   ac_status=$?
6479   echo "$as_me:6479: \$? = $ac_status" >&5
6480   (exit "$ac_status"); } &&
6481          { ac_try='test -s "conftest.$ac_objext"'
6482   { (eval echo "$as_me:6482: \"$ac_try\"") >&5
6483   (eval $ac_try) 2>&5
6484   ac_status=$?
6485   echo "$as_me:6485: \$? = $ac_status" >&5
6486   (exit "$ac_status"); }; }; then
6487
6488         cf_cv_term_header="$cf_test"
6489 else
6490   echo "$as_me: failed program was:" >&5
6491 cat "conftest.$ac_ext" >&5
6492
6493         cf_cv_term_header=unknown
6494
6495 fi
6496 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6497         test "$cf_cv_term_header" != unknown && break
6498 done
6499
6500 fi
6501 echo "$as_me:6501: result: $cf_cv_term_header" >&5
6502 echo "${ECHO_T}$cf_cv_term_header" >&6
6503
6504 # Set definitions to allow ifdef'ing to accommodate subdirectories
6505
6506 case "$cf_cv_term_header" in
6507 (*term.h)
6508
6509 cat >>confdefs.h <<\EOF
6510 #define HAVE_TERM_H 1
6511 EOF
6512
6513         ;;
6514 esac
6515
6516 case "$cf_cv_term_header" in
6517 (ncurses/term.h)
6518
6519 cat >>confdefs.h <<\EOF
6520 #define HAVE_NCURSES_TERM_H 1
6521 EOF
6522
6523         ;;
6524 (ncursesw/term.h)
6525
6526 cat >>confdefs.h <<\EOF
6527 #define HAVE_NCURSESW_TERM_H 1
6528 EOF
6529
6530         ;;
6531 esac
6532
6533 echo "$as_me:6533: checking for ncurses version" >&5
6534 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6535 if test "${cf_cv_ncurses_version+set}" = set; then
6536   echo $ECHO_N "(cached) $ECHO_C" >&6
6537 else
6538
6539         cf_cv_ncurses_version=no
6540         cf_tempfile=out$$
6541         rm -f "$cf_tempfile"
6542         if test "$cross_compiling" = yes; then
6543
6544         # This will not work if the preprocessor splits the line after the
6545         # Autoconf token.  The 'unproto' program does that.
6546         cat > "conftest.$ac_ext" <<EOF
6547 #include <${cf_cv_ncurses_header:-curses.h}>
6548 #undef Autoconf
6549 #ifdef NCURSES_VERSION
6550 Autoconf NCURSES_VERSION
6551 #else
6552 #ifdef __NCURSES_H
6553 Autoconf "old"
6554 #endif
6555 ;
6556 #endif
6557 EOF
6558         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6559         { (eval echo "$as_me:6559: \"$cf_try\"") >&5
6560   (eval $cf_try) 2>&5
6561   ac_status=$?
6562   echo "$as_me:6562: \$? = $ac_status" >&5
6563   (exit "$ac_status"); }
6564         if test -f conftest.out ; then
6565                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6566                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6567                 rm -f conftest.out
6568         fi
6569
6570 else
6571   cat >"conftest.$ac_ext" <<_ACEOF
6572 #line 6572 "configure"
6573 #include "confdefs.h"
6574
6575 #include <${cf_cv_ncurses_header:-curses.h}>
6576 #include <stdio.h>
6577 int main(void)
6578 {
6579         FILE *fp = fopen("$cf_tempfile", "w");
6580 #ifdef NCURSES_VERSION
6581 # ifdef NCURSES_VERSION_PATCH
6582         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6583 # else
6584         fprintf(fp, "%s\\n", NCURSES_VERSION);
6585 # endif
6586 #else
6587 # ifdef __NCURSES_H
6588         fprintf(fp, "old\\n");
6589 # else
6590         make an error
6591 # endif
6592 #endif
6593         ${cf_cv_main_return:-return}(0);
6594 }
6595 _ACEOF
6596 rm -f "conftest$ac_exeext"
6597 if { (eval echo "$as_me:6597: \"$ac_link\"") >&5
6598   (eval $ac_link) 2>&5
6599   ac_status=$?
6600   echo "$as_me:6600: \$? = $ac_status" >&5
6601   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6602   { (eval echo "$as_me:6602: \"$ac_try\"") >&5
6603   (eval $ac_try) 2>&5
6604   ac_status=$?
6605   echo "$as_me:6605: \$? = $ac_status" >&5
6606   (exit "$ac_status"); }; }; then
6607
6608         cf_cv_ncurses_version=`cat $cf_tempfile`
6609 else
6610   echo "$as_me: program exited with status $ac_status" >&5
6611 echo "$as_me: failed program was:" >&5
6612 cat "conftest.$ac_ext" >&5
6613 fi
6614 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6615 fi
6616         rm -f "$cf_tempfile"
6617
6618 fi
6619 echo "$as_me:6619: result: $cf_cv_ncurses_version" >&5
6620 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6621 test "$cf_cv_ncurses_version" = no ||
6622 cat >>confdefs.h <<\EOF
6623 #define NCURSES 1
6624 EOF
6625
6626 echo "$as_me:6626: checking if we have identified curses libraries" >&5
6627 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6628 cat >"conftest.$ac_ext" <<_ACEOF
6629 #line 6629 "configure"
6630 #include "confdefs.h"
6631 #include <${cf_cv_ncurses_header:-curses.h}>
6632 int
6633 main (void)
6634 {
6635 initscr(); tgoto("?", 0,0)
6636   ;
6637   return 0;
6638 }
6639 _ACEOF
6640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6641 if { (eval echo "$as_me:6641: \"$ac_link\"") >&5
6642   (eval $ac_link) 2>&5
6643   ac_status=$?
6644   echo "$as_me:6644: \$? = $ac_status" >&5
6645   (exit "$ac_status"); } &&
6646          { ac_try='test -s "conftest$ac_exeext"'
6647   { (eval echo "$as_me:6647: \"$ac_try\"") >&5
6648   (eval $ac_try) 2>&5
6649   ac_status=$?
6650   echo "$as_me:6650: \$? = $ac_status" >&5
6651   (exit "$ac_status"); }; }; then
6652   cf_result=yes
6653 else
6654   echo "$as_me: failed program was:" >&5
6655 cat "conftest.$ac_ext" >&5
6656 cf_result=no
6657 fi
6658 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6659 echo "$as_me:6659: result: $cf_result" >&5
6660 echo "${ECHO_T}$cf_result" >&6
6661
6662 if test "$cf_result" = no ; then
6663 case "$host_os" in
6664 (freebsd*)
6665         echo "$as_me:6665: checking for tgoto in -lmytinfo" >&5
6666 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6667 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6668   echo $ECHO_N "(cached) $ECHO_C" >&6
6669 else
6670   ac_check_lib_save_LIBS=$LIBS
6671 LIBS="-lmytinfo  $LIBS"
6672 cat >"conftest.$ac_ext" <<_ACEOF
6673 #line 6673 "configure"
6674 #include "confdefs.h"
6675
6676 /* Override any gcc2 internal prototype to avoid an error.  */
6677 #ifdef __cplusplus
6678 extern "C"
6679 #endif
6680 /* We use char because int might match the return type of a gcc2
6681    builtin and then its argument prototype would still apply.  */
6682 char tgoto ();
6683 int
6684 main (void)
6685 {
6686 tgoto ();
6687   ;
6688   return 0;
6689 }
6690 _ACEOF
6691 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6692 if { (eval echo "$as_me:6692: \"$ac_link\"") >&5
6693   (eval $ac_link) 2>&5
6694   ac_status=$?
6695   echo "$as_me:6695: \$? = $ac_status" >&5
6696   (exit "$ac_status"); } &&
6697          { ac_try='test -s "conftest$ac_exeext"'
6698   { (eval echo "$as_me:6698: \"$ac_try\"") >&5
6699   (eval $ac_try) 2>&5
6700   ac_status=$?
6701   echo "$as_me:6701: \$? = $ac_status" >&5
6702   (exit "$ac_status"); }; }; then
6703   ac_cv_lib_mytinfo_tgoto=yes
6704 else
6705   echo "$as_me: failed program was:" >&5
6706 cat "conftest.$ac_ext" >&5
6707 ac_cv_lib_mytinfo_tgoto=no
6708 fi
6709 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6710 LIBS=$ac_check_lib_save_LIBS
6711 fi
6712 echo "$as_me:6712: result: $ac_cv_lib_mytinfo_tgoto" >&5
6713 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6714 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6715
6716 cf_add_libs="$LIBS"
6717 # reverse order
6718 cf_add_0lib=
6719 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6720 # filter duplicates
6721 for cf_add_1lib in $cf_add_0lib; do
6722         for cf_add_2lib in $cf_add_libs; do
6723                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6724                         cf_add_1lib=
6725                         break
6726                 fi
6727         done
6728         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6729 done
6730 LIBS="$cf_add_libs"
6731
6732 fi
6733
6734         ;;
6735 (hpux10.*)
6736         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6737         # next (1998), and xcurses "newer" (2000).  There is no header file for
6738         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6739         # term.h) for cur_colr
6740         if test "x$cf_cv_screen" = "xcurses_colr"
6741         then
6742                 echo "$as_me:6742: checking for initscr in -lcur_colr" >&5
6743 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6744 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6745   echo $ECHO_N "(cached) $ECHO_C" >&6
6746 else
6747   ac_check_lib_save_LIBS=$LIBS
6748 LIBS="-lcur_colr  $LIBS"
6749 cat >"conftest.$ac_ext" <<_ACEOF
6750 #line 6750 "configure"
6751 #include "confdefs.h"
6752
6753 /* Override any gcc2 internal prototype to avoid an error.  */
6754 #ifdef __cplusplus
6755 extern "C"
6756 #endif
6757 /* We use char because int might match the return type of a gcc2
6758    builtin and then its argument prototype would still apply.  */
6759 char initscr ();
6760 int
6761 main (void)
6762 {
6763 initscr ();
6764   ;
6765   return 0;
6766 }
6767 _ACEOF
6768 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6769 if { (eval echo "$as_me:6769: \"$ac_link\"") >&5
6770   (eval $ac_link) 2>&5
6771   ac_status=$?
6772   echo "$as_me:6772: \$? = $ac_status" >&5
6773   (exit "$ac_status"); } &&
6774          { ac_try='test -s "conftest$ac_exeext"'
6775   { (eval echo "$as_me:6775: \"$ac_try\"") >&5
6776   (eval $ac_try) 2>&5
6777   ac_status=$?
6778   echo "$as_me:6778: \$? = $ac_status" >&5
6779   (exit "$ac_status"); }; }; then
6780   ac_cv_lib_cur_colr_initscr=yes
6781 else
6782   echo "$as_me: failed program was:" >&5
6783 cat "conftest.$ac_ext" >&5
6784 ac_cv_lib_cur_colr_initscr=no
6785 fi
6786 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6787 LIBS=$ac_check_lib_save_LIBS
6788 fi
6789 echo "$as_me:6789: result: $ac_cv_lib_cur_colr_initscr" >&5
6790 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6791 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
6792
6793 cf_add_libs="$LIBS"
6794 # reverse order
6795 cf_add_0lib=
6796 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6797 # filter duplicates
6798 for cf_add_1lib in $cf_add_0lib; do
6799         for cf_add_2lib in $cf_add_libs; do
6800                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6801                         cf_add_1lib=
6802                         break
6803                 fi
6804         done
6805         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6806 done
6807 LIBS="$cf_add_libs"
6808
6809                         ac_cv_func_initscr=yes
6810
6811 else
6812
6813                 echo "$as_me:6813: checking for initscr in -lHcurses" >&5
6814 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6815 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6816   echo $ECHO_N "(cached) $ECHO_C" >&6
6817 else
6818   ac_check_lib_save_LIBS=$LIBS
6819 LIBS="-lHcurses  $LIBS"
6820 cat >"conftest.$ac_ext" <<_ACEOF
6821 #line 6821 "configure"
6822 #include "confdefs.h"
6823
6824 /* Override any gcc2 internal prototype to avoid an error.  */
6825 #ifdef __cplusplus
6826 extern "C"
6827 #endif
6828 /* We use char because int might match the return type of a gcc2
6829    builtin and then its argument prototype would still apply.  */
6830 char initscr ();
6831 int
6832 main (void)
6833 {
6834 initscr ();
6835   ;
6836   return 0;
6837 }
6838 _ACEOF
6839 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6840 if { (eval echo "$as_me:6840: \"$ac_link\"") >&5
6841   (eval $ac_link) 2>&5
6842   ac_status=$?
6843   echo "$as_me:6843: \$? = $ac_status" >&5
6844   (exit "$ac_status"); } &&
6845          { ac_try='test -s "conftest$ac_exeext"'
6846   { (eval echo "$as_me:6846: \"$ac_try\"") >&5
6847   (eval $ac_try) 2>&5
6848   ac_status=$?
6849   echo "$as_me:6849: \$? = $ac_status" >&5
6850   (exit "$ac_status"); }; }; then
6851   ac_cv_lib_Hcurses_initscr=yes
6852 else
6853   echo "$as_me: failed program was:" >&5
6854 cat "conftest.$ac_ext" >&5
6855 ac_cv_lib_Hcurses_initscr=no
6856 fi
6857 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6858 LIBS=$ac_check_lib_save_LIBS
6859 fi
6860 echo "$as_me:6860: result: $ac_cv_lib_Hcurses_initscr" >&5
6861 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6862 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
6863
6864                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6865
6866 cf_add_libs="$LIBS"
6867 # reverse order
6868 cf_add_0lib=
6869 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6870 # filter duplicates
6871 for cf_add_1lib in $cf_add_0lib; do
6872         for cf_add_2lib in $cf_add_libs; do
6873                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6874                         cf_add_1lib=
6875                         break
6876                 fi
6877         done
6878         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6879 done
6880 LIBS="$cf_add_libs"
6881
6882         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6883         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6884
6885                         ac_cv_func_initscr=yes
6886
6887 fi
6888
6889 fi
6890
6891         fi
6892         ;;
6893 (linux*)
6894         case `arch 2>/dev/null` in
6895         (x86_64)
6896                 if test -d /lib64
6897                 then
6898
6899 if test -n "/lib64" ; then
6900         for cf_add_libdir in /lib64
6901         do
6902                 if test "$cf_add_libdir" = /usr/lib ; then
6903                         :
6904                 elif test -d "$cf_add_libdir"
6905                 then
6906                         cf_have_libdir=no
6907                         if test -n "$LDFLAGS$LIBS" ; then
6908                                 # a loop is needed to ensure we can add subdirs of existing dirs
6909                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6910                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6911                                                 cf_have_libdir=yes; break
6912                                         fi
6913                                 done
6914                         fi
6915                         if test "$cf_have_libdir" = no ; then
6916                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6917
6918 echo "${as_me:-configure}:6918: testing adding $cf_add_libdir to library-path ..." 1>&5
6919
6920                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6921                         fi
6922                 fi
6923         done
6924 fi
6925
6926                 else
6927
6928 if test -n "/lib" ; then
6929         for cf_add_libdir in /lib
6930         do
6931                 if test "$cf_add_libdir" = /usr/lib ; then
6932                         :
6933                 elif test -d "$cf_add_libdir"
6934                 then
6935                         cf_have_libdir=no
6936                         if test -n "$LDFLAGS$LIBS" ; then
6937                                 # a loop is needed to ensure we can add subdirs of existing dirs
6938                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6939                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6940                                                 cf_have_libdir=yes; break
6941                                         fi
6942                                 done
6943                         fi
6944                         if test "$cf_have_libdir" = no ; then
6945                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6946
6947 echo "${as_me:-configure}:6947: testing adding $cf_add_libdir to library-path ..." 1>&5
6948
6949                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6950                         fi
6951                 fi
6952         done
6953 fi
6954
6955                 fi
6956                 ;;
6957         (*)
6958
6959 if test -n "/lib" ; then
6960         for cf_add_libdir in /lib
6961         do
6962                 if test "$cf_add_libdir" = /usr/lib ; then
6963                         :
6964                 elif test -d "$cf_add_libdir"
6965                 then
6966                         cf_have_libdir=no
6967                         if test -n "$LDFLAGS$LIBS" ; then
6968                                 # a loop is needed to ensure we can add subdirs of existing dirs
6969                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6970                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6971                                                 cf_have_libdir=yes; break
6972                                         fi
6973                                 done
6974                         fi
6975                         if test "$cf_have_libdir" = no ; then
6976                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6977
6978 echo "${as_me:-configure}:6978: testing adding $cf_add_libdir to library-path ..." 1>&5
6979
6980                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6981                         fi
6982                 fi
6983         done
6984 fi
6985
6986                 ;;
6987         esac
6988         ;;
6989 (sunos3*|sunos4*)
6990         if test "x$cf_cv_screen" = "xcurses_5lib"
6991         then
6992                 if test -d /usr/5lib ; then
6993
6994 if test -n "/usr/5lib" ; then
6995         for cf_add_libdir in /usr/5lib
6996         do
6997                 if test "$cf_add_libdir" = /usr/lib ; then
6998                         :
6999                 elif test -d "$cf_add_libdir"
7000                 then
7001                         cf_have_libdir=no
7002                         if test -n "$LDFLAGS$LIBS" ; then
7003                                 # a loop is needed to ensure we can add subdirs of existing dirs
7004                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7005                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7006                                                 cf_have_libdir=yes; break
7007                                         fi
7008                                 done
7009                         fi
7010                         if test "$cf_have_libdir" = no ; then
7011                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7012
7013 echo "${as_me:-configure}:7013: testing adding $cf_add_libdir to library-path ..." 1>&5
7014
7015                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7016                         fi
7017                 fi
7018         done
7019 fi
7020
7021 cf_add_libs="$LIBS"
7022 # reverse order
7023 cf_add_0lib=
7024 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7025 # filter duplicates
7026 for cf_add_1lib in $cf_add_0lib; do
7027         for cf_add_2lib in $cf_add_libs; do
7028                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7029                         cf_add_1lib=
7030                         break
7031                 fi
7032         done
7033         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7034 done
7035 LIBS="$cf_add_libs"
7036
7037                 fi
7038         fi
7039         ac_cv_func_initscr=yes
7040         ;;
7041 esac
7042
7043 if test ".$ac_cv_func_initscr" != .yes ; then
7044         cf_save_LIBS="$LIBS"
7045
7046         if test ".${cf_cv_ncurses_version:-no}" != .no
7047         then
7048                 cf_check_list="ncurses curses cursesX"
7049         else
7050                 cf_check_list="cursesX curses ncurses"
7051         fi
7052
7053         # Check for library containing tgoto.  Do this before curses library
7054         # because it may be needed to link the test-case for initscr.
7055         if test "x$cf_term_lib" = x
7056         then
7057                 echo "$as_me:7057: checking for tgoto" >&5
7058 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7059 if test "${ac_cv_func_tgoto+set}" = set; then
7060   echo $ECHO_N "(cached) $ECHO_C" >&6
7061 else
7062   cat >"conftest.$ac_ext" <<_ACEOF
7063 #line 7063 "configure"
7064 #include "confdefs.h"
7065 #define tgoto autoconf_temporary
7066 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7067 #undef tgoto
7068
7069 #ifdef __cplusplus
7070 extern "C"
7071 #endif
7072
7073 /* We use char because int might match the return type of a gcc2
7074    builtin and then its argument prototype would still apply.  */
7075 char tgoto (void);
7076
7077 int
7078 main (void)
7079 {
7080
7081 /* The GNU C library defines stubs for functions which it implements
7082     to always fail with ENOSYS.  Some functions are actually named
7083     something starting with __ and the normal name is an alias.  */
7084 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7085 #error found stub for tgoto
7086 #endif
7087
7088         return tgoto ();
7089   ;
7090   return 0;
7091 }
7092 _ACEOF
7093 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7094 if { (eval echo "$as_me:7094: \"$ac_link\"") >&5
7095   (eval $ac_link) 2>&5
7096   ac_status=$?
7097   echo "$as_me:7097: \$? = $ac_status" >&5
7098   (exit "$ac_status"); } &&
7099          { ac_try='test -s "conftest$ac_exeext"'
7100   { (eval echo "$as_me:7100: \"$ac_try\"") >&5
7101   (eval $ac_try) 2>&5
7102   ac_status=$?
7103   echo "$as_me:7103: \$? = $ac_status" >&5
7104   (exit "$ac_status"); }; }; then
7105   ac_cv_func_tgoto=yes
7106 else
7107   echo "$as_me: failed program was:" >&5
7108 cat "conftest.$ac_ext" >&5
7109 ac_cv_func_tgoto=no
7110 fi
7111 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7112 fi
7113 echo "$as_me:7113: result: $ac_cv_func_tgoto" >&5
7114 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7115 if test "$ac_cv_func_tgoto" = yes; then
7116   cf_term_lib=predefined
7117 else
7118
7119                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7120                         do
7121                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7122 echo "$as_me:7122: checking for tgoto in -l$cf_term_lib" >&5
7123 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7124 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7125   echo $ECHO_N "(cached) $ECHO_C" >&6
7126 else
7127   ac_check_lib_save_LIBS=$LIBS
7128 LIBS="-l$cf_term_lib  $LIBS"
7129 cat >"conftest.$ac_ext" <<_ACEOF
7130 #line 7130 "configure"
7131 #include "confdefs.h"
7132
7133 /* Override any gcc2 internal prototype to avoid an error.  */
7134 #ifdef __cplusplus
7135 extern "C"
7136 #endif
7137 /* We use char because int might match the return type of a gcc2
7138    builtin and then its argument prototype would still apply.  */
7139 char tgoto ();
7140 int
7141 main (void)
7142 {
7143 tgoto ();
7144   ;
7145   return 0;
7146 }
7147 _ACEOF
7148 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7149 if { (eval echo "$as_me:7149: \"$ac_link\"") >&5
7150   (eval $ac_link) 2>&5
7151   ac_status=$?
7152   echo "$as_me:7152: \$? = $ac_status" >&5
7153   (exit "$ac_status"); } &&
7154          { ac_try='test -s "conftest$ac_exeext"'
7155   { (eval echo "$as_me:7155: \"$ac_try\"") >&5
7156   (eval $ac_try) 2>&5
7157   ac_status=$?
7158   echo "$as_me:7158: \$? = $ac_status" >&5
7159   (exit "$ac_status"); }; }; then
7160   eval "$as_ac_Lib=yes"
7161 else
7162   echo "$as_me: failed program was:" >&5
7163 cat "conftest.$ac_ext" >&5
7164 eval "$as_ac_Lib=no"
7165 fi
7166 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7167 LIBS=$ac_check_lib_save_LIBS
7168 fi
7169 echo "$as_me:7169: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7170 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7171 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7172
7173                                         : "${cf_nculib_root:=$cf_term_lib}"
7174                                         break
7175
7176 fi
7177
7178                         done
7179
7180 fi
7181
7182         fi
7183
7184         # Check for library containing initscr
7185         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7186         if test "x$cf_curs_lib" = x
7187         then
7188                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7189                 do
7190                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7191                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7192                                 echo "$as_me:7192: checking if we can link with $cf_curs_lib library" >&5
7193 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7194                                 cat >"conftest.$ac_ext" <<_ACEOF
7195 #line 7195 "configure"
7196 #include "confdefs.h"
7197 #include <${cf_cv_ncurses_header:-curses.h}>
7198 int
7199 main (void)
7200 {
7201 initscr()
7202   ;
7203   return 0;
7204 }
7205 _ACEOF
7206 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7207 if { (eval echo "$as_me:7207: \"$ac_link\"") >&5
7208   (eval $ac_link) 2>&5
7209   ac_status=$?
7210   echo "$as_me:7210: \$? = $ac_status" >&5
7211   (exit "$ac_status"); } &&
7212          { ac_try='test -s "conftest$ac_exeext"'
7213   { (eval echo "$as_me:7213: \"$ac_try\"") >&5
7214   (eval $ac_try) 2>&5
7215   ac_status=$?
7216   echo "$as_me:7216: \$? = $ac_status" >&5
7217   (exit "$ac_status"); }; }; then
7218   cf_result=yes
7219 else
7220   echo "$as_me: failed program was:" >&5
7221 cat "conftest.$ac_ext" >&5
7222 cf_result=no
7223 fi
7224 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7225                                 echo "$as_me:7225: result: $cf_result" >&5
7226 echo "${ECHO_T}$cf_result" >&6
7227                                 test "$cf_result" = yes && break
7228                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7229                                 cf_result=no
7230                         elif test "$cf_term_lib" != predefined ; then
7231                                 echo "$as_me:7231: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7232 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7233                                 cat >"conftest.$ac_ext" <<_ACEOF
7234 #line 7234 "configure"
7235 #include "confdefs.h"
7236 #include <${cf_cv_ncurses_header:-curses.h}>
7237 int
7238 main (void)
7239 {
7240 initscr(); tgoto((char *)0, 0, 0);
7241   ;
7242   return 0;
7243 }
7244 _ACEOF
7245 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7246 if { (eval echo "$as_me:7246: \"$ac_link\"") >&5
7247   (eval $ac_link) 2>&5
7248   ac_status=$?
7249   echo "$as_me:7249: \$? = $ac_status" >&5
7250   (exit "$ac_status"); } &&
7251          { ac_try='test -s "conftest$ac_exeext"'
7252   { (eval echo "$as_me:7252: \"$ac_try\"") >&5
7253   (eval $ac_try) 2>&5
7254   ac_status=$?
7255   echo "$as_me:7255: \$? = $ac_status" >&5
7256   (exit "$ac_status"); }; }; then
7257   cf_result=no
7258 else
7259   echo "$as_me: failed program was:" >&5
7260 cat "conftest.$ac_ext" >&5
7261
7262                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7263                                         cat >"conftest.$ac_ext" <<_ACEOF
7264 #line 7264 "configure"
7265 #include "confdefs.h"
7266 #include <${cf_cv_ncurses_header:-curses.h}>
7267 int
7268 main (void)
7269 {
7270 initscr()
7271   ;
7272   return 0;
7273 }
7274 _ACEOF
7275 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7276 if { (eval echo "$as_me:7276: \"$ac_link\"") >&5
7277   (eval $ac_link) 2>&5
7278   ac_status=$?
7279   echo "$as_me:7279: \$? = $ac_status" >&5
7280   (exit "$ac_status"); } &&
7281          { ac_try='test -s "conftest$ac_exeext"'
7282   { (eval echo "$as_me:7282: \"$ac_try\"") >&5
7283   (eval $ac_try) 2>&5
7284   ac_status=$?
7285   echo "$as_me:7285: \$? = $ac_status" >&5
7286   (exit "$ac_status"); }; }; then
7287   cf_result=yes
7288 else
7289   echo "$as_me: failed program was:" >&5
7290 cat "conftest.$ac_ext" >&5
7291 cf_result=error
7292 fi
7293 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7294
7295 fi
7296 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7297                                 echo "$as_me:7297: result: $cf_result" >&5
7298 echo "${ECHO_T}$cf_result" >&6
7299                                 test "$cf_result" != error && break
7300                         fi
7301                 done
7302         fi
7303         test "$cf_curs_lib" = unknown && { { echo "$as_me:7303: error: no curses library found" >&5
7304 echo "$as_me: error: no curses library found" >&2;}
7305    { (exit 1); exit 1; }; }
7306 fi
7307 fi
7308
7309         ;;
7310 (ncursesw*)
7311
7312 echo "$as_me:7312: checking for multibyte character support" >&5
7313 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7314 if test "${cf_cv_utf8_lib+set}" = set; then
7315   echo $ECHO_N "(cached) $ECHO_C" >&6
7316 else
7317
7318         cf_save_LIBS="$LIBS"
7319         cat >"conftest.$ac_ext" <<_ACEOF
7320 #line 7320 "configure"
7321 #include "confdefs.h"
7322
7323 #include <stdlib.h>
7324 int
7325 main (void)
7326 {
7327 putwc(0,0);
7328   ;
7329   return 0;
7330 }
7331 _ACEOF
7332 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7333 if { (eval echo "$as_me:7333: \"$ac_link\"") >&5
7334   (eval $ac_link) 2>&5
7335   ac_status=$?
7336   echo "$as_me:7336: \$? = $ac_status" >&5
7337   (exit "$ac_status"); } &&
7338          { ac_try='test -s "conftest$ac_exeext"'
7339   { (eval echo "$as_me:7339: \"$ac_try\"") >&5
7340   (eval $ac_try) 2>&5
7341   ac_status=$?
7342   echo "$as_me:7342: \$? = $ac_status" >&5
7343   (exit "$ac_status"); }; }; then
7344   cf_cv_utf8_lib=yes
7345 else
7346   echo "$as_me: failed program was:" >&5
7347 cat "conftest.$ac_ext" >&5
7348
7349 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7350 # will be set on completion of the AC_TRY_LINK below.
7351 cf_cv_header_path_utf8=
7352 cf_cv_library_path_utf8=
7353
7354 echo "${as_me:-configure}:7354: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7355
7356 cf_save_LIBS="$LIBS"
7357
7358 cat >"conftest.$ac_ext" <<_ACEOF
7359 #line 7359 "configure"
7360 #include "confdefs.h"
7361
7362 #include <libutf8.h>
7363 int
7364 main (void)
7365 {
7366 putwc(0,0);
7367   ;
7368   return 0;
7369 }
7370 _ACEOF
7371 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7372 if { (eval echo "$as_me:7372: \"$ac_link\"") >&5
7373   (eval $ac_link) 2>&5
7374   ac_status=$?
7375   echo "$as_me:7375: \$? = $ac_status" >&5
7376   (exit "$ac_status"); } &&
7377          { ac_try='test -s "conftest$ac_exeext"'
7378   { (eval echo "$as_me:7378: \"$ac_try\"") >&5
7379   (eval $ac_try) 2>&5
7380   ac_status=$?
7381   echo "$as_me:7381: \$? = $ac_status" >&5
7382   (exit "$ac_status"); }; }; then
7383
7384         cf_cv_find_linkage_utf8=yes
7385         cf_cv_header_path_utf8=/usr/include
7386         cf_cv_library_path_utf8=/usr/lib
7387
7388 else
7389   echo "$as_me: failed program was:" >&5
7390 cat "conftest.$ac_ext" >&5
7391
7392 LIBS="-lutf8  $cf_save_LIBS"
7393
7394 cat >"conftest.$ac_ext" <<_ACEOF
7395 #line 7395 "configure"
7396 #include "confdefs.h"
7397
7398 #include <libutf8.h>
7399 int
7400 main (void)
7401 {
7402 putwc(0,0);
7403   ;
7404   return 0;
7405 }
7406 _ACEOF
7407 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7408 if { (eval echo "$as_me:7408: \"$ac_link\"") >&5
7409   (eval $ac_link) 2>&5
7410   ac_status=$?
7411   echo "$as_me:7411: \$? = $ac_status" >&5
7412   (exit "$ac_status"); } &&
7413          { ac_try='test -s "conftest$ac_exeext"'
7414   { (eval echo "$as_me:7414: \"$ac_try\"") >&5
7415   (eval $ac_try) 2>&5
7416   ac_status=$?
7417   echo "$as_me:7417: \$? = $ac_status" >&5
7418   (exit "$ac_status"); }; }; then
7419
7420         cf_cv_find_linkage_utf8=yes
7421         cf_cv_header_path_utf8=/usr/include
7422         cf_cv_library_path_utf8=/usr/lib
7423         cf_cv_library_file_utf8="-lutf8"
7424
7425 else
7426   echo "$as_me: failed program was:" >&5
7427 cat "conftest.$ac_ext" >&5
7428
7429         cf_cv_find_linkage_utf8=no
7430         LIBS="$cf_save_LIBS"
7431
7432         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7433
7434 echo "${as_me:-configure}:7434: testing find linkage for utf8 library ..." 1>&5
7435
7436 echo "${as_me:-configure}:7436: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7437
7438         cf_save_CPPFLAGS="$CPPFLAGS"
7439         cf_test_CPPFLAGS="$CPPFLAGS"
7440
7441 cf_search=
7442
7443 # collect the current set of include-directories from compiler flags
7444 cf_header_path_list=""
7445 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7446         for cf_header_path in $CPPFLAGS $CFLAGS
7447         do
7448                 case "$cf_header_path" in
7449                 (-I*)
7450                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7451
7452 test "x$cf_header_path" != "xNONE" && \
7453 test -d "$cf_header_path" && \
7454  {
7455         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7456         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7457         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7458         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7459         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7460         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7461 }
7462
7463                         cf_header_path_list="$cf_header_path_list $cf_search"
7464                         ;;
7465                 esac
7466         done
7467 fi
7468
7469 # add the variations for the package we are looking for
7470
7471 cf_search=
7472
7473 test "x$prefix" != "xNONE" && \
7474 test -d "$prefix" && \
7475  {
7476         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7477         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7478         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7479         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7480         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7481         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7482 }
7483
7484 for cf_subdir_prefix in \
7485         /usr \
7486         /usr/local \
7487         /usr/pkg \
7488         /opt \
7489         /opt/local \
7490         $HOME
7491 do
7492
7493 test "x$cf_subdir_prefix" != "x$prefix" && \
7494 test -d "$cf_subdir_prefix" && \
7495 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7496         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7497         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7498         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7499         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7500         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7501         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7502 }
7503
7504 done
7505
7506 test "$includedir" != NONE && \
7507 test "$includedir" != "/usr/include" && \
7508 test -d "$includedir" && {
7509         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7510         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7511 }
7512
7513 test "$oldincludedir" != NONE && \
7514 test "$oldincludedir" != "/usr/include" && \
7515 test -d "$oldincludedir" && {
7516         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7517         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7518 }
7519
7520 cf_search="$cf_search $cf_header_path_list"
7521
7522         for cf_cv_header_path_utf8 in $cf_search
7523         do
7524                 if test -d "$cf_cv_header_path_utf8" ; then
7525                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7526
7527 echo "${as_me:-configure}:7527: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7528
7529                         CPPFLAGS="$cf_save_CPPFLAGS"
7530
7531         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7532         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7533
7534                         cat >"conftest.$ac_ext" <<_ACEOF
7535 #line 7535 "configure"
7536 #include "confdefs.h"
7537
7538 #include <libutf8.h>
7539 int
7540 main (void)
7541 {
7542 putwc(0,0);
7543   ;
7544   return 0;
7545 }
7546 _ACEOF
7547 rm -f "conftest.$ac_objext"
7548 if { (eval echo "$as_me:7548: \"$ac_compile\"") >&5
7549   (eval $ac_compile) 2>&5
7550   ac_status=$?
7551   echo "$as_me:7551: \$? = $ac_status" >&5
7552   (exit "$ac_status"); } &&
7553          { ac_try='test -s "conftest.$ac_objext"'
7554   { (eval echo "$as_me:7554: \"$ac_try\"") >&5
7555   (eval $ac_try) 2>&5
7556   ac_status=$?
7557   echo "$as_me:7557: \$? = $ac_status" >&5
7558   (exit "$ac_status"); }; }; then
7559
7560                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7561
7562 echo "${as_me:-configure}:7562: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7563
7564                                 cf_cv_find_linkage_utf8=maybe
7565                                 cf_test_CPPFLAGS="$CPPFLAGS"
7566                                 break
7567 else
7568   echo "$as_me: failed program was:" >&5
7569 cat "conftest.$ac_ext" >&5
7570
7571                                 CPPFLAGS="$cf_save_CPPFLAGS"
7572
7573 fi
7574 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7575                 fi
7576         done
7577
7578         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7579
7580 echo "${as_me:-configure}:7580: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7581
7582                 cf_save_LIBS="$LIBS"
7583                 cf_save_LDFLAGS="$LDFLAGS"
7584
7585                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7586
7587 cf_search=
7588 cf_library_path_list=""
7589 if test -n "${LDFLAGS}${LIBS}" ; then
7590         for cf_library_path in $LDFLAGS $LIBS
7591         do
7592                 case "$cf_library_path" in
7593                 (-L*)
7594                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7595
7596 test "x$cf_library_path" != "xNONE" && \
7597 test -d "$cf_library_path" && \
7598  {
7599         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7600         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7601         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7602         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7603         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7604         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7605 }
7606
7607                         cf_library_path_list="$cf_library_path_list $cf_search"
7608                         ;;
7609                 esac
7610         done
7611 fi
7612
7613 cf_search=
7614
7615 test "x$prefix" != "xNONE" && \
7616 test -d "$prefix" && \
7617  {
7618         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7619         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7620         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7621         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7622         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7623         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7624 }
7625
7626 for cf_subdir_prefix in \
7627         /usr \
7628         /usr/local \
7629         /usr/pkg \
7630         /opt \
7631         /opt/local \
7632         $HOME
7633 do
7634
7635 test "x$cf_subdir_prefix" != "x$prefix" && \
7636 test -d "$cf_subdir_prefix" && \
7637 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7638         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7639         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7640         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7641         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7642         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7643         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7644 }
7645
7646 done
7647
7648 cf_search="$cf_library_path_list $cf_search"
7649
7650                         for cf_cv_library_path_utf8 in $cf_search
7651                         do
7652                                 if test -d "$cf_cv_library_path_utf8" ; then
7653                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7654
7655 echo "${as_me:-configure}:7655: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7656
7657                                         CPPFLAGS="$cf_test_CPPFLAGS"
7658                                         LIBS="-lutf8  $cf_save_LIBS"
7659                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7660                                         cat >"conftest.$ac_ext" <<_ACEOF
7661 #line 7661 "configure"
7662 #include "confdefs.h"
7663
7664 #include <libutf8.h>
7665 int
7666 main (void)
7667 {
7668 putwc(0,0);
7669   ;
7670   return 0;
7671 }
7672 _ACEOF
7673 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7674 if { (eval echo "$as_me:7674: \"$ac_link\"") >&5
7675   (eval $ac_link) 2>&5
7676   ac_status=$?
7677   echo "$as_me:7677: \$? = $ac_status" >&5
7678   (exit "$ac_status"); } &&
7679          { ac_try='test -s "conftest$ac_exeext"'
7680   { (eval echo "$as_me:7680: \"$ac_try\"") >&5
7681   (eval $ac_try) 2>&5
7682   ac_status=$?
7683   echo "$as_me:7683: \$? = $ac_status" >&5
7684   (exit "$ac_status"); }; }; then
7685
7686                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7687
7688 echo "${as_me:-configure}:7688: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7689
7690                                         cf_cv_find_linkage_utf8=yes
7691                                         cf_cv_library_file_utf8="-lutf8"
7692                                         break
7693 else
7694   echo "$as_me: failed program was:" >&5
7695 cat "conftest.$ac_ext" >&5
7696
7697                                         CPPFLAGS="$cf_save_CPPFLAGS"
7698                                         LIBS="$cf_save_LIBS"
7699                                         LDFLAGS="$cf_save_LDFLAGS"
7700
7701 fi
7702 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7703                                 fi
7704                         done
7705                         CPPFLAGS="$cf_save_CPPFLAGS"
7706                         LDFLAGS="$cf_save_LDFLAGS"
7707                 fi
7708
7709         else
7710                 cf_cv_find_linkage_utf8=no
7711         fi
7712
7713 fi
7714 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7715
7716 fi
7717 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7718
7719 LIBS="$cf_save_LIBS"
7720
7721 if test "$cf_cv_find_linkage_utf8" = yes ; then
7722 cf_cv_utf8_lib=add-on
7723 else
7724 cf_cv_utf8_lib=no
7725 fi
7726
7727 fi
7728 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7729 fi
7730 echo "$as_me:7730: result: $cf_cv_utf8_lib" >&5
7731 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7732
7733 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7734 # ncurses/ncursesw:
7735 if test "$cf_cv_utf8_lib" = "add-on" ; then
7736
7737 cat >>confdefs.h <<\EOF
7738 #define HAVE_LIBUTF8_H 1
7739 EOF
7740
7741 if test -n "$cf_cv_header_path_utf8" ; then
7742   for cf_add_incdir in $cf_cv_header_path_utf8
7743   do
7744         while test "$cf_add_incdir" != /usr/include
7745         do
7746           if test -d "$cf_add_incdir"
7747           then
7748                 cf_have_incdir=no
7749                 if test -n "$CFLAGS$CPPFLAGS" ; then
7750                   # a loop is needed to ensure we can add subdirs of existing dirs
7751                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7752                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7753                           cf_have_incdir=yes; break
7754                         fi
7755                   done
7756                 fi
7757
7758                 if test "$cf_have_incdir" = no ; then
7759                   if test "$cf_add_incdir" = /usr/local/include ; then
7760                         if test "$GCC" = yes
7761                         then
7762                           cf_save_CPPFLAGS=$CPPFLAGS
7763
7764         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7765         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7766
7767                           cat >"conftest.$ac_ext" <<_ACEOF
7768 #line 7768 "configure"
7769 #include "confdefs.h"
7770 #include <stdio.h>
7771 int
7772 main (void)
7773 {
7774 printf("Hello")
7775   ;
7776   return 0;
7777 }
7778 _ACEOF
7779 rm -f "conftest.$ac_objext"
7780 if { (eval echo "$as_me:7780: \"$ac_compile\"") >&5
7781   (eval $ac_compile) 2>&5
7782   ac_status=$?
7783   echo "$as_me:7783: \$? = $ac_status" >&5
7784   (exit "$ac_status"); } &&
7785          { ac_try='test -s "conftest.$ac_objext"'
7786   { (eval echo "$as_me:7786: \"$ac_try\"") >&5
7787   (eval $ac_try) 2>&5
7788   ac_status=$?
7789   echo "$as_me:7789: \$? = $ac_status" >&5
7790   (exit "$ac_status"); }; }; then
7791   :
7792 else
7793   echo "$as_me: failed program was:" >&5
7794 cat "conftest.$ac_ext" >&5
7795 cf_have_incdir=yes
7796 fi
7797 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7798                           CPPFLAGS=$cf_save_CPPFLAGS
7799                         fi
7800                   fi
7801                 fi
7802
7803                 if test "$cf_have_incdir" = no ; then
7804                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7805
7806 echo "${as_me:-configure}:7806: testing adding $cf_add_incdir to include-path ..." 1>&5
7807
7808                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7809
7810                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7811                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7812                   cf_add_incdir="$cf_top_incdir"
7813                 else
7814                   break
7815                 fi
7816           else
7817                 break
7818           fi
7819         done
7820   done
7821 fi
7822
7823 if test -n "$cf_cv_library_path_utf8" ; then
7824         for cf_add_libdir in $cf_cv_library_path_utf8
7825         do
7826                 if test "$cf_add_libdir" = /usr/lib ; then
7827                         :
7828                 elif test -d "$cf_add_libdir"
7829                 then
7830                         cf_have_libdir=no
7831                         if test -n "$LDFLAGS$LIBS" ; then
7832                                 # a loop is needed to ensure we can add subdirs of existing dirs
7833                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7834                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7835                                                 cf_have_libdir=yes; break
7836                                         fi
7837                                 done
7838                         fi
7839                         if test "$cf_have_libdir" = no ; then
7840                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7841
7842 echo "${as_me:-configure}:7842: testing adding $cf_add_libdir to library-path ..." 1>&5
7843
7844                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7845                         fi
7846                 fi
7847         done
7848 fi
7849
7850 cf_add_libs="$LIBS"
7851 # reverse order
7852 cf_add_0lib=
7853 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7854 # filter duplicates
7855 for cf_add_1lib in $cf_add_0lib; do
7856         for cf_add_2lib in $cf_add_libs; do
7857                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7858                         cf_add_1lib=
7859                         break
7860                 fi
7861         done
7862         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7863 done
7864 LIBS="$cf_add_libs"
7865
7866 fi
7867
7868 cf_ncuconfig_root=$cf_cv_screen
7869 cf_have_ncuconfig=no
7870
7871 if test "x${PKG_CONFIG:=none}" != xnone; then
7872         echo "$as_me:7872: checking pkg-config for $cf_ncuconfig_root" >&5
7873 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7874         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7875                 echo "$as_me:7875: result: yes" >&5
7876 echo "${ECHO_T}yes" >&6
7877
7878                 echo "$as_me:7878: checking if the $cf_ncuconfig_root package files work" >&5
7879 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7880                 cf_have_ncuconfig=unknown
7881
7882                 cf_save_CFLAGS="$CFLAGS"
7883                 cf_save_CPPFLAGS="$CPPFLAGS"
7884                 cf_save_LIBS="$LIBS"
7885
7886                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7887                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7888
7889                 # while -W for passing linker flags is prevalent, it is not "standard".
7890                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7891                 # incompatible _and_ non-standard -W option which gives an error.  Work
7892                 # around that pitfall.
7893                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7894                 (x*c[89]9@@*-W*)
7895
7896 cf_fix_cppflags=no
7897 cf_new_cflags=
7898 cf_new_cppflags=
7899 cf_new_extra_cppflags=
7900
7901 for cf_add_cflags in $cf_pkg_cflags
7902 do
7903 case "$cf_fix_cppflags" in
7904 (no)
7905         case "$cf_add_cflags" in
7906         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7907                 case "$cf_add_cflags" in
7908                 (-D*)
7909                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7910
7911                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7912                                 && test -z "${cf_tst_cflags}" \
7913                                 && cf_fix_cppflags=yes
7914
7915                         if test "$cf_fix_cppflags" = yes ; then
7916
7917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7919
7920                                 continue
7921                         elif test "${cf_tst_cflags}" = "\"'" ; then
7922
7923         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7924         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7925
7926                                 continue
7927                         fi
7928                         ;;
7929                 esac
7930                 case "$CPPFLAGS" in
7931                 (*$cf_add_cflags)
7932                         ;;
7933                 (*)
7934                         case "$cf_add_cflags" in
7935                         (-D*)
7936                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7937
7938 CPPFLAGS=`echo "$CPPFLAGS" | \
7939         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7940                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7941
7942                                 ;;
7943                         esac
7944
7945         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7946         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7947
7948                         ;;
7949                 esac
7950                 ;;
7951         (*)
7952
7953         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7954         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7955
7956                 ;;
7957         esac
7958         ;;
7959 (yes)
7960
7961         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7962         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7963
7964         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7965
7966         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7967                 && test -z "${cf_tst_cflags}" \
7968                 && cf_fix_cppflags=no
7969         ;;
7970 esac
7971 done
7972
7973 if test -n "$cf_new_cflags" ; then
7974
7975         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7976         CFLAGS="${CFLAGS}$cf_new_cflags"
7977
7978 fi
7979
7980 if test -n "$cf_new_cppflags" ; then
7981
7982         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7983         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7984
7985 fi
7986
7987 if test -n "$cf_new_extra_cppflags" ; then
7988
7989         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7990         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7991
7992 fi
7993
7994 cf_add_libs="$LIBS"
7995 # reverse order
7996 cf_add_0lib=
7997 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7998 # filter duplicates
7999 for cf_add_1lib in $cf_add_0lib; do
8000         for cf_add_2lib in $cf_add_libs; do
8001                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8002                         cf_add_1lib=
8003                         break
8004                 fi
8005         done
8006         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8007 done
8008 LIBS="$cf_add_libs"
8009
8010                         cat >"conftest.$ac_ext" <<_ACEOF
8011 #line 8011 "configure"
8012 #include "confdefs.h"
8013 #include <${cf_cv_ncurses_header:-curses.h}>
8014 int
8015 main (void)
8016 {
8017 initscr(); mousemask(0,0); tigetstr((char *)0);
8018   ;
8019   return 0;
8020 }
8021 _ACEOF
8022 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8023 if { (eval echo "$as_me:8023: \"$ac_link\"") >&5
8024   (eval $ac_link) 2>&5
8025   ac_status=$?
8026   echo "$as_me:8026: \$? = $ac_status" >&5
8027   (exit "$ac_status"); } &&
8028          { ac_try='test -s "conftest$ac_exeext"'
8029   { (eval echo "$as_me:8029: \"$ac_try\"") >&5
8030   (eval $ac_try) 2>&5
8031   ac_status=$?
8032   echo "$as_me:8032: \$? = $ac_status" >&5
8033   (exit "$ac_status"); }; }; then
8034   if test "$cross_compiling" = yes; then
8035   cf_test_ncuconfig=maybe
8036 else
8037   cat >"conftest.$ac_ext" <<_ACEOF
8038 #line 8038 "configure"
8039 #include "confdefs.h"
8040 #include <${cf_cv_ncurses_header:-curses.h}>
8041                                         int main(void)
8042                                         { char *xx = curses_version(); return (xx == 0); }
8043 _ACEOF
8044 rm -f "conftest$ac_exeext"
8045 if { (eval echo "$as_me:8045: \"$ac_link\"") >&5
8046   (eval $ac_link) 2>&5
8047   ac_status=$?
8048   echo "$as_me:8048: \$? = $ac_status" >&5
8049   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8050   { (eval echo "$as_me:8050: \"$ac_try\"") >&5
8051   (eval $ac_try) 2>&5
8052   ac_status=$?
8053   echo "$as_me:8053: \$? = $ac_status" >&5
8054   (exit "$ac_status"); }; }; then
8055   cf_test_ncuconfig=yes
8056 else
8057   echo "$as_me: program exited with status $ac_status" >&5
8058 echo "$as_me: failed program was:" >&5
8059 cat "conftest.$ac_ext" >&5
8060 cf_test_ncuconfig=no
8061 fi
8062 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8063 fi
8064 else
8065   echo "$as_me: failed program was:" >&5
8066 cat "conftest.$ac_ext" >&5
8067 cf_test_ncuconfig=no
8068 fi
8069 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8070
8071                         CFLAGS="$cf_save_CFLAGS"
8072                         CPPFLAGS="$cf_save_CPPFLAGS"
8073                         LIBS="$cf_save_LIBS"
8074
8075                         if test "x$cf_test_ncuconfig" != xyes; then
8076                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8077                                 cf_pkg_cflags="$cf_temp"
8078                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8079                                 cf_pkg_libs="$cf_temp"
8080                         fi
8081                         ;;
8082                 esac
8083
8084 cf_fix_cppflags=no
8085 cf_new_cflags=
8086 cf_new_cppflags=
8087 cf_new_extra_cppflags=
8088
8089 for cf_add_cflags in $cf_pkg_cflags
8090 do
8091 case "$cf_fix_cppflags" in
8092 (no)
8093         case "$cf_add_cflags" in
8094         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8095                 case "$cf_add_cflags" in
8096                 (-D*)
8097                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8098
8099                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8100                                 && test -z "${cf_tst_cflags}" \
8101                                 && cf_fix_cppflags=yes
8102
8103                         if test "$cf_fix_cppflags" = yes ; then
8104
8105         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8106         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8107
8108                                 continue
8109                         elif test "${cf_tst_cflags}" = "\"'" ; then
8110
8111         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8112         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8113
8114                                 continue
8115                         fi
8116                         ;;
8117                 esac
8118                 case "$CPPFLAGS" in
8119                 (*$cf_add_cflags)
8120                         ;;
8121                 (*)
8122                         case "$cf_add_cflags" in
8123                         (-D*)
8124                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8125
8126 CPPFLAGS=`echo "$CPPFLAGS" | \
8127         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8128                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8129
8130                                 ;;
8131                         esac
8132
8133         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8134         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8135
8136                         ;;
8137                 esac
8138                 ;;
8139         (*)
8140
8141         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8142         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8143
8144                 ;;
8145         esac
8146         ;;
8147 (yes)
8148
8149         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8150         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8151
8152         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8153
8154         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8155                 && test -z "${cf_tst_cflags}" \
8156                 && cf_fix_cppflags=no
8157         ;;
8158 esac
8159 done
8160
8161 if test -n "$cf_new_cflags" ; then
8162
8163         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8164         CFLAGS="${CFLAGS}$cf_new_cflags"
8165
8166 fi
8167
8168 if test -n "$cf_new_cppflags" ; then
8169
8170         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8171         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8172
8173 fi
8174
8175 if test -n "$cf_new_extra_cppflags" ; then
8176
8177         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8178         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8179
8180 fi
8181
8182 cf_add_libs="$LIBS"
8183 # reverse order
8184 cf_add_0lib=
8185 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8186 # filter duplicates
8187 for cf_add_1lib in $cf_add_0lib; do
8188         for cf_add_2lib in $cf_add_libs; do
8189                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8190                         cf_add_1lib=
8191                         break
8192                 fi
8193         done
8194         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8195 done
8196 LIBS="$cf_add_libs"
8197
8198                 cat >"conftest.$ac_ext" <<_ACEOF
8199 #line 8199 "configure"
8200 #include "confdefs.h"
8201 #include <${cf_cv_ncurses_header:-curses.h}>
8202 int
8203 main (void)
8204 {
8205 initscr(); mousemask(0,0); tigetstr((char *)0);
8206   ;
8207   return 0;
8208 }
8209 _ACEOF
8210 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8211 if { (eval echo "$as_me:8211: \"$ac_link\"") >&5
8212   (eval $ac_link) 2>&5
8213   ac_status=$?
8214   echo "$as_me:8214: \$? = $ac_status" >&5
8215   (exit "$ac_status"); } &&
8216          { ac_try='test -s "conftest$ac_exeext"'
8217   { (eval echo "$as_me:8217: \"$ac_try\"") >&5
8218   (eval $ac_try) 2>&5
8219   ac_status=$?
8220   echo "$as_me:8220: \$? = $ac_status" >&5
8221   (exit "$ac_status"); }; }; then
8222   if test "$cross_compiling" = yes; then
8223   cf_have_ncuconfig=maybe
8224 else
8225   cat >"conftest.$ac_ext" <<_ACEOF
8226 #line 8226 "configure"
8227 #include "confdefs.h"
8228 #include <${cf_cv_ncurses_header:-curses.h}>
8229                                 int main(void)
8230                                 { char *xx = curses_version(); return (xx == 0); }
8231 _ACEOF
8232 rm -f "conftest$ac_exeext"
8233 if { (eval echo "$as_me:8233: \"$ac_link\"") >&5
8234   (eval $ac_link) 2>&5
8235   ac_status=$?
8236   echo "$as_me:8236: \$? = $ac_status" >&5
8237   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8238   { (eval echo "$as_me:8238: \"$ac_try\"") >&5
8239   (eval $ac_try) 2>&5
8240   ac_status=$?
8241   echo "$as_me:8241: \$? = $ac_status" >&5
8242   (exit "$ac_status"); }; }; then
8243   cf_have_ncuconfig=yes
8244 else
8245   echo "$as_me: program exited with status $ac_status" >&5
8246 echo "$as_me: failed program was:" >&5
8247 cat "conftest.$ac_ext" >&5
8248 cf_have_ncuconfig=no
8249 fi
8250 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8251 fi
8252 else
8253   echo "$as_me: failed program was:" >&5
8254 cat "conftest.$ac_ext" >&5
8255 cf_have_ncuconfig=no
8256 fi
8257 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8258                 echo "$as_me:8258: result: $cf_have_ncuconfig" >&5
8259 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8260                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8261                 if test "$cf_have_ncuconfig" != "yes"
8262                 then
8263                         CPPFLAGS="$cf_save_CPPFLAGS"
8264                         LIBS="$cf_save_LIBS"
8265                         NCURSES_CONFIG_PKG=none
8266                 else
8267
8268 cat >>confdefs.h <<\EOF
8269 #define NCURSES 1
8270 EOF
8271
8272                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8273
8274 echo "$as_me:8274: checking for terminfo header" >&5
8275 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8276 if test "${cf_cv_term_header+set}" = set; then
8277   echo $ECHO_N "(cached) $ECHO_C" >&6
8278 else
8279
8280 case "${cf_cv_ncurses_header}" in
8281 (*/ncurses.h|*/ncursesw.h)
8282         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8283         ;;
8284 (*)
8285         cf_term_header=term.h
8286         ;;
8287 esac
8288
8289 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8290 do
8291 cat >"conftest.$ac_ext" <<_ACEOF
8292 #line 8292 "configure"
8293 #include "confdefs.h"
8294 #include <stdio.h>
8295 #include <${cf_cv_ncurses_header:-curses.h}>
8296 #include <$cf_test>
8297
8298 int
8299 main (void)
8300 {
8301 int x = auto_left_margin; (void)x
8302   ;
8303   return 0;
8304 }
8305 _ACEOF
8306 rm -f "conftest.$ac_objext"
8307 if { (eval echo "$as_me:8307: \"$ac_compile\"") >&5
8308   (eval $ac_compile) 2>&5
8309   ac_status=$?
8310   echo "$as_me:8310: \$? = $ac_status" >&5
8311   (exit "$ac_status"); } &&
8312          { ac_try='test -s "conftest.$ac_objext"'
8313   { (eval echo "$as_me:8313: \"$ac_try\"") >&5
8314   (eval $ac_try) 2>&5
8315   ac_status=$?
8316   echo "$as_me:8316: \$? = $ac_status" >&5
8317   (exit "$ac_status"); }; }; then
8318
8319         cf_cv_term_header="$cf_test"
8320 else
8321   echo "$as_me: failed program was:" >&5
8322 cat "conftest.$ac_ext" >&5
8323
8324         cf_cv_term_header=unknown
8325
8326 fi
8327 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8328         test "$cf_cv_term_header" != unknown && break
8329 done
8330
8331 fi
8332 echo "$as_me:8332: result: $cf_cv_term_header" >&5
8333 echo "${ECHO_T}$cf_cv_term_header" >&6
8334
8335 # Set definitions to allow ifdef'ing to accommodate subdirectories
8336
8337 case "$cf_cv_term_header" in
8338 (*term.h)
8339
8340 cat >>confdefs.h <<\EOF
8341 #define HAVE_TERM_H 1
8342 EOF
8343
8344         ;;
8345 esac
8346
8347 case "$cf_cv_term_header" in
8348 (ncurses/term.h)
8349
8350 cat >>confdefs.h <<\EOF
8351 #define HAVE_NCURSES_TERM_H 1
8352 EOF
8353
8354         ;;
8355 (ncursesw/term.h)
8356
8357 cat >>confdefs.h <<\EOF
8358 #define HAVE_NCURSESW_TERM_H 1
8359 EOF
8360
8361         ;;
8362 esac
8363
8364                 fi
8365
8366         else
8367                 echo "$as_me:8367: result: no" >&5
8368 echo "${ECHO_T}no" >&6
8369                 NCURSES_CONFIG_PKG=none
8370         fi
8371 else
8372         NCURSES_CONFIG_PKG=none
8373 fi
8374
8375 if test "x$cf_have_ncuconfig" = "xno"; then
8376         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8377
8378 if test -n "$ac_tool_prefix"; then
8379   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8380   do
8381     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8382 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8383 echo "$as_me:8383: checking for $ac_word" >&5
8384 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8385 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8386   echo $ECHO_N "(cached) $ECHO_C" >&6
8387 else
8388   if test -n "$NCURSES_CONFIG"; then
8389   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8390 else
8391   ac_save_IFS=$IFS; IFS=$ac_path_separator
8392 ac_dummy="$PATH"
8393 for ac_dir in $ac_dummy; do
8394   IFS=$ac_save_IFS
8395   test -z "$ac_dir" && ac_dir=.
8396   $as_executable_p "$ac_dir/$ac_word" || continue
8397 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8398 echo "$as_me:8398: found $ac_dir/$ac_word" >&5
8399 break
8400 done
8401
8402 fi
8403 fi
8404 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8405 if test -n "$NCURSES_CONFIG"; then
8406   echo "$as_me:8406: result: $NCURSES_CONFIG" >&5
8407 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8408 else
8409   echo "$as_me:8409: result: no" >&5
8410 echo "${ECHO_T}no" >&6
8411 fi
8412
8413     test -n "$NCURSES_CONFIG" && break
8414   done
8415 fi
8416 if test -z "$NCURSES_CONFIG"; then
8417   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8418   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8419 do
8420   # Extract the first word of "$ac_prog", so it can be a program name with args.
8421 set dummy $ac_prog; ac_word=$2
8422 echo "$as_me:8422: checking for $ac_word" >&5
8423 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8424 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8425   echo $ECHO_N "(cached) $ECHO_C" >&6
8426 else
8427   if test -n "$ac_ct_NCURSES_CONFIG"; then
8428   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8429 else
8430   ac_save_IFS=$IFS; IFS=$ac_path_separator
8431 ac_dummy="$PATH"
8432 for ac_dir in $ac_dummy; do
8433   IFS=$ac_save_IFS
8434   test -z "$ac_dir" && ac_dir=.
8435   $as_executable_p "$ac_dir/$ac_word" || continue
8436 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8437 echo "$as_me:8437: found $ac_dir/$ac_word" >&5
8438 break
8439 done
8440
8441 fi
8442 fi
8443 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8444 if test -n "$ac_ct_NCURSES_CONFIG"; then
8445   echo "$as_me:8445: result: $ac_ct_NCURSES_CONFIG" >&5
8446 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8447 else
8448   echo "$as_me:8448: result: no" >&5
8449 echo "${ECHO_T}no" >&6
8450 fi
8451
8452   test -n "$ac_ct_NCURSES_CONFIG" && break
8453 done
8454 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8455
8456   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8457 fi
8458
8459         if test "$NCURSES_CONFIG" != none ; then
8460
8461 cf_fix_cppflags=no
8462 cf_new_cflags=
8463 cf_new_cppflags=
8464 cf_new_extra_cppflags=
8465
8466 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8467 do
8468 case "$cf_fix_cppflags" in
8469 (no)
8470         case "$cf_add_cflags" in
8471         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8472                 case "$cf_add_cflags" in
8473                 (-D*)
8474                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8475
8476                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8477                                 && test -z "${cf_tst_cflags}" \
8478                                 && cf_fix_cppflags=yes
8479
8480                         if test "$cf_fix_cppflags" = yes ; then
8481
8482         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8483         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8484
8485                                 continue
8486                         elif test "${cf_tst_cflags}" = "\"'" ; then
8487
8488         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8489         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8490
8491                                 continue
8492                         fi
8493                         ;;
8494                 esac
8495                 case "$CPPFLAGS" in
8496                 (*$cf_add_cflags)
8497                         ;;
8498                 (*)
8499                         case "$cf_add_cflags" in
8500                         (-D*)
8501                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8502
8503 CPPFLAGS=`echo "$CPPFLAGS" | \
8504         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8505                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8506
8507                                 ;;
8508                         esac
8509
8510         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8511         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8512
8513                         ;;
8514                 esac
8515                 ;;
8516         (*)
8517
8518         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8519         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8520
8521                 ;;
8522         esac
8523         ;;
8524 (yes)
8525
8526         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8527         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8528
8529         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8530
8531         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8532                 && test -z "${cf_tst_cflags}" \
8533                 && cf_fix_cppflags=no
8534         ;;
8535 esac
8536 done
8537
8538 if test -n "$cf_new_cflags" ; then
8539
8540         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8541         CFLAGS="${CFLAGS}$cf_new_cflags"
8542
8543 fi
8544
8545 if test -n "$cf_new_cppflags" ; then
8546
8547         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8548         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8549
8550 fi
8551
8552 if test -n "$cf_new_extra_cppflags" ; then
8553
8554         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8555         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8556
8557 fi
8558
8559 cf_add_libs="$LIBS"
8560 # reverse order
8561 cf_add_0lib=
8562 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8563 # filter duplicates
8564 for cf_add_1lib in $cf_add_0lib; do
8565         for cf_add_2lib in $cf_add_libs; do
8566                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8567                         cf_add_1lib=
8568                         break
8569                 fi
8570         done
8571         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8572 done
8573 LIBS="$cf_add_libs"
8574
8575                 # even with config script, some packages use no-override for curses.h
8576
8577 echo "$as_me:8577: checking if we have identified curses headers" >&5
8578 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8579 if test "${cf_cv_ncurses_header+set}" = set; then
8580   echo $ECHO_N "(cached) $ECHO_C" >&6
8581 else
8582
8583 cf_cv_ncurses_header=none
8584 for cf_header in \
8585         ncurses.h $cf_cv_screen/ncurses.h \
8586         curses.h $cf_cv_screen/curses.h
8587 do
8588 cat >"conftest.$ac_ext" <<_ACEOF
8589 #line 8589 "configure"
8590 #include "confdefs.h"
8591 #include <${cf_header}>
8592 int
8593 main (void)
8594 {
8595 initscr(); tgoto("?", 0,0)
8596   ;
8597   return 0;
8598 }
8599 _ACEOF
8600 rm -f "conftest.$ac_objext"
8601 if { (eval echo "$as_me:8601: \"$ac_compile\"") >&5
8602   (eval $ac_compile) 2>&5
8603   ac_status=$?
8604   echo "$as_me:8604: \$? = $ac_status" >&5
8605   (exit "$ac_status"); } &&
8606          { ac_try='test -s "conftest.$ac_objext"'
8607   { (eval echo "$as_me:8607: \"$ac_try\"") >&5
8608   (eval $ac_try) 2>&5
8609   ac_status=$?
8610   echo "$as_me:8610: \$? = $ac_status" >&5
8611   (exit "$ac_status"); }; }; then
8612   cf_cv_ncurses_header=$cf_header; break
8613 else
8614   echo "$as_me: failed program was:" >&5
8615 cat "conftest.$ac_ext" >&5
8616 fi
8617 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8618 done
8619
8620 fi
8621 echo "$as_me:8621: result: $cf_cv_ncurses_header" >&5
8622 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8623
8624 if test "$cf_cv_ncurses_header" = none ; then
8625         { { echo "$as_me:8625: error: No curses header-files found" >&5
8626 echo "$as_me: error: No curses header-files found" >&2;}
8627    { (exit 1); exit 1; }; }
8628 fi
8629
8630 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8631
8632 for ac_header in $cf_cv_ncurses_header
8633 do
8634 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8635 echo "$as_me:8635: checking for $ac_header" >&5
8636 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8637 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8638   echo $ECHO_N "(cached) $ECHO_C" >&6
8639 else
8640   cat >"conftest.$ac_ext" <<_ACEOF
8641 #line 8641 "configure"
8642 #include "confdefs.h"
8643 #include <$ac_header>
8644 _ACEOF
8645 if { (eval echo "$as_me:8645: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8646   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8647   ac_status=$?
8648   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8649   rm -f conftest.er1
8650   cat conftest.err >&5
8651   echo "$as_me:8651: \$? = $ac_status" >&5
8652   (exit "$ac_status"); } >/dev/null; then
8653   if test -s conftest.err; then
8654     ac_cpp_err=$ac_c_preproc_warn_flag
8655   else
8656     ac_cpp_err=
8657   fi
8658 else
8659   ac_cpp_err=yes
8660 fi
8661 if test -z "$ac_cpp_err"; then
8662   eval "$as_ac_Header=yes"
8663 else
8664   echo "$as_me: failed program was:" >&5
8665   cat "conftest.$ac_ext" >&5
8666   eval "$as_ac_Header=no"
8667 fi
8668 rm -f conftest.err "conftest.$ac_ext"
8669 fi
8670 echo "$as_me:8670: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8671 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8672 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8673   cat >>confdefs.h <<EOF
8674 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8675 EOF
8676
8677 fi
8678 done
8679
8680 cat >>confdefs.h <<\EOF
8681 #define NCURSES 1
8682 EOF
8683
8684 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8685
8686                 cat >>confdefs.h <<EOF
8687 #define $cf_nculib_ROOT 1
8688 EOF
8689
8690                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8691
8692         else
8693
8694 cf_ncuhdr_root=$cf_cv_screen
8695
8696 test -n "$cf_cv_curses_dir" && \
8697 test "$cf_cv_curses_dir" != "no" && { \
8698
8699 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8700   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8701   do
8702         while test "$cf_add_incdir" != /usr/include
8703         do
8704           if test -d "$cf_add_incdir"
8705           then
8706                 cf_have_incdir=no
8707                 if test -n "$CFLAGS$CPPFLAGS" ; then
8708                   # a loop is needed to ensure we can add subdirs of existing dirs
8709                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8710                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8711                           cf_have_incdir=yes; break
8712                         fi
8713                   done
8714                 fi
8715
8716                 if test "$cf_have_incdir" = no ; then
8717                   if test "$cf_add_incdir" = /usr/local/include ; then
8718                         if test "$GCC" = yes
8719                         then
8720                           cf_save_CPPFLAGS=$CPPFLAGS
8721
8722         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8723         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8724
8725                           cat >"conftest.$ac_ext" <<_ACEOF
8726 #line 8726 "configure"
8727 #include "confdefs.h"
8728 #include <stdio.h>
8729 int
8730 main (void)
8731 {
8732 printf("Hello")
8733   ;
8734   return 0;
8735 }
8736 _ACEOF
8737 rm -f "conftest.$ac_objext"
8738 if { (eval echo "$as_me:8738: \"$ac_compile\"") >&5
8739   (eval $ac_compile) 2>&5
8740   ac_status=$?
8741   echo "$as_me:8741: \$? = $ac_status" >&5
8742   (exit "$ac_status"); } &&
8743          { ac_try='test -s "conftest.$ac_objext"'
8744   { (eval echo "$as_me:8744: \"$ac_try\"") >&5
8745   (eval $ac_try) 2>&5
8746   ac_status=$?
8747   echo "$as_me:8747: \$? = $ac_status" >&5
8748   (exit "$ac_status"); }; }; then
8749   :
8750 else
8751   echo "$as_me: failed program was:" >&5
8752 cat "conftest.$ac_ext" >&5
8753 cf_have_incdir=yes
8754 fi
8755 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8756                           CPPFLAGS=$cf_save_CPPFLAGS
8757                         fi
8758                   fi
8759                 fi
8760
8761                 if test "$cf_have_incdir" = no ; then
8762                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8763
8764 echo "${as_me:-configure}:8764: testing adding $cf_add_incdir to include-path ..." 1>&5
8765
8766                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8767
8768                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8769                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8770                   cf_add_incdir="$cf_top_incdir"
8771                 else
8772                   break
8773                 fi
8774           else
8775                 break
8776           fi
8777         done
8778   done
8779 fi
8780
8781 }
8782
8783 echo "$as_me:8783: checking for $cf_ncuhdr_root header in include-path" >&5
8784 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8785 if test "${cf_cv_ncurses_h+set}" = set; then
8786   echo $ECHO_N "(cached) $ECHO_C" >&6
8787 else
8788
8789         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8790         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8791         for cf_header in $cf_header_list
8792         do
8793
8794         cat >"conftest.$ac_ext" <<_ACEOF
8795 #line 8795 "configure"
8796 #include "confdefs.h"
8797
8798 #include <$cf_header>
8799 int
8800 main (void)
8801 {
8802
8803 #ifdef NCURSES_VERSION
8804
8805 printf("%s\\n", NCURSES_VERSION);
8806 #else
8807 #ifdef __NCURSES_H
8808 printf("old\\n");
8809 #else
8810         make an error
8811 #endif
8812 #endif
8813
8814   ;
8815   return 0;
8816 }
8817 _ACEOF
8818 rm -f "conftest.$ac_objext"
8819 if { (eval echo "$as_me:8819: \"$ac_compile\"") >&5
8820   (eval $ac_compile) 2>&5
8821   ac_status=$?
8822   echo "$as_me:8822: \$? = $ac_status" >&5
8823   (exit "$ac_status"); } &&
8824          { ac_try='test -s "conftest.$ac_objext"'
8825   { (eval echo "$as_me:8825: \"$ac_try\"") >&5
8826   (eval $ac_try) 2>&5
8827   ac_status=$?
8828   echo "$as_me:8828: \$? = $ac_status" >&5
8829   (exit "$ac_status"); }; }; then
8830   cf_cv_ncurses_h=$cf_header
8831
8832 else
8833   echo "$as_me: failed program was:" >&5
8834 cat "conftest.$ac_ext" >&5
8835 cf_cv_ncurses_h=no
8836 fi
8837 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8838
8839                 test "$cf_cv_ncurses_h" != no && break
8840         done
8841
8842 fi
8843 echo "$as_me:8843: result: $cf_cv_ncurses_h" >&5
8844 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8845
8846 if test "$cf_cv_ncurses_h" != no ; then
8847         cf_cv_ncurses_header=$cf_cv_ncurses_h
8848 else
8849
8850 echo "$as_me:8850: checking for $cf_ncuhdr_root include-path" >&5
8851 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8852 if test "${cf_cv_ncurses_h2+set}" = set; then
8853   echo $ECHO_N "(cached) $ECHO_C" >&6
8854 else
8855
8856         test -n "$verbose" && echo
8857
8858 cf_search=
8859
8860 # collect the current set of include-directories from compiler flags
8861 cf_header_path_list=""
8862 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8863         for cf_header_path in $CPPFLAGS $CFLAGS
8864         do
8865                 case "$cf_header_path" in
8866                 (-I*)
8867                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8868
8869 test "x$cf_header_path" != "xNONE" && \
8870 test -d "$cf_header_path" && \
8871  {
8872         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8873         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8874         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8875         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8876         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8877         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"
8878 }
8879
8880                         cf_header_path_list="$cf_header_path_list $cf_search"
8881                         ;;
8882                 esac
8883         done
8884 fi
8885
8886 # add the variations for the package we are looking for
8887
8888 cf_search=
8889
8890 test "x$prefix" != "xNONE" && \
8891 test -d "$prefix" && \
8892  {
8893         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8894         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8895         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8896         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8897         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8898         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8899 }
8900
8901 for cf_subdir_prefix in \
8902         /usr \
8903         /usr/local \
8904         /usr/pkg \
8905         /opt \
8906         /opt/local \
8907         $HOME
8908 do
8909
8910 test "x$cf_subdir_prefix" != "x$prefix" && \
8911 test -d "$cf_subdir_prefix" && \
8912 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8913         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8914         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8915         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8916         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8917         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8918         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"
8919 }
8920
8921 done
8922
8923 test "$includedir" != NONE && \
8924 test "$includedir" != "/usr/include" && \
8925 test -d "$includedir" && {
8926         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8927         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8928 }
8929
8930 test "$oldincludedir" != NONE && \
8931 test "$oldincludedir" != "/usr/include" && \
8932 test -d "$oldincludedir" && {
8933         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8934         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8935 }
8936
8937 cf_search="$cf_search $cf_header_path_list"
8938
8939         test -n "$verbose" && echo "search path $cf_search"
8940         cf_save2_CPPFLAGS="$CPPFLAGS"
8941         for cf_incdir in $cf_search
8942         do
8943
8944 if test -n "$cf_incdir" ; then
8945   for cf_add_incdir in $cf_incdir
8946   do
8947         while test "$cf_add_incdir" != /usr/include
8948         do
8949           if test -d "$cf_add_incdir"
8950           then
8951                 cf_have_incdir=no
8952                 if test -n "$CFLAGS$CPPFLAGS" ; then
8953                   # a loop is needed to ensure we can add subdirs of existing dirs
8954                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8955                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8956                           cf_have_incdir=yes; break
8957                         fi
8958                   done
8959                 fi
8960
8961                 if test "$cf_have_incdir" = no ; then
8962                   if test "$cf_add_incdir" = /usr/local/include ; then
8963                         if test "$GCC" = yes
8964                         then
8965                           cf_save_CPPFLAGS=$CPPFLAGS
8966
8967         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8968         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8969
8970                           cat >"conftest.$ac_ext" <<_ACEOF
8971 #line 8971 "configure"
8972 #include "confdefs.h"
8973 #include <stdio.h>
8974 int
8975 main (void)
8976 {
8977 printf("Hello")
8978   ;
8979   return 0;
8980 }
8981 _ACEOF
8982 rm -f "conftest.$ac_objext"
8983 if { (eval echo "$as_me:8983: \"$ac_compile\"") >&5
8984   (eval $ac_compile) 2>&5
8985   ac_status=$?
8986   echo "$as_me:8986: \$? = $ac_status" >&5
8987   (exit "$ac_status"); } &&
8988          { ac_try='test -s "conftest.$ac_objext"'
8989   { (eval echo "$as_me:8989: \"$ac_try\"") >&5
8990   (eval $ac_try) 2>&5
8991   ac_status=$?
8992   echo "$as_me:8992: \$? = $ac_status" >&5
8993   (exit "$ac_status"); }; }; then
8994   :
8995 else
8996   echo "$as_me: failed program was:" >&5
8997 cat "conftest.$ac_ext" >&5
8998 cf_have_incdir=yes
8999 fi
9000 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9001                           CPPFLAGS=$cf_save_CPPFLAGS
9002                         fi
9003                   fi
9004                 fi
9005
9006                 if test "$cf_have_incdir" = no ; then
9007                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9008
9009 echo "${as_me:-configure}:9009: testing adding $cf_add_incdir to include-path ..." 1>&5
9010
9011                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9012
9013                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9014                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9015                   cf_add_incdir="$cf_top_incdir"
9016                 else
9017                   break
9018                 fi
9019           else
9020                 break
9021           fi
9022         done
9023   done
9024 fi
9025
9026                 for cf_header in \
9027                         ncurses.h \
9028                         curses.h
9029                 do
9030
9031         cat >"conftest.$ac_ext" <<_ACEOF
9032 #line 9032 "configure"
9033 #include "confdefs.h"
9034
9035 #include <$cf_header>
9036 int
9037 main (void)
9038 {
9039
9040 #ifdef NCURSES_VERSION
9041
9042 printf("%s\\n", NCURSES_VERSION);
9043 #else
9044 #ifdef __NCURSES_H
9045 printf("old\\n");
9046 #else
9047         make an error
9048 #endif
9049 #endif
9050
9051   ;
9052   return 0;
9053 }
9054 _ACEOF
9055 rm -f "conftest.$ac_objext"
9056 if { (eval echo "$as_me:9056: \"$ac_compile\"") >&5
9057   (eval $ac_compile) 2>&5
9058   ac_status=$?
9059   echo "$as_me:9059: \$? = $ac_status" >&5
9060   (exit "$ac_status"); } &&
9061          { ac_try='test -s "conftest.$ac_objext"'
9062   { (eval echo "$as_me:9062: \"$ac_try\"") >&5
9063   (eval $ac_try) 2>&5
9064   ac_status=$?
9065   echo "$as_me:9065: \$? = $ac_status" >&5
9066   (exit "$ac_status"); }; }; then
9067   cf_cv_ncurses_h2=$cf_header
9068
9069 else
9070   echo "$as_me: failed program was:" >&5
9071 cat "conftest.$ac_ext" >&5
9072 cf_cv_ncurses_h2=no
9073 fi
9074 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9075
9076                         if test "$cf_cv_ncurses_h2" != no ; then
9077                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9078                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9079                                 break
9080                         fi
9081                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9082                 done
9083                 CPPFLAGS="$cf_save2_CPPFLAGS"
9084                 test "$cf_cv_ncurses_h2" != no && break
9085         done
9086         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9086: error: not found" >&5
9087 echo "$as_me: error: not found" >&2;}
9088    { (exit 1); exit 1; }; }
9089
9090 fi
9091 echo "$as_me:9091: result: $cf_cv_ncurses_h2" >&5
9092 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9093
9094         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9095         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9096         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9097                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9098         fi
9099
9100 if test -n "$cf_1st_incdir" ; then
9101   for cf_add_incdir in $cf_1st_incdir
9102   do
9103         while test "$cf_add_incdir" != /usr/include
9104         do
9105           if test -d "$cf_add_incdir"
9106           then
9107                 cf_have_incdir=no
9108                 if test -n "$CFLAGS$CPPFLAGS" ; then
9109                   # a loop is needed to ensure we can add subdirs of existing dirs
9110                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9111                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9112                           cf_have_incdir=yes; break
9113                         fi
9114                   done
9115                 fi
9116
9117                 if test "$cf_have_incdir" = no ; then
9118                   if test "$cf_add_incdir" = /usr/local/include ; then
9119                         if test "$GCC" = yes
9120                         then
9121                           cf_save_CPPFLAGS=$CPPFLAGS
9122
9123         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9124         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9125
9126                           cat >"conftest.$ac_ext" <<_ACEOF
9127 #line 9127 "configure"
9128 #include "confdefs.h"
9129 #include <stdio.h>
9130 int
9131 main (void)
9132 {
9133 printf("Hello")
9134   ;
9135   return 0;
9136 }
9137 _ACEOF
9138 rm -f "conftest.$ac_objext"
9139 if { (eval echo "$as_me:9139: \"$ac_compile\"") >&5
9140   (eval $ac_compile) 2>&5
9141   ac_status=$?
9142   echo "$as_me:9142: \$? = $ac_status" >&5
9143   (exit "$ac_status"); } &&
9144          { ac_try='test -s "conftest.$ac_objext"'
9145   { (eval echo "$as_me:9145: \"$ac_try\"") >&5
9146   (eval $ac_try) 2>&5
9147   ac_status=$?
9148   echo "$as_me:9148: \$? = $ac_status" >&5
9149   (exit "$ac_status"); }; }; then
9150   :
9151 else
9152   echo "$as_me: failed program was:" >&5
9153 cat "conftest.$ac_ext" >&5
9154 cf_have_incdir=yes
9155 fi
9156 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9157                           CPPFLAGS=$cf_save_CPPFLAGS
9158                         fi
9159                   fi
9160                 fi
9161
9162                 if test "$cf_have_incdir" = no ; then
9163                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9164
9165 echo "${as_me:-configure}:9165: testing adding $cf_add_incdir to include-path ..." 1>&5
9166
9167                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9168
9169                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9170                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9171                   cf_add_incdir="$cf_top_incdir"
9172                 else
9173                   break
9174                 fi
9175           else
9176                 break
9177           fi
9178         done
9179   done
9180 fi
9181
9182 fi
9183
9184 # Set definitions to allow ifdef'ing for ncurses.h
9185
9186 case "$cf_cv_ncurses_header" in
9187 (*ncurses.h)
9188
9189 cat >>confdefs.h <<\EOF
9190 #define HAVE_NCURSES_H 1
9191 EOF
9192
9193         ;;
9194 esac
9195
9196 case "$cf_cv_ncurses_header" in
9197 (ncurses/curses.h|ncurses/ncurses.h)
9198
9199 cat >>confdefs.h <<\EOF
9200 #define HAVE_NCURSES_NCURSES_H 1
9201 EOF
9202
9203         ;;
9204 (ncursesw/curses.h|ncursesw/ncurses.h)
9205
9206 cat >>confdefs.h <<\EOF
9207 #define HAVE_NCURSESW_NCURSES_H 1
9208 EOF
9209
9210         ;;
9211 esac
9212
9213 echo "$as_me:9213: checking for terminfo header" >&5
9214 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9215 if test "${cf_cv_term_header+set}" = set; then
9216   echo $ECHO_N "(cached) $ECHO_C" >&6
9217 else
9218
9219 case "${cf_cv_ncurses_header}" in
9220 (*/ncurses.h|*/ncursesw.h)
9221         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9222         ;;
9223 (*)
9224         cf_term_header=term.h
9225         ;;
9226 esac
9227
9228 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9229 do
9230 cat >"conftest.$ac_ext" <<_ACEOF
9231 #line 9231 "configure"
9232 #include "confdefs.h"
9233 #include <stdio.h>
9234 #include <${cf_cv_ncurses_header:-curses.h}>
9235 #include <$cf_test>
9236
9237 int
9238 main (void)
9239 {
9240 int x = auto_left_margin; (void)x
9241   ;
9242   return 0;
9243 }
9244 _ACEOF
9245 rm -f "conftest.$ac_objext"
9246 if { (eval echo "$as_me:9246: \"$ac_compile\"") >&5
9247   (eval $ac_compile) 2>&5
9248   ac_status=$?
9249   echo "$as_me:9249: \$? = $ac_status" >&5
9250   (exit "$ac_status"); } &&
9251          { ac_try='test -s "conftest.$ac_objext"'
9252   { (eval echo "$as_me:9252: \"$ac_try\"") >&5
9253   (eval $ac_try) 2>&5
9254   ac_status=$?
9255   echo "$as_me:9255: \$? = $ac_status" >&5
9256   (exit "$ac_status"); }; }; then
9257
9258         cf_cv_term_header="$cf_test"
9259 else
9260   echo "$as_me: failed program was:" >&5
9261 cat "conftest.$ac_ext" >&5
9262
9263         cf_cv_term_header=unknown
9264
9265 fi
9266 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9267         test "$cf_cv_term_header" != unknown && break
9268 done
9269
9270 fi
9271 echo "$as_me:9271: result: $cf_cv_term_header" >&5
9272 echo "${ECHO_T}$cf_cv_term_header" >&6
9273
9274 # Set definitions to allow ifdef'ing to accommodate subdirectories
9275
9276 case "$cf_cv_term_header" in
9277 (*term.h)
9278
9279 cat >>confdefs.h <<\EOF
9280 #define HAVE_TERM_H 1
9281 EOF
9282
9283         ;;
9284 esac
9285
9286 case "$cf_cv_term_header" in
9287 (ncurses/term.h)
9288
9289 cat >>confdefs.h <<\EOF
9290 #define HAVE_NCURSES_TERM_H 1
9291 EOF
9292
9293         ;;
9294 (ncursesw/term.h)
9295
9296 cat >>confdefs.h <<\EOF
9297 #define HAVE_NCURSESW_TERM_H 1
9298 EOF
9299
9300         ;;
9301 esac
9302
9303 # some applications need this, but should check for NCURSES_VERSION
9304
9305 cat >>confdefs.h <<\EOF
9306 #define NCURSES 1
9307 EOF
9308
9309 echo "$as_me:9309: checking for ncurses version" >&5
9310 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9311 if test "${cf_cv_ncurses_version+set}" = set; then
9312   echo $ECHO_N "(cached) $ECHO_C" >&6
9313 else
9314
9315         cf_cv_ncurses_version=no
9316         cf_tempfile=out$$
9317         rm -f "$cf_tempfile"
9318         if test "$cross_compiling" = yes; then
9319
9320         # This will not work if the preprocessor splits the line after the
9321         # Autoconf token.  The 'unproto' program does that.
9322         cat > "conftest.$ac_ext" <<EOF
9323 #include <${cf_cv_ncurses_header:-curses.h}>
9324 #undef Autoconf
9325 #ifdef NCURSES_VERSION
9326 Autoconf NCURSES_VERSION
9327 #else
9328 #ifdef __NCURSES_H
9329 Autoconf "old"
9330 #endif
9331 ;
9332 #endif
9333 EOF
9334         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9335         { (eval echo "$as_me:9335: \"$cf_try\"") >&5
9336   (eval $cf_try) 2>&5
9337   ac_status=$?
9338   echo "$as_me:9338: \$? = $ac_status" >&5
9339   (exit "$ac_status"); }
9340         if test -f conftest.out ; then
9341                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9342                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9343                 rm -f conftest.out
9344         fi
9345
9346 else
9347   cat >"conftest.$ac_ext" <<_ACEOF
9348 #line 9348 "configure"
9349 #include "confdefs.h"
9350
9351 #include <${cf_cv_ncurses_header:-curses.h}>
9352 #include <stdio.h>
9353 int main(void)
9354 {
9355         FILE *fp = fopen("$cf_tempfile", "w");
9356 #ifdef NCURSES_VERSION
9357 # ifdef NCURSES_VERSION_PATCH
9358         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9359 # else
9360         fprintf(fp, "%s\\n", NCURSES_VERSION);
9361 # endif
9362 #else
9363 # ifdef __NCURSES_H
9364         fprintf(fp, "old\\n");
9365 # else
9366         make an error
9367 # endif
9368 #endif
9369         ${cf_cv_main_return:-return}(0);
9370 }
9371 _ACEOF
9372 rm -f "conftest$ac_exeext"
9373 if { (eval echo "$as_me:9373: \"$ac_link\"") >&5
9374   (eval $ac_link) 2>&5
9375   ac_status=$?
9376   echo "$as_me:9376: \$? = $ac_status" >&5
9377   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9378   { (eval echo "$as_me:9378: \"$ac_try\"") >&5
9379   (eval $ac_try) 2>&5
9380   ac_status=$?
9381   echo "$as_me:9381: \$? = $ac_status" >&5
9382   (exit "$ac_status"); }; }; then
9383
9384         cf_cv_ncurses_version=`cat $cf_tempfile`
9385 else
9386   echo "$as_me: program exited with status $ac_status" >&5
9387 echo "$as_me: failed program was:" >&5
9388 cat "conftest.$ac_ext" >&5
9389 fi
9390 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9391 fi
9392         rm -f "$cf_tempfile"
9393
9394 fi
9395 echo "$as_me:9395: result: $cf_cv_ncurses_version" >&5
9396 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9397 test "$cf_cv_ncurses_version" = no ||
9398 cat >>confdefs.h <<\EOF
9399 #define NCURSES 1
9400 EOF
9401
9402 cf_nculib_root=$cf_cv_screen
9403         # This works, except for the special case where we find gpm, but
9404         # ncurses is in a nonstandard location via $LIBS, and we really want
9405         # to link gpm.
9406 cf_ncurses_LIBS=""
9407 cf_ncurses_SAVE="$LIBS"
9408 echo "$as_me:9408: checking for Gpm_Open in -lgpm" >&5
9409 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9410 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9411   echo $ECHO_N "(cached) $ECHO_C" >&6
9412 else
9413   ac_check_lib_save_LIBS=$LIBS
9414 LIBS="-lgpm  $LIBS"
9415 cat >"conftest.$ac_ext" <<_ACEOF
9416 #line 9416 "configure"
9417 #include "confdefs.h"
9418
9419 /* Override any gcc2 internal prototype to avoid an error.  */
9420 #ifdef __cplusplus
9421 extern "C"
9422 #endif
9423 /* We use char because int might match the return type of a gcc2
9424    builtin and then its argument prototype would still apply.  */
9425 char Gpm_Open ();
9426 int
9427 main (void)
9428 {
9429 Gpm_Open ();
9430   ;
9431   return 0;
9432 }
9433 _ACEOF
9434 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9435 if { (eval echo "$as_me:9435: \"$ac_link\"") >&5
9436   (eval $ac_link) 2>&5
9437   ac_status=$?
9438   echo "$as_me:9438: \$? = $ac_status" >&5
9439   (exit "$ac_status"); } &&
9440          { ac_try='test -s "conftest$ac_exeext"'
9441   { (eval echo "$as_me:9441: \"$ac_try\"") >&5
9442   (eval $ac_try) 2>&5
9443   ac_status=$?
9444   echo "$as_me:9444: \$? = $ac_status" >&5
9445   (exit "$ac_status"); }; }; then
9446   ac_cv_lib_gpm_Gpm_Open=yes
9447 else
9448   echo "$as_me: failed program was:" >&5
9449 cat "conftest.$ac_ext" >&5
9450 ac_cv_lib_gpm_Gpm_Open=no
9451 fi
9452 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9453 LIBS=$ac_check_lib_save_LIBS
9454 fi
9455 echo "$as_me:9455: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9456 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9457 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9458   echo "$as_me:9458: checking for initscr in -lgpm" >&5
9459 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9460 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9461   echo $ECHO_N "(cached) $ECHO_C" >&6
9462 else
9463   ac_check_lib_save_LIBS=$LIBS
9464 LIBS="-lgpm  $LIBS"
9465 cat >"conftest.$ac_ext" <<_ACEOF
9466 #line 9466 "configure"
9467 #include "confdefs.h"
9468
9469 /* Override any gcc2 internal prototype to avoid an error.  */
9470 #ifdef __cplusplus
9471 extern "C"
9472 #endif
9473 /* We use char because int might match the return type of a gcc2
9474    builtin and then its argument prototype would still apply.  */
9475 char initscr ();
9476 int
9477 main (void)
9478 {
9479 initscr ();
9480   ;
9481   return 0;
9482 }
9483 _ACEOF
9484 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9485 if { (eval echo "$as_me:9485: \"$ac_link\"") >&5
9486   (eval $ac_link) 2>&5
9487   ac_status=$?
9488   echo "$as_me:9488: \$? = $ac_status" >&5
9489   (exit "$ac_status"); } &&
9490          { ac_try='test -s "conftest$ac_exeext"'
9491   { (eval echo "$as_me:9491: \"$ac_try\"") >&5
9492   (eval $ac_try) 2>&5
9493   ac_status=$?
9494   echo "$as_me:9494: \$? = $ac_status" >&5
9495   (exit "$ac_status"); }; }; then
9496   ac_cv_lib_gpm_initscr=yes
9497 else
9498   echo "$as_me: failed program was:" >&5
9499 cat "conftest.$ac_ext" >&5
9500 ac_cv_lib_gpm_initscr=no
9501 fi
9502 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9503 LIBS=$ac_check_lib_save_LIBS
9504 fi
9505 echo "$as_me:9505: result: $ac_cv_lib_gpm_initscr" >&5
9506 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9507 if test "$ac_cv_lib_gpm_initscr" = yes; then
9508   LIBS="$cf_ncurses_SAVE"
9509 else
9510   cf_ncurses_LIBS="-lgpm"
9511 fi
9512
9513 fi
9514
9515 case "$host_os" in
9516 (freebsd*)
9517         # This is only necessary if you are linking against an obsolete
9518         # version of ncurses (but it should do no harm, since it's static).
9519         if test "$cf_nculib_root" = ncurses ; then
9520                 echo "$as_me:9520: checking for tgoto in -lmytinfo" >&5
9521 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9522 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9523   echo $ECHO_N "(cached) $ECHO_C" >&6
9524 else
9525   ac_check_lib_save_LIBS=$LIBS
9526 LIBS="-lmytinfo  $LIBS"
9527 cat >"conftest.$ac_ext" <<_ACEOF
9528 #line 9528 "configure"
9529 #include "confdefs.h"
9530
9531 /* Override any gcc2 internal prototype to avoid an error.  */
9532 #ifdef __cplusplus
9533 extern "C"
9534 #endif
9535 /* We use char because int might match the return type of a gcc2
9536    builtin and then its argument prototype would still apply.  */
9537 char tgoto ();
9538 int
9539 main (void)
9540 {
9541 tgoto ();
9542   ;
9543   return 0;
9544 }
9545 _ACEOF
9546 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9547 if { (eval echo "$as_me:9547: \"$ac_link\"") >&5
9548   (eval $ac_link) 2>&5
9549   ac_status=$?
9550   echo "$as_me:9550: \$? = $ac_status" >&5
9551   (exit "$ac_status"); } &&
9552          { ac_try='test -s "conftest$ac_exeext"'
9553   { (eval echo "$as_me:9553: \"$ac_try\"") >&5
9554   (eval $ac_try) 2>&5
9555   ac_status=$?
9556   echo "$as_me:9556: \$? = $ac_status" >&5
9557   (exit "$ac_status"); }; }; then
9558   ac_cv_lib_mytinfo_tgoto=yes
9559 else
9560   echo "$as_me: failed program was:" >&5
9561 cat "conftest.$ac_ext" >&5
9562 ac_cv_lib_mytinfo_tgoto=no
9563 fi
9564 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9565 LIBS=$ac_check_lib_save_LIBS
9566 fi
9567 echo "$as_me:9567: result: $ac_cv_lib_mytinfo_tgoto" >&5
9568 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9569 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9570   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9571 fi
9572
9573         fi
9574         ;;
9575 esac
9576
9577 cf_add_libs="$LIBS"
9578 # reverse order
9579 cf_add_0lib=
9580 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9581 # filter duplicates
9582 for cf_add_1lib in $cf_add_0lib; do
9583         for cf_add_2lib in $cf_add_libs; do
9584                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9585                         cf_add_1lib=
9586                         break
9587                 fi
9588         done
9589         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9590 done
9591 LIBS="$cf_add_libs"
9592
9593 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9594 then
9595
9596 cf_add_libs="$LIBS"
9597 # reverse order
9598 cf_add_0lib=
9599 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9600 # filter duplicates
9601 for cf_add_1lib in $cf_add_0lib; do
9602         for cf_add_2lib in $cf_add_libs; do
9603                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9604                         cf_add_1lib=
9605                         break
9606                 fi
9607         done
9608         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9609 done
9610 LIBS="$cf_add_libs"
9611
9612 else
9613
9614         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9615         cf_libdir=""
9616         echo "$as_me:9616: checking for initscr" >&5
9617 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9618 if test "${ac_cv_func_initscr+set}" = set; then
9619   echo $ECHO_N "(cached) $ECHO_C" >&6
9620 else
9621   cat >"conftest.$ac_ext" <<_ACEOF
9622 #line 9622 "configure"
9623 #include "confdefs.h"
9624 #define initscr autoconf_temporary
9625 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9626 #undef initscr
9627
9628 #ifdef __cplusplus
9629 extern "C"
9630 #endif
9631
9632 /* We use char because int might match the return type of a gcc2
9633    builtin and then its argument prototype would still apply.  */
9634 char initscr (void);
9635
9636 int
9637 main (void)
9638 {
9639
9640 /* The GNU C library defines stubs for functions which it implements
9641     to always fail with ENOSYS.  Some functions are actually named
9642     something starting with __ and the normal name is an alias.  */
9643 #if defined (__stub_initscr) || defined (__stub___initscr)
9644 #error found stub for initscr
9645 #endif
9646
9647         return initscr ();
9648   ;
9649   return 0;
9650 }
9651 _ACEOF
9652 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9653 if { (eval echo "$as_me:9653: \"$ac_link\"") >&5
9654   (eval $ac_link) 2>&5
9655   ac_status=$?
9656   echo "$as_me:9656: \$? = $ac_status" >&5
9657   (exit "$ac_status"); } &&
9658          { ac_try='test -s "conftest$ac_exeext"'
9659   { (eval echo "$as_me:9659: \"$ac_try\"") >&5
9660   (eval $ac_try) 2>&5
9661   ac_status=$?
9662   echo "$as_me:9662: \$? = $ac_status" >&5
9663   (exit "$ac_status"); }; }; then
9664   ac_cv_func_initscr=yes
9665 else
9666   echo "$as_me: failed program was:" >&5
9667 cat "conftest.$ac_ext" >&5
9668 ac_cv_func_initscr=no
9669 fi
9670 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9671 fi
9672 echo "$as_me:9672: result: $ac_cv_func_initscr" >&5
9673 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9674 if test "$ac_cv_func_initscr" = yes; then
9675   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9676 else
9677
9678                 cf_save_LIBS="$LIBS"
9679                 echo "$as_me:9679: checking for initscr in -l$cf_nculib_root" >&5
9680 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9681                 LIBS="-l$cf_nculib_root $LIBS"
9682                 cat >"conftest.$ac_ext" <<_ACEOF
9683 #line 9683 "configure"
9684 #include "confdefs.h"
9685 #include <${cf_cv_ncurses_header:-curses.h}>
9686 int
9687 main (void)
9688 {
9689 initscr()
9690   ;
9691   return 0;
9692 }
9693 _ACEOF
9694 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9695 if { (eval echo "$as_me:9695: \"$ac_link\"") >&5
9696   (eval $ac_link) 2>&5
9697   ac_status=$?
9698   echo "$as_me:9698: \$? = $ac_status" >&5
9699   (exit "$ac_status"); } &&
9700          { ac_try='test -s "conftest$ac_exeext"'
9701   { (eval echo "$as_me:9701: \"$ac_try\"") >&5
9702   (eval $ac_try) 2>&5
9703   ac_status=$?
9704   echo "$as_me:9704: \$? = $ac_status" >&5
9705   (exit "$ac_status"); }; }; then
9706   echo "$as_me:9706: result: yes" >&5
9707 echo "${ECHO_T}yes" >&6
9708                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9709
9710 else
9711   echo "$as_me: failed program was:" >&5
9712 cat "conftest.$ac_ext" >&5
9713 echo "$as_me:9713: result: no" >&5
9714 echo "${ECHO_T}no" >&6
9715
9716 cf_search=
9717 cf_library_path_list=""
9718 if test -n "${LDFLAGS}${LIBS}" ; then
9719         for cf_library_path in $LDFLAGS $LIBS
9720         do
9721                 case "$cf_library_path" in
9722                 (-L*)
9723                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9724
9725 test "x$cf_library_path" != "xNONE" && \
9726 test -d "$cf_library_path" && \
9727  {
9728         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9729         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9730         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9731         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9732         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9733         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"
9734 }
9735
9736                         cf_library_path_list="$cf_library_path_list $cf_search"
9737                         ;;
9738                 esac
9739         done
9740 fi
9741
9742 cf_search=
9743
9744 test "x$prefix" != "xNONE" && \
9745 test -d "$prefix" && \
9746  {
9747         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9748         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9749         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9750         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9751         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9752         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9753 }
9754
9755 for cf_subdir_prefix in \
9756         /usr \
9757         /usr/local \
9758         /usr/pkg \
9759         /opt \
9760         /opt/local \
9761         $HOME
9762 do
9763
9764 test "x$cf_subdir_prefix" != "x$prefix" && \
9765 test -d "$cf_subdir_prefix" && \
9766 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9767         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9768         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9769         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9770         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9771         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9772         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"
9773 }
9774
9775 done
9776
9777 cf_search="$cf_library_path_list $cf_search"
9778
9779                         for cf_libdir in $cf_search
9780                         do
9781                                 echo "$as_me:9781: checking for -l$cf_nculib_root in $cf_libdir" >&5
9782 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9783                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9784                                 cat >"conftest.$ac_ext" <<_ACEOF
9785 #line 9785 "configure"
9786 #include "confdefs.h"
9787 #include <${cf_cv_ncurses_header:-curses.h}>
9788 int
9789 main (void)
9790 {
9791 initscr()
9792   ;
9793   return 0;
9794 }
9795 _ACEOF
9796 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9797 if { (eval echo "$as_me:9797: \"$ac_link\"") >&5
9798   (eval $ac_link) 2>&5
9799   ac_status=$?
9800   echo "$as_me:9800: \$? = $ac_status" >&5
9801   (exit "$ac_status"); } &&
9802          { ac_try='test -s "conftest$ac_exeext"'
9803   { (eval echo "$as_me:9803: \"$ac_try\"") >&5
9804   (eval $ac_try) 2>&5
9805   ac_status=$?
9806   echo "$as_me:9806: \$? = $ac_status" >&5
9807   (exit "$ac_status"); }; }; then
9808   echo "$as_me:9808: result: yes" >&5
9809 echo "${ECHO_T}yes" >&6
9810                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9811                                          break
9812 else
9813   echo "$as_me: failed program was:" >&5
9814 cat "conftest.$ac_ext" >&5
9815 echo "$as_me:9815: result: no" >&5
9816 echo "${ECHO_T}no" >&6
9817                                          LIBS="$cf_save_LIBS"
9818 fi
9819 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9820                         done
9821
9822 fi
9823 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9824
9825 fi
9826
9827 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9828
9829 if test "$cf_found_library" = no ; then
9830         { { echo "$as_me:9830: error: Cannot link $cf_nculib_root library" >&5
9831 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9832    { (exit 1); exit 1; }; }
9833 fi
9834
9835 fi
9836
9837 if test -n "$cf_ncurses_LIBS" ; then
9838         echo "$as_me:9838: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9839 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9840         cf_ncurses_SAVE="$LIBS"
9841         for p in $cf_ncurses_LIBS ; do
9842                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9843                 if test "$q" != "$LIBS" ; then
9844                         LIBS="$q"
9845                 fi
9846         done
9847         cat >"conftest.$ac_ext" <<_ACEOF
9848 #line 9848 "configure"
9849 #include "confdefs.h"
9850 #include <${cf_cv_ncurses_header:-curses.h}>
9851 int
9852 main (void)
9853 {
9854 initscr(); mousemask(0,0); tigetstr((char *)0);
9855   ;
9856   return 0;
9857 }
9858 _ACEOF
9859 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9860 if { (eval echo "$as_me:9860: \"$ac_link\"") >&5
9861   (eval $ac_link) 2>&5
9862   ac_status=$?
9863   echo "$as_me:9863: \$? = $ac_status" >&5
9864   (exit "$ac_status"); } &&
9865          { ac_try='test -s "conftest$ac_exeext"'
9866   { (eval echo "$as_me:9866: \"$ac_try\"") >&5
9867   (eval $ac_try) 2>&5
9868   ac_status=$?
9869   echo "$as_me:9869: \$? = $ac_status" >&5
9870   (exit "$ac_status"); }; }; then
9871   echo "$as_me:9871: result: yes" >&5
9872 echo "${ECHO_T}yes" >&6
9873 else
9874   echo "$as_me: failed program was:" >&5
9875 cat "conftest.$ac_ext" >&5
9876 echo "$as_me:9876: result: no" >&5
9877 echo "${ECHO_T}no" >&6
9878                  LIBS="$cf_ncurses_SAVE"
9879 fi
9880 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9881 fi
9882
9883 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9884
9885 cat >>confdefs.h <<EOF
9886 #define $cf_nculib_ROOT 1
9887 EOF
9888
9889         fi
9890 else
9891         NCURSES_CONFIG=none
9892 fi
9893
9894         ;;
9895 (ncurses*)
9896
9897 cf_ncuconfig_root=$cf_cv_screen
9898 cf_have_ncuconfig=no
9899
9900 if test "x${PKG_CONFIG:=none}" != xnone; then
9901         echo "$as_me:9901: checking pkg-config for $cf_ncuconfig_root" >&5
9902 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9903         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9904                 echo "$as_me:9904: result: yes" >&5
9905 echo "${ECHO_T}yes" >&6
9906
9907                 echo "$as_me:9907: checking if the $cf_ncuconfig_root package files work" >&5
9908 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9909                 cf_have_ncuconfig=unknown
9910
9911                 cf_save_CFLAGS="$CFLAGS"
9912                 cf_save_CPPFLAGS="$CPPFLAGS"
9913                 cf_save_LIBS="$LIBS"
9914
9915                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9916                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9917
9918                 # while -W for passing linker flags is prevalent, it is not "standard".
9919                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9920                 # incompatible _and_ non-standard -W option which gives an error.  Work
9921                 # around that pitfall.
9922                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9923                 (x*c[89]9@@*-W*)
9924
9925 cf_fix_cppflags=no
9926 cf_new_cflags=
9927 cf_new_cppflags=
9928 cf_new_extra_cppflags=
9929
9930 for cf_add_cflags in $cf_pkg_cflags
9931 do
9932 case "$cf_fix_cppflags" in
9933 (no)
9934         case "$cf_add_cflags" in
9935         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9936                 case "$cf_add_cflags" in
9937                 (-D*)
9938                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9939
9940                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9941                                 && test -z "${cf_tst_cflags}" \
9942                                 && cf_fix_cppflags=yes
9943
9944                         if test "$cf_fix_cppflags" = yes ; then
9945
9946         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9947         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9948
9949                                 continue
9950                         elif test "${cf_tst_cflags}" = "\"'" ; then
9951
9952         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9953         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9954
9955                                 continue
9956                         fi
9957                         ;;
9958                 esac
9959                 case "$CPPFLAGS" in
9960                 (*$cf_add_cflags)
9961                         ;;
9962                 (*)
9963                         case "$cf_add_cflags" in
9964                         (-D*)
9965                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9966
9967 CPPFLAGS=`echo "$CPPFLAGS" | \
9968         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9969                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9970
9971                                 ;;
9972                         esac
9973
9974         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9975         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9976
9977                         ;;
9978                 esac
9979                 ;;
9980         (*)
9981
9982         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9983         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9984
9985                 ;;
9986         esac
9987         ;;
9988 (yes)
9989
9990         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9991         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9992
9993         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9994
9995         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9996                 && test -z "${cf_tst_cflags}" \
9997                 && cf_fix_cppflags=no
9998         ;;
9999 esac
10000 done
10001
10002 if test -n "$cf_new_cflags" ; then
10003
10004         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10005         CFLAGS="${CFLAGS}$cf_new_cflags"
10006
10007 fi
10008
10009 if test -n "$cf_new_cppflags" ; then
10010
10011         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10012         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10013
10014 fi
10015
10016 if test -n "$cf_new_extra_cppflags" ; then
10017
10018         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10019         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10020
10021 fi
10022
10023 cf_add_libs="$LIBS"
10024 # reverse order
10025 cf_add_0lib=
10026 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10027 # filter duplicates
10028 for cf_add_1lib in $cf_add_0lib; do
10029         for cf_add_2lib in $cf_add_libs; do
10030                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10031                         cf_add_1lib=
10032                         break
10033                 fi
10034         done
10035         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10036 done
10037 LIBS="$cf_add_libs"
10038
10039                         cat >"conftest.$ac_ext" <<_ACEOF
10040 #line 10040 "configure"
10041 #include "confdefs.h"
10042 #include <${cf_cv_ncurses_header:-curses.h}>
10043 int
10044 main (void)
10045 {
10046 initscr(); mousemask(0,0); tigetstr((char *)0);
10047   ;
10048   return 0;
10049 }
10050 _ACEOF
10051 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10052 if { (eval echo "$as_me:10052: \"$ac_link\"") >&5
10053   (eval $ac_link) 2>&5
10054   ac_status=$?
10055   echo "$as_me:10055: \$? = $ac_status" >&5
10056   (exit "$ac_status"); } &&
10057          { ac_try='test -s "conftest$ac_exeext"'
10058   { (eval echo "$as_me:10058: \"$ac_try\"") >&5
10059   (eval $ac_try) 2>&5
10060   ac_status=$?
10061   echo "$as_me:10061: \$? = $ac_status" >&5
10062   (exit "$ac_status"); }; }; then
10063   if test "$cross_compiling" = yes; then
10064   cf_test_ncuconfig=maybe
10065 else
10066   cat >"conftest.$ac_ext" <<_ACEOF
10067 #line 10067 "configure"
10068 #include "confdefs.h"
10069 #include <${cf_cv_ncurses_header:-curses.h}>
10070                                         int main(void)
10071                                         { char *xx = curses_version(); return (xx == 0); }
10072 _ACEOF
10073 rm -f "conftest$ac_exeext"
10074 if { (eval echo "$as_me:10074: \"$ac_link\"") >&5
10075   (eval $ac_link) 2>&5
10076   ac_status=$?
10077   echo "$as_me:10077: \$? = $ac_status" >&5
10078   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10079   { (eval echo "$as_me:10079: \"$ac_try\"") >&5
10080   (eval $ac_try) 2>&5
10081   ac_status=$?
10082   echo "$as_me:10082: \$? = $ac_status" >&5
10083   (exit "$ac_status"); }; }; then
10084   cf_test_ncuconfig=yes
10085 else
10086   echo "$as_me: program exited with status $ac_status" >&5
10087 echo "$as_me: failed program was:" >&5
10088 cat "conftest.$ac_ext" >&5
10089 cf_test_ncuconfig=no
10090 fi
10091 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10092 fi
10093 else
10094   echo "$as_me: failed program was:" >&5
10095 cat "conftest.$ac_ext" >&5
10096 cf_test_ncuconfig=no
10097 fi
10098 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10099
10100                         CFLAGS="$cf_save_CFLAGS"
10101                         CPPFLAGS="$cf_save_CPPFLAGS"
10102                         LIBS="$cf_save_LIBS"
10103
10104                         if test "x$cf_test_ncuconfig" != xyes; then
10105                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10106                                 cf_pkg_cflags="$cf_temp"
10107                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10108                                 cf_pkg_libs="$cf_temp"
10109                         fi
10110                         ;;
10111                 esac
10112
10113 cf_fix_cppflags=no
10114 cf_new_cflags=
10115 cf_new_cppflags=
10116 cf_new_extra_cppflags=
10117
10118 for cf_add_cflags in $cf_pkg_cflags
10119 do
10120 case "$cf_fix_cppflags" in
10121 (no)
10122         case "$cf_add_cflags" in
10123         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10124                 case "$cf_add_cflags" in
10125                 (-D*)
10126                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10127
10128                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10129                                 && test -z "${cf_tst_cflags}" \
10130                                 && cf_fix_cppflags=yes
10131
10132                         if test "$cf_fix_cppflags" = yes ; then
10133
10134         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10135         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10136
10137                                 continue
10138                         elif test "${cf_tst_cflags}" = "\"'" ; then
10139
10140         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10141         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10142
10143                                 continue
10144                         fi
10145                         ;;
10146                 esac
10147                 case "$CPPFLAGS" in
10148                 (*$cf_add_cflags)
10149                         ;;
10150                 (*)
10151                         case "$cf_add_cflags" in
10152                         (-D*)
10153                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10154
10155 CPPFLAGS=`echo "$CPPFLAGS" | \
10156         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10157                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10158
10159                                 ;;
10160                         esac
10161
10162         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10163         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10164
10165                         ;;
10166                 esac
10167                 ;;
10168         (*)
10169
10170         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10171         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10172
10173                 ;;
10174         esac
10175         ;;
10176 (yes)
10177
10178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10180
10181         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10182
10183         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10184                 && test -z "${cf_tst_cflags}" \
10185                 && cf_fix_cppflags=no
10186         ;;
10187 esac
10188 done
10189
10190 if test -n "$cf_new_cflags" ; then
10191
10192         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10193         CFLAGS="${CFLAGS}$cf_new_cflags"
10194
10195 fi
10196
10197 if test -n "$cf_new_cppflags" ; then
10198
10199         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10200         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10201
10202 fi
10203
10204 if test -n "$cf_new_extra_cppflags" ; then
10205
10206         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10207         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10208
10209 fi
10210
10211 cf_add_libs="$LIBS"
10212 # reverse order
10213 cf_add_0lib=
10214 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10215 # filter duplicates
10216 for cf_add_1lib in $cf_add_0lib; do
10217         for cf_add_2lib in $cf_add_libs; do
10218                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10219                         cf_add_1lib=
10220                         break
10221                 fi
10222         done
10223         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10224 done
10225 LIBS="$cf_add_libs"
10226
10227                 cat >"conftest.$ac_ext" <<_ACEOF
10228 #line 10228 "configure"
10229 #include "confdefs.h"
10230 #include <${cf_cv_ncurses_header:-curses.h}>
10231 int
10232 main (void)
10233 {
10234 initscr(); mousemask(0,0); tigetstr((char *)0);
10235   ;
10236   return 0;
10237 }
10238 _ACEOF
10239 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10240 if { (eval echo "$as_me:10240: \"$ac_link\"") >&5
10241   (eval $ac_link) 2>&5
10242   ac_status=$?
10243   echo "$as_me:10243: \$? = $ac_status" >&5
10244   (exit "$ac_status"); } &&
10245          { ac_try='test -s "conftest$ac_exeext"'
10246   { (eval echo "$as_me:10246: \"$ac_try\"") >&5
10247   (eval $ac_try) 2>&5
10248   ac_status=$?
10249   echo "$as_me:10249: \$? = $ac_status" >&5
10250   (exit "$ac_status"); }; }; then
10251   if test "$cross_compiling" = yes; then
10252   cf_have_ncuconfig=maybe
10253 else
10254   cat >"conftest.$ac_ext" <<_ACEOF
10255 #line 10255 "configure"
10256 #include "confdefs.h"
10257 #include <${cf_cv_ncurses_header:-curses.h}>
10258                                 int main(void)
10259                                 { char *xx = curses_version(); return (xx == 0); }
10260 _ACEOF
10261 rm -f "conftest$ac_exeext"
10262 if { (eval echo "$as_me:10262: \"$ac_link\"") >&5
10263   (eval $ac_link) 2>&5
10264   ac_status=$?
10265   echo "$as_me:10265: \$? = $ac_status" >&5
10266   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10267   { (eval echo "$as_me:10267: \"$ac_try\"") >&5
10268   (eval $ac_try) 2>&5
10269   ac_status=$?
10270   echo "$as_me:10270: \$? = $ac_status" >&5
10271   (exit "$ac_status"); }; }; then
10272   cf_have_ncuconfig=yes
10273 else
10274   echo "$as_me: program exited with status $ac_status" >&5
10275 echo "$as_me: failed program was:" >&5
10276 cat "conftest.$ac_ext" >&5
10277 cf_have_ncuconfig=no
10278 fi
10279 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10280 fi
10281 else
10282   echo "$as_me: failed program was:" >&5
10283 cat "conftest.$ac_ext" >&5
10284 cf_have_ncuconfig=no
10285 fi
10286 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10287                 echo "$as_me:10287: result: $cf_have_ncuconfig" >&5
10288 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10289                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10290                 if test "$cf_have_ncuconfig" != "yes"
10291                 then
10292                         CPPFLAGS="$cf_save_CPPFLAGS"
10293                         LIBS="$cf_save_LIBS"
10294                         NCURSES_CONFIG_PKG=none
10295                 else
10296
10297 cat >>confdefs.h <<\EOF
10298 #define NCURSES 1
10299 EOF
10300
10301                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10302
10303 echo "$as_me:10303: checking for terminfo header" >&5
10304 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10305 if test "${cf_cv_term_header+set}" = set; then
10306   echo $ECHO_N "(cached) $ECHO_C" >&6
10307 else
10308
10309 case "${cf_cv_ncurses_header}" in
10310 (*/ncurses.h|*/ncursesw.h)
10311         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10312         ;;
10313 (*)
10314         cf_term_header=term.h
10315         ;;
10316 esac
10317
10318 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10319 do
10320 cat >"conftest.$ac_ext" <<_ACEOF
10321 #line 10321 "configure"
10322 #include "confdefs.h"
10323 #include <stdio.h>
10324 #include <${cf_cv_ncurses_header:-curses.h}>
10325 #include <$cf_test>
10326
10327 int
10328 main (void)
10329 {
10330 int x = auto_left_margin; (void)x
10331   ;
10332   return 0;
10333 }
10334 _ACEOF
10335 rm -f "conftest.$ac_objext"
10336 if { (eval echo "$as_me:10336: \"$ac_compile\"") >&5
10337   (eval $ac_compile) 2>&5
10338   ac_status=$?
10339   echo "$as_me:10339: \$? = $ac_status" >&5
10340   (exit "$ac_status"); } &&
10341          { ac_try='test -s "conftest.$ac_objext"'
10342   { (eval echo "$as_me:10342: \"$ac_try\"") >&5
10343   (eval $ac_try) 2>&5
10344   ac_status=$?
10345   echo "$as_me:10345: \$? = $ac_status" >&5
10346   (exit "$ac_status"); }; }; then
10347
10348         cf_cv_term_header="$cf_test"
10349 else
10350   echo "$as_me: failed program was:" >&5
10351 cat "conftest.$ac_ext" >&5
10352
10353         cf_cv_term_header=unknown
10354
10355 fi
10356 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10357         test "$cf_cv_term_header" != unknown && break
10358 done
10359
10360 fi
10361 echo "$as_me:10361: result: $cf_cv_term_header" >&5
10362 echo "${ECHO_T}$cf_cv_term_header" >&6
10363
10364 # Set definitions to allow ifdef'ing to accommodate subdirectories
10365
10366 case "$cf_cv_term_header" in
10367 (*term.h)
10368
10369 cat >>confdefs.h <<\EOF
10370 #define HAVE_TERM_H 1
10371 EOF
10372
10373         ;;
10374 esac
10375
10376 case "$cf_cv_term_header" in
10377 (ncurses/term.h)
10378
10379 cat >>confdefs.h <<\EOF
10380 #define HAVE_NCURSES_TERM_H 1
10381 EOF
10382
10383         ;;
10384 (ncursesw/term.h)
10385
10386 cat >>confdefs.h <<\EOF
10387 #define HAVE_NCURSESW_TERM_H 1
10388 EOF
10389
10390         ;;
10391 esac
10392
10393                 fi
10394
10395         else
10396                 echo "$as_me:10396: result: no" >&5
10397 echo "${ECHO_T}no" >&6
10398                 NCURSES_CONFIG_PKG=none
10399         fi
10400 else
10401         NCURSES_CONFIG_PKG=none
10402 fi
10403
10404 if test "x$cf_have_ncuconfig" = "xno"; then
10405         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10406
10407 if test -n "$ac_tool_prefix"; then
10408   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10409   do
10410     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10411 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10412 echo "$as_me:10412: checking for $ac_word" >&5
10413 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10414 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10415   echo $ECHO_N "(cached) $ECHO_C" >&6
10416 else
10417   if test -n "$NCURSES_CONFIG"; then
10418   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10419 else
10420   ac_save_IFS=$IFS; IFS=$ac_path_separator
10421 ac_dummy="$PATH"
10422 for ac_dir in $ac_dummy; do
10423   IFS=$ac_save_IFS
10424   test -z "$ac_dir" && ac_dir=.
10425   $as_executable_p "$ac_dir/$ac_word" || continue
10426 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10427 echo "$as_me:10427: found $ac_dir/$ac_word" >&5
10428 break
10429 done
10430
10431 fi
10432 fi
10433 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10434 if test -n "$NCURSES_CONFIG"; then
10435   echo "$as_me:10435: result: $NCURSES_CONFIG" >&5
10436 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10437 else
10438   echo "$as_me:10438: result: no" >&5
10439 echo "${ECHO_T}no" >&6
10440 fi
10441
10442     test -n "$NCURSES_CONFIG" && break
10443   done
10444 fi
10445 if test -z "$NCURSES_CONFIG"; then
10446   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10447   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10448 do
10449   # Extract the first word of "$ac_prog", so it can be a program name with args.
10450 set dummy $ac_prog; ac_word=$2
10451 echo "$as_me:10451: checking for $ac_word" >&5
10452 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10453 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10454   echo $ECHO_N "(cached) $ECHO_C" >&6
10455 else
10456   if test -n "$ac_ct_NCURSES_CONFIG"; then
10457   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10458 else
10459   ac_save_IFS=$IFS; IFS=$ac_path_separator
10460 ac_dummy="$PATH"
10461 for ac_dir in $ac_dummy; do
10462   IFS=$ac_save_IFS
10463   test -z "$ac_dir" && ac_dir=.
10464   $as_executable_p "$ac_dir/$ac_word" || continue
10465 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10466 echo "$as_me:10466: found $ac_dir/$ac_word" >&5
10467 break
10468 done
10469
10470 fi
10471 fi
10472 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10473 if test -n "$ac_ct_NCURSES_CONFIG"; then
10474   echo "$as_me:10474: result: $ac_ct_NCURSES_CONFIG" >&5
10475 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10476 else
10477   echo "$as_me:10477: result: no" >&5
10478 echo "${ECHO_T}no" >&6
10479 fi
10480
10481   test -n "$ac_ct_NCURSES_CONFIG" && break
10482 done
10483 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10484
10485   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10486 fi
10487
10488         if test "$NCURSES_CONFIG" != none ; then
10489
10490 cf_fix_cppflags=no
10491 cf_new_cflags=
10492 cf_new_cppflags=
10493 cf_new_extra_cppflags=
10494
10495 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10496 do
10497 case "$cf_fix_cppflags" in
10498 (no)
10499         case "$cf_add_cflags" in
10500         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10501                 case "$cf_add_cflags" in
10502                 (-D*)
10503                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10504
10505                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10506                                 && test -z "${cf_tst_cflags}" \
10507                                 && cf_fix_cppflags=yes
10508
10509                         if test "$cf_fix_cppflags" = yes ; then
10510
10511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10513
10514                                 continue
10515                         elif test "${cf_tst_cflags}" = "\"'" ; then
10516
10517         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10518         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10519
10520                                 continue
10521                         fi
10522                         ;;
10523                 esac
10524                 case "$CPPFLAGS" in
10525                 (*$cf_add_cflags)
10526                         ;;
10527                 (*)
10528                         case "$cf_add_cflags" in
10529                         (-D*)
10530                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10531
10532 CPPFLAGS=`echo "$CPPFLAGS" | \
10533         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10534                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10535
10536                                 ;;
10537                         esac
10538
10539         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10540         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10541
10542                         ;;
10543                 esac
10544                 ;;
10545         (*)
10546
10547         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10548         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10549
10550                 ;;
10551         esac
10552         ;;
10553 (yes)
10554
10555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10557
10558         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10559
10560         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10561                 && test -z "${cf_tst_cflags}" \
10562                 && cf_fix_cppflags=no
10563         ;;
10564 esac
10565 done
10566
10567 if test -n "$cf_new_cflags" ; then
10568
10569         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10570         CFLAGS="${CFLAGS}$cf_new_cflags"
10571
10572 fi
10573
10574 if test -n "$cf_new_cppflags" ; then
10575
10576         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10577         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10578
10579 fi
10580
10581 if test -n "$cf_new_extra_cppflags" ; then
10582
10583         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10584         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10585
10586 fi
10587
10588 cf_add_libs="$LIBS"
10589 # reverse order
10590 cf_add_0lib=
10591 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10592 # filter duplicates
10593 for cf_add_1lib in $cf_add_0lib; do
10594         for cf_add_2lib in $cf_add_libs; do
10595                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10596                         cf_add_1lib=
10597                         break
10598                 fi
10599         done
10600         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10601 done
10602 LIBS="$cf_add_libs"
10603
10604                 # even with config script, some packages use no-override for curses.h
10605
10606 echo "$as_me:10606: checking if we have identified curses headers" >&5
10607 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10608 if test "${cf_cv_ncurses_header+set}" = set; then
10609   echo $ECHO_N "(cached) $ECHO_C" >&6
10610 else
10611
10612 cf_cv_ncurses_header=none
10613 for cf_header in \
10614         ncurses.h $cf_cv_screen/ncurses.h \
10615         curses.h $cf_cv_screen/curses.h
10616 do
10617 cat >"conftest.$ac_ext" <<_ACEOF
10618 #line 10618 "configure"
10619 #include "confdefs.h"
10620 #include <${cf_header}>
10621 int
10622 main (void)
10623 {
10624 initscr(); tgoto("?", 0,0)
10625   ;
10626   return 0;
10627 }
10628 _ACEOF
10629 rm -f "conftest.$ac_objext"
10630 if { (eval echo "$as_me:10630: \"$ac_compile\"") >&5
10631   (eval $ac_compile) 2>&5
10632   ac_status=$?
10633   echo "$as_me:10633: \$? = $ac_status" >&5
10634   (exit "$ac_status"); } &&
10635          { ac_try='test -s "conftest.$ac_objext"'
10636   { (eval echo "$as_me:10636: \"$ac_try\"") >&5
10637   (eval $ac_try) 2>&5
10638   ac_status=$?
10639   echo "$as_me:10639: \$? = $ac_status" >&5
10640   (exit "$ac_status"); }; }; then
10641   cf_cv_ncurses_header=$cf_header; break
10642 else
10643   echo "$as_me: failed program was:" >&5
10644 cat "conftest.$ac_ext" >&5
10645 fi
10646 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10647 done
10648
10649 fi
10650 echo "$as_me:10650: result: $cf_cv_ncurses_header" >&5
10651 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10652
10653 if test "$cf_cv_ncurses_header" = none ; then
10654         { { echo "$as_me:10654: error: No curses header-files found" >&5
10655 echo "$as_me: error: No curses header-files found" >&2;}
10656    { (exit 1); exit 1; }; }
10657 fi
10658
10659 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10660
10661 for ac_header in $cf_cv_ncurses_header
10662 do
10663 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10664 echo "$as_me:10664: checking for $ac_header" >&5
10665 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10666 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10667   echo $ECHO_N "(cached) $ECHO_C" >&6
10668 else
10669   cat >"conftest.$ac_ext" <<_ACEOF
10670 #line 10670 "configure"
10671 #include "confdefs.h"
10672 #include <$ac_header>
10673 _ACEOF
10674 if { (eval echo "$as_me:10674: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10675   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10676   ac_status=$?
10677   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10678   rm -f conftest.er1
10679   cat conftest.err >&5
10680   echo "$as_me:10680: \$? = $ac_status" >&5
10681   (exit "$ac_status"); } >/dev/null; then
10682   if test -s conftest.err; then
10683     ac_cpp_err=$ac_c_preproc_warn_flag
10684   else
10685     ac_cpp_err=
10686   fi
10687 else
10688   ac_cpp_err=yes
10689 fi
10690 if test -z "$ac_cpp_err"; then
10691   eval "$as_ac_Header=yes"
10692 else
10693   echo "$as_me: failed program was:" >&5
10694   cat "conftest.$ac_ext" >&5
10695   eval "$as_ac_Header=no"
10696 fi
10697 rm -f conftest.err "conftest.$ac_ext"
10698 fi
10699 echo "$as_me:10699: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10700 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10701 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10702   cat >>confdefs.h <<EOF
10703 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10704 EOF
10705
10706 fi
10707 done
10708
10709 cat >>confdefs.h <<\EOF
10710 #define NCURSES 1
10711 EOF
10712
10713 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10714
10715                 cat >>confdefs.h <<EOF
10716 #define $cf_nculib_ROOT 1
10717 EOF
10718
10719                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10720
10721         else
10722
10723 cf_ncuhdr_root=$cf_cv_screen
10724
10725 test -n "$cf_cv_curses_dir" && \
10726 test "$cf_cv_curses_dir" != "no" && { \
10727
10728 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10729   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10730   do
10731         while test "$cf_add_incdir" != /usr/include
10732         do
10733           if test -d "$cf_add_incdir"
10734           then
10735                 cf_have_incdir=no
10736                 if test -n "$CFLAGS$CPPFLAGS" ; then
10737                   # a loop is needed to ensure we can add subdirs of existing dirs
10738                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10739                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10740                           cf_have_incdir=yes; break
10741                         fi
10742                   done
10743                 fi
10744
10745                 if test "$cf_have_incdir" = no ; then
10746                   if test "$cf_add_incdir" = /usr/local/include ; then
10747                         if test "$GCC" = yes
10748                         then
10749                           cf_save_CPPFLAGS=$CPPFLAGS
10750
10751         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10752         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10753
10754                           cat >"conftest.$ac_ext" <<_ACEOF
10755 #line 10755 "configure"
10756 #include "confdefs.h"
10757 #include <stdio.h>
10758 int
10759 main (void)
10760 {
10761 printf("Hello")
10762   ;
10763   return 0;
10764 }
10765 _ACEOF
10766 rm -f "conftest.$ac_objext"
10767 if { (eval echo "$as_me:10767: \"$ac_compile\"") >&5
10768   (eval $ac_compile) 2>&5
10769   ac_status=$?
10770   echo "$as_me:10770: \$? = $ac_status" >&5
10771   (exit "$ac_status"); } &&
10772          { ac_try='test -s "conftest.$ac_objext"'
10773   { (eval echo "$as_me:10773: \"$ac_try\"") >&5
10774   (eval $ac_try) 2>&5
10775   ac_status=$?
10776   echo "$as_me:10776: \$? = $ac_status" >&5
10777   (exit "$ac_status"); }; }; then
10778   :
10779 else
10780   echo "$as_me: failed program was:" >&5
10781 cat "conftest.$ac_ext" >&5
10782 cf_have_incdir=yes
10783 fi
10784 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10785                           CPPFLAGS=$cf_save_CPPFLAGS
10786                         fi
10787                   fi
10788                 fi
10789
10790                 if test "$cf_have_incdir" = no ; then
10791                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10792
10793 echo "${as_me:-configure}:10793: testing adding $cf_add_incdir to include-path ..." 1>&5
10794
10795                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10796
10797                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10798                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10799                   cf_add_incdir="$cf_top_incdir"
10800                 else
10801                   break
10802                 fi
10803           else
10804                 break
10805           fi
10806         done
10807   done
10808 fi
10809
10810 }
10811
10812 echo "$as_me:10812: checking for $cf_ncuhdr_root header in include-path" >&5
10813 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10814 if test "${cf_cv_ncurses_h+set}" = set; then
10815   echo $ECHO_N "(cached) $ECHO_C" >&6
10816 else
10817
10818         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10819         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10820         for cf_header in $cf_header_list
10821         do
10822
10823         cat >"conftest.$ac_ext" <<_ACEOF
10824 #line 10824 "configure"
10825 #include "confdefs.h"
10826
10827 #include <$cf_header>
10828 int
10829 main (void)
10830 {
10831
10832 #ifdef NCURSES_VERSION
10833
10834 printf("%s\\n", NCURSES_VERSION);
10835 #else
10836 #ifdef __NCURSES_H
10837 printf("old\\n");
10838 #else
10839         make an error
10840 #endif
10841 #endif
10842
10843   ;
10844   return 0;
10845 }
10846 _ACEOF
10847 rm -f "conftest.$ac_objext"
10848 if { (eval echo "$as_me:10848: \"$ac_compile\"") >&5
10849   (eval $ac_compile) 2>&5
10850   ac_status=$?
10851   echo "$as_me:10851: \$? = $ac_status" >&5
10852   (exit "$ac_status"); } &&
10853          { ac_try='test -s "conftest.$ac_objext"'
10854   { (eval echo "$as_me:10854: \"$ac_try\"") >&5
10855   (eval $ac_try) 2>&5
10856   ac_status=$?
10857   echo "$as_me:10857: \$? = $ac_status" >&5
10858   (exit "$ac_status"); }; }; then
10859   cf_cv_ncurses_h=$cf_header
10860
10861 else
10862   echo "$as_me: failed program was:" >&5
10863 cat "conftest.$ac_ext" >&5
10864 cf_cv_ncurses_h=no
10865 fi
10866 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10867
10868                 test "$cf_cv_ncurses_h" != no && break
10869         done
10870
10871 fi
10872 echo "$as_me:10872: result: $cf_cv_ncurses_h" >&5
10873 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10874
10875 if test "$cf_cv_ncurses_h" != no ; then
10876         cf_cv_ncurses_header=$cf_cv_ncurses_h
10877 else
10878
10879 echo "$as_me:10879: checking for $cf_ncuhdr_root include-path" >&5
10880 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10881 if test "${cf_cv_ncurses_h2+set}" = set; then
10882   echo $ECHO_N "(cached) $ECHO_C" >&6
10883 else
10884
10885         test -n "$verbose" && echo
10886
10887 cf_search=
10888
10889 # collect the current set of include-directories from compiler flags
10890 cf_header_path_list=""
10891 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10892         for cf_header_path in $CPPFLAGS $CFLAGS
10893         do
10894                 case "$cf_header_path" in
10895                 (-I*)
10896                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10897
10898 test "x$cf_header_path" != "xNONE" && \
10899 test -d "$cf_header_path" && \
10900  {
10901         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10902         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10903         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10904         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10905         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10906         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"
10907 }
10908
10909                         cf_header_path_list="$cf_header_path_list $cf_search"
10910                         ;;
10911                 esac
10912         done
10913 fi
10914
10915 # add the variations for the package we are looking for
10916
10917 cf_search=
10918
10919 test "x$prefix" != "xNONE" && \
10920 test -d "$prefix" && \
10921  {
10922         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10923         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10924         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10925         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10926         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10927         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10928 }
10929
10930 for cf_subdir_prefix in \
10931         /usr \
10932         /usr/local \
10933         /usr/pkg \
10934         /opt \
10935         /opt/local \
10936         $HOME
10937 do
10938
10939 test "x$cf_subdir_prefix" != "x$prefix" && \
10940 test -d "$cf_subdir_prefix" && \
10941 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10942         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10943         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10944         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10945         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10946         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10947         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"
10948 }
10949
10950 done
10951
10952 test "$includedir" != NONE && \
10953 test "$includedir" != "/usr/include" && \
10954 test -d "$includedir" && {
10955         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10956         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10957 }
10958
10959 test "$oldincludedir" != NONE && \
10960 test "$oldincludedir" != "/usr/include" && \
10961 test -d "$oldincludedir" && {
10962         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10963         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10964 }
10965
10966 cf_search="$cf_search $cf_header_path_list"
10967
10968         test -n "$verbose" && echo "search path $cf_search"
10969         cf_save2_CPPFLAGS="$CPPFLAGS"
10970         for cf_incdir in $cf_search
10971         do
10972
10973 if test -n "$cf_incdir" ; then
10974   for cf_add_incdir in $cf_incdir
10975   do
10976         while test "$cf_add_incdir" != /usr/include
10977         do
10978           if test -d "$cf_add_incdir"
10979           then
10980                 cf_have_incdir=no
10981                 if test -n "$CFLAGS$CPPFLAGS" ; then
10982                   # a loop is needed to ensure we can add subdirs of existing dirs
10983                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10984                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10985                           cf_have_incdir=yes; break
10986                         fi
10987                   done
10988                 fi
10989
10990                 if test "$cf_have_incdir" = no ; then
10991                   if test "$cf_add_incdir" = /usr/local/include ; then
10992                         if test "$GCC" = yes
10993                         then
10994                           cf_save_CPPFLAGS=$CPPFLAGS
10995
10996         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10997         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10998
10999                           cat >"conftest.$ac_ext" <<_ACEOF
11000 #line 11000 "configure"
11001 #include "confdefs.h"
11002 #include <stdio.h>
11003 int
11004 main (void)
11005 {
11006 printf("Hello")
11007   ;
11008   return 0;
11009 }
11010 _ACEOF
11011 rm -f "conftest.$ac_objext"
11012 if { (eval echo "$as_me:11012: \"$ac_compile\"") >&5
11013   (eval $ac_compile) 2>&5
11014   ac_status=$?
11015   echo "$as_me:11015: \$? = $ac_status" >&5
11016   (exit "$ac_status"); } &&
11017          { ac_try='test -s "conftest.$ac_objext"'
11018   { (eval echo "$as_me:11018: \"$ac_try\"") >&5
11019   (eval $ac_try) 2>&5
11020   ac_status=$?
11021   echo "$as_me:11021: \$? = $ac_status" >&5
11022   (exit "$ac_status"); }; }; then
11023   :
11024 else
11025   echo "$as_me: failed program was:" >&5
11026 cat "conftest.$ac_ext" >&5
11027 cf_have_incdir=yes
11028 fi
11029 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11030                           CPPFLAGS=$cf_save_CPPFLAGS
11031                         fi
11032                   fi
11033                 fi
11034
11035                 if test "$cf_have_incdir" = no ; then
11036                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11037
11038 echo "${as_me:-configure}:11038: testing adding $cf_add_incdir to include-path ..." 1>&5
11039
11040                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11041
11042                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11043                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11044                   cf_add_incdir="$cf_top_incdir"
11045                 else
11046                   break
11047                 fi
11048           else
11049                 break
11050           fi
11051         done
11052   done
11053 fi
11054
11055                 for cf_header in \
11056                         ncurses.h \
11057                         curses.h
11058                 do
11059
11060         cat >"conftest.$ac_ext" <<_ACEOF
11061 #line 11061 "configure"
11062 #include "confdefs.h"
11063
11064 #include <$cf_header>
11065 int
11066 main (void)
11067 {
11068
11069 #ifdef NCURSES_VERSION
11070
11071 printf("%s\\n", NCURSES_VERSION);
11072 #else
11073 #ifdef __NCURSES_H
11074 printf("old\\n");
11075 #else
11076         make an error
11077 #endif
11078 #endif
11079
11080   ;
11081   return 0;
11082 }
11083 _ACEOF
11084 rm -f "conftest.$ac_objext"
11085 if { (eval echo "$as_me:11085: \"$ac_compile\"") >&5
11086   (eval $ac_compile) 2>&5
11087   ac_status=$?
11088   echo "$as_me:11088: \$? = $ac_status" >&5
11089   (exit "$ac_status"); } &&
11090          { ac_try='test -s "conftest.$ac_objext"'
11091   { (eval echo "$as_me:11091: \"$ac_try\"") >&5
11092   (eval $ac_try) 2>&5
11093   ac_status=$?
11094   echo "$as_me:11094: \$? = $ac_status" >&5
11095   (exit "$ac_status"); }; }; then
11096   cf_cv_ncurses_h2=$cf_header
11097
11098 else
11099   echo "$as_me: failed program was:" >&5
11100 cat "conftest.$ac_ext" >&5
11101 cf_cv_ncurses_h2=no
11102 fi
11103 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11104
11105                         if test "$cf_cv_ncurses_h2" != no ; then
11106                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11107                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11108                                 break
11109                         fi
11110                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11111                 done
11112                 CPPFLAGS="$cf_save2_CPPFLAGS"
11113                 test "$cf_cv_ncurses_h2" != no && break
11114         done
11115         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11115: error: not found" >&5
11116 echo "$as_me: error: not found" >&2;}
11117    { (exit 1); exit 1; }; }
11118
11119 fi
11120 echo "$as_me:11120: result: $cf_cv_ncurses_h2" >&5
11121 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11122
11123         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11124         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11125         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11126                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11127         fi
11128
11129 if test -n "$cf_1st_incdir" ; then
11130   for cf_add_incdir in $cf_1st_incdir
11131   do
11132         while test "$cf_add_incdir" != /usr/include
11133         do
11134           if test -d "$cf_add_incdir"
11135           then
11136                 cf_have_incdir=no
11137                 if test -n "$CFLAGS$CPPFLAGS" ; then
11138                   # a loop is needed to ensure we can add subdirs of existing dirs
11139                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11140                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11141                           cf_have_incdir=yes; break
11142                         fi
11143                   done
11144                 fi
11145
11146                 if test "$cf_have_incdir" = no ; then
11147                   if test "$cf_add_incdir" = /usr/local/include ; then
11148                         if test "$GCC" = yes
11149                         then
11150                           cf_save_CPPFLAGS=$CPPFLAGS
11151
11152         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11153         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11154
11155                           cat >"conftest.$ac_ext" <<_ACEOF
11156 #line 11156 "configure"
11157 #include "confdefs.h"
11158 #include <stdio.h>
11159 int
11160 main (void)
11161 {
11162 printf("Hello")
11163   ;
11164   return 0;
11165 }
11166 _ACEOF
11167 rm -f "conftest.$ac_objext"
11168 if { (eval echo "$as_me:11168: \"$ac_compile\"") >&5
11169   (eval $ac_compile) 2>&5
11170   ac_status=$?
11171   echo "$as_me:11171: \$? = $ac_status" >&5
11172   (exit "$ac_status"); } &&
11173          { ac_try='test -s "conftest.$ac_objext"'
11174   { (eval echo "$as_me:11174: \"$ac_try\"") >&5
11175   (eval $ac_try) 2>&5
11176   ac_status=$?
11177   echo "$as_me:11177: \$? = $ac_status" >&5
11178   (exit "$ac_status"); }; }; then
11179   :
11180 else
11181   echo "$as_me: failed program was:" >&5
11182 cat "conftest.$ac_ext" >&5
11183 cf_have_incdir=yes
11184 fi
11185 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11186                           CPPFLAGS=$cf_save_CPPFLAGS
11187                         fi
11188                   fi
11189                 fi
11190
11191                 if test "$cf_have_incdir" = no ; then
11192                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11193
11194 echo "${as_me:-configure}:11194: testing adding $cf_add_incdir to include-path ..." 1>&5
11195
11196                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11197
11198                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11199                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11200                   cf_add_incdir="$cf_top_incdir"
11201                 else
11202                   break
11203                 fi
11204           else
11205                 break
11206           fi
11207         done
11208   done
11209 fi
11210
11211 fi
11212
11213 # Set definitions to allow ifdef'ing for ncurses.h
11214
11215 case "$cf_cv_ncurses_header" in
11216 (*ncurses.h)
11217
11218 cat >>confdefs.h <<\EOF
11219 #define HAVE_NCURSES_H 1
11220 EOF
11221
11222         ;;
11223 esac
11224
11225 case "$cf_cv_ncurses_header" in
11226 (ncurses/curses.h|ncurses/ncurses.h)
11227
11228 cat >>confdefs.h <<\EOF
11229 #define HAVE_NCURSES_NCURSES_H 1
11230 EOF
11231
11232         ;;
11233 (ncursesw/curses.h|ncursesw/ncurses.h)
11234
11235 cat >>confdefs.h <<\EOF
11236 #define HAVE_NCURSESW_NCURSES_H 1
11237 EOF
11238
11239         ;;
11240 esac
11241
11242 echo "$as_me:11242: checking for terminfo header" >&5
11243 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11244 if test "${cf_cv_term_header+set}" = set; then
11245   echo $ECHO_N "(cached) $ECHO_C" >&6
11246 else
11247
11248 case "${cf_cv_ncurses_header}" in
11249 (*/ncurses.h|*/ncursesw.h)
11250         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11251         ;;
11252 (*)
11253         cf_term_header=term.h
11254         ;;
11255 esac
11256
11257 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11258 do
11259 cat >"conftest.$ac_ext" <<_ACEOF
11260 #line 11260 "configure"
11261 #include "confdefs.h"
11262 #include <stdio.h>
11263 #include <${cf_cv_ncurses_header:-curses.h}>
11264 #include <$cf_test>
11265
11266 int
11267 main (void)
11268 {
11269 int x = auto_left_margin; (void)x
11270   ;
11271   return 0;
11272 }
11273 _ACEOF
11274 rm -f "conftest.$ac_objext"
11275 if { (eval echo "$as_me:11275: \"$ac_compile\"") >&5
11276   (eval $ac_compile) 2>&5
11277   ac_status=$?
11278   echo "$as_me:11278: \$? = $ac_status" >&5
11279   (exit "$ac_status"); } &&
11280          { ac_try='test -s "conftest.$ac_objext"'
11281   { (eval echo "$as_me:11281: \"$ac_try\"") >&5
11282   (eval $ac_try) 2>&5
11283   ac_status=$?
11284   echo "$as_me:11284: \$? = $ac_status" >&5
11285   (exit "$ac_status"); }; }; then
11286
11287         cf_cv_term_header="$cf_test"
11288 else
11289   echo "$as_me: failed program was:" >&5
11290 cat "conftest.$ac_ext" >&5
11291
11292         cf_cv_term_header=unknown
11293
11294 fi
11295 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11296         test "$cf_cv_term_header" != unknown && break
11297 done
11298
11299 fi
11300 echo "$as_me:11300: result: $cf_cv_term_header" >&5
11301 echo "${ECHO_T}$cf_cv_term_header" >&6
11302
11303 # Set definitions to allow ifdef'ing to accommodate subdirectories
11304
11305 case "$cf_cv_term_header" in
11306 (*term.h)
11307
11308 cat >>confdefs.h <<\EOF
11309 #define HAVE_TERM_H 1
11310 EOF
11311
11312         ;;
11313 esac
11314
11315 case "$cf_cv_term_header" in
11316 (ncurses/term.h)
11317
11318 cat >>confdefs.h <<\EOF
11319 #define HAVE_NCURSES_TERM_H 1
11320 EOF
11321
11322         ;;
11323 (ncursesw/term.h)
11324
11325 cat >>confdefs.h <<\EOF
11326 #define HAVE_NCURSESW_TERM_H 1
11327 EOF
11328
11329         ;;
11330 esac
11331
11332 # some applications need this, but should check for NCURSES_VERSION
11333
11334 cat >>confdefs.h <<\EOF
11335 #define NCURSES 1
11336 EOF
11337
11338 echo "$as_me:11338: checking for ncurses version" >&5
11339 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11340 if test "${cf_cv_ncurses_version+set}" = set; then
11341   echo $ECHO_N "(cached) $ECHO_C" >&6
11342 else
11343
11344         cf_cv_ncurses_version=no
11345         cf_tempfile=out$$
11346         rm -f "$cf_tempfile"
11347         if test "$cross_compiling" = yes; then
11348
11349         # This will not work if the preprocessor splits the line after the
11350         # Autoconf token.  The 'unproto' program does that.
11351         cat > "conftest.$ac_ext" <<EOF
11352 #include <${cf_cv_ncurses_header:-curses.h}>
11353 #undef Autoconf
11354 #ifdef NCURSES_VERSION
11355 Autoconf NCURSES_VERSION
11356 #else
11357 #ifdef __NCURSES_H
11358 Autoconf "old"
11359 #endif
11360 ;
11361 #endif
11362 EOF
11363         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11364         { (eval echo "$as_me:11364: \"$cf_try\"") >&5
11365   (eval $cf_try) 2>&5
11366   ac_status=$?
11367   echo "$as_me:11367: \$? = $ac_status" >&5
11368   (exit "$ac_status"); }
11369         if test -f conftest.out ; then
11370                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11371                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11372                 rm -f conftest.out
11373         fi
11374
11375 else
11376   cat >"conftest.$ac_ext" <<_ACEOF
11377 #line 11377 "configure"
11378 #include "confdefs.h"
11379
11380 #include <${cf_cv_ncurses_header:-curses.h}>
11381 #include <stdio.h>
11382 int main(void)
11383 {
11384         FILE *fp = fopen("$cf_tempfile", "w");
11385 #ifdef NCURSES_VERSION
11386 # ifdef NCURSES_VERSION_PATCH
11387         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11388 # else
11389         fprintf(fp, "%s\\n", NCURSES_VERSION);
11390 # endif
11391 #else
11392 # ifdef __NCURSES_H
11393         fprintf(fp, "old\\n");
11394 # else
11395         make an error
11396 # endif
11397 #endif
11398         ${cf_cv_main_return:-return}(0);
11399 }
11400 _ACEOF
11401 rm -f "conftest$ac_exeext"
11402 if { (eval echo "$as_me:11402: \"$ac_link\"") >&5
11403   (eval $ac_link) 2>&5
11404   ac_status=$?
11405   echo "$as_me:11405: \$? = $ac_status" >&5
11406   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11407   { (eval echo "$as_me:11407: \"$ac_try\"") >&5
11408   (eval $ac_try) 2>&5
11409   ac_status=$?
11410   echo "$as_me:11410: \$? = $ac_status" >&5
11411   (exit "$ac_status"); }; }; then
11412
11413         cf_cv_ncurses_version=`cat $cf_tempfile`
11414 else
11415   echo "$as_me: program exited with status $ac_status" >&5
11416 echo "$as_me: failed program was:" >&5
11417 cat "conftest.$ac_ext" >&5
11418 fi
11419 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11420 fi
11421         rm -f "$cf_tempfile"
11422
11423 fi
11424 echo "$as_me:11424: result: $cf_cv_ncurses_version" >&5
11425 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11426 test "$cf_cv_ncurses_version" = no ||
11427 cat >>confdefs.h <<\EOF
11428 #define NCURSES 1
11429 EOF
11430
11431 cf_nculib_root=$cf_cv_screen
11432         # This works, except for the special case where we find gpm, but
11433         # ncurses is in a nonstandard location via $LIBS, and we really want
11434         # to link gpm.
11435 cf_ncurses_LIBS=""
11436 cf_ncurses_SAVE="$LIBS"
11437 echo "$as_me:11437: checking for Gpm_Open in -lgpm" >&5
11438 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11439 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11440   echo $ECHO_N "(cached) $ECHO_C" >&6
11441 else
11442   ac_check_lib_save_LIBS=$LIBS
11443 LIBS="-lgpm  $LIBS"
11444 cat >"conftest.$ac_ext" <<_ACEOF
11445 #line 11445 "configure"
11446 #include "confdefs.h"
11447
11448 /* Override any gcc2 internal prototype to avoid an error.  */
11449 #ifdef __cplusplus
11450 extern "C"
11451 #endif
11452 /* We use char because int might match the return type of a gcc2
11453    builtin and then its argument prototype would still apply.  */
11454 char Gpm_Open ();
11455 int
11456 main (void)
11457 {
11458 Gpm_Open ();
11459   ;
11460   return 0;
11461 }
11462 _ACEOF
11463 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11464 if { (eval echo "$as_me:11464: \"$ac_link\"") >&5
11465   (eval $ac_link) 2>&5
11466   ac_status=$?
11467   echo "$as_me:11467: \$? = $ac_status" >&5
11468   (exit "$ac_status"); } &&
11469          { ac_try='test -s "conftest$ac_exeext"'
11470   { (eval echo "$as_me:11470: \"$ac_try\"") >&5
11471   (eval $ac_try) 2>&5
11472   ac_status=$?
11473   echo "$as_me:11473: \$? = $ac_status" >&5
11474   (exit "$ac_status"); }; }; then
11475   ac_cv_lib_gpm_Gpm_Open=yes
11476 else
11477   echo "$as_me: failed program was:" >&5
11478 cat "conftest.$ac_ext" >&5
11479 ac_cv_lib_gpm_Gpm_Open=no
11480 fi
11481 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11482 LIBS=$ac_check_lib_save_LIBS
11483 fi
11484 echo "$as_me:11484: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11485 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11486 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11487   echo "$as_me:11487: checking for initscr in -lgpm" >&5
11488 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11489 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11490   echo $ECHO_N "(cached) $ECHO_C" >&6
11491 else
11492   ac_check_lib_save_LIBS=$LIBS
11493 LIBS="-lgpm  $LIBS"
11494 cat >"conftest.$ac_ext" <<_ACEOF
11495 #line 11495 "configure"
11496 #include "confdefs.h"
11497
11498 /* Override any gcc2 internal prototype to avoid an error.  */
11499 #ifdef __cplusplus
11500 extern "C"
11501 #endif
11502 /* We use char because int might match the return type of a gcc2
11503    builtin and then its argument prototype would still apply.  */
11504 char initscr ();
11505 int
11506 main (void)
11507 {
11508 initscr ();
11509   ;
11510   return 0;
11511 }
11512 _ACEOF
11513 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11514 if { (eval echo "$as_me:11514: \"$ac_link\"") >&5
11515   (eval $ac_link) 2>&5
11516   ac_status=$?
11517   echo "$as_me:11517: \$? = $ac_status" >&5
11518   (exit "$ac_status"); } &&
11519          { ac_try='test -s "conftest$ac_exeext"'
11520   { (eval echo "$as_me:11520: \"$ac_try\"") >&5
11521   (eval $ac_try) 2>&5
11522   ac_status=$?
11523   echo "$as_me:11523: \$? = $ac_status" >&5
11524   (exit "$ac_status"); }; }; then
11525   ac_cv_lib_gpm_initscr=yes
11526 else
11527   echo "$as_me: failed program was:" >&5
11528 cat "conftest.$ac_ext" >&5
11529 ac_cv_lib_gpm_initscr=no
11530 fi
11531 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11532 LIBS=$ac_check_lib_save_LIBS
11533 fi
11534 echo "$as_me:11534: result: $ac_cv_lib_gpm_initscr" >&5
11535 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11536 if test "$ac_cv_lib_gpm_initscr" = yes; then
11537   LIBS="$cf_ncurses_SAVE"
11538 else
11539   cf_ncurses_LIBS="-lgpm"
11540 fi
11541
11542 fi
11543
11544 case "$host_os" in
11545 (freebsd*)
11546         # This is only necessary if you are linking against an obsolete
11547         # version of ncurses (but it should do no harm, since it's static).
11548         if test "$cf_nculib_root" = ncurses ; then
11549                 echo "$as_me:11549: checking for tgoto in -lmytinfo" >&5
11550 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11551 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11552   echo $ECHO_N "(cached) $ECHO_C" >&6
11553 else
11554   ac_check_lib_save_LIBS=$LIBS
11555 LIBS="-lmytinfo  $LIBS"
11556 cat >"conftest.$ac_ext" <<_ACEOF
11557 #line 11557 "configure"
11558 #include "confdefs.h"
11559
11560 /* Override any gcc2 internal prototype to avoid an error.  */
11561 #ifdef __cplusplus
11562 extern "C"
11563 #endif
11564 /* We use char because int might match the return type of a gcc2
11565    builtin and then its argument prototype would still apply.  */
11566 char tgoto ();
11567 int
11568 main (void)
11569 {
11570 tgoto ();
11571   ;
11572   return 0;
11573 }
11574 _ACEOF
11575 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11576 if { (eval echo "$as_me:11576: \"$ac_link\"") >&5
11577   (eval $ac_link) 2>&5
11578   ac_status=$?
11579   echo "$as_me:11579: \$? = $ac_status" >&5
11580   (exit "$ac_status"); } &&
11581          { ac_try='test -s "conftest$ac_exeext"'
11582   { (eval echo "$as_me:11582: \"$ac_try\"") >&5
11583   (eval $ac_try) 2>&5
11584   ac_status=$?
11585   echo "$as_me:11585: \$? = $ac_status" >&5
11586   (exit "$ac_status"); }; }; then
11587   ac_cv_lib_mytinfo_tgoto=yes
11588 else
11589   echo "$as_me: failed program was:" >&5
11590 cat "conftest.$ac_ext" >&5
11591 ac_cv_lib_mytinfo_tgoto=no
11592 fi
11593 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11594 LIBS=$ac_check_lib_save_LIBS
11595 fi
11596 echo "$as_me:11596: result: $ac_cv_lib_mytinfo_tgoto" >&5
11597 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11598 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11599   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11600 fi
11601
11602         fi
11603         ;;
11604 esac
11605
11606 cf_add_libs="$LIBS"
11607 # reverse order
11608 cf_add_0lib=
11609 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11610 # filter duplicates
11611 for cf_add_1lib in $cf_add_0lib; do
11612         for cf_add_2lib in $cf_add_libs; do
11613                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11614                         cf_add_1lib=
11615                         break
11616                 fi
11617         done
11618         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11619 done
11620 LIBS="$cf_add_libs"
11621
11622 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11623 then
11624
11625 cf_add_libs="$LIBS"
11626 # reverse order
11627 cf_add_0lib=
11628 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11629 # filter duplicates
11630 for cf_add_1lib in $cf_add_0lib; do
11631         for cf_add_2lib in $cf_add_libs; do
11632                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11633                         cf_add_1lib=
11634                         break
11635                 fi
11636         done
11637         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11638 done
11639 LIBS="$cf_add_libs"
11640
11641 else
11642
11643         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11644         cf_libdir=""
11645         echo "$as_me:11645: checking for initscr" >&5
11646 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11647 if test "${ac_cv_func_initscr+set}" = set; then
11648   echo $ECHO_N "(cached) $ECHO_C" >&6
11649 else
11650   cat >"conftest.$ac_ext" <<_ACEOF
11651 #line 11651 "configure"
11652 #include "confdefs.h"
11653 #define initscr autoconf_temporary
11654 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11655 #undef initscr
11656
11657 #ifdef __cplusplus
11658 extern "C"
11659 #endif
11660
11661 /* We use char because int might match the return type of a gcc2
11662    builtin and then its argument prototype would still apply.  */
11663 char initscr (void);
11664
11665 int
11666 main (void)
11667 {
11668
11669 /* The GNU C library defines stubs for functions which it implements
11670     to always fail with ENOSYS.  Some functions are actually named
11671     something starting with __ and the normal name is an alias.  */
11672 #if defined (__stub_initscr) || defined (__stub___initscr)
11673 #error found stub for initscr
11674 #endif
11675
11676         return initscr ();
11677   ;
11678   return 0;
11679 }
11680 _ACEOF
11681 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11682 if { (eval echo "$as_me:11682: \"$ac_link\"") >&5
11683   (eval $ac_link) 2>&5
11684   ac_status=$?
11685   echo "$as_me:11685: \$? = $ac_status" >&5
11686   (exit "$ac_status"); } &&
11687          { ac_try='test -s "conftest$ac_exeext"'
11688   { (eval echo "$as_me:11688: \"$ac_try\"") >&5
11689   (eval $ac_try) 2>&5
11690   ac_status=$?
11691   echo "$as_me:11691: \$? = $ac_status" >&5
11692   (exit "$ac_status"); }; }; then
11693   ac_cv_func_initscr=yes
11694 else
11695   echo "$as_me: failed program was:" >&5
11696 cat "conftest.$ac_ext" >&5
11697 ac_cv_func_initscr=no
11698 fi
11699 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11700 fi
11701 echo "$as_me:11701: result: $ac_cv_func_initscr" >&5
11702 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11703 if test "$ac_cv_func_initscr" = yes; then
11704   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11705 else
11706
11707                 cf_save_LIBS="$LIBS"
11708                 echo "$as_me:11708: checking for initscr in -l$cf_nculib_root" >&5
11709 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11710                 LIBS="-l$cf_nculib_root $LIBS"
11711                 cat >"conftest.$ac_ext" <<_ACEOF
11712 #line 11712 "configure"
11713 #include "confdefs.h"
11714 #include <${cf_cv_ncurses_header:-curses.h}>
11715 int
11716 main (void)
11717 {
11718 initscr()
11719   ;
11720   return 0;
11721 }
11722 _ACEOF
11723 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11724 if { (eval echo "$as_me:11724: \"$ac_link\"") >&5
11725   (eval $ac_link) 2>&5
11726   ac_status=$?
11727   echo "$as_me:11727: \$? = $ac_status" >&5
11728   (exit "$ac_status"); } &&
11729          { ac_try='test -s "conftest$ac_exeext"'
11730   { (eval echo "$as_me:11730: \"$ac_try\"") >&5
11731   (eval $ac_try) 2>&5
11732   ac_status=$?
11733   echo "$as_me:11733: \$? = $ac_status" >&5
11734   (exit "$ac_status"); }; }; then
11735   echo "$as_me:11735: result: yes" >&5
11736 echo "${ECHO_T}yes" >&6
11737                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11738
11739 else
11740   echo "$as_me: failed program was:" >&5
11741 cat "conftest.$ac_ext" >&5
11742 echo "$as_me:11742: result: no" >&5
11743 echo "${ECHO_T}no" >&6
11744
11745 cf_search=
11746 cf_library_path_list=""
11747 if test -n "${LDFLAGS}${LIBS}" ; then
11748         for cf_library_path in $LDFLAGS $LIBS
11749         do
11750                 case "$cf_library_path" in
11751                 (-L*)
11752                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11753
11754 test "x$cf_library_path" != "xNONE" && \
11755 test -d "$cf_library_path" && \
11756  {
11757         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11758         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11759         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11760         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11761         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11762         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"
11763 }
11764
11765                         cf_library_path_list="$cf_library_path_list $cf_search"
11766                         ;;
11767                 esac
11768         done
11769 fi
11770
11771 cf_search=
11772
11773 test "x$prefix" != "xNONE" && \
11774 test -d "$prefix" && \
11775  {
11776         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11777         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11778         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11779         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11780         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11781         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11782 }
11783
11784 for cf_subdir_prefix in \
11785         /usr \
11786         /usr/local \
11787         /usr/pkg \
11788         /opt \
11789         /opt/local \
11790         $HOME
11791 do
11792
11793 test "x$cf_subdir_prefix" != "x$prefix" && \
11794 test -d "$cf_subdir_prefix" && \
11795 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11796         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11797         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11798         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11799         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11800         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11801         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"
11802 }
11803
11804 done
11805
11806 cf_search="$cf_library_path_list $cf_search"
11807
11808                         for cf_libdir in $cf_search
11809                         do
11810                                 echo "$as_me:11810: checking for -l$cf_nculib_root in $cf_libdir" >&5
11811 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11812                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11813                                 cat >"conftest.$ac_ext" <<_ACEOF
11814 #line 11814 "configure"
11815 #include "confdefs.h"
11816 #include <${cf_cv_ncurses_header:-curses.h}>
11817 int
11818 main (void)
11819 {
11820 initscr()
11821   ;
11822   return 0;
11823 }
11824 _ACEOF
11825 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11826 if { (eval echo "$as_me:11826: \"$ac_link\"") >&5
11827   (eval $ac_link) 2>&5
11828   ac_status=$?
11829   echo "$as_me:11829: \$? = $ac_status" >&5
11830   (exit "$ac_status"); } &&
11831          { ac_try='test -s "conftest$ac_exeext"'
11832   { (eval echo "$as_me:11832: \"$ac_try\"") >&5
11833   (eval $ac_try) 2>&5
11834   ac_status=$?
11835   echo "$as_me:11835: \$? = $ac_status" >&5
11836   (exit "$ac_status"); }; }; then
11837   echo "$as_me:11837: result: yes" >&5
11838 echo "${ECHO_T}yes" >&6
11839                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11840                                          break
11841 else
11842   echo "$as_me: failed program was:" >&5
11843 cat "conftest.$ac_ext" >&5
11844 echo "$as_me:11844: result: no" >&5
11845 echo "${ECHO_T}no" >&6
11846                                          LIBS="$cf_save_LIBS"
11847 fi
11848 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11849                         done
11850
11851 fi
11852 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11853
11854 fi
11855
11856 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11857
11858 if test "$cf_found_library" = no ; then
11859         { { echo "$as_me:11859: error: Cannot link $cf_nculib_root library" >&5
11860 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11861    { (exit 1); exit 1; }; }
11862 fi
11863
11864 fi
11865
11866 if test -n "$cf_ncurses_LIBS" ; then
11867         echo "$as_me:11867: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11868 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11869         cf_ncurses_SAVE="$LIBS"
11870         for p in $cf_ncurses_LIBS ; do
11871                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11872                 if test "$q" != "$LIBS" ; then
11873                         LIBS="$q"
11874                 fi
11875         done
11876         cat >"conftest.$ac_ext" <<_ACEOF
11877 #line 11877 "configure"
11878 #include "confdefs.h"
11879 #include <${cf_cv_ncurses_header:-curses.h}>
11880 int
11881 main (void)
11882 {
11883 initscr(); mousemask(0,0); tigetstr((char *)0);
11884   ;
11885   return 0;
11886 }
11887 _ACEOF
11888 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11889 if { (eval echo "$as_me:11889: \"$ac_link\"") >&5
11890   (eval $ac_link) 2>&5
11891   ac_status=$?
11892   echo "$as_me:11892: \$? = $ac_status" >&5
11893   (exit "$ac_status"); } &&
11894          { ac_try='test -s "conftest$ac_exeext"'
11895   { (eval echo "$as_me:11895: \"$ac_try\"") >&5
11896   (eval $ac_try) 2>&5
11897   ac_status=$?
11898   echo "$as_me:11898: \$? = $ac_status" >&5
11899   (exit "$ac_status"); }; }; then
11900   echo "$as_me:11900: result: yes" >&5
11901 echo "${ECHO_T}yes" >&6
11902 else
11903   echo "$as_me: failed program was:" >&5
11904 cat "conftest.$ac_ext" >&5
11905 echo "$as_me:11905: result: no" >&5
11906 echo "${ECHO_T}no" >&6
11907                  LIBS="$cf_ncurses_SAVE"
11908 fi
11909 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11910 fi
11911
11912 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11913
11914 cat >>confdefs.h <<EOF
11915 #define $cf_nculib_ROOT 1
11916 EOF
11917
11918         fi
11919 else
11920         NCURSES_CONFIG=none
11921 fi
11922
11923         ;;
11924 (pdcurses)
11925         echo "$as_me:11925: checking for X" >&5
11926 echo $ECHO_N "checking for X... $ECHO_C" >&6
11927
11928 # Check whether --with-x or --without-x was given.
11929 if test "${with_x+set}" = set; then
11930   withval="$with_x"
11931
11932 fi;
11933 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11934 if test "x$with_x" = xno; then
11935   # The user explicitly disabled X.
11936   have_x=disabled
11937 else
11938   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11939     # Both variables are already set.
11940     have_x=yes
11941   else
11942     if test "${ac_cv_have_x+set}" = set; then
11943   echo $ECHO_N "(cached) $ECHO_C" >&6
11944 else
11945   # One or both of the vars are not set, and there is no cached value.
11946 ac_x_includes=no ac_x_libraries=no
11947 rm -fr conftest.dir
11948 if mkdir conftest.dir; then
11949   cd conftest.dir
11950   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11951   cat >Imakefile <<'EOF'
11952 acfindx:
11953         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11954 EOF
11955   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11956     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11957     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
11958     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11959     for ac_extension in a so sl dylib dll; do
11960       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
11961          test -f "$ac_im_libdir/libX11.$ac_extension"; then
11962         ac_im_usrlibdir=$ac_im_libdir; break
11963       fi
11964     done
11965     # Screen out bogus values from the imake configuration.  They are
11966     # bogus both because they are the default anyway, and because
11967     # using them would break gcc on systems where it needs fixed includes.
11968     case $ac_im_incroot in
11969         /usr/include) ;;
11970         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11971     esac
11972     case $ac_im_usrlibdir in
11973         /usr/lib | /lib) ;;
11974         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11975     esac
11976   fi
11977   cd ..
11978   rm -fr conftest.dir
11979 fi
11980
11981 # Standard set of common directories for X headers.
11982 # Check X11 before X11Rn because it is often a symlink to the current release.
11983 ac_x_header_dirs='
11984 /usr/X11/include
11985 /usr/X11R7/include
11986 /usr/X11R6/include
11987 /usr/X11R5/include
11988 /usr/X11R4/include
11989
11990 /opt/local/include
11991 /opt/X11/include
11992
11993 /usr/include/X11
11994 /usr/include/X11R7
11995 /usr/include/X11R6
11996 /usr/include/X11R5
11997 /usr/include/X11R4
11998
11999 /usr/local/X11/include
12000 /usr/local/X11R7/include
12001 /usr/local/X11R6/include
12002 /usr/local/X11R5/include
12003 /usr/local/X11R4/include
12004
12005 /usr/local/include/X11
12006 /usr/local/include/X11R7
12007 /usr/local/include/X11R6
12008 /usr/local/include/X11R5
12009 /usr/local/include/X11R4
12010
12011 /usr/X386/include
12012 /usr/x386/include
12013 /usr/XFree86/include/X11
12014
12015 /usr/include
12016 /usr/local/include
12017 /usr/unsupported/include
12018 /usr/athena/include
12019 /usr/local/x11r5/include
12020 /usr/lpp/Xamples/include
12021
12022 /usr/openwin/include
12023 /usr/openwin/share/include'
12024
12025 if test "$ac_x_includes" = no; then
12026   # Guess where to find include files, by looking for Intrinsic.h.
12027   # First, try using that file with no special directory specified.
12028   cat >"conftest.$ac_ext" <<_ACEOF
12029 #line 12029 "configure"
12030 #include "confdefs.h"
12031 #include <X11/Intrinsic.h>
12032 _ACEOF
12033 if { (eval echo "$as_me:12033: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12034   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12035   ac_status=$?
12036   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12037   rm -f conftest.er1
12038   cat conftest.err >&5
12039   echo "$as_me:12039: \$? = $ac_status" >&5
12040   (exit "$ac_status"); } >/dev/null; then
12041   if test -s conftest.err; then
12042     ac_cpp_err=$ac_c_preproc_warn_flag
12043   else
12044     ac_cpp_err=
12045   fi
12046 else
12047   ac_cpp_err=yes
12048 fi
12049 if test -z "$ac_cpp_err"; then
12050   # We can compile using X headers with no special include directory.
12051 ac_x_includes=
12052 else
12053   echo "$as_me: failed program was:" >&5
12054   cat "conftest.$ac_ext" >&5
12055   for ac_dir in $ac_x_header_dirs; do
12056   if test -r "$ac_dir/X11/Intrinsic.h"; then
12057     ac_x_includes=$ac_dir
12058     break
12059   fi
12060 done
12061 fi
12062 rm -f conftest.err "conftest.$ac_ext"
12063 fi # $ac_x_includes = no
12064
12065 if test "$ac_x_libraries" = no; then
12066   # Check for the libraries.
12067   # See if we find them without any special options.
12068   # Don't add to $LIBS permanently.
12069   ac_save_LIBS=$LIBS
12070   LIBS="-lXt $LIBS"
12071   cat >"conftest.$ac_ext" <<_ACEOF
12072 #line 12072 "configure"
12073 #include "confdefs.h"
12074 #include <X11/Intrinsic.h>
12075 int
12076 main (void)
12077 {
12078 XtMalloc (0)
12079   ;
12080   return 0;
12081 }
12082 _ACEOF
12083 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12084 if { (eval echo "$as_me:12084: \"$ac_link\"") >&5
12085   (eval $ac_link) 2>&5
12086   ac_status=$?
12087   echo "$as_me:12087: \$? = $ac_status" >&5
12088   (exit "$ac_status"); } &&
12089          { ac_try='test -s "conftest$ac_exeext"'
12090   { (eval echo "$as_me:12090: \"$ac_try\"") >&5
12091   (eval $ac_try) 2>&5
12092   ac_status=$?
12093   echo "$as_me:12093: \$? = $ac_status" >&5
12094   (exit "$ac_status"); }; }; then
12095   LIBS=$ac_save_LIBS
12096 # We can link X programs with no special library path.
12097 ac_x_libraries=
12098 else
12099   echo "$as_me: failed program was:" >&5
12100 cat "conftest.$ac_ext" >&5
12101 LIBS=$ac_save_LIBS
12102 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12103 do
12104   # Don't even attempt the hair of trying to link an X program!
12105   for ac_extension in a so sl dylib dll; do
12106     if test -r "$ac_dir/libXt.$ac_extension"; then
12107       ac_x_libraries=$ac_dir
12108       break 2
12109     fi
12110   done
12111 done
12112 fi
12113 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12114 fi # $ac_x_libraries = no
12115
12116 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12117   # Didn't find X anywhere.  Cache the known absence of X.
12118   ac_cv_have_x="have_x=no"
12119 else
12120   # Record where we found X for the cache.
12121   ac_cv_have_x="have_x=yes \
12122                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12123 fi
12124 fi
12125
12126   fi
12127   eval "$ac_cv_have_x"
12128 fi # $with_x != no
12129
12130 if test "$have_x" != yes; then
12131   echo "$as_me:12131: result: $have_x" >&5
12132 echo "${ECHO_T}$have_x" >&6
12133   no_x=yes
12134 else
12135   # If each of the values was on the command line, it overrides each guess.
12136   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12137   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12138   # Update the cache value to reflect the command line values.
12139   ac_cv_have_x="have_x=yes \
12140                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12141   echo "$as_me:12141: result: libraries $x_libraries, headers $x_includes" >&5
12142 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12143 fi
12144
12145 if test "$no_x" = yes; then
12146   # Not all programs may use this symbol, but it does not hurt to define it.
12147
12148 cat >>confdefs.h <<\EOF
12149 #define X_DISPLAY_MISSING 1
12150 EOF
12151
12152   X_CFLAGS=
12153   X_PRE_LIBS=
12154   X_LIBS=
12155   X_EXTRA_LIBS=
12156 else
12157   if test -n "$x_includes"; then
12158     X_CFLAGS="$X_CFLAGS -I$x_includes"
12159   fi
12160
12161   # It would also be nice to do this for all -L options, not just this one.
12162   if test -n "$x_libraries"; then
12163     X_LIBS="$X_LIBS -L$x_libraries"
12164     # For Solaris; some versions of Sun CC require a space after -R and
12165     # others require no space.  Words are not sufficient . . . .
12166     case `(uname -sr) 2>/dev/null` in
12167     "SunOS 5"*)
12168       echo "$as_me:12168: checking whether -R must be followed by a space" >&5
12169 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12170       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12171       cat >"conftest.$ac_ext" <<_ACEOF
12172 #line 12172 "configure"
12173 #include "confdefs.h"
12174
12175 int
12176 main (void)
12177 {
12178
12179   ;
12180   return 0;
12181 }
12182 _ACEOF
12183 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12184 if { (eval echo "$as_me:12184: \"$ac_link\"") >&5
12185   (eval $ac_link) 2>&5
12186   ac_status=$?
12187   echo "$as_me:12187: \$? = $ac_status" >&5
12188   (exit "$ac_status"); } &&
12189          { ac_try='test -s "conftest$ac_exeext"'
12190   { (eval echo "$as_me:12190: \"$ac_try\"") >&5
12191   (eval $ac_try) 2>&5
12192   ac_status=$?
12193   echo "$as_me:12193: \$? = $ac_status" >&5
12194   (exit "$ac_status"); }; }; then
12195   ac_R_nospace=yes
12196 else
12197   echo "$as_me: failed program was:" >&5
12198 cat "conftest.$ac_ext" >&5
12199 ac_R_nospace=no
12200 fi
12201 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12202       if test $ac_R_nospace = yes; then
12203         echo "$as_me:12203: result: no" >&5
12204 echo "${ECHO_T}no" >&6
12205         X_LIBS="$X_LIBS -R$x_libraries"
12206       else
12207         LIBS="$ac_xsave_LIBS -R $x_libraries"
12208         cat >"conftest.$ac_ext" <<_ACEOF
12209 #line 12209 "configure"
12210 #include "confdefs.h"
12211
12212 int
12213 main (void)
12214 {
12215
12216   ;
12217   return 0;
12218 }
12219 _ACEOF
12220 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12221 if { (eval echo "$as_me:12221: \"$ac_link\"") >&5
12222   (eval $ac_link) 2>&5
12223   ac_status=$?
12224   echo "$as_me:12224: \$? = $ac_status" >&5
12225   (exit "$ac_status"); } &&
12226          { ac_try='test -s "conftest$ac_exeext"'
12227   { (eval echo "$as_me:12227: \"$ac_try\"") >&5
12228   (eval $ac_try) 2>&5
12229   ac_status=$?
12230   echo "$as_me:12230: \$? = $ac_status" >&5
12231   (exit "$ac_status"); }; }; then
12232   ac_R_space=yes
12233 else
12234   echo "$as_me: failed program was:" >&5
12235 cat "conftest.$ac_ext" >&5
12236 ac_R_space=no
12237 fi
12238 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12239         if test $ac_R_space = yes; then
12240           echo "$as_me:12240: result: yes" >&5
12241 echo "${ECHO_T}yes" >&6
12242           X_LIBS="$X_LIBS -R $x_libraries"
12243         else
12244           echo "$as_me:12244: result: neither works" >&5
12245 echo "${ECHO_T}neither works" >&6
12246         fi
12247       fi
12248       LIBS=$ac_xsave_LIBS
12249     esac
12250   fi
12251
12252   # Check for system-dependent libraries X programs must link with.
12253   # Do this before checking for the system-independent R6 libraries
12254   # (-lICE), since we may need -lsocket or whatever for X linking.
12255
12256   if test "$ISC" = yes; then
12257     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12258   else
12259     # Martyn Johnson says this is needed for Ultrix, if the X
12260     # libraries were built with DECnet support.  And Karl Berry says
12261     # the Alpha needs dnet_stub (dnet does not exist).
12262     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12263     cat >"conftest.$ac_ext" <<_ACEOF
12264 #line 12264 "configure"
12265 #include "confdefs.h"
12266
12267 /* Override any gcc2 internal prototype to avoid an error.  */
12268 #ifdef __cplusplus
12269 extern "C"
12270 #endif
12271 /* We use char because int might match the return type of a gcc2
12272    builtin and then its argument prototype would still apply.  */
12273 char XOpenDisplay ();
12274 int
12275 main (void)
12276 {
12277 XOpenDisplay ();
12278   ;
12279   return 0;
12280 }
12281 _ACEOF
12282 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12283 if { (eval echo "$as_me:12283: \"$ac_link\"") >&5
12284   (eval $ac_link) 2>&5
12285   ac_status=$?
12286   echo "$as_me:12286: \$? = $ac_status" >&5
12287   (exit "$ac_status"); } &&
12288          { ac_try='test -s "conftest$ac_exeext"'
12289   { (eval echo "$as_me:12289: \"$ac_try\"") >&5
12290   (eval $ac_try) 2>&5
12291   ac_status=$?
12292   echo "$as_me:12292: \$? = $ac_status" >&5
12293   (exit "$ac_status"); }; }; then
12294   :
12295 else
12296   echo "$as_me: failed program was:" >&5
12297 cat "conftest.$ac_ext" >&5
12298 echo "$as_me:12298: checking for dnet_ntoa in -ldnet" >&5
12299 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12300 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12301   echo $ECHO_N "(cached) $ECHO_C" >&6
12302 else
12303   ac_check_lib_save_LIBS=$LIBS
12304 LIBS="-ldnet  $LIBS"
12305 cat >"conftest.$ac_ext" <<_ACEOF
12306 #line 12306 "configure"
12307 #include "confdefs.h"
12308
12309 /* Override any gcc2 internal prototype to avoid an error.  */
12310 #ifdef __cplusplus
12311 extern "C"
12312 #endif
12313 /* We use char because int might match the return type of a gcc2
12314    builtin and then its argument prototype would still apply.  */
12315 char dnet_ntoa ();
12316 int
12317 main (void)
12318 {
12319 dnet_ntoa ();
12320   ;
12321   return 0;
12322 }
12323 _ACEOF
12324 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12325 if { (eval echo "$as_me:12325: \"$ac_link\"") >&5
12326   (eval $ac_link) 2>&5
12327   ac_status=$?
12328   echo "$as_me:12328: \$? = $ac_status" >&5
12329   (exit "$ac_status"); } &&
12330          { ac_try='test -s "conftest$ac_exeext"'
12331   { (eval echo "$as_me:12331: \"$ac_try\"") >&5
12332   (eval $ac_try) 2>&5
12333   ac_status=$?
12334   echo "$as_me:12334: \$? = $ac_status" >&5
12335   (exit "$ac_status"); }; }; then
12336   ac_cv_lib_dnet_dnet_ntoa=yes
12337 else
12338   echo "$as_me: failed program was:" >&5
12339 cat "conftest.$ac_ext" >&5
12340 ac_cv_lib_dnet_dnet_ntoa=no
12341 fi
12342 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12343 LIBS=$ac_check_lib_save_LIBS
12344 fi
12345 echo "$as_me:12345: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12346 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12347 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12348   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12349 fi
12350
12351     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12352       echo "$as_me:12352: checking for dnet_ntoa in -ldnet_stub" >&5
12353 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12354 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12355   echo $ECHO_N "(cached) $ECHO_C" >&6
12356 else
12357   ac_check_lib_save_LIBS=$LIBS
12358 LIBS="-ldnet_stub  $LIBS"
12359 cat >"conftest.$ac_ext" <<_ACEOF
12360 #line 12360 "configure"
12361 #include "confdefs.h"
12362
12363 /* Override any gcc2 internal prototype to avoid an error.  */
12364 #ifdef __cplusplus
12365 extern "C"
12366 #endif
12367 /* We use char because int might match the return type of a gcc2
12368    builtin and then its argument prototype would still apply.  */
12369 char dnet_ntoa ();
12370 int
12371 main (void)
12372 {
12373 dnet_ntoa ();
12374   ;
12375   return 0;
12376 }
12377 _ACEOF
12378 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12379 if { (eval echo "$as_me:12379: \"$ac_link\"") >&5
12380   (eval $ac_link) 2>&5
12381   ac_status=$?
12382   echo "$as_me:12382: \$? = $ac_status" >&5
12383   (exit "$ac_status"); } &&
12384          { ac_try='test -s "conftest$ac_exeext"'
12385   { (eval echo "$as_me:12385: \"$ac_try\"") >&5
12386   (eval $ac_try) 2>&5
12387   ac_status=$?
12388   echo "$as_me:12388: \$? = $ac_status" >&5
12389   (exit "$ac_status"); }; }; then
12390   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12391 else
12392   echo "$as_me: failed program was:" >&5
12393 cat "conftest.$ac_ext" >&5
12394 ac_cv_lib_dnet_stub_dnet_ntoa=no
12395 fi
12396 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12397 LIBS=$ac_check_lib_save_LIBS
12398 fi
12399 echo "$as_me:12399: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12400 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12401 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12402   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12403 fi
12404
12405     fi
12406 fi
12407 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12408     LIBS="$ac_xsave_LIBS"
12409
12410     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12411     # to get the SysV transport functions.
12412     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12413     # needs -lnsl.
12414     # The nsl library prevents programs from opening the X display
12415     # on Irix 5.2, according to T.E. Dickey.
12416     # The functions gethostbyname, getservbyname, and inet_addr are
12417     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12418     echo "$as_me:12418: checking for gethostbyname" >&5
12419 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12420 if test "${ac_cv_func_gethostbyname+set}" = set; then
12421   echo $ECHO_N "(cached) $ECHO_C" >&6
12422 else
12423   cat >"conftest.$ac_ext" <<_ACEOF
12424 #line 12424 "configure"
12425 #include "confdefs.h"
12426 #define gethostbyname autoconf_temporary
12427 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12428 #undef gethostbyname
12429
12430 #ifdef __cplusplus
12431 extern "C"
12432 #endif
12433
12434 /* We use char because int might match the return type of a gcc2
12435    builtin and then its argument prototype would still apply.  */
12436 char gethostbyname (void);
12437
12438 int
12439 main (void)
12440 {
12441
12442 /* The GNU C library defines stubs for functions which it implements
12443     to always fail with ENOSYS.  Some functions are actually named
12444     something starting with __ and the normal name is an alias.  */
12445 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12446 #error found stub for gethostbyname
12447 #endif
12448
12449         return gethostbyname ();
12450   ;
12451   return 0;
12452 }
12453 _ACEOF
12454 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12455 if { (eval echo "$as_me:12455: \"$ac_link\"") >&5
12456   (eval $ac_link) 2>&5
12457   ac_status=$?
12458   echo "$as_me:12458: \$? = $ac_status" >&5
12459   (exit "$ac_status"); } &&
12460          { ac_try='test -s "conftest$ac_exeext"'
12461   { (eval echo "$as_me:12461: \"$ac_try\"") >&5
12462   (eval $ac_try) 2>&5
12463   ac_status=$?
12464   echo "$as_me:12464: \$? = $ac_status" >&5
12465   (exit "$ac_status"); }; }; then
12466   ac_cv_func_gethostbyname=yes
12467 else
12468   echo "$as_me: failed program was:" >&5
12469 cat "conftest.$ac_ext" >&5
12470 ac_cv_func_gethostbyname=no
12471 fi
12472 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12473 fi
12474 echo "$as_me:12474: result: $ac_cv_func_gethostbyname" >&5
12475 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12476
12477     if test $ac_cv_func_gethostbyname = no; then
12478       echo "$as_me:12478: checking for gethostbyname in -lnsl" >&5
12479 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12480 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12481   echo $ECHO_N "(cached) $ECHO_C" >&6
12482 else
12483   ac_check_lib_save_LIBS=$LIBS
12484 LIBS="-lnsl  $LIBS"
12485 cat >"conftest.$ac_ext" <<_ACEOF
12486 #line 12486 "configure"
12487 #include "confdefs.h"
12488
12489 /* Override any gcc2 internal prototype to avoid an error.  */
12490 #ifdef __cplusplus
12491 extern "C"
12492 #endif
12493 /* We use char because int might match the return type of a gcc2
12494    builtin and then its argument prototype would still apply.  */
12495 char gethostbyname ();
12496 int
12497 main (void)
12498 {
12499 gethostbyname ();
12500   ;
12501   return 0;
12502 }
12503 _ACEOF
12504 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12505 if { (eval echo "$as_me:12505: \"$ac_link\"") >&5
12506   (eval $ac_link) 2>&5
12507   ac_status=$?
12508   echo "$as_me:12508: \$? = $ac_status" >&5
12509   (exit "$ac_status"); } &&
12510          { ac_try='test -s "conftest$ac_exeext"'
12511   { (eval echo "$as_me:12511: \"$ac_try\"") >&5
12512   (eval $ac_try) 2>&5
12513   ac_status=$?
12514   echo "$as_me:12514: \$? = $ac_status" >&5
12515   (exit "$ac_status"); }; }; then
12516   ac_cv_lib_nsl_gethostbyname=yes
12517 else
12518   echo "$as_me: failed program was:" >&5
12519 cat "conftest.$ac_ext" >&5
12520 ac_cv_lib_nsl_gethostbyname=no
12521 fi
12522 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12523 LIBS=$ac_check_lib_save_LIBS
12524 fi
12525 echo "$as_me:12525: result: $ac_cv_lib_nsl_gethostbyname" >&5
12526 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12527 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12528   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12529 fi
12530
12531       if test $ac_cv_lib_nsl_gethostbyname = no; then
12532         echo "$as_me:12532: checking for gethostbyname in -lbsd" >&5
12533 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12534 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12535   echo $ECHO_N "(cached) $ECHO_C" >&6
12536 else
12537   ac_check_lib_save_LIBS=$LIBS
12538 LIBS="-lbsd  $LIBS"
12539 cat >"conftest.$ac_ext" <<_ACEOF
12540 #line 12540 "configure"
12541 #include "confdefs.h"
12542
12543 /* Override any gcc2 internal prototype to avoid an error.  */
12544 #ifdef __cplusplus
12545 extern "C"
12546 #endif
12547 /* We use char because int might match the return type of a gcc2
12548    builtin and then its argument prototype would still apply.  */
12549 char gethostbyname ();
12550 int
12551 main (void)
12552 {
12553 gethostbyname ();
12554   ;
12555   return 0;
12556 }
12557 _ACEOF
12558 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12559 if { (eval echo "$as_me:12559: \"$ac_link\"") >&5
12560   (eval $ac_link) 2>&5
12561   ac_status=$?
12562   echo "$as_me:12562: \$? = $ac_status" >&5
12563   (exit "$ac_status"); } &&
12564          { ac_try='test -s "conftest$ac_exeext"'
12565   { (eval echo "$as_me:12565: \"$ac_try\"") >&5
12566   (eval $ac_try) 2>&5
12567   ac_status=$?
12568   echo "$as_me:12568: \$? = $ac_status" >&5
12569   (exit "$ac_status"); }; }; then
12570   ac_cv_lib_bsd_gethostbyname=yes
12571 else
12572   echo "$as_me: failed program was:" >&5
12573 cat "conftest.$ac_ext" >&5
12574 ac_cv_lib_bsd_gethostbyname=no
12575 fi
12576 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12577 LIBS=$ac_check_lib_save_LIBS
12578 fi
12579 echo "$as_me:12579: result: $ac_cv_lib_bsd_gethostbyname" >&5
12580 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12581 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
12582   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12583 fi
12584
12585       fi
12586     fi
12587
12588     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12589     # socket/setsockopt and other routines are undefined under SCO ODT
12590     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12591     # on later versions), says Simon Leinen: it contains gethostby*
12592     # variants that don't use the nameserver (or something).  -lsocket
12593     # must be given before -lnsl if both are needed.  We assume that
12594     # if connect needs -lnsl, so does gethostbyname.
12595     echo "$as_me:12595: checking for connect" >&5
12596 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12597 if test "${ac_cv_func_connect+set}" = set; then
12598   echo $ECHO_N "(cached) $ECHO_C" >&6
12599 else
12600   cat >"conftest.$ac_ext" <<_ACEOF
12601 #line 12601 "configure"
12602 #include "confdefs.h"
12603 #define connect autoconf_temporary
12604 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12605 #undef connect
12606
12607 #ifdef __cplusplus
12608 extern "C"
12609 #endif
12610
12611 /* We use char because int might match the return type of a gcc2
12612    builtin and then its argument prototype would still apply.  */
12613 char connect (void);
12614
12615 int
12616 main (void)
12617 {
12618
12619 /* The GNU C library defines stubs for functions which it implements
12620     to always fail with ENOSYS.  Some functions are actually named
12621     something starting with __ and the normal name is an alias.  */
12622 #if defined (__stub_connect) || defined (__stub___connect)
12623 #error found stub for connect
12624 #endif
12625
12626         return connect ();
12627   ;
12628   return 0;
12629 }
12630 _ACEOF
12631 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12632 if { (eval echo "$as_me:12632: \"$ac_link\"") >&5
12633   (eval $ac_link) 2>&5
12634   ac_status=$?
12635   echo "$as_me:12635: \$? = $ac_status" >&5
12636   (exit "$ac_status"); } &&
12637          { ac_try='test -s "conftest$ac_exeext"'
12638   { (eval echo "$as_me:12638: \"$ac_try\"") >&5
12639   (eval $ac_try) 2>&5
12640   ac_status=$?
12641   echo "$as_me:12641: \$? = $ac_status" >&5
12642   (exit "$ac_status"); }; }; then
12643   ac_cv_func_connect=yes
12644 else
12645   echo "$as_me: failed program was:" >&5
12646 cat "conftest.$ac_ext" >&5
12647 ac_cv_func_connect=no
12648 fi
12649 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12650 fi
12651 echo "$as_me:12651: result: $ac_cv_func_connect" >&5
12652 echo "${ECHO_T}$ac_cv_func_connect" >&6
12653
12654     if test $ac_cv_func_connect = no; then
12655       echo "$as_me:12655: checking for connect in -lsocket" >&5
12656 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12657 if test "${ac_cv_lib_socket_connect+set}" = set; then
12658   echo $ECHO_N "(cached) $ECHO_C" >&6
12659 else
12660   ac_check_lib_save_LIBS=$LIBS
12661 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12662 cat >"conftest.$ac_ext" <<_ACEOF
12663 #line 12663 "configure"
12664 #include "confdefs.h"
12665
12666 /* Override any gcc2 internal prototype to avoid an error.  */
12667 #ifdef __cplusplus
12668 extern "C"
12669 #endif
12670 /* We use char because int might match the return type of a gcc2
12671    builtin and then its argument prototype would still apply.  */
12672 char connect ();
12673 int
12674 main (void)
12675 {
12676 connect ();
12677   ;
12678   return 0;
12679 }
12680 _ACEOF
12681 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12682 if { (eval echo "$as_me:12682: \"$ac_link\"") >&5
12683   (eval $ac_link) 2>&5
12684   ac_status=$?
12685   echo "$as_me:12685: \$? = $ac_status" >&5
12686   (exit "$ac_status"); } &&
12687          { ac_try='test -s "conftest$ac_exeext"'
12688   { (eval echo "$as_me:12688: \"$ac_try\"") >&5
12689   (eval $ac_try) 2>&5
12690   ac_status=$?
12691   echo "$as_me:12691: \$? = $ac_status" >&5
12692   (exit "$ac_status"); }; }; then
12693   ac_cv_lib_socket_connect=yes
12694 else
12695   echo "$as_me: failed program was:" >&5
12696 cat "conftest.$ac_ext" >&5
12697 ac_cv_lib_socket_connect=no
12698 fi
12699 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12700 LIBS=$ac_check_lib_save_LIBS
12701 fi
12702 echo "$as_me:12702: result: $ac_cv_lib_socket_connect" >&5
12703 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12704 if test "$ac_cv_lib_socket_connect" = yes; then
12705   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12706 fi
12707
12708     fi
12709
12710     # Guillermo Gomez says -lposix is necessary on A/UX.
12711     echo "$as_me:12711: checking for remove" >&5
12712 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12713 if test "${ac_cv_func_remove+set}" = set; then
12714   echo $ECHO_N "(cached) $ECHO_C" >&6
12715 else
12716   cat >"conftest.$ac_ext" <<_ACEOF
12717 #line 12717 "configure"
12718 #include "confdefs.h"
12719 #define remove autoconf_temporary
12720 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12721 #undef remove
12722
12723 #ifdef __cplusplus
12724 extern "C"
12725 #endif
12726
12727 /* We use char because int might match the return type of a gcc2
12728    builtin and then its argument prototype would still apply.  */
12729 char remove (void);
12730
12731 int
12732 main (void)
12733 {
12734
12735 /* The GNU C library defines stubs for functions which it implements
12736     to always fail with ENOSYS.  Some functions are actually named
12737     something starting with __ and the normal name is an alias.  */
12738 #if defined (__stub_remove) || defined (__stub___remove)
12739 #error found stub for remove
12740 #endif
12741
12742         return remove ();
12743   ;
12744   return 0;
12745 }
12746 _ACEOF
12747 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12748 if { (eval echo "$as_me:12748: \"$ac_link\"") >&5
12749   (eval $ac_link) 2>&5
12750   ac_status=$?
12751   echo "$as_me:12751: \$? = $ac_status" >&5
12752   (exit "$ac_status"); } &&
12753          { ac_try='test -s "conftest$ac_exeext"'
12754   { (eval echo "$as_me:12754: \"$ac_try\"") >&5
12755   (eval $ac_try) 2>&5
12756   ac_status=$?
12757   echo "$as_me:12757: \$? = $ac_status" >&5
12758   (exit "$ac_status"); }; }; then
12759   ac_cv_func_remove=yes
12760 else
12761   echo "$as_me: failed program was:" >&5
12762 cat "conftest.$ac_ext" >&5
12763 ac_cv_func_remove=no
12764 fi
12765 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12766 fi
12767 echo "$as_me:12767: result: $ac_cv_func_remove" >&5
12768 echo "${ECHO_T}$ac_cv_func_remove" >&6
12769
12770     if test $ac_cv_func_remove = no; then
12771       echo "$as_me:12771: checking for remove in -lposix" >&5
12772 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12773 if test "${ac_cv_lib_posix_remove+set}" = set; then
12774   echo $ECHO_N "(cached) $ECHO_C" >&6
12775 else
12776   ac_check_lib_save_LIBS=$LIBS
12777 LIBS="-lposix  $LIBS"
12778 cat >"conftest.$ac_ext" <<_ACEOF
12779 #line 12779 "configure"
12780 #include "confdefs.h"
12781
12782 /* Override any gcc2 internal prototype to avoid an error.  */
12783 #ifdef __cplusplus
12784 extern "C"
12785 #endif
12786 /* We use char because int might match the return type of a gcc2
12787    builtin and then its argument prototype would still apply.  */
12788 char remove ();
12789 int
12790 main (void)
12791 {
12792 remove ();
12793   ;
12794   return 0;
12795 }
12796 _ACEOF
12797 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12798 if { (eval echo "$as_me:12798: \"$ac_link\"") >&5
12799   (eval $ac_link) 2>&5
12800   ac_status=$?
12801   echo "$as_me:12801: \$? = $ac_status" >&5
12802   (exit "$ac_status"); } &&
12803          { ac_try='test -s "conftest$ac_exeext"'
12804   { (eval echo "$as_me:12804: \"$ac_try\"") >&5
12805   (eval $ac_try) 2>&5
12806   ac_status=$?
12807   echo "$as_me:12807: \$? = $ac_status" >&5
12808   (exit "$ac_status"); }; }; then
12809   ac_cv_lib_posix_remove=yes
12810 else
12811   echo "$as_me: failed program was:" >&5
12812 cat "conftest.$ac_ext" >&5
12813 ac_cv_lib_posix_remove=no
12814 fi
12815 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12816 LIBS=$ac_check_lib_save_LIBS
12817 fi
12818 echo "$as_me:12818: result: $ac_cv_lib_posix_remove" >&5
12819 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12820 if test "$ac_cv_lib_posix_remove" = yes; then
12821   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12822 fi
12823
12824     fi
12825
12826     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12827     echo "$as_me:12827: checking for shmat" >&5
12828 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12829 if test "${ac_cv_func_shmat+set}" = set; then
12830   echo $ECHO_N "(cached) $ECHO_C" >&6
12831 else
12832   cat >"conftest.$ac_ext" <<_ACEOF
12833 #line 12833 "configure"
12834 #include "confdefs.h"
12835 #define shmat autoconf_temporary
12836 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12837 #undef shmat
12838
12839 #ifdef __cplusplus
12840 extern "C"
12841 #endif
12842
12843 /* We use char because int might match the return type of a gcc2
12844    builtin and then its argument prototype would still apply.  */
12845 char shmat (void);
12846
12847 int
12848 main (void)
12849 {
12850
12851 /* The GNU C library defines stubs for functions which it implements
12852     to always fail with ENOSYS.  Some functions are actually named
12853     something starting with __ and the normal name is an alias.  */
12854 #if defined (__stub_shmat) || defined (__stub___shmat)
12855 #error found stub for shmat
12856 #endif
12857
12858         return shmat ();
12859   ;
12860   return 0;
12861 }
12862 _ACEOF
12863 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12864 if { (eval echo "$as_me:12864: \"$ac_link\"") >&5
12865   (eval $ac_link) 2>&5
12866   ac_status=$?
12867   echo "$as_me:12867: \$? = $ac_status" >&5
12868   (exit "$ac_status"); } &&
12869          { ac_try='test -s "conftest$ac_exeext"'
12870   { (eval echo "$as_me:12870: \"$ac_try\"") >&5
12871   (eval $ac_try) 2>&5
12872   ac_status=$?
12873   echo "$as_me:12873: \$? = $ac_status" >&5
12874   (exit "$ac_status"); }; }; then
12875   ac_cv_func_shmat=yes
12876 else
12877   echo "$as_me: failed program was:" >&5
12878 cat "conftest.$ac_ext" >&5
12879 ac_cv_func_shmat=no
12880 fi
12881 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12882 fi
12883 echo "$as_me:12883: result: $ac_cv_func_shmat" >&5
12884 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12885
12886     if test $ac_cv_func_shmat = no; then
12887       echo "$as_me:12887: checking for shmat in -lipc" >&5
12888 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12889 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12890   echo $ECHO_N "(cached) $ECHO_C" >&6
12891 else
12892   ac_check_lib_save_LIBS=$LIBS
12893 LIBS="-lipc  $LIBS"
12894 cat >"conftest.$ac_ext" <<_ACEOF
12895 #line 12895 "configure"
12896 #include "confdefs.h"
12897
12898 /* Override any gcc2 internal prototype to avoid an error.  */
12899 #ifdef __cplusplus
12900 extern "C"
12901 #endif
12902 /* We use char because int might match the return type of a gcc2
12903    builtin and then its argument prototype would still apply.  */
12904 char shmat ();
12905 int
12906 main (void)
12907 {
12908 shmat ();
12909   ;
12910   return 0;
12911 }
12912 _ACEOF
12913 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12914 if { (eval echo "$as_me:12914: \"$ac_link\"") >&5
12915   (eval $ac_link) 2>&5
12916   ac_status=$?
12917   echo "$as_me:12917: \$? = $ac_status" >&5
12918   (exit "$ac_status"); } &&
12919          { ac_try='test -s "conftest$ac_exeext"'
12920   { (eval echo "$as_me:12920: \"$ac_try\"") >&5
12921   (eval $ac_try) 2>&5
12922   ac_status=$?
12923   echo "$as_me:12923: \$? = $ac_status" >&5
12924   (exit "$ac_status"); }; }; then
12925   ac_cv_lib_ipc_shmat=yes
12926 else
12927   echo "$as_me: failed program was:" >&5
12928 cat "conftest.$ac_ext" >&5
12929 ac_cv_lib_ipc_shmat=no
12930 fi
12931 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12932 LIBS=$ac_check_lib_save_LIBS
12933 fi
12934 echo "$as_me:12934: result: $ac_cv_lib_ipc_shmat" >&5
12935 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12936 if test "$ac_cv_lib_ipc_shmat" = yes; then
12937   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12938 fi
12939
12940     fi
12941   fi
12942
12943   # Check for libraries that X11R6 Xt/Xaw programs need.
12944   ac_save_LDFLAGS=$LDFLAGS
12945   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12946   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12947   # check for ICE first), but we must link in the order -lSM -lICE or
12948   # we get undefined symbols.  So assume we have SM if we have ICE.
12949   # These have to be linked with before -lX11, unlike the other
12950   # libraries we check for below, so use a different variable.
12951   # John Interrante, Karl Berry
12952   echo "$as_me:12952: checking for IceConnectionNumber in -lICE" >&5
12953 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12954 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12955   echo $ECHO_N "(cached) $ECHO_C" >&6
12956 else
12957   ac_check_lib_save_LIBS=$LIBS
12958 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12959 cat >"conftest.$ac_ext" <<_ACEOF
12960 #line 12960 "configure"
12961 #include "confdefs.h"
12962
12963 /* Override any gcc2 internal prototype to avoid an error.  */
12964 #ifdef __cplusplus
12965 extern "C"
12966 #endif
12967 /* We use char because int might match the return type of a gcc2
12968    builtin and then its argument prototype would still apply.  */
12969 char IceConnectionNumber ();
12970 int
12971 main (void)
12972 {
12973 IceConnectionNumber ();
12974   ;
12975   return 0;
12976 }
12977 _ACEOF
12978 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12979 if { (eval echo "$as_me:12979: \"$ac_link\"") >&5
12980   (eval $ac_link) 2>&5
12981   ac_status=$?
12982   echo "$as_me:12982: \$? = $ac_status" >&5
12983   (exit "$ac_status"); } &&
12984          { ac_try='test -s "conftest$ac_exeext"'
12985   { (eval echo "$as_me:12985: \"$ac_try\"") >&5
12986   (eval $ac_try) 2>&5
12987   ac_status=$?
12988   echo "$as_me:12988: \$? = $ac_status" >&5
12989   (exit "$ac_status"); }; }; then
12990   ac_cv_lib_ICE_IceConnectionNumber=yes
12991 else
12992   echo "$as_me: failed program was:" >&5
12993 cat "conftest.$ac_ext" >&5
12994 ac_cv_lib_ICE_IceConnectionNumber=no
12995 fi
12996 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12997 LIBS=$ac_check_lib_save_LIBS
12998 fi
12999 echo "$as_me:12999: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13000 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13001 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13002   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13003 fi
13004
13005   LDFLAGS=$ac_save_LDFLAGS
13006
13007 fi
13008
13009 cf_x_athena=${cf_x_athena:-Xaw}
13010
13011 echo "$as_me:13011: checking if you want to link with Xaw 3d library" >&5
13012 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13013 withval=
13014
13015 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13016 if test "${with_Xaw3d+set}" = set; then
13017   withval="$with_Xaw3d"
13018
13019 fi;
13020 if test "$withval" = yes ; then
13021         cf_x_athena=Xaw3d
13022         echo "$as_me:13022: result: yes" >&5
13023 echo "${ECHO_T}yes" >&6
13024 else
13025         echo "$as_me:13025: result: no" >&5
13026 echo "${ECHO_T}no" >&6
13027 fi
13028
13029 echo "$as_me:13029: checking if you want to link with Xaw 3d xft library" >&5
13030 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13031 withval=
13032
13033 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13034 if test "${with_Xaw3dxft+set}" = set; then
13035   withval="$with_Xaw3dxft"
13036
13037 fi;
13038 if test "$withval" = yes ; then
13039         cf_x_athena=Xaw3dxft
13040         echo "$as_me:13040: result: yes" >&5
13041 echo "${ECHO_T}yes" >&6
13042 else
13043         echo "$as_me:13043: result: no" >&5
13044 echo "${ECHO_T}no" >&6
13045 fi
13046
13047 echo "$as_me:13047: checking if you want to link with neXT Athena library" >&5
13048 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13049 withval=
13050
13051 # Check whether --with-neXtaw or --without-neXtaw was given.
13052 if test "${with_neXtaw+set}" = set; then
13053   withval="$with_neXtaw"
13054
13055 fi;
13056 if test "$withval" = yes ; then
13057         cf_x_athena=neXtaw
13058         echo "$as_me:13058: result: yes" >&5
13059 echo "${ECHO_T}yes" >&6
13060 else
13061         echo "$as_me:13061: result: no" >&5
13062 echo "${ECHO_T}no" >&6
13063 fi
13064
13065 echo "$as_me:13065: checking if you want to link with Athena-Plus library" >&5
13066 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13067 withval=
13068
13069 # Check whether --with-XawPlus or --without-XawPlus was given.
13070 if test "${with_XawPlus+set}" = set; then
13071   withval="$with_XawPlus"
13072
13073 fi;
13074 if test "$withval" = yes ; then
13075         cf_x_athena=XawPlus
13076         echo "$as_me:13076: result: yes" >&5
13077 echo "${ECHO_T}yes" >&6
13078 else
13079         echo "$as_me:13079: result: no" >&5
13080 echo "${ECHO_T}no" >&6
13081 fi
13082
13083 cf_x_athena_lib=""
13084
13085 if test "$PKG_CONFIG" != none ; then
13086         cf_athena_list=
13087         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13088         for cf_athena_pkg in \
13089                 $cf_athena_list \
13090                 ${cf_x_athena} \
13091                 ${cf_x_athena}-devel \
13092                 lib${cf_x_athena} \
13093                 lib${cf_x_athena}-devel
13094         do
13095
13096 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13097         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13098
13099 echo "${as_me:-configure}:13099: testing found package $cf_athena_pkg ..." 1>&5
13100
13101         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13102         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13103         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13104
13105 echo "${as_me:-configure}:13105: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13106
13107         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13108
13109 echo "${as_me:-configure}:13109: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13110
13111 cf_fix_cppflags=no
13112 cf_new_cflags=
13113 cf_new_cppflags=
13114 cf_new_extra_cppflags=
13115
13116 for cf_add_cflags in $cf_pkgconfig_incs
13117 do
13118 case "$cf_fix_cppflags" in
13119 (no)
13120         case "$cf_add_cflags" in
13121         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13122                 case "$cf_add_cflags" in
13123                 (-D*)
13124                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13125
13126                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13127                                 && test -z "${cf_tst_cflags}" \
13128                                 && cf_fix_cppflags=yes
13129
13130                         if test "$cf_fix_cppflags" = yes ; then
13131
13132         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13133         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13134
13135                                 continue
13136                         elif test "${cf_tst_cflags}" = "\"'" ; then
13137
13138         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13139         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13140
13141                                 continue
13142                         fi
13143                         ;;
13144                 esac
13145                 case "$CPPFLAGS" in
13146                 (*$cf_add_cflags)
13147                         ;;
13148                 (*)
13149                         case "$cf_add_cflags" in
13150                         (-D*)
13151                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13152
13153 CPPFLAGS=`echo "$CPPFLAGS" | \
13154         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13155                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13156
13157                                 ;;
13158                         esac
13159
13160         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13161         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13162
13163                         ;;
13164                 esac
13165                 ;;
13166         (*)
13167
13168         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13169         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13170
13171                 ;;
13172         esac
13173         ;;
13174 (yes)
13175
13176         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13177         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13178
13179         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13180
13181         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13182                 && test -z "${cf_tst_cflags}" \
13183                 && cf_fix_cppflags=no
13184         ;;
13185 esac
13186 done
13187
13188 if test -n "$cf_new_cflags" ; then
13189
13190         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13191         CFLAGS="${CFLAGS}$cf_new_cflags"
13192
13193 fi
13194
13195 if test -n "$cf_new_cppflags" ; then
13196
13197         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13198         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13199
13200 fi
13201
13202 if test -n "$cf_new_extra_cppflags" ; then
13203
13204         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13205         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13206
13207 fi
13208
13209 cf_add_libs="$LIBS"
13210 # reverse order
13211 cf_add_0lib=
13212 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13213 # filter duplicates
13214 for cf_add_1lib in $cf_add_0lib; do
13215         for cf_add_2lib in $cf_add_libs; do
13216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13217                         cf_add_1lib=
13218                         break
13219                 fi
13220         done
13221         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13222 done
13223 LIBS="$cf_add_libs"
13224
13225                         cf_x_athena_lib="$cf_pkgconfig_libs"
13226
13227 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13228
13229                         cat >>confdefs.h <<EOF
13230 #define $cf_x_athena_LIBS 1
13231 EOF
13232
13233         for cf_trim_lib in Xmu Xt X11
13234         do
13235                 case "$LIBS" in
13236                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13237                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13238                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13239
13240 echo "${as_me:-configure}:13240: testing ..trimmed $LIBS ..." 1>&5
13241
13242                         ;;
13243                 esac
13244         done
13245
13246 echo "$as_me:13246: checking for usable $cf_x_athena/Xmu package" >&5
13247 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13248 if test "${cf_cv_xaw_compat+set}" = set; then
13249   echo $ECHO_N "(cached) $ECHO_C" >&6
13250 else
13251
13252 cat >"conftest.$ac_ext" <<_ACEOF
13253 #line 13253 "configure"
13254 #include "confdefs.h"
13255
13256 #include <X11/Xmu/CharSet.h>
13257
13258 int
13259 main (void)
13260 {
13261
13262 int check = XmuCompareISOLatin1("big", "small");
13263 (void)check;
13264
13265   ;
13266   return 0;
13267 }
13268 _ACEOF
13269 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13270 if { (eval echo "$as_me:13270: \"$ac_link\"") >&5
13271   (eval $ac_link) 2>&5
13272   ac_status=$?
13273   echo "$as_me:13273: \$? = $ac_status" >&5
13274   (exit "$ac_status"); } &&
13275          { ac_try='test -s "conftest$ac_exeext"'
13276   { (eval echo "$as_me:13276: \"$ac_try\"") >&5
13277   (eval $ac_try) 2>&5
13278   ac_status=$?
13279   echo "$as_me:13279: \$? = $ac_status" >&5
13280   (exit "$ac_status"); }; }; then
13281   cf_cv_xaw_compat=yes
13282 else
13283   echo "$as_me: failed program was:" >&5
13284 cat "conftest.$ac_ext" >&5
13285 cf_cv_xaw_compat=no
13286 fi
13287 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13288 fi
13289 echo "$as_me:13289: result: $cf_cv_xaw_compat" >&5
13290 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13291
13292                         if test "$cf_cv_xaw_compat" = no
13293                         then
13294                                 # workaround for broken ".pc" files...
13295                                 case "$cf_x_athena_lib" in
13296                                 (*-lXmu*)
13297                                         ;;
13298                                 (*)
13299                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13300
13301 echo "${as_me:-configure}:13301: testing work around broken package ..." 1>&5
13302
13303                                         cf_save_xmu="$LIBS"
13304                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13305
13306 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13307         test -n "$verbose" && echo "    found package xmu" 1>&6
13308
13309 echo "${as_me:-configure}:13309: testing found package xmu ..." 1>&5
13310
13311         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13312         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13313         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13314
13315 echo "${as_me:-configure}:13315: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13316
13317         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13318
13319 echo "${as_me:-configure}:13319: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13320
13321 cf_fix_cppflags=no
13322 cf_new_cflags=
13323 cf_new_cppflags=
13324 cf_new_extra_cppflags=
13325
13326 for cf_add_cflags in $cf_pkgconfig_incs
13327 do
13328 case "$cf_fix_cppflags" in
13329 (no)
13330         case "$cf_add_cflags" in
13331         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13332                 case "$cf_add_cflags" in
13333                 (-D*)
13334                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13335
13336                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13337                                 && test -z "${cf_tst_cflags}" \
13338                                 && cf_fix_cppflags=yes
13339
13340                         if test "$cf_fix_cppflags" = yes ; then
13341
13342         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13343         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13344
13345                                 continue
13346                         elif test "${cf_tst_cflags}" = "\"'" ; then
13347
13348         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13349         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13350
13351                                 continue
13352                         fi
13353                         ;;
13354                 esac
13355                 case "$CPPFLAGS" in
13356                 (*$cf_add_cflags)
13357                         ;;
13358                 (*)
13359                         case "$cf_add_cflags" in
13360                         (-D*)
13361                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13362
13363 CPPFLAGS=`echo "$CPPFLAGS" | \
13364         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13365                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13366
13367                                 ;;
13368                         esac
13369
13370         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13371         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13372
13373                         ;;
13374                 esac
13375                 ;;
13376         (*)
13377
13378         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13379         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13380
13381                 ;;
13382         esac
13383         ;;
13384 (yes)
13385
13386         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13387         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13388
13389         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13390
13391         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13392                 && test -z "${cf_tst_cflags}" \
13393                 && cf_fix_cppflags=no
13394         ;;
13395 esac
13396 done
13397
13398 if test -n "$cf_new_cflags" ; then
13399
13400         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13401         CFLAGS="${CFLAGS}$cf_new_cflags"
13402
13403 fi
13404
13405 if test -n "$cf_new_cppflags" ; then
13406
13407         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13408         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13409
13410 fi
13411
13412 if test -n "$cf_new_extra_cppflags" ; then
13413
13414         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13415         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13416
13417 fi
13418
13419 cf_add_libs="$LIBS"
13420 # reverse order
13421 cf_add_0lib=
13422 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13423 # filter duplicates
13424 for cf_add_1lib in $cf_add_0lib; do
13425         for cf_add_2lib in $cf_add_libs; do
13426                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13427                         cf_add_1lib=
13428                         break
13429                 fi
13430         done
13431         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13432 done
13433 LIBS="$cf_add_libs"
13434
13435                                                         LIBS="$cf_save_xmu"
13436
13437 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13438
13439 echo "${as_me:-configure}:13439: testing ...before $LIBS ..." 1>&5
13440
13441 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13442 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13443
13444 echo "${as_me:-configure}:13444: testing ...after  $LIBS ..." 1>&5
13445
13446 else
13447         cf_pkgconfig_incs=
13448         cf_pkgconfig_libs=
13449
13450 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13451
13452 echo "${as_me:-configure}:13452: testing ...before $LIBS ..." 1>&5
13453
13454 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13455 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13456
13457 echo "${as_me:-configure}:13457: testing ...after  $LIBS ..." 1>&5
13458
13459 fi
13460
13461         for cf_trim_lib in Xmu Xt X11
13462         do
13463                 case "$LIBS" in
13464                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13465                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13466                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13467
13468 echo "${as_me:-configure}:13468: testing ..trimmed $LIBS ..." 1>&5
13469
13470                         ;;
13471                 esac
13472         done
13473
13474                                         ;;
13475                                 esac
13476                         fi
13477
13478                         break
13479 else
13480         cf_pkgconfig_incs=
13481         cf_pkgconfig_libs=
13482         :
13483 fi
13484
13485         done
13486 fi
13487
13488 if test -z "$cf_x_athena_lib" ; then
13489
13490 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13491         test -n "$verbose" && echo "    found package Xext" 1>&6
13492
13493 echo "${as_me:-configure}:13493: testing found package Xext ..." 1>&5
13494
13495         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13496         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13497         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13498
13499 echo "${as_me:-configure}:13499: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13500
13501         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13502
13503 echo "${as_me:-configure}:13503: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13504
13505 cf_fix_cppflags=no
13506 cf_new_cflags=
13507 cf_new_cppflags=
13508 cf_new_extra_cppflags=
13509
13510 for cf_add_cflags in $cf_pkgconfig_incs
13511 do
13512 case "$cf_fix_cppflags" in
13513 (no)
13514         case "$cf_add_cflags" in
13515         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13516                 case "$cf_add_cflags" in
13517                 (-D*)
13518                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13519
13520                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13521                                 && test -z "${cf_tst_cflags}" \
13522                                 && cf_fix_cppflags=yes
13523
13524                         if test "$cf_fix_cppflags" = yes ; then
13525
13526         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13527         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13528
13529                                 continue
13530                         elif test "${cf_tst_cflags}" = "\"'" ; then
13531
13532         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13533         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13534
13535                                 continue
13536                         fi
13537                         ;;
13538                 esac
13539                 case "$CPPFLAGS" in
13540                 (*$cf_add_cflags)
13541                         ;;
13542                 (*)
13543                         case "$cf_add_cflags" in
13544                         (-D*)
13545                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13546
13547 CPPFLAGS=`echo "$CPPFLAGS" | \
13548         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13549                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13550
13551                                 ;;
13552                         esac
13553
13554         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13555         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13556
13557                         ;;
13558                 esac
13559                 ;;
13560         (*)
13561
13562         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13563         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13564
13565                 ;;
13566         esac
13567         ;;
13568 (yes)
13569
13570         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13571         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13572
13573         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13574
13575         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13576                 && test -z "${cf_tst_cflags}" \
13577                 && cf_fix_cppflags=no
13578         ;;
13579 esac
13580 done
13581
13582 if test -n "$cf_new_cflags" ; then
13583
13584         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13585         CFLAGS="${CFLAGS}$cf_new_cflags"
13586
13587 fi
13588
13589 if test -n "$cf_new_cppflags" ; then
13590
13591         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13592         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13593
13594 fi
13595
13596 if test -n "$cf_new_extra_cppflags" ; then
13597
13598         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13599         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13600
13601 fi
13602
13603 cf_add_libs="$LIBS"
13604 # reverse order
13605 cf_add_0lib=
13606 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13607 # filter duplicates
13608 for cf_add_1lib in $cf_add_0lib; do
13609         for cf_add_2lib in $cf_add_libs; do
13610                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13611                         cf_add_1lib=
13612                         break
13613                 fi
13614         done
13615         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13616 done
13617 LIBS="$cf_add_libs"
13618
13619         :
13620 else
13621         cf_pkgconfig_incs=
13622         cf_pkgconfig_libs=
13623
13624         echo "$as_me:13624: checking for XextCreateExtension in -lXext" >&5
13625 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13626 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13627   echo $ECHO_N "(cached) $ECHO_C" >&6
13628 else
13629   ac_check_lib_save_LIBS=$LIBS
13630 LIBS="-lXext  $LIBS"
13631 cat >"conftest.$ac_ext" <<_ACEOF
13632 #line 13632 "configure"
13633 #include "confdefs.h"
13634
13635 /* Override any gcc2 internal prototype to avoid an error.  */
13636 #ifdef __cplusplus
13637 extern "C"
13638 #endif
13639 /* We use char because int might match the return type of a gcc2
13640    builtin and then its argument prototype would still apply.  */
13641 char XextCreateExtension ();
13642 int
13643 main (void)
13644 {
13645 XextCreateExtension ();
13646   ;
13647   return 0;
13648 }
13649 _ACEOF
13650 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13651 if { (eval echo "$as_me:13651: \"$ac_link\"") >&5
13652   (eval $ac_link) 2>&5
13653   ac_status=$?
13654   echo "$as_me:13654: \$? = $ac_status" >&5
13655   (exit "$ac_status"); } &&
13656          { ac_try='test -s "conftest$ac_exeext"'
13657   { (eval echo "$as_me:13657: \"$ac_try\"") >&5
13658   (eval $ac_try) 2>&5
13659   ac_status=$?
13660   echo "$as_me:13660: \$? = $ac_status" >&5
13661   (exit "$ac_status"); }; }; then
13662   ac_cv_lib_Xext_XextCreateExtension=yes
13663 else
13664   echo "$as_me: failed program was:" >&5
13665 cat "conftest.$ac_ext" >&5
13666 ac_cv_lib_Xext_XextCreateExtension=no
13667 fi
13668 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13669 LIBS=$ac_check_lib_save_LIBS
13670 fi
13671 echo "$as_me:13671: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13672 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13673 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
13674
13675 cf_add_libs="$LIBS"
13676 # reverse order
13677 cf_add_0lib=
13678 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13679 # filter duplicates
13680 for cf_add_1lib in $cf_add_0lib; do
13681         for cf_add_2lib in $cf_add_libs; do
13682                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13683                         cf_add_1lib=
13684                         break
13685                 fi
13686         done
13687         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13688 done
13689 LIBS="$cf_add_libs"
13690
13691 fi
13692
13693 fi
13694
13695 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13696 # in some cases has installed dummy files in the former, other cases replaced
13697 # it with a link to the new location).  This complicates the configure script.
13698 # Check for that pitfall, and recover using pkg-config
13699 #
13700 # If none of these are set, the configuration is almost certainly broken.
13701 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13702 then
13703
13704 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
13705         test -n "$verbose" && echo "    found package x11" 1>&6
13706
13707 echo "${as_me:-configure}:13707: testing found package x11 ..." 1>&5
13708
13709         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
13710         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
13711         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13712
13713 echo "${as_me:-configure}:13713: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13714
13715         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13716
13717 echo "${as_me:-configure}:13717: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13718
13719 cf_fix_cppflags=no
13720 cf_new_cflags=
13721 cf_new_cppflags=
13722 cf_new_extra_cppflags=
13723
13724 for cf_add_cflags in $cf_pkgconfig_incs
13725 do
13726 case "$cf_fix_cppflags" in
13727 (no)
13728         case "$cf_add_cflags" in
13729         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13730                 case "$cf_add_cflags" in
13731                 (-D*)
13732                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13733
13734                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13735                                 && test -z "${cf_tst_cflags}" \
13736                                 && cf_fix_cppflags=yes
13737
13738                         if test "$cf_fix_cppflags" = yes ; then
13739
13740         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13741         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13742
13743                                 continue
13744                         elif test "${cf_tst_cflags}" = "\"'" ; then
13745
13746         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13747         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13748
13749                                 continue
13750                         fi
13751                         ;;
13752                 esac
13753                 case "$CPPFLAGS" in
13754                 (*$cf_add_cflags)
13755                         ;;
13756                 (*)
13757                         case "$cf_add_cflags" in
13758                         (-D*)
13759                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13760
13761 CPPFLAGS=`echo "$CPPFLAGS" | \
13762         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13763                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13764
13765                                 ;;
13766                         esac
13767
13768         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13769         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13770
13771                         ;;
13772                 esac
13773                 ;;
13774         (*)
13775
13776         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13777         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13778
13779                 ;;
13780         esac
13781         ;;
13782 (yes)
13783
13784         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13785         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13786
13787         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13788
13789         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13790                 && test -z "${cf_tst_cflags}" \
13791                 && cf_fix_cppflags=no
13792         ;;
13793 esac
13794 done
13795
13796 if test -n "$cf_new_cflags" ; then
13797
13798         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13799         CFLAGS="${CFLAGS}$cf_new_cflags"
13800
13801 fi
13802
13803 if test -n "$cf_new_cppflags" ; then
13804
13805         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13806         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13807
13808 fi
13809
13810 if test -n "$cf_new_extra_cppflags" ; then
13811
13812         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13813         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13814
13815 fi
13816
13817 cf_add_libs="$LIBS"
13818 # reverse order
13819 cf_add_0lib=
13820 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13821 # filter duplicates
13822 for cf_add_1lib in $cf_add_0lib; do
13823         for cf_add_2lib in $cf_add_libs; do
13824                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13825                         cf_add_1lib=
13826                         break
13827                 fi
13828         done
13829         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13830 done
13831 LIBS="$cf_add_libs"
13832
13833         :
13834 else
13835         cf_pkgconfig_incs=
13836         cf_pkgconfig_libs=
13837         { echo "$as_me:13837: WARNING: unable to find X11 library" >&5
13838 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13839 fi
13840
13841 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
13842         test -n "$verbose" && echo "    found package ice" 1>&6
13843
13844 echo "${as_me:-configure}:13844: testing found package ice ..." 1>&5
13845
13846         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
13847         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
13848         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13849
13850 echo "${as_me:-configure}:13850: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13851
13852         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13853
13854 echo "${as_me:-configure}:13854: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13855
13856 cf_fix_cppflags=no
13857 cf_new_cflags=
13858 cf_new_cppflags=
13859 cf_new_extra_cppflags=
13860
13861 for cf_add_cflags in $cf_pkgconfig_incs
13862 do
13863 case "$cf_fix_cppflags" in
13864 (no)
13865         case "$cf_add_cflags" in
13866         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13867                 case "$cf_add_cflags" in
13868                 (-D*)
13869                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13870
13871                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13872                                 && test -z "${cf_tst_cflags}" \
13873                                 && cf_fix_cppflags=yes
13874
13875                         if test "$cf_fix_cppflags" = yes ; then
13876
13877         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13878         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13879
13880                                 continue
13881                         elif test "${cf_tst_cflags}" = "\"'" ; then
13882
13883         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13884         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13885
13886                                 continue
13887                         fi
13888                         ;;
13889                 esac
13890                 case "$CPPFLAGS" in
13891                 (*$cf_add_cflags)
13892                         ;;
13893                 (*)
13894                         case "$cf_add_cflags" in
13895                         (-D*)
13896                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13897
13898 CPPFLAGS=`echo "$CPPFLAGS" | \
13899         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13900                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13901
13902                                 ;;
13903                         esac
13904
13905         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13906         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13907
13908                         ;;
13909                 esac
13910                 ;;
13911         (*)
13912
13913         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13914         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13915
13916                 ;;
13917         esac
13918         ;;
13919 (yes)
13920
13921         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13922         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13923
13924         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13925
13926         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13927                 && test -z "${cf_tst_cflags}" \
13928                 && cf_fix_cppflags=no
13929         ;;
13930 esac
13931 done
13932
13933 if test -n "$cf_new_cflags" ; then
13934
13935         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13936         CFLAGS="${CFLAGS}$cf_new_cflags"
13937
13938 fi
13939
13940 if test -n "$cf_new_cppflags" ; then
13941
13942         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13943         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13944
13945 fi
13946
13947 if test -n "$cf_new_extra_cppflags" ; then
13948
13949         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13950         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13951
13952 fi
13953
13954 cf_add_libs="$LIBS"
13955 # reverse order
13956 cf_add_0lib=
13957 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13958 # filter duplicates
13959 for cf_add_1lib in $cf_add_0lib; do
13960         for cf_add_2lib in $cf_add_libs; do
13961                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13962                         cf_add_1lib=
13963                         break
13964                 fi
13965         done
13966         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13967 done
13968 LIBS="$cf_add_libs"
13969
13970         :
13971 else
13972         cf_pkgconfig_incs=
13973         cf_pkgconfig_libs=
13974         { echo "$as_me:13974: WARNING: unable to find ICE library" >&5
13975 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13976 fi
13977
13978 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
13979         test -n "$verbose" && echo "    found package sm" 1>&6
13980
13981 echo "${as_me:-configure}:13981: testing found package sm ..." 1>&5
13982
13983         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
13984         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
13985         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13986
13987 echo "${as_me:-configure}:13987: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13988
13989         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13990
13991 echo "${as_me:-configure}:13991: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13992
13993 cf_fix_cppflags=no
13994 cf_new_cflags=
13995 cf_new_cppflags=
13996 cf_new_extra_cppflags=
13997
13998 for cf_add_cflags in $cf_pkgconfig_incs
13999 do
14000 case "$cf_fix_cppflags" in
14001 (no)
14002         case "$cf_add_cflags" in
14003         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14004                 case "$cf_add_cflags" in
14005                 (-D*)
14006                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14007
14008                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14009                                 && test -z "${cf_tst_cflags}" \
14010                                 && cf_fix_cppflags=yes
14011
14012                         if test "$cf_fix_cppflags" = yes ; then
14013
14014         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14015         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14016
14017                                 continue
14018                         elif test "${cf_tst_cflags}" = "\"'" ; then
14019
14020         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14021         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14022
14023                                 continue
14024                         fi
14025                         ;;
14026                 esac
14027                 case "$CPPFLAGS" in
14028                 (*$cf_add_cflags)
14029                         ;;
14030                 (*)
14031                         case "$cf_add_cflags" in
14032                         (-D*)
14033                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14034
14035 CPPFLAGS=`echo "$CPPFLAGS" | \
14036         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14037                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14038
14039                                 ;;
14040                         esac
14041
14042         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14043         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14044
14045                         ;;
14046                 esac
14047                 ;;
14048         (*)
14049
14050         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14051         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14052
14053                 ;;
14054         esac
14055         ;;
14056 (yes)
14057
14058         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14059         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14060
14061         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14062
14063         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14064                 && test -z "${cf_tst_cflags}" \
14065                 && cf_fix_cppflags=no
14066         ;;
14067 esac
14068 done
14069
14070 if test -n "$cf_new_cflags" ; then
14071
14072         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14073         CFLAGS="${CFLAGS}$cf_new_cflags"
14074
14075 fi
14076
14077 if test -n "$cf_new_cppflags" ; then
14078
14079         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14080         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14081
14082 fi
14083
14084 if test -n "$cf_new_extra_cppflags" ; then
14085
14086         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14087         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14088
14089 fi
14090
14091 cf_add_libs="$LIBS"
14092 # reverse order
14093 cf_add_0lib=
14094 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14095 # filter duplicates
14096 for cf_add_1lib in $cf_add_0lib; do
14097         for cf_add_2lib in $cf_add_libs; do
14098                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14099                         cf_add_1lib=
14100                         break
14101                 fi
14102         done
14103         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14104 done
14105 LIBS="$cf_add_libs"
14106
14107         :
14108 else
14109         cf_pkgconfig_incs=
14110         cf_pkgconfig_libs=
14111         { echo "$as_me:14111: WARNING: unable to find SM library" >&5
14112 echo "$as_me: WARNING: unable to find SM library" >&2;}
14113 fi
14114
14115 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14116         test -n "$verbose" && echo "    found package xt" 1>&6
14117
14118 echo "${as_me:-configure}:14118: testing found package xt ..." 1>&5
14119
14120         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14121         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14122         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14123
14124 echo "${as_me:-configure}:14124: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14125
14126         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14127
14128 echo "${as_me:-configure}:14128: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14129
14130 cf_fix_cppflags=no
14131 cf_new_cflags=
14132 cf_new_cppflags=
14133 cf_new_extra_cppflags=
14134
14135 for cf_add_cflags in $cf_pkgconfig_incs
14136 do
14137 case "$cf_fix_cppflags" in
14138 (no)
14139         case "$cf_add_cflags" in
14140         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14141                 case "$cf_add_cflags" in
14142                 (-D*)
14143                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14144
14145                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14146                                 && test -z "${cf_tst_cflags}" \
14147                                 && cf_fix_cppflags=yes
14148
14149                         if test "$cf_fix_cppflags" = yes ; then
14150
14151         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14152         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14153
14154                                 continue
14155                         elif test "${cf_tst_cflags}" = "\"'" ; then
14156
14157         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14158         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14159
14160                                 continue
14161                         fi
14162                         ;;
14163                 esac
14164                 case "$CPPFLAGS" in
14165                 (*$cf_add_cflags)
14166                         ;;
14167                 (*)
14168                         case "$cf_add_cflags" in
14169                         (-D*)
14170                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14171
14172 CPPFLAGS=`echo "$CPPFLAGS" | \
14173         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14174                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14175
14176                                 ;;
14177                         esac
14178
14179         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14180         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14181
14182                         ;;
14183                 esac
14184                 ;;
14185         (*)
14186
14187         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14188         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14189
14190                 ;;
14191         esac
14192         ;;
14193 (yes)
14194
14195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14197
14198         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14199
14200         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14201                 && test -z "${cf_tst_cflags}" \
14202                 && cf_fix_cppflags=no
14203         ;;
14204 esac
14205 done
14206
14207 if test -n "$cf_new_cflags" ; then
14208
14209         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14210         CFLAGS="${CFLAGS}$cf_new_cflags"
14211
14212 fi
14213
14214 if test -n "$cf_new_cppflags" ; then
14215
14216         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14217         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14218
14219 fi
14220
14221 if test -n "$cf_new_extra_cppflags" ; then
14222
14223         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14224         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14225
14226 fi
14227
14228 cf_add_libs="$LIBS"
14229 # reverse order
14230 cf_add_0lib=
14231 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14232 # filter duplicates
14233 for cf_add_1lib in $cf_add_0lib; do
14234         for cf_add_2lib in $cf_add_libs; do
14235                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14236                         cf_add_1lib=
14237                         break
14238                 fi
14239         done
14240         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14241 done
14242 LIBS="$cf_add_libs"
14243
14244         :
14245 else
14246         cf_pkgconfig_incs=
14247         cf_pkgconfig_libs=
14248         { echo "$as_me:14248: WARNING: unable to find Xt library" >&5
14249 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14250 fi
14251
14252 else
14253         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14254 fi
14255
14256 cf_have_X_LIBS=no
14257
14258 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14259         test -n "$verbose" && echo "    found package xt" 1>&6
14260
14261 echo "${as_me:-configure}:14261: testing found package xt ..." 1>&5
14262
14263         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14264         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14265         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14266
14267 echo "${as_me:-configure}:14267: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14268
14269         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14270
14271 echo "${as_me:-configure}:14271: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14272
14273 cf_fix_cppflags=no
14274 cf_new_cflags=
14275 cf_new_cppflags=
14276 cf_new_extra_cppflags=
14277
14278 for cf_add_cflags in $cf_pkgconfig_incs
14279 do
14280 case "$cf_fix_cppflags" in
14281 (no)
14282         case "$cf_add_cflags" in
14283         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14284                 case "$cf_add_cflags" in
14285                 (-D*)
14286                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14287
14288                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14289                                 && test -z "${cf_tst_cflags}" \
14290                                 && cf_fix_cppflags=yes
14291
14292                         if test "$cf_fix_cppflags" = yes ; then
14293
14294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14296
14297                                 continue
14298                         elif test "${cf_tst_cflags}" = "\"'" ; then
14299
14300         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14301         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14302
14303                                 continue
14304                         fi
14305                         ;;
14306                 esac
14307                 case "$CPPFLAGS" in
14308                 (*$cf_add_cflags)
14309                         ;;
14310                 (*)
14311                         case "$cf_add_cflags" in
14312                         (-D*)
14313                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14314
14315 CPPFLAGS=`echo "$CPPFLAGS" | \
14316         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14317                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14318
14319                                 ;;
14320                         esac
14321
14322         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14323         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14324
14325                         ;;
14326                 esac
14327                 ;;
14328         (*)
14329
14330         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14331         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14332
14333                 ;;
14334         esac
14335         ;;
14336 (yes)
14337
14338         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14339         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14340
14341         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14342
14343         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14344                 && test -z "${cf_tst_cflags}" \
14345                 && cf_fix_cppflags=no
14346         ;;
14347 esac
14348 done
14349
14350 if test -n "$cf_new_cflags" ; then
14351
14352         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14353         CFLAGS="${CFLAGS}$cf_new_cflags"
14354
14355 fi
14356
14357 if test -n "$cf_new_cppflags" ; then
14358
14359         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14360         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14361
14362 fi
14363
14364 if test -n "$cf_new_extra_cppflags" ; then
14365
14366         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14367         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14368
14369 fi
14370
14371 cf_add_libs="$LIBS"
14372 # reverse order
14373 cf_add_0lib=
14374 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14375 # filter duplicates
14376 for cf_add_1lib in $cf_add_0lib; do
14377         for cf_add_2lib in $cf_add_libs; do
14378                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14379                         cf_add_1lib=
14380                         break
14381                 fi
14382         done
14383         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14384 done
14385 LIBS="$cf_add_libs"
14386
14387         case "x$LIBS" in
14388         (*-lX11*)
14389                 ;;
14390         (*)
14391 # we have an "xt" package, but it may omit Xt's dependency on X11
14392 echo "$as_me:14392: checking for usable X dependency" >&5
14393 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14394 if test "${cf_cv_xt_x11_compat+set}" = set; then
14395   echo $ECHO_N "(cached) $ECHO_C" >&6
14396 else
14397
14398 cat >"conftest.$ac_ext" <<_ACEOF
14399 #line 14399 "configure"
14400 #include "confdefs.h"
14401
14402 #include <X11/Xlib.h>
14403
14404 int
14405 main (void)
14406 {
14407
14408         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14409         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14410         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14411         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14412
14413   ;
14414   return 0;
14415 }
14416 _ACEOF
14417 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14418 if { (eval echo "$as_me:14418: \"$ac_link\"") >&5
14419   (eval $ac_link) 2>&5
14420   ac_status=$?
14421   echo "$as_me:14421: \$? = $ac_status" >&5
14422   (exit "$ac_status"); } &&
14423          { ac_try='test -s "conftest$ac_exeext"'
14424   { (eval echo "$as_me:14424: \"$ac_try\"") >&5
14425   (eval $ac_try) 2>&5
14426   ac_status=$?
14427   echo "$as_me:14427: \$? = $ac_status" >&5
14428   (exit "$ac_status"); }; }; then
14429   cf_cv_xt_x11_compat=yes
14430 else
14431   echo "$as_me: failed program was:" >&5
14432 cat "conftest.$ac_ext" >&5
14433 cf_cv_xt_x11_compat=no
14434 fi
14435 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14436 fi
14437 echo "$as_me:14437: result: $cf_cv_xt_x11_compat" >&5
14438 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14439                 if test "$cf_cv_xt_x11_compat" = no
14440                 then
14441                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14442
14443 echo "${as_me:-configure}:14443: testing work around broken X11 dependency ..." 1>&5
14444
14445                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14446
14447 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14448         test -n "$verbose" && echo "    found package x11" 1>&6
14449
14450 echo "${as_me:-configure}:14450: testing found package x11 ..." 1>&5
14451
14452         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14453         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14454         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14455
14456 echo "${as_me:-configure}:14456: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14457
14458         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14459
14460 echo "${as_me:-configure}:14460: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14461
14462 cf_fix_cppflags=no
14463 cf_new_cflags=
14464 cf_new_cppflags=
14465 cf_new_extra_cppflags=
14466
14467 for cf_add_cflags in $cf_pkgconfig_incs
14468 do
14469 case "$cf_fix_cppflags" in
14470 (no)
14471         case "$cf_add_cflags" in
14472         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14473                 case "$cf_add_cflags" in
14474                 (-D*)
14475                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14476
14477                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14478                                 && test -z "${cf_tst_cflags}" \
14479                                 && cf_fix_cppflags=yes
14480
14481                         if test "$cf_fix_cppflags" = yes ; then
14482
14483         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14484         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14485
14486                                 continue
14487                         elif test "${cf_tst_cflags}" = "\"'" ; then
14488
14489         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14490         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14491
14492                                 continue
14493                         fi
14494                         ;;
14495                 esac
14496                 case "$CPPFLAGS" in
14497                 (*$cf_add_cflags)
14498                         ;;
14499                 (*)
14500                         case "$cf_add_cflags" in
14501                         (-D*)
14502                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14503
14504 CPPFLAGS=`echo "$CPPFLAGS" | \
14505         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14506                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14507
14508                                 ;;
14509                         esac
14510
14511         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14512         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14513
14514                         ;;
14515                 esac
14516                 ;;
14517         (*)
14518
14519         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14520         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14521
14522                 ;;
14523         esac
14524         ;;
14525 (yes)
14526
14527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14529
14530         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14531
14532         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14533                 && test -z "${cf_tst_cflags}" \
14534                 && cf_fix_cppflags=no
14535         ;;
14536 esac
14537 done
14538
14539 if test -n "$cf_new_cflags" ; then
14540
14541         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14542         CFLAGS="${CFLAGS}$cf_new_cflags"
14543
14544 fi
14545
14546 if test -n "$cf_new_cppflags" ; then
14547
14548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14549         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14550
14551 fi
14552
14553 if test -n "$cf_new_extra_cppflags" ; then
14554
14555         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14556         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14557
14558 fi
14559
14560 cf_add_libs="$LIBS"
14561 # reverse order
14562 cf_add_0lib=
14563 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14564 # filter duplicates
14565 for cf_add_1lib in $cf_add_0lib; do
14566         for cf_add_2lib in $cf_add_libs; do
14567                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14568                         cf_add_1lib=
14569                         break
14570                 fi
14571         done
14572         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14573 done
14574 LIBS="$cf_add_libs"
14575
14576         :
14577 else
14578         cf_pkgconfig_incs=
14579         cf_pkgconfig_libs=
14580
14581 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14582
14583 echo "${as_me:-configure}:14583: testing ...before $LIBS ..." 1>&5
14584
14585 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14586 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14587
14588 echo "${as_me:-configure}:14588: testing ...after  $LIBS ..." 1>&5
14589
14590 fi
14591
14592                 fi
14593                 ;;
14594         esac
14595
14596 echo "$as_me:14596: checking for usable X Toolkit package" >&5
14597 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14598 if test "${cf_cv_xt_ice_compat+set}" = set; then
14599   echo $ECHO_N "(cached) $ECHO_C" >&6
14600 else
14601
14602 cat >"conftest.$ac_ext" <<_ACEOF
14603 #line 14603 "configure"
14604 #include "confdefs.h"
14605
14606 #include <X11/Shell.h>
14607
14608 int
14609 main (void)
14610 {
14611 int num = IceConnectionNumber(0); (void) num
14612
14613   ;
14614   return 0;
14615 }
14616 _ACEOF
14617 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14618 if { (eval echo "$as_me:14618: \"$ac_link\"") >&5
14619   (eval $ac_link) 2>&5
14620   ac_status=$?
14621   echo "$as_me:14621: \$? = $ac_status" >&5
14622   (exit "$ac_status"); } &&
14623          { ac_try='test -s "conftest$ac_exeext"'
14624   { (eval echo "$as_me:14624: \"$ac_try\"") >&5
14625   (eval $ac_try) 2>&5
14626   ac_status=$?
14627   echo "$as_me:14627: \$? = $ac_status" >&5
14628   (exit "$ac_status"); }; }; then
14629   cf_cv_xt_ice_compat=yes
14630 else
14631   echo "$as_me: failed program was:" >&5
14632 cat "conftest.$ac_ext" >&5
14633 cf_cv_xt_ice_compat=no
14634 fi
14635 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14636 fi
14637 echo "$as_me:14637: result: $cf_cv_xt_ice_compat" >&5
14638 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14639
14640         if test "$cf_cv_xt_ice_compat" = no
14641         then
14642                 # workaround for broken ".pc" files used for X Toolkit.
14643                 case "x$X_PRE_LIBS" in
14644                 (*-lICE*)
14645                         case "x$LIBS" in
14646                         (*-lICE*)
14647                                 ;;
14648                         (*)
14649                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14650
14651 echo "${as_me:-configure}:14651: testing work around broken ICE dependency ..." 1>&5
14652
14653 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14654         test -n "$verbose" && echo "    found package ice" 1>&6
14655
14656 echo "${as_me:-configure}:14656: testing found package ice ..." 1>&5
14657
14658         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14659         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14660         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14661
14662 echo "${as_me:-configure}:14662: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14663
14664         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14665
14666 echo "${as_me:-configure}:14666: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14667
14668 cf_fix_cppflags=no
14669 cf_new_cflags=
14670 cf_new_cppflags=
14671 cf_new_extra_cppflags=
14672
14673 for cf_add_cflags in $cf_pkgconfig_incs
14674 do
14675 case "$cf_fix_cppflags" in
14676 (no)
14677         case "$cf_add_cflags" in
14678         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14679                 case "$cf_add_cflags" in
14680                 (-D*)
14681                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14682
14683                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14684                                 && test -z "${cf_tst_cflags}" \
14685                                 && cf_fix_cppflags=yes
14686
14687                         if test "$cf_fix_cppflags" = yes ; then
14688
14689         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14690         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14691
14692                                 continue
14693                         elif test "${cf_tst_cflags}" = "\"'" ; then
14694
14695         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14696         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14697
14698                                 continue
14699                         fi
14700                         ;;
14701                 esac
14702                 case "$CPPFLAGS" in
14703                 (*$cf_add_cflags)
14704                         ;;
14705                 (*)
14706                         case "$cf_add_cflags" in
14707                         (-D*)
14708                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14709
14710 CPPFLAGS=`echo "$CPPFLAGS" | \
14711         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14712                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14713
14714                                 ;;
14715                         esac
14716
14717         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14718         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14719
14720                         ;;
14721                 esac
14722                 ;;
14723         (*)
14724
14725         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14726         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14727
14728                 ;;
14729         esac
14730         ;;
14731 (yes)
14732
14733         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14734         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14735
14736         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14737
14738         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14739                 && test -z "${cf_tst_cflags}" \
14740                 && cf_fix_cppflags=no
14741         ;;
14742 esac
14743 done
14744
14745 if test -n "$cf_new_cflags" ; then
14746
14747         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14748         CFLAGS="${CFLAGS}$cf_new_cflags"
14749
14750 fi
14751
14752 if test -n "$cf_new_cppflags" ; then
14753
14754         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14755         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14756
14757 fi
14758
14759 if test -n "$cf_new_extra_cppflags" ; then
14760
14761         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14762         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14763
14764 fi
14765
14766 cf_add_libs="$LIBS"
14767 # reverse order
14768 cf_add_0lib=
14769 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14770 # filter duplicates
14771 for cf_add_1lib in $cf_add_0lib; do
14772         for cf_add_2lib in $cf_add_libs; do
14773                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14774                         cf_add_1lib=
14775                         break
14776                 fi
14777         done
14778         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14779 done
14780 LIBS="$cf_add_libs"
14781
14782 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14783         test -n "$verbose" && echo "    found package sm" 1>&6
14784
14785 echo "${as_me:-configure}:14785: testing found package sm ..." 1>&5
14786
14787         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14788         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14789         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14790
14791 echo "${as_me:-configure}:14791: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14792
14793         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14794
14795 echo "${as_me:-configure}:14795: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14796
14797 cf_fix_cppflags=no
14798 cf_new_cflags=
14799 cf_new_cppflags=
14800 cf_new_extra_cppflags=
14801
14802 for cf_add_cflags in $cf_pkgconfig_incs
14803 do
14804 case "$cf_fix_cppflags" in
14805 (no)
14806         case "$cf_add_cflags" in
14807         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14808                 case "$cf_add_cflags" in
14809                 (-D*)
14810                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14811
14812                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14813                                 && test -z "${cf_tst_cflags}" \
14814                                 && cf_fix_cppflags=yes
14815
14816                         if test "$cf_fix_cppflags" = yes ; then
14817
14818         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14819         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14820
14821                                 continue
14822                         elif test "${cf_tst_cflags}" = "\"'" ; then
14823
14824         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14825         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14826
14827                                 continue
14828                         fi
14829                         ;;
14830                 esac
14831                 case "$CPPFLAGS" in
14832                 (*$cf_add_cflags)
14833                         ;;
14834                 (*)
14835                         case "$cf_add_cflags" in
14836                         (-D*)
14837                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14838
14839 CPPFLAGS=`echo "$CPPFLAGS" | \
14840         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14841                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14842
14843                                 ;;
14844                         esac
14845
14846         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14847         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14848
14849                         ;;
14850                 esac
14851                 ;;
14852         (*)
14853
14854         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14855         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14856
14857                 ;;
14858         esac
14859         ;;
14860 (yes)
14861
14862         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14863         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14864
14865         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14866
14867         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14868                 && test -z "${cf_tst_cflags}" \
14869                 && cf_fix_cppflags=no
14870         ;;
14871 esac
14872 done
14873
14874 if test -n "$cf_new_cflags" ; then
14875
14876         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14877         CFLAGS="${CFLAGS}$cf_new_cflags"
14878
14879 fi
14880
14881 if test -n "$cf_new_cppflags" ; then
14882
14883         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14884         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14885
14886 fi
14887
14888 if test -n "$cf_new_extra_cppflags" ; then
14889
14890         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14891         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14892
14893 fi
14894
14895 cf_add_libs="$LIBS"
14896 # reverse order
14897 cf_add_0lib=
14898 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14899 # filter duplicates
14900 for cf_add_1lib in $cf_add_0lib; do
14901         for cf_add_2lib in $cf_add_libs; do
14902                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14903                         cf_add_1lib=
14904                         break
14905                 fi
14906         done
14907         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14908 done
14909 LIBS="$cf_add_libs"
14910
14911         :
14912 else
14913         cf_pkgconfig_incs=
14914         cf_pkgconfig_libs=
14915         :
14916 fi
14917
14918 else
14919         cf_pkgconfig_incs=
14920         cf_pkgconfig_libs=
14921
14922 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14923
14924 echo "${as_me:-configure}:14924: testing ...before $LIBS ..." 1>&5
14925
14926 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14927 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14928
14929 echo "${as_me:-configure}:14929: testing ...after  $LIBS ..." 1>&5
14930
14931 fi
14932
14933                                 ;;
14934                         esac
14935                         ;;
14936                 esac
14937         fi
14938
14939         cf_have_X_LIBS=yes
14940
14941 else
14942         cf_pkgconfig_incs=
14943         cf_pkgconfig_libs=
14944
14945         LDFLAGS="$X_LIBS $LDFLAGS"
14946
14947 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14948
14949 echo "${as_me:-configure}:14949: testing checking additions to CFLAGS ..." 1>&5
14950
14951 cf_check_cflags="$CFLAGS"
14952 cf_check_cppflags="$CPPFLAGS"
14953
14954 cf_fix_cppflags=no
14955 cf_new_cflags=
14956 cf_new_cppflags=
14957 cf_new_extra_cppflags=
14958
14959 for cf_add_cflags in $X_CFLAGS
14960 do
14961 case "$cf_fix_cppflags" in
14962 (no)
14963         case "$cf_add_cflags" in
14964         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14965                 case "$cf_add_cflags" in
14966                 (-D*)
14967                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14968
14969                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14970                                 && test -z "${cf_tst_cflags}" \
14971                                 && cf_fix_cppflags=yes
14972
14973                         if test "$cf_fix_cppflags" = yes ; then
14974
14975         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14976         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14977
14978                                 continue
14979                         elif test "${cf_tst_cflags}" = "\"'" ; then
14980
14981         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14982         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14983
14984                                 continue
14985                         fi
14986                         ;;
14987                 esac
14988                 case "$CPPFLAGS" in
14989                 (*$cf_add_cflags)
14990                         ;;
14991                 (*)
14992                         case "$cf_add_cflags" in
14993                         (-D*)
14994                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14995
14996 CPPFLAGS=`echo "$CPPFLAGS" | \
14997         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14998                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14999
15000                                 ;;
15001                         esac
15002
15003         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15004         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15005
15006                         ;;
15007                 esac
15008                 ;;
15009         (*)
15010
15011         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15012         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15013
15014                 ;;
15015         esac
15016         ;;
15017 (yes)
15018
15019         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15020         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15021
15022         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15023
15024         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15025                 && test -z "${cf_tst_cflags}" \
15026                 && cf_fix_cppflags=no
15027         ;;
15028 esac
15029 done
15030
15031 if test -n "$cf_new_cflags" ; then
15032         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15033
15034 echo "${as_me:-configure}:15034: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15035
15036         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15037         CFLAGS="${CFLAGS}$cf_new_cflags"
15038
15039 fi
15040
15041 if test -n "$cf_new_cppflags" ; then
15042         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15043
15044 echo "${as_me:-configure}:15044: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15045
15046         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15047         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15048
15049 fi
15050
15051 if test -n "$cf_new_extra_cppflags" ; then
15052         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15053
15054 echo "${as_me:-configure}:15054: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15055
15056         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15057         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15058
15059 fi
15060
15061 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15062 cat >"conftest.$ac_ext" <<_ACEOF
15063 #line 15063 "configure"
15064 #include "confdefs.h"
15065 #include <stdio.h>
15066 int
15067 main (void)
15068 {
15069 printf("Hello world");
15070   ;
15071   return 0;
15072 }
15073 _ACEOF
15074 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15075 if { (eval echo "$as_me:15075: \"$ac_link\"") >&5
15076   (eval $ac_link) 2>&5
15077   ac_status=$?
15078   echo "$as_me:15078: \$? = $ac_status" >&5
15079   (exit "$ac_status"); } &&
15080          { ac_try='test -s "conftest$ac_exeext"'
15081   { (eval echo "$as_me:15081: \"$ac_try\"") >&5
15082   (eval $ac_try) 2>&5
15083   ac_status=$?
15084   echo "$as_me:15084: \$? = $ac_status" >&5
15085   (exit "$ac_status"); }; }; then
15086   :
15087 else
15088   echo "$as_me: failed program was:" >&5
15089 cat "conftest.$ac_ext" >&5
15090 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15091
15092 echo "${as_me:-configure}:15092: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15093
15094          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15095                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15096
15097 echo "${as_me:-configure}:15097: testing but keeping change to \$CPPFLAGS ..." 1>&5
15098
15099          fi
15100          CFLAGS="$cf_check_cflags"
15101 fi
15102 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15103 fi
15104
15105         echo "$as_me:15105: checking for XOpenDisplay" >&5
15106 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15107 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15108   echo $ECHO_N "(cached) $ECHO_C" >&6
15109 else
15110   cat >"conftest.$ac_ext" <<_ACEOF
15111 #line 15111 "configure"
15112 #include "confdefs.h"
15113 #define XOpenDisplay autoconf_temporary
15114 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15115 #undef XOpenDisplay
15116
15117 #ifdef __cplusplus
15118 extern "C"
15119 #endif
15120
15121 /* We use char because int might match the return type of a gcc2
15122    builtin and then its argument prototype would still apply.  */
15123 char XOpenDisplay (void);
15124
15125 int
15126 main (void)
15127 {
15128
15129 /* The GNU C library defines stubs for functions which it implements
15130     to always fail with ENOSYS.  Some functions are actually named
15131     something starting with __ and the normal name is an alias.  */
15132 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15133 #error found stub for XOpenDisplay
15134 #endif
15135
15136         return XOpenDisplay ();
15137   ;
15138   return 0;
15139 }
15140 _ACEOF
15141 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15142 if { (eval echo "$as_me:15142: \"$ac_link\"") >&5
15143   (eval $ac_link) 2>&5
15144   ac_status=$?
15145   echo "$as_me:15145: \$? = $ac_status" >&5
15146   (exit "$ac_status"); } &&
15147          { ac_try='test -s "conftest$ac_exeext"'
15148   { (eval echo "$as_me:15148: \"$ac_try\"") >&5
15149   (eval $ac_try) 2>&5
15150   ac_status=$?
15151   echo "$as_me:15151: \$? = $ac_status" >&5
15152   (exit "$ac_status"); }; }; then
15153   ac_cv_func_XOpenDisplay=yes
15154 else
15155   echo "$as_me: failed program was:" >&5
15156 cat "conftest.$ac_ext" >&5
15157 ac_cv_func_XOpenDisplay=no
15158 fi
15159 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15160 fi
15161 echo "$as_me:15161: result: $ac_cv_func_XOpenDisplay" >&5
15162 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15163 if test "$ac_cv_func_XOpenDisplay" = yes; then
15164   :
15165 else
15166
15167         echo "$as_me:15167: checking for XOpenDisplay in -lX11" >&5
15168 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15169 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15170   echo $ECHO_N "(cached) $ECHO_C" >&6
15171 else
15172   ac_check_lib_save_LIBS=$LIBS
15173 LIBS="-lX11  $LIBS"
15174 cat >"conftest.$ac_ext" <<_ACEOF
15175 #line 15175 "configure"
15176 #include "confdefs.h"
15177
15178 /* Override any gcc2 internal prototype to avoid an error.  */
15179 #ifdef __cplusplus
15180 extern "C"
15181 #endif
15182 /* We use char because int might match the return type of a gcc2
15183    builtin and then its argument prototype would still apply.  */
15184 char XOpenDisplay ();
15185 int
15186 main (void)
15187 {
15188 XOpenDisplay ();
15189   ;
15190   return 0;
15191 }
15192 _ACEOF
15193 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15194 if { (eval echo "$as_me:15194: \"$ac_link\"") >&5
15195   (eval $ac_link) 2>&5
15196   ac_status=$?
15197   echo "$as_me:15197: \$? = $ac_status" >&5
15198   (exit "$ac_status"); } &&
15199          { ac_try='test -s "conftest$ac_exeext"'
15200   { (eval echo "$as_me:15200: \"$ac_try\"") >&5
15201   (eval $ac_try) 2>&5
15202   ac_status=$?
15203   echo "$as_me:15203: \$? = $ac_status" >&5
15204   (exit "$ac_status"); }; }; then
15205   ac_cv_lib_X11_XOpenDisplay=yes
15206 else
15207   echo "$as_me: failed program was:" >&5
15208 cat "conftest.$ac_ext" >&5
15209 ac_cv_lib_X11_XOpenDisplay=no
15210 fi
15211 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15212 LIBS=$ac_check_lib_save_LIBS
15213 fi
15214 echo "$as_me:15214: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15215 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15216 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15217
15218 cf_add_libs="$LIBS"
15219 # reverse order
15220 cf_add_0lib=
15221 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15222 # filter duplicates
15223 for cf_add_1lib in $cf_add_0lib; do
15224         for cf_add_2lib in $cf_add_libs; do
15225                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15226                         cf_add_1lib=
15227                         break
15228                 fi
15229         done
15230         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15231 done
15232 LIBS="$cf_add_libs"
15233
15234 fi
15235
15236 fi
15237
15238         echo "$as_me:15238: checking for XtAppInitialize" >&5
15239 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15240 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15241   echo $ECHO_N "(cached) $ECHO_C" >&6
15242 else
15243   cat >"conftest.$ac_ext" <<_ACEOF
15244 #line 15244 "configure"
15245 #include "confdefs.h"
15246 #define XtAppInitialize autoconf_temporary
15247 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15248 #undef XtAppInitialize
15249
15250 #ifdef __cplusplus
15251 extern "C"
15252 #endif
15253
15254 /* We use char because int might match the return type of a gcc2
15255    builtin and then its argument prototype would still apply.  */
15256 char XtAppInitialize (void);
15257
15258 int
15259 main (void)
15260 {
15261
15262 /* The GNU C library defines stubs for functions which it implements
15263     to always fail with ENOSYS.  Some functions are actually named
15264     something starting with __ and the normal name is an alias.  */
15265 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15266 #error found stub for XtAppInitialize
15267 #endif
15268
15269         return XtAppInitialize ();
15270   ;
15271   return 0;
15272 }
15273 _ACEOF
15274 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15275 if { (eval echo "$as_me:15275: \"$ac_link\"") >&5
15276   (eval $ac_link) 2>&5
15277   ac_status=$?
15278   echo "$as_me:15278: \$? = $ac_status" >&5
15279   (exit "$ac_status"); } &&
15280          { ac_try='test -s "conftest$ac_exeext"'
15281   { (eval echo "$as_me:15281: \"$ac_try\"") >&5
15282   (eval $ac_try) 2>&5
15283   ac_status=$?
15284   echo "$as_me:15284: \$? = $ac_status" >&5
15285   (exit "$ac_status"); }; }; then
15286   ac_cv_func_XtAppInitialize=yes
15287 else
15288   echo "$as_me: failed program was:" >&5
15289 cat "conftest.$ac_ext" >&5
15290 ac_cv_func_XtAppInitialize=no
15291 fi
15292 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15293 fi
15294 echo "$as_me:15294: result: $ac_cv_func_XtAppInitialize" >&5
15295 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15296 if test "$ac_cv_func_XtAppInitialize" = yes; then
15297   :
15298 else
15299
15300         echo "$as_me:15300: checking for XtAppInitialize in -lXt" >&5
15301 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15302 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15303   echo $ECHO_N "(cached) $ECHO_C" >&6
15304 else
15305   ac_check_lib_save_LIBS=$LIBS
15306 LIBS="-lXt  $LIBS"
15307 cat >"conftest.$ac_ext" <<_ACEOF
15308 #line 15308 "configure"
15309 #include "confdefs.h"
15310
15311 /* Override any gcc2 internal prototype to avoid an error.  */
15312 #ifdef __cplusplus
15313 extern "C"
15314 #endif
15315 /* We use char because int might match the return type of a gcc2
15316    builtin and then its argument prototype would still apply.  */
15317 char XtAppInitialize ();
15318 int
15319 main (void)
15320 {
15321 XtAppInitialize ();
15322   ;
15323   return 0;
15324 }
15325 _ACEOF
15326 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15327 if { (eval echo "$as_me:15327: \"$ac_link\"") >&5
15328   (eval $ac_link) 2>&5
15329   ac_status=$?
15330   echo "$as_me:15330: \$? = $ac_status" >&5
15331   (exit "$ac_status"); } &&
15332          { ac_try='test -s "conftest$ac_exeext"'
15333   { (eval echo "$as_me:15333: \"$ac_try\"") >&5
15334   (eval $ac_try) 2>&5
15335   ac_status=$?
15336   echo "$as_me:15336: \$? = $ac_status" >&5
15337   (exit "$ac_status"); }; }; then
15338   ac_cv_lib_Xt_XtAppInitialize=yes
15339 else
15340   echo "$as_me: failed program was:" >&5
15341 cat "conftest.$ac_ext" >&5
15342 ac_cv_lib_Xt_XtAppInitialize=no
15343 fi
15344 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15345 LIBS=$ac_check_lib_save_LIBS
15346 fi
15347 echo "$as_me:15347: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15348 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15349 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15350
15351 cat >>confdefs.h <<\EOF
15352 #define HAVE_LIBXT 1
15353 EOF
15354
15355                  cf_have_X_LIBS=Xt
15356                  LIBS="-lXt $LIBS"
15357 fi
15358
15359 fi
15360
15361 fi
15362
15363 if test "$cf_have_X_LIBS" = no ; then
15364         { echo "$as_me:15364: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15365 test program.  You will have to check and add the proper libraries by hand
15366 to makefile." >&5
15367 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15368 test program.  You will have to check and add the proper libraries by hand
15369 to makefile." >&2;}
15370 fi
15371
15372 cf_x_athena_root=$cf_x_athena
15373 cf_x_athena_inc=""
15374
15375 for cf_path in default \
15376         /usr/contrib/X11R6 \
15377         /usr/contrib/X11R5 \
15378         /usr/lib/X11R5 \
15379         /usr/local
15380 do
15381         if test -z "$cf_x_athena_inc" ; then
15382
15383 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15384 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15385 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15386 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15387 for cf_X_CFLAGS in $X_CFLAGS
15388 do
15389         case "x$cf_X_CFLAGS" in
15390         x-[IUD]*)
15391                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15392                 ;;
15393         *)
15394                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15395                 ;;
15396         esac
15397 done
15398
15399                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15400                 if test "$cf_path" != default ; then
15401
15402         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15403         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15404
15405                         echo "$as_me:15405: checking for $cf_test in $cf_path" >&5
15406 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15407                 else
15408                         echo "$as_me:15408: checking for $cf_test" >&5
15409 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15410                 fi
15411                 cat >"conftest.$ac_ext" <<_ACEOF
15412 #line 15412 "configure"
15413 #include "confdefs.h"
15414
15415 #include <X11/Intrinsic.h>
15416 #include <$cf_test>
15417 int
15418 main (void)
15419 {
15420
15421   ;
15422   return 0;
15423 }
15424 _ACEOF
15425 rm -f "conftest.$ac_objext"
15426 if { (eval echo "$as_me:15426: \"$ac_compile\"") >&5
15427   (eval $ac_compile) 2>&5
15428   ac_status=$?
15429   echo "$as_me:15429: \$? = $ac_status" >&5
15430   (exit "$ac_status"); } &&
15431          { ac_try='test -s "conftest.$ac_objext"'
15432   { (eval echo "$as_me:15432: \"$ac_try\"") >&5
15433   (eval $ac_try) 2>&5
15434   ac_status=$?
15435   echo "$as_me:15435: \$? = $ac_status" >&5
15436   (exit "$ac_status"); }; }; then
15437   cf_result=yes
15438 else
15439   echo "$as_me: failed program was:" >&5
15440 cat "conftest.$ac_ext" >&5
15441 cf_result=no
15442 fi
15443 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15444                 echo "$as_me:15444: result: $cf_result" >&5
15445 echo "${ECHO_T}$cf_result" >&6
15446
15447 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15448 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15449 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15450
15451                 if test "$cf_result" = yes ; then
15452                         test "$cf_path"  = default && cf_x_athena_inc=default
15453                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15454                         break
15455                 fi
15456         fi
15457 done
15458
15459 if test -z "$cf_x_athena_inc" ; then
15460         { echo "$as_me:15460: WARNING: Unable to find Athena header files" >&5
15461 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15462 elif test "$cf_x_athena_inc" != default ; then
15463
15464         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15465         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15466
15467 fi
15468
15469 cf_x_athena_root=$cf_x_athena
15470 cf_x_athena_lib=""
15471
15472 for cf_path in default \
15473         /usr/contrib/X11R6 \
15474         /usr/contrib/X11R5 \
15475         /usr/lib/X11R5 \
15476         /usr/local
15477 do
15478         for cf_lib in \
15479                 ${cf_x_athena_root} \
15480                 ${cf_x_athena_root}7 \
15481                 ${cf_x_athena_root}6
15482         do
15483         for cf_libs in \
15484                 "-l$cf_lib -lXmu" \
15485                 "-l$cf_lib -lXpm -lXmu" \
15486                 "-l${cf_lib}_s -lXmu_s"
15487         do
15488                 test -n "$cf_x_athena_lib" && break
15489
15490 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15491 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15492 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15493 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15494 for cf_X_CFLAGS in $X_CFLAGS
15495 do
15496         case "x$cf_X_CFLAGS" in
15497         x-[IUD]*)
15498                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15499                 ;;
15500         *)
15501                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15502                 ;;
15503         esac
15504 done
15505
15506                 cf_test=XawSimpleMenuAddGlobalActions
15507                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15508
15509 cf_add_libs="$LIBS"
15510 # reverse order
15511 cf_add_0lib=
15512 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15513 # filter duplicates
15514 for cf_add_1lib in $cf_add_0lib; do
15515         for cf_add_2lib in $cf_add_libs; do
15516                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15517                         cf_add_1lib=
15518                         break
15519                 fi
15520         done
15521         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15522 done
15523 LIBS="$cf_add_libs"
15524
15525                 echo "$as_me:15525: checking for $cf_test in $cf_libs" >&5
15526 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15527                 cat >"conftest.$ac_ext" <<_ACEOF
15528 #line 15528 "configure"
15529 #include "confdefs.h"
15530
15531 #include <X11/Intrinsic.h>
15532 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15533
15534 int
15535 main (void)
15536 {
15537
15538 $cf_test((XtAppContext) 0)
15539   ;
15540   return 0;
15541 }
15542 _ACEOF
15543 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15544 if { (eval echo "$as_me:15544: \"$ac_link\"") >&5
15545   (eval $ac_link) 2>&5
15546   ac_status=$?
15547   echo "$as_me:15547: \$? = $ac_status" >&5
15548   (exit "$ac_status"); } &&
15549          { ac_try='test -s "conftest$ac_exeext"'
15550   { (eval echo "$as_me:15550: \"$ac_try\"") >&5
15551   (eval $ac_try) 2>&5
15552   ac_status=$?
15553   echo "$as_me:15553: \$? = $ac_status" >&5
15554   (exit "$ac_status"); }; }; then
15555   cf_result=yes
15556 else
15557   echo "$as_me: failed program was:" >&5
15558 cat "conftest.$ac_ext" >&5
15559 cf_result=no
15560 fi
15561 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15562                 echo "$as_me:15562: result: $cf_result" >&5
15563 echo "${ECHO_T}$cf_result" >&6
15564
15565 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15566 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15567 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15568
15569                 if test "$cf_result" = yes ; then
15570                         cf_x_athena_lib="$cf_libs"
15571                         break
15572                 fi
15573         done # cf_libs
15574                 test -n "$cf_x_athena_lib" && break
15575         done # cf_lib
15576 done
15577
15578 if test -z "$cf_x_athena_lib" ; then
15579         { { echo "$as_me:15579: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15580 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15581    { (exit 1); exit 1; }; }
15582 fi
15583
15584 cf_add_libs="$LIBS"
15585 # reverse order
15586 cf_add_0lib=
15587 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15588 # filter duplicates
15589 for cf_add_1lib in $cf_add_0lib; do
15590         for cf_add_2lib in $cf_add_libs; do
15591                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15592                         cf_add_1lib=
15593                         break
15594                 fi
15595         done
15596         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15597 done
15598 LIBS="$cf_add_libs"
15599
15600 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15601
15602 cat >>confdefs.h <<EOF
15603 #define $cf_x_athena_LIBS 1
15604 EOF
15605
15606 fi
15607
15608 if test -n "$ac_tool_prefix"; then
15609   for ac_prog in xcurses-config
15610   do
15611     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15612 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15613 echo "$as_me:15613: checking for $ac_word" >&5
15614 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15615 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15616   echo $ECHO_N "(cached) $ECHO_C" >&6
15617 else
15618   if test -n "$XCURSES_CONFIG"; then
15619   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15620 else
15621   ac_save_IFS=$IFS; IFS=$ac_path_separator
15622 ac_dummy="$PATH"
15623 for ac_dir in $ac_dummy; do
15624   IFS=$ac_save_IFS
15625   test -z "$ac_dir" && ac_dir=.
15626   $as_executable_p "$ac_dir/$ac_word" || continue
15627 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15628 echo "$as_me:15628: found $ac_dir/$ac_word" >&5
15629 break
15630 done
15631
15632 fi
15633 fi
15634 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15635 if test -n "$XCURSES_CONFIG"; then
15636   echo "$as_me:15636: result: $XCURSES_CONFIG" >&5
15637 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15638 else
15639   echo "$as_me:15639: result: no" >&5
15640 echo "${ECHO_T}no" >&6
15641 fi
15642
15643     test -n "$XCURSES_CONFIG" && break
15644   done
15645 fi
15646 if test -z "$XCURSES_CONFIG"; then
15647   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15648   for ac_prog in xcurses-config
15649 do
15650   # Extract the first word of "$ac_prog", so it can be a program name with args.
15651 set dummy $ac_prog; ac_word=$2
15652 echo "$as_me:15652: checking for $ac_word" >&5
15653 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15654 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15655   echo $ECHO_N "(cached) $ECHO_C" >&6
15656 else
15657   if test -n "$ac_ct_XCURSES_CONFIG"; then
15658   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15659 else
15660   ac_save_IFS=$IFS; IFS=$ac_path_separator
15661 ac_dummy="$PATH"
15662 for ac_dir in $ac_dummy; do
15663   IFS=$ac_save_IFS
15664   test -z "$ac_dir" && ac_dir=.
15665   $as_executable_p "$ac_dir/$ac_word" || continue
15666 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15667 echo "$as_me:15667: found $ac_dir/$ac_word" >&5
15668 break
15669 done
15670
15671 fi
15672 fi
15673 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15674 if test -n "$ac_ct_XCURSES_CONFIG"; then
15675   echo "$as_me:15675: result: $ac_ct_XCURSES_CONFIG" >&5
15676 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15677 else
15678   echo "$as_me:15678: result: no" >&5
15679 echo "${ECHO_T}no" >&6
15680 fi
15681
15682   test -n "$ac_ct_XCURSES_CONFIG" && break
15683 done
15684 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15685
15686   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15687 fi
15688
15689 if test "$XCURSES_CONFIG" != none ; then
15690
15691 cf_fix_cppflags=no
15692 cf_new_cflags=
15693 cf_new_cppflags=
15694 cf_new_extra_cppflags=
15695
15696 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15697 do
15698 case "$cf_fix_cppflags" in
15699 (no)
15700         case "$cf_add_cflags" in
15701         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15702                 case "$cf_add_cflags" in
15703                 (-D*)
15704                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15705
15706                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15707                                 && test -z "${cf_tst_cflags}" \
15708                                 && cf_fix_cppflags=yes
15709
15710                         if test "$cf_fix_cppflags" = yes ; then
15711
15712         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15713         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15714
15715                                 continue
15716                         elif test "${cf_tst_cflags}" = "\"'" ; then
15717
15718         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15719         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15720
15721                                 continue
15722                         fi
15723                         ;;
15724                 esac
15725                 case "$CPPFLAGS" in
15726                 (*$cf_add_cflags)
15727                         ;;
15728                 (*)
15729                         case "$cf_add_cflags" in
15730                         (-D*)
15731                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15732
15733 CPPFLAGS=`echo "$CPPFLAGS" | \
15734         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15735                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15736
15737                                 ;;
15738                         esac
15739
15740         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15741         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15742
15743                         ;;
15744                 esac
15745                 ;;
15746         (*)
15747
15748         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15749         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15750
15751                 ;;
15752         esac
15753         ;;
15754 (yes)
15755
15756         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15757         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15758
15759         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15760
15761         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15762                 && test -z "${cf_tst_cflags}" \
15763                 && cf_fix_cppflags=no
15764         ;;
15765 esac
15766 done
15767
15768 if test -n "$cf_new_cflags" ; then
15769
15770         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15771         CFLAGS="${CFLAGS}$cf_new_cflags"
15772
15773 fi
15774
15775 if test -n "$cf_new_cppflags" ; then
15776
15777         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15778         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15779
15780 fi
15781
15782 if test -n "$cf_new_extra_cppflags" ; then
15783
15784         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15785         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15786
15787 fi
15788
15789 cf_add_libs="$LIBS"
15790 # reverse order
15791 cf_add_0lib=
15792 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15793 # filter duplicates
15794 for cf_add_1lib in $cf_add_0lib; do
15795         for cf_add_2lib in $cf_add_libs; do
15796                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15797                         cf_add_1lib=
15798                         break
15799                 fi
15800         done
15801         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15802 done
15803 LIBS="$cf_add_libs"
15804
15805 cf_cv_lib_XCurses=yes
15806
15807 else
15808
15809 LDFLAGS="$LDFLAGS $X_LIBS"
15810
15811 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15812
15813 echo "${as_me:-configure}:15813: testing checking additions to CFLAGS ..." 1>&5
15814
15815 cf_check_cflags="$CFLAGS"
15816 cf_check_cppflags="$CPPFLAGS"
15817
15818 cf_fix_cppflags=no
15819 cf_new_cflags=
15820 cf_new_cppflags=
15821 cf_new_extra_cppflags=
15822
15823 for cf_add_cflags in $X_CFLAGS
15824 do
15825 case "$cf_fix_cppflags" in
15826 (no)
15827         case "$cf_add_cflags" in
15828         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15829                 case "$cf_add_cflags" in
15830                 (-D*)
15831                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15832
15833                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15834                                 && test -z "${cf_tst_cflags}" \
15835                                 && cf_fix_cppflags=yes
15836
15837                         if test "$cf_fix_cppflags" = yes ; then
15838
15839         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15840         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15841
15842                                 continue
15843                         elif test "${cf_tst_cflags}" = "\"'" ; then
15844
15845         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15846         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15847
15848                                 continue
15849                         fi
15850                         ;;
15851                 esac
15852                 case "$CPPFLAGS" in
15853                 (*$cf_add_cflags)
15854                         ;;
15855                 (*)
15856                         case "$cf_add_cflags" in
15857                         (-D*)
15858                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15859
15860 CPPFLAGS=`echo "$CPPFLAGS" | \
15861         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15862                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15863
15864                                 ;;
15865                         esac
15866
15867         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15868         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15869
15870                         ;;
15871                 esac
15872                 ;;
15873         (*)
15874
15875         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15876         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15877
15878                 ;;
15879         esac
15880         ;;
15881 (yes)
15882
15883         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15884         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15885
15886         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15887
15888         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15889                 && test -z "${cf_tst_cflags}" \
15890                 && cf_fix_cppflags=no
15891         ;;
15892 esac
15893 done
15894
15895 if test -n "$cf_new_cflags" ; then
15896         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15897
15898 echo "${as_me:-configure}:15898: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15899
15900         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15901         CFLAGS="${CFLAGS}$cf_new_cflags"
15902
15903 fi
15904
15905 if test -n "$cf_new_cppflags" ; then
15906         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15907
15908 echo "${as_me:-configure}:15908: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15909
15910         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15911         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15912
15913 fi
15914
15915 if test -n "$cf_new_extra_cppflags" ; then
15916         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15917
15918 echo "${as_me:-configure}:15918: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15919
15920         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15921         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15922
15923 fi
15924
15925 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15926 cat >"conftest.$ac_ext" <<_ACEOF
15927 #line 15927 "configure"
15928 #include "confdefs.h"
15929 #include <stdio.h>
15930 int
15931 main (void)
15932 {
15933 printf("Hello world");
15934   ;
15935   return 0;
15936 }
15937 _ACEOF
15938 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15939 if { (eval echo "$as_me:15939: \"$ac_link\"") >&5
15940   (eval $ac_link) 2>&5
15941   ac_status=$?
15942   echo "$as_me:15942: \$? = $ac_status" >&5
15943   (exit "$ac_status"); } &&
15944          { ac_try='test -s "conftest$ac_exeext"'
15945   { (eval echo "$as_me:15945: \"$ac_try\"") >&5
15946   (eval $ac_try) 2>&5
15947   ac_status=$?
15948   echo "$as_me:15948: \$? = $ac_status" >&5
15949   (exit "$ac_status"); }; }; then
15950   :
15951 else
15952   echo "$as_me: failed program was:" >&5
15953 cat "conftest.$ac_ext" >&5
15954 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15955
15956 echo "${as_me:-configure}:15956: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15957
15958          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15959                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15960
15961 echo "${as_me:-configure}:15961: testing but keeping change to \$CPPFLAGS ..." 1>&5
15962
15963          fi
15964          CFLAGS="$cf_check_cflags"
15965 fi
15966 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15967 fi
15968
15969 echo "$as_me:15969: checking for XOpenDisplay in -lX11" >&5
15970 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15971 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15972   echo $ECHO_N "(cached) $ECHO_C" >&6
15973 else
15974   ac_check_lib_save_LIBS=$LIBS
15975 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15976 cat >"conftest.$ac_ext" <<_ACEOF
15977 #line 15977 "configure"
15978 #include "confdefs.h"
15979
15980 /* Override any gcc2 internal prototype to avoid an error.  */
15981 #ifdef __cplusplus
15982 extern "C"
15983 #endif
15984 /* We use char because int might match the return type of a gcc2
15985    builtin and then its argument prototype would still apply.  */
15986 char XOpenDisplay ();
15987 int
15988 main (void)
15989 {
15990 XOpenDisplay ();
15991   ;
15992   return 0;
15993 }
15994 _ACEOF
15995 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15996 if { (eval echo "$as_me:15996: \"$ac_link\"") >&5
15997   (eval $ac_link) 2>&5
15998   ac_status=$?
15999   echo "$as_me:15999: \$? = $ac_status" >&5
16000   (exit "$ac_status"); } &&
16001          { ac_try='test -s "conftest$ac_exeext"'
16002   { (eval echo "$as_me:16002: \"$ac_try\"") >&5
16003   (eval $ac_try) 2>&5
16004   ac_status=$?
16005   echo "$as_me:16005: \$? = $ac_status" >&5
16006   (exit "$ac_status"); }; }; then
16007   ac_cv_lib_X11_XOpenDisplay=yes
16008 else
16009   echo "$as_me: failed program was:" >&5
16010 cat "conftest.$ac_ext" >&5
16011 ac_cv_lib_X11_XOpenDisplay=no
16012 fi
16013 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16014 LIBS=$ac_check_lib_save_LIBS
16015 fi
16016 echo "$as_me:16016: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16017 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16018 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16019
16020 cf_add_libs="$LIBS"
16021 # reverse order
16022 cf_add_0lib=
16023 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16024 # filter duplicates
16025 for cf_add_1lib in $cf_add_0lib; do
16026         for cf_add_2lib in $cf_add_libs; do
16027                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16028                         cf_add_1lib=
16029                         break
16030                 fi
16031         done
16032         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16033 done
16034 LIBS="$cf_add_libs"
16035
16036 fi
16037
16038 echo "$as_me:16038: checking for XCurses library" >&5
16039 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16040 if test "${cf_cv_lib_XCurses+set}" = set; then
16041   echo $ECHO_N "(cached) $ECHO_C" >&6
16042 else
16043
16044 cf_add_libs="$LIBS"
16045 # reverse order
16046 cf_add_0lib=
16047 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16048 # filter duplicates
16049 for cf_add_1lib in $cf_add_0lib; do
16050         for cf_add_2lib in $cf_add_libs; do
16051                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16052                         cf_add_1lib=
16053                         break
16054                 fi
16055         done
16056         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16057 done
16058 LIBS="$cf_add_libs"
16059
16060 cat >"conftest.$ac_ext" <<_ACEOF
16061 #line 16061 "configure"
16062 #include "confdefs.h"
16063
16064 #include <xcurses.h>
16065 char *XCursesProgramName = "test";
16066
16067 int
16068 main (void)
16069 {
16070 XCursesExit();
16071   ;
16072   return 0;
16073 }
16074 _ACEOF
16075 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16076 if { (eval echo "$as_me:16076: \"$ac_link\"") >&5
16077   (eval $ac_link) 2>&5
16078   ac_status=$?
16079   echo "$as_me:16079: \$? = $ac_status" >&5
16080   (exit "$ac_status"); } &&
16081          { ac_try='test -s "conftest$ac_exeext"'
16082   { (eval echo "$as_me:16082: \"$ac_try\"") >&5
16083   (eval $ac_try) 2>&5
16084   ac_status=$?
16085   echo "$as_me:16085: \$? = $ac_status" >&5
16086   (exit "$ac_status"); }; }; then
16087   cf_cv_lib_XCurses=yes
16088 else
16089   echo "$as_me: failed program was:" >&5
16090 cat "conftest.$ac_ext" >&5
16091 cf_cv_lib_XCurses=no
16092 fi
16093 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16094
16095 fi
16096 echo "$as_me:16096: result: $cf_cv_lib_XCurses" >&5
16097 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16098
16099 fi
16100
16101 if test "$cf_cv_lib_XCurses" = yes ; then
16102
16103 cat >>confdefs.h <<\EOF
16104 #define UNIX 1
16105 EOF
16106
16107 cat >>confdefs.h <<\EOF
16108 #define XCURSES 1
16109 EOF
16110
16111         echo "$as_me:16111: checking for xcurses.h" >&5
16112 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16113 if test "${ac_cv_header_xcurses_h+set}" = set; then
16114   echo $ECHO_N "(cached) $ECHO_C" >&6
16115 else
16116   cat >"conftest.$ac_ext" <<_ACEOF
16117 #line 16117 "configure"
16118 #include "confdefs.h"
16119 #include <xcurses.h>
16120 _ACEOF
16121 if { (eval echo "$as_me:16121: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16122   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16123   ac_status=$?
16124   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16125   rm -f conftest.er1
16126   cat conftest.err >&5
16127   echo "$as_me:16127: \$? = $ac_status" >&5
16128   (exit "$ac_status"); } >/dev/null; then
16129   if test -s conftest.err; then
16130     ac_cpp_err=$ac_c_preproc_warn_flag
16131   else
16132     ac_cpp_err=
16133   fi
16134 else
16135   ac_cpp_err=yes
16136 fi
16137 if test -z "$ac_cpp_err"; then
16138   ac_cv_header_xcurses_h=yes
16139 else
16140   echo "$as_me: failed program was:" >&5
16141   cat "conftest.$ac_ext" >&5
16142   ac_cv_header_xcurses_h=no
16143 fi
16144 rm -f conftest.err "conftest.$ac_ext"
16145 fi
16146 echo "$as_me:16146: result: $ac_cv_header_xcurses_h" >&5
16147 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16148 if test "$ac_cv_header_xcurses_h" = yes; then
16149
16150 cat >>confdefs.h <<\EOF
16151 #define HAVE_XCURSES 1
16152 EOF
16153
16154 fi
16155
16156 else
16157         { { echo "$as_me:16157: error: Cannot link with XCurses" >&5
16158 echo "$as_me: error: Cannot link with XCurses" >&2;}
16159    { (exit 1); exit 1; }; }
16160 fi
16161
16162         ;;
16163 (*)
16164         { { echo "$as_me:16164: error: unexpected screen-value: $cf_cv_screen" >&5
16165 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16166    { (exit 1); exit 1; }; }
16167         ;;
16168 esac
16169
16170 : ${cf_nculib_root:=$cf_cv_screen}
16171 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16172 echo "$as_me:16172: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16173 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16174 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16175   echo $ECHO_N "(cached) $ECHO_C" >&6
16176 else
16177   ac_check_lib_save_LIBS=$LIBS
16178 LIBS="-l$cf_nculib_root  $LIBS"
16179 cat >"conftest.$ac_ext" <<_ACEOF
16180 #line 16180 "configure"
16181 #include "confdefs.h"
16182
16183 /* Override any gcc2 internal prototype to avoid an error.  */
16184 #ifdef __cplusplus
16185 extern "C"
16186 #endif
16187 /* We use char because int might match the return type of a gcc2
16188    builtin and then its argument prototype would still apply.  */
16189 char _nc_init_pthreads ();
16190 int
16191 main (void)
16192 {
16193 _nc_init_pthreads ();
16194   ;
16195   return 0;
16196 }
16197 _ACEOF
16198 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16199 if { (eval echo "$as_me:16199: \"$ac_link\"") >&5
16200   (eval $ac_link) 2>&5
16201   ac_status=$?
16202   echo "$as_me:16202: \$? = $ac_status" >&5
16203   (exit "$ac_status"); } &&
16204          { ac_try='test -s "conftest$ac_exeext"'
16205   { (eval echo "$as_me:16205: \"$ac_try\"") >&5
16206   (eval $ac_try) 2>&5
16207   ac_status=$?
16208   echo "$as_me:16208: \$? = $ac_status" >&5
16209   (exit "$ac_status"); }; }; then
16210   eval "$as_ac_Lib=yes"
16211 else
16212   echo "$as_me: failed program was:" >&5
16213 cat "conftest.$ac_ext" >&5
16214 eval "$as_ac_Lib=no"
16215 fi
16216 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16217 LIBS=$ac_check_lib_save_LIBS
16218 fi
16219 echo "$as_me:16219: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16220 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16221 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16222   cf_cv_ncurses_pthreads=yes
16223 else
16224   cf_cv_ncurses_pthreads=no
16225 fi
16226
16227 if test "$cf_cv_ncurses_pthreads" = yes
16228 then
16229
16230 cf_add_libs="$LIBS"
16231 # reverse order
16232 cf_add_0lib=
16233 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16234 # filter duplicates
16235 for cf_add_1lib in $cf_add_0lib; do
16236         for cf_add_2lib in $cf_add_libs; do
16237                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16238                         cf_add_1lib=
16239                         break
16240                 fi
16241         done
16242         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16243 done
16244 LIBS="$cf_add_libs"
16245
16246 fi
16247
16248 case $cf_cv_screen in
16249 (ncurses*)
16250         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16251         ;;
16252 esac
16253
16254 echo "$as_me:16254: checking for X11 rgb file" >&5
16255 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16256
16257 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16258 if test "${with_x11_rgb+set}" = set; then
16259   withval="$with_x11_rgb"
16260   RGB_PATH=$withval
16261 else
16262   RGB_PATH=auto
16263 fi;
16264
16265 if test "x$RGB_PATH" = xauto
16266 then
16267         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16268         for cf_path in \
16269                 /opt/local/share/X11/rgb.txt \
16270                 /opt/X11/share/X11/rgb.txt \
16271                 /usr/share/X11/rgb.txt \
16272                 /usr/X11/share/X11/rgb.txt \
16273                 /usr/X11/lib/X11/rgb.txt \
16274                 /usr/lib/X11/rgb.txt \
16275                 /etc/X11/rgb.txt \
16276                 /usr/pkg/lib/X11/rgb.txt \
16277                 /usr/X11R7/lib/X11/rgb.txt \
16278                 /usr/X11R6/lib/X11/rgb.txt \
16279                 /usr/X11R5/lib/X11/rgb.txt \
16280                 /usr/X11R4/lib/X11/rgb.txt \
16281                 /usr/local/lib/X11/rgb.txt \
16282                 /usr/local/share/X11/rgb.txt \
16283                 /usr/lib64/X11/rgb.txt
16284         do
16285                 if test -f "$cf_path" ; then
16286                         RGB_PATH="$cf_path"
16287                         break
16288                 fi
16289         done
16290 else
16291         cf_path=$RGB_PATH
16292
16293 if test "x$prefix" != xNONE; then
16294         cf_path_syntax="$prefix"
16295 else
16296         cf_path_syntax="$ac_default_prefix"
16297 fi
16298
16299 case ".$cf_path" in
16300 (.\$\(*\)*|.\'*\'*)
16301         ;;
16302 (..|./*|.\\*)
16303         ;;
16304 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16305         ;;
16306 (.\$\{*prefix\}*|.\$\{*dir\}*)
16307         eval cf_path="$cf_path"
16308         case ".$cf_path" in
16309         (.NONE/*)
16310                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16311                 ;;
16312         esac
16313         ;;
16314 (.no|.NONE/*)
16315         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16316         ;;
16317 (*)
16318         { { echo "$as_me:16318: error: expected a pathname, not \"$cf_path\"" >&5
16319 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16320    { (exit 1); exit 1; }; }
16321         ;;
16322 esac
16323
16324 fi
16325
16326 echo "$as_me:16326: result: $RGB_PATH" >&5
16327 echo "${ECHO_T}$RGB_PATH" >&6
16328
16329 cat >>confdefs.h <<EOF
16330 #define RGB_PATH "$cf_path"
16331 EOF
16332
16333 no_x11_rgb=
16334 if test "$RGB_PATH" = no
16335 then
16336         no_x11_rgb="#"
16337 fi
16338
16339 cf_curses_headers=
16340
16341 case $cf_cv_screen in
16342 (pdcurses)
16343         cf_default_panel=no
16344         cf_default_form=no
16345         cf_default_menu=no
16346         cf_default_tinfo=no
16347         ;;
16348 (xcurses|bsdcurses)
16349         cf_default_panel=no
16350         cf_default_form=no
16351         cf_default_menu=no
16352         cf_default_tinfo=yes
16353         ;;
16354 (*)
16355         cf_default_panel=yes
16356         cf_default_form=yes
16357         cf_default_menu=yes
16358         cf_default_tinfo=yes
16359         case $cf_cv_screen in
16360         (ncurses*)
16361                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16362                 ;;
16363         esac
16364         ;;
16365 esac
16366
16367 echo "$as_me:16367: checking for desired basename for form library" >&5
16368 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16369
16370 # Check whether --with-form-libname or --without-form-libname was given.
16371 if test "${with_form_libname+set}" = set; then
16372   withval="$with_form_libname"
16373   with_lib_basename=$withval
16374 else
16375   with_lib_basename=form
16376 fi;
16377 FORM_NAME="$with_lib_basename"
16378
16379 case "x$FORM_NAME" in
16380 (x|xno|xnone|xyes)
16381         FORM_NAME=form
16382         ;;
16383 (*)
16384         ;;
16385 esac
16386
16387 echo "$as_me:16387: result: $FORM_NAME" >&5
16388 echo "${ECHO_T}$FORM_NAME" >&6
16389
16390 echo "$as_me:16390: checking for desired basename for menu library" >&5
16391 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16392
16393 # Check whether --with-menu-libname or --without-menu-libname was given.
16394 if test "${with_menu_libname+set}" = set; then
16395   withval="$with_menu_libname"
16396   with_lib_basename=$withval
16397 else
16398   with_lib_basename=menu
16399 fi;
16400 MENU_NAME="$with_lib_basename"
16401
16402 case "x$MENU_NAME" in
16403 (x|xno|xnone|xyes)
16404         MENU_NAME=menu
16405         ;;
16406 (*)
16407         ;;
16408 esac
16409
16410 echo "$as_me:16410: result: $MENU_NAME" >&5
16411 echo "${ECHO_T}$MENU_NAME" >&6
16412
16413 echo "$as_me:16413: checking for desired basename for panel library" >&5
16414 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16415
16416 # Check whether --with-panel-libname or --without-panel-libname was given.
16417 if test "${with_panel_libname+set}" = set; then
16418   withval="$with_panel_libname"
16419   with_lib_basename=$withval
16420 else
16421   with_lib_basename=panel
16422 fi;
16423 PANEL_NAME="$with_lib_basename"
16424
16425 case "x$PANEL_NAME" in
16426 (x|xno|xnone|xyes)
16427         PANEL_NAME=panel
16428         ;;
16429 (*)
16430         ;;
16431 esac
16432
16433 echo "$as_me:16433: result: $PANEL_NAME" >&5
16434 echo "${ECHO_T}$PANEL_NAME" >&6
16435
16436 echo "$as_me:16436: checking if you want to check for panel functions" >&5
16437 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16438
16439 # Check whether --enable-panel or --disable-panel was given.
16440 if test "${enable_panel+set}" = set; then
16441   enableval="$enable_panel"
16442   test "$enableval" != no && enableval=yes
16443         if test "$enableval" != "yes" ; then
16444     cf_enable_panel=no
16445         else
16446                 cf_enable_panel=$cf_default_panel
16447         fi
16448 else
16449   enableval=yes
16450         cf_enable_panel=$cf_default_panel
16451
16452 fi;
16453 echo "$as_me:16453: result: $cf_enable_panel" >&5
16454 echo "${ECHO_T}$cf_enable_panel" >&6
16455 if test $cf_enable_panel = yes
16456 then
16457
16458 cf_have_curses_lib=no
16459
16460 : ${NCURSES_CONFIG_PKG:=none}
16461 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16462         :
16463 elif test "x${PKG_CONFIG:=none}" != xnone; then
16464         echo "$as_me:16464: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16465 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16466         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16467                 echo "$as_me:16467: result: yes" >&5
16468 echo "${ECHO_T}yes" >&6
16469
16470                 echo "$as_me:16470: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16471 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16472
16473                 cf_save_CPPFLAGS="$CPPFLAGS"
16474                 cf_save_LIBS="$LIBS"
16475
16476 cf_fix_cppflags=no
16477 cf_new_cflags=
16478 cf_new_cppflags=
16479 cf_new_extra_cppflags=
16480
16481 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16482 do
16483 case "$cf_fix_cppflags" in
16484 (no)
16485         case "$cf_add_cflags" in
16486         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16487                 case "$cf_add_cflags" in
16488                 (-D*)
16489                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16490
16491                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16492                                 && test -z "${cf_tst_cflags}" \
16493                                 && cf_fix_cppflags=yes
16494
16495                         if test "$cf_fix_cppflags" = yes ; then
16496
16497         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16498         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16499
16500                                 continue
16501                         elif test "${cf_tst_cflags}" = "\"'" ; then
16502
16503         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16504         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16505
16506                                 continue
16507                         fi
16508                         ;;
16509                 esac
16510                 case "$CPPFLAGS" in
16511                 (*$cf_add_cflags)
16512                         ;;
16513                 (*)
16514                         case "$cf_add_cflags" in
16515                         (-D*)
16516                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16517
16518 CPPFLAGS=`echo "$CPPFLAGS" | \
16519         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16520                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16521
16522                                 ;;
16523                         esac
16524
16525         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16526         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16527
16528                         ;;
16529                 esac
16530                 ;;
16531         (*)
16532
16533         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16534         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16535
16536                 ;;
16537         esac
16538         ;;
16539 (yes)
16540
16541         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16542         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16543
16544         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16545
16546         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16547                 && test -z "${cf_tst_cflags}" \
16548                 && cf_fix_cppflags=no
16549         ;;
16550 esac
16551 done
16552
16553 if test -n "$cf_new_cflags" ; then
16554
16555         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16556         CFLAGS="${CFLAGS}$cf_new_cflags"
16557
16558 fi
16559
16560 if test -n "$cf_new_cppflags" ; then
16561
16562         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16563         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16564
16565 fi
16566
16567 if test -n "$cf_new_extra_cppflags" ; then
16568
16569         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16570         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16571
16572 fi
16573
16574 cf_add_libs="$LIBS"
16575 # reverse order
16576 cf_add_0lib=
16577 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16578 # filter duplicates
16579 for cf_add_1lib in $cf_add_0lib; do
16580         for cf_add_2lib in $cf_add_libs; do
16581                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16582                         cf_add_1lib=
16583                         break
16584                 fi
16585         done
16586         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16587 done
16588 LIBS="$cf_add_libs"
16589
16590                 cat >"conftest.$ac_ext" <<_ACEOF
16591 #line 16591 "configure"
16592 #include "confdefs.h"
16593 #include <$PANEL_NAME.h>
16594 int
16595 main (void)
16596 {
16597 (void) new_panel ( 0 );
16598   ;
16599   return 0;
16600 }
16601 _ACEOF
16602 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16603 if { (eval echo "$as_me:16603: \"$ac_link\"") >&5
16604   (eval $ac_link) 2>&5
16605   ac_status=$?
16606   echo "$as_me:16606: \$? = $ac_status" >&5
16607   (exit "$ac_status"); } &&
16608          { ac_try='test -s "conftest$ac_exeext"'
16609   { (eval echo "$as_me:16609: \"$ac_try\"") >&5
16610   (eval $ac_try) 2>&5
16611   ac_status=$?
16612   echo "$as_me:16612: \$? = $ac_status" >&5
16613   (exit "$ac_status"); }; }; then
16614   if test "$cross_compiling" = yes; then
16615   cf_have_curses_lib=maybe
16616 else
16617   cat >"conftest.$ac_ext" <<_ACEOF
16618 #line 16618 "configure"
16619 #include "confdefs.h"
16620 #include <$PANEL_NAME.h>
16621                                 int main(void)
16622                                 { (void) new_panel ( 0 ); return 0; }
16623 _ACEOF
16624 rm -f "conftest$ac_exeext"
16625 if { (eval echo "$as_me:16625: \"$ac_link\"") >&5
16626   (eval $ac_link) 2>&5
16627   ac_status=$?
16628   echo "$as_me:16628: \$? = $ac_status" >&5
16629   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16630   { (eval echo "$as_me:16630: \"$ac_try\"") >&5
16631   (eval $ac_try) 2>&5
16632   ac_status=$?
16633   echo "$as_me:16633: \$? = $ac_status" >&5
16634   (exit "$ac_status"); }; }; then
16635   cf_have_curses_lib=yes
16636 else
16637   echo "$as_me: program exited with status $ac_status" >&5
16638 echo "$as_me: failed program was:" >&5
16639 cat "conftest.$ac_ext" >&5
16640 cf_have_curses_lib=no
16641 fi
16642 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16643 fi
16644 else
16645   echo "$as_me: failed program was:" >&5
16646 cat "conftest.$ac_ext" >&5
16647 cf_have_curses_lib=no
16648 fi
16649 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16650                 echo "$as_me:16650: result: $cf_have_curses_lib" >&5
16651 echo "${ECHO_T}$cf_have_curses_lib" >&6
16652                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16653                 if test "$cf_have_curses_lib" != "yes"
16654                 then
16655                         CPPFLAGS="$cf_save_CPPFLAGS"
16656                         LIBS="$cf_save_LIBS"
16657                 else
16658
16659 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16660
16661                         cat >>confdefs.h <<EOF
16662 #define $cf_upper 1
16663 EOF
16664
16665                 fi
16666         fi
16667 fi
16668 if test "$cf_have_curses_lib" = no; then
16669         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16670 echo "$as_me:16670: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16671 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16672 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16673   echo $ECHO_N "(cached) $ECHO_C" >&6
16674 else
16675   ac_check_lib_save_LIBS=$LIBS
16676 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16677 cat >"conftest.$ac_ext" <<_ACEOF
16678 #line 16678 "configure"
16679 #include "confdefs.h"
16680
16681 /* Override any gcc2 internal prototype to avoid an error.  */
16682 #ifdef __cplusplus
16683 extern "C"
16684 #endif
16685 /* We use char because int might match the return type of a gcc2
16686    builtin and then its argument prototype would still apply.  */
16687 char new_panel ();
16688 int
16689 main (void)
16690 {
16691 new_panel ();
16692   ;
16693   return 0;
16694 }
16695 _ACEOF
16696 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16697 if { (eval echo "$as_me:16697: \"$ac_link\"") >&5
16698   (eval $ac_link) 2>&5
16699   ac_status=$?
16700   echo "$as_me:16700: \$? = $ac_status" >&5
16701   (exit "$ac_status"); } &&
16702          { ac_try='test -s "conftest$ac_exeext"'
16703   { (eval echo "$as_me:16703: \"$ac_try\"") >&5
16704   (eval $ac_try) 2>&5
16705   ac_status=$?
16706   echo "$as_me:16706: \$? = $ac_status" >&5
16707   (exit "$ac_status"); }; }; then
16708   eval "$as_ac_Lib=yes"
16709 else
16710   echo "$as_me: failed program was:" >&5
16711 cat "conftest.$ac_ext" >&5
16712 eval "$as_ac_Lib=no"
16713 fi
16714 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16715 LIBS=$ac_check_lib_save_LIBS
16716 fi
16717 echo "$as_me:16717: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16718 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16719 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16720
16721 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16722
16723 cf_add_libs="$LIBS"
16724 # reverse order
16725 cf_add_0lib=
16726 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16727 # filter duplicates
16728 for cf_add_1lib in $cf_add_0lib; do
16729         for cf_add_2lib in $cf_add_libs; do
16730                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16731                         cf_add_1lib=
16732                         break
16733                 fi
16734         done
16735         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16736 done
16737 LIBS="$cf_add_libs"
16738
16739                 cat >>confdefs.h <<EOF
16740 #define $cf_upper 1
16741 EOF
16742
16743 fi
16744
16745 fi
16746
16747         cf_curses_headers="$cf_curses_headers panel.h"
16748 fi
16749
16750 echo "$as_me:16750: checking if you want to check for menu functions" >&5
16751 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16752
16753 # Check whether --enable-menu or --disable-menu was given.
16754 if test "${enable_menu+set}" = set; then
16755   enableval="$enable_menu"
16756   test "$enableval" != no && enableval=yes
16757         if test "$enableval" != "yes" ; then
16758     cf_enable_menu=no
16759         else
16760                 cf_enable_menu=$cf_default_menu
16761         fi
16762 else
16763   enableval=yes
16764         cf_enable_menu=$cf_default_menu
16765
16766 fi;
16767 echo "$as_me:16767: result: $cf_enable_menu" >&5
16768 echo "${ECHO_T}$cf_enable_menu" >&6
16769 if test $cf_enable_menu = yes
16770 then
16771         case $cf_cv_screen in
16772         (ncurses*)
16773                 ;;
16774         (curses*)
16775
16776 echo "$as_me:16776: checking for NetBSD menu.h" >&5
16777 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16778 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16779   echo $ECHO_N "(cached) $ECHO_C" >&6
16780 else
16781
16782 cat >"conftest.$ac_ext" <<_ACEOF
16783 #line 16783 "configure"
16784 #include "confdefs.h"
16785
16786 #include <${cf_cv_ncurses_header:-curses.h}>
16787 #include <menu.h>
16788
16789 int
16790 main (void)
16791 {
16792
16793         MENU *menu;
16794         int y = menu->max_item_width;
16795
16796   ;
16797   return 0;
16798 }
16799 _ACEOF
16800 rm -f "conftest.$ac_objext"
16801 if { (eval echo "$as_me:16801: \"$ac_compile\"") >&5
16802   (eval $ac_compile) 2>&5
16803   ac_status=$?
16804   echo "$as_me:16804: \$? = $ac_status" >&5
16805   (exit "$ac_status"); } &&
16806          { ac_try='test -s "conftest.$ac_objext"'
16807   { (eval echo "$as_me:16807: \"$ac_try\"") >&5
16808   (eval $ac_try) 2>&5
16809   ac_status=$?
16810   echo "$as_me:16810: \$? = $ac_status" >&5
16811   (exit "$ac_status"); }; }; then
16812   cf_cv_netbsd_menu_h=yes
16813
16814 else
16815   echo "$as_me: failed program was:" >&5
16816 cat "conftest.$ac_ext" >&5
16817 cf_cv_netbsd_menu_h=no
16818 fi
16819 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16820
16821 fi
16822 echo "$as_me:16822: result: $cf_cv_netbsd_menu_h" >&5
16823 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16824
16825 test "$cf_cv_netbsd_menu_h" = yes &&
16826 cat >>confdefs.h <<\EOF
16827 #define HAVE_NETBSD_MENU_H 1
16828 EOF
16829
16830                 ;;
16831         esac
16832
16833 cf_have_curses_lib=no
16834
16835 : ${NCURSES_CONFIG_PKG:=none}
16836 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16837         :
16838 elif test "x${PKG_CONFIG:=none}" != xnone; then
16839         echo "$as_me:16839: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16840 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16841         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
16842                 echo "$as_me:16842: result: yes" >&5
16843 echo "${ECHO_T}yes" >&6
16844
16845                 echo "$as_me:16845: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16846 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16847
16848                 cf_save_CPPFLAGS="$CPPFLAGS"
16849                 cf_save_LIBS="$LIBS"
16850
16851 cf_fix_cppflags=no
16852 cf_new_cflags=
16853 cf_new_cppflags=
16854 cf_new_extra_cppflags=
16855
16856 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
16857 do
16858 case "$cf_fix_cppflags" in
16859 (no)
16860         case "$cf_add_cflags" in
16861         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16862                 case "$cf_add_cflags" in
16863                 (-D*)
16864                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16865
16866                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16867                                 && test -z "${cf_tst_cflags}" \
16868                                 && cf_fix_cppflags=yes
16869
16870                         if test "$cf_fix_cppflags" = yes ; then
16871
16872         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16873         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16874
16875                                 continue
16876                         elif test "${cf_tst_cflags}" = "\"'" ; then
16877
16878         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16879         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16880
16881                                 continue
16882                         fi
16883                         ;;
16884                 esac
16885                 case "$CPPFLAGS" in
16886                 (*$cf_add_cflags)
16887                         ;;
16888                 (*)
16889                         case "$cf_add_cflags" in
16890                         (-D*)
16891                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16892
16893 CPPFLAGS=`echo "$CPPFLAGS" | \
16894         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16895                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16896
16897                                 ;;
16898                         esac
16899
16900         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16901         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16902
16903                         ;;
16904                 esac
16905                 ;;
16906         (*)
16907
16908         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16909         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16910
16911                 ;;
16912         esac
16913         ;;
16914 (yes)
16915
16916         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16917         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16918
16919         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16920
16921         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16922                 && test -z "${cf_tst_cflags}" \
16923                 && cf_fix_cppflags=no
16924         ;;
16925 esac
16926 done
16927
16928 if test -n "$cf_new_cflags" ; then
16929
16930         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16931         CFLAGS="${CFLAGS}$cf_new_cflags"
16932
16933 fi
16934
16935 if test -n "$cf_new_cppflags" ; then
16936
16937         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16938         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16939
16940 fi
16941
16942 if test -n "$cf_new_extra_cppflags" ; then
16943
16944         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16945         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16946
16947 fi
16948
16949 cf_add_libs="$LIBS"
16950 # reverse order
16951 cf_add_0lib=
16952 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16953 # filter duplicates
16954 for cf_add_1lib in $cf_add_0lib; do
16955         for cf_add_2lib in $cf_add_libs; do
16956                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16957                         cf_add_1lib=
16958                         break
16959                 fi
16960         done
16961         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16962 done
16963 LIBS="$cf_add_libs"
16964
16965                 cat >"conftest.$ac_ext" <<_ACEOF
16966 #line 16966 "configure"
16967 #include "confdefs.h"
16968 #include <$MENU_NAME.h>
16969 int
16970 main (void)
16971 {
16972 (void) menu_driver ( 0,0 );
16973   ;
16974   return 0;
16975 }
16976 _ACEOF
16977 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16978 if { (eval echo "$as_me:16978: \"$ac_link\"") >&5
16979   (eval $ac_link) 2>&5
16980   ac_status=$?
16981   echo "$as_me:16981: \$? = $ac_status" >&5
16982   (exit "$ac_status"); } &&
16983          { ac_try='test -s "conftest$ac_exeext"'
16984   { (eval echo "$as_me:16984: \"$ac_try\"") >&5
16985   (eval $ac_try) 2>&5
16986   ac_status=$?
16987   echo "$as_me:16987: \$? = $ac_status" >&5
16988   (exit "$ac_status"); }; }; then
16989   if test "$cross_compiling" = yes; then
16990   cf_have_curses_lib=maybe
16991 else
16992   cat >"conftest.$ac_ext" <<_ACEOF
16993 #line 16993 "configure"
16994 #include "confdefs.h"
16995 #include <$MENU_NAME.h>
16996                                 int main(void)
16997                                 { (void) menu_driver ( 0,0 ); return 0; }
16998 _ACEOF
16999 rm -f "conftest$ac_exeext"
17000 if { (eval echo "$as_me:17000: \"$ac_link\"") >&5
17001   (eval $ac_link) 2>&5
17002   ac_status=$?
17003   echo "$as_me:17003: \$? = $ac_status" >&5
17004   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17005   { (eval echo "$as_me:17005: \"$ac_try\"") >&5
17006   (eval $ac_try) 2>&5
17007   ac_status=$?
17008   echo "$as_me:17008: \$? = $ac_status" >&5
17009   (exit "$ac_status"); }; }; then
17010   cf_have_curses_lib=yes
17011 else
17012   echo "$as_me: program exited with status $ac_status" >&5
17013 echo "$as_me: failed program was:" >&5
17014 cat "conftest.$ac_ext" >&5
17015 cf_have_curses_lib=no
17016 fi
17017 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17018 fi
17019 else
17020   echo "$as_me: failed program was:" >&5
17021 cat "conftest.$ac_ext" >&5
17022 cf_have_curses_lib=no
17023 fi
17024 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17025                 echo "$as_me:17025: result: $cf_have_curses_lib" >&5
17026 echo "${ECHO_T}$cf_have_curses_lib" >&6
17027                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17028                 if test "$cf_have_curses_lib" != "yes"
17029                 then
17030                         CPPFLAGS="$cf_save_CPPFLAGS"
17031                         LIBS="$cf_save_LIBS"
17032                 else
17033
17034 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17035
17036                         cat >>confdefs.h <<EOF
17037 #define $cf_upper 1
17038 EOF
17039
17040                 fi
17041         fi
17042 fi
17043 if test "$cf_have_curses_lib" = no; then
17044         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17045 echo "$as_me:17045: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17046 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17047 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17048   echo $ECHO_N "(cached) $ECHO_C" >&6
17049 else
17050   ac_check_lib_save_LIBS=$LIBS
17051 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17052 cat >"conftest.$ac_ext" <<_ACEOF
17053 #line 17053 "configure"
17054 #include "confdefs.h"
17055
17056 /* Override any gcc2 internal prototype to avoid an error.  */
17057 #ifdef __cplusplus
17058 extern "C"
17059 #endif
17060 /* We use char because int might match the return type of a gcc2
17061    builtin and then its argument prototype would still apply.  */
17062 char menu_driver ();
17063 int
17064 main (void)
17065 {
17066 menu_driver ();
17067   ;
17068   return 0;
17069 }
17070 _ACEOF
17071 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17072 if { (eval echo "$as_me:17072: \"$ac_link\"") >&5
17073   (eval $ac_link) 2>&5
17074   ac_status=$?
17075   echo "$as_me:17075: \$? = $ac_status" >&5
17076   (exit "$ac_status"); } &&
17077          { ac_try='test -s "conftest$ac_exeext"'
17078   { (eval echo "$as_me:17078: \"$ac_try\"") >&5
17079   (eval $ac_try) 2>&5
17080   ac_status=$?
17081   echo "$as_me:17081: \$? = $ac_status" >&5
17082   (exit "$ac_status"); }; }; then
17083   eval "$as_ac_Lib=yes"
17084 else
17085   echo "$as_me: failed program was:" >&5
17086 cat "conftest.$ac_ext" >&5
17087 eval "$as_ac_Lib=no"
17088 fi
17089 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17090 LIBS=$ac_check_lib_save_LIBS
17091 fi
17092 echo "$as_me:17092: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17093 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17094 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17095
17096 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17097
17098 cf_add_libs="$LIBS"
17099 # reverse order
17100 cf_add_0lib=
17101 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17102 # filter duplicates
17103 for cf_add_1lib in $cf_add_0lib; do
17104         for cf_add_2lib in $cf_add_libs; do
17105                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17106                         cf_add_1lib=
17107                         break
17108                 fi
17109         done
17110         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17111 done
17112 LIBS="$cf_add_libs"
17113
17114                 cat >>confdefs.h <<EOF
17115 #define $cf_upper 1
17116 EOF
17117
17118 fi
17119
17120 fi
17121
17122         cf_curses_headers="$cf_curses_headers menu.h"
17123 fi
17124
17125 echo "$as_me:17125: checking if you want to check for form functions" >&5
17126 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17127
17128 # Check whether --enable-form or --disable-form was given.
17129 if test "${enable_form+set}" = set; then
17130   enableval="$enable_form"
17131   test "$enableval" != no && enableval=yes
17132         if test "$enableval" != "yes" ; then
17133     cf_enable_form=no
17134         else
17135                 cf_enable_form=$cf_default_form
17136         fi
17137 else
17138   enableval=yes
17139         cf_enable_form=$cf_default_form
17140
17141 fi;
17142 echo "$as_me:17142: result: $cf_enable_form" >&5
17143 echo "${ECHO_T}$cf_enable_form" >&6
17144 if test $cf_enable_form = yes
17145 then
17146         case $cf_cv_screen in
17147         (ncurses*)
17148                 ;;
17149         (curses*)
17150
17151 echo "$as_me:17151: checking for NetBSD form.h" >&5
17152 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17153 if test "${cf_cv_netbsd_form_h+set}" = set; then
17154   echo $ECHO_N "(cached) $ECHO_C" >&6
17155 else
17156
17157 cat >"conftest.$ac_ext" <<_ACEOF
17158 #line 17158 "configure"
17159 #include "confdefs.h"
17160
17161 #include <${cf_cv_ncurses_header:-curses.h}>
17162 #include <form.h>
17163
17164 int
17165 main (void)
17166 {
17167
17168         FORM *form;
17169         int y = current_field(form)->cursor_ypos;
17170         int x = current_field(form)->cursor_xpos;
17171
17172   ;
17173   return 0;
17174 }
17175 _ACEOF
17176 rm -f "conftest.$ac_objext"
17177 if { (eval echo "$as_me:17177: \"$ac_compile\"") >&5
17178   (eval $ac_compile) 2>&5
17179   ac_status=$?
17180   echo "$as_me:17180: \$? = $ac_status" >&5
17181   (exit "$ac_status"); } &&
17182          { ac_try='test -s "conftest.$ac_objext"'
17183   { (eval echo "$as_me:17183: \"$ac_try\"") >&5
17184   (eval $ac_try) 2>&5
17185   ac_status=$?
17186   echo "$as_me:17186: \$? = $ac_status" >&5
17187   (exit "$ac_status"); }; }; then
17188   cf_cv_netbsd_form_h=yes
17189
17190 else
17191   echo "$as_me: failed program was:" >&5
17192 cat "conftest.$ac_ext" >&5
17193 cf_cv_netbsd_form_h=no
17194 fi
17195 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17196
17197 fi
17198 echo "$as_me:17198: result: $cf_cv_netbsd_form_h" >&5
17199 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17200
17201 test "$cf_cv_netbsd_form_h" = yes &&
17202 cat >>confdefs.h <<\EOF
17203 #define HAVE_NETBSD_FORM_H 1
17204 EOF
17205
17206                 ;;
17207         esac
17208
17209 cf_have_curses_lib=no
17210
17211 : ${NCURSES_CONFIG_PKG:=none}
17212 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17213         :
17214 elif test "x${PKG_CONFIG:=none}" != xnone; then
17215         echo "$as_me:17215: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17216 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17217         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17218                 echo "$as_me:17218: result: yes" >&5
17219 echo "${ECHO_T}yes" >&6
17220
17221                 echo "$as_me:17221: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17222 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17223
17224                 cf_save_CPPFLAGS="$CPPFLAGS"
17225                 cf_save_LIBS="$LIBS"
17226
17227 cf_fix_cppflags=no
17228 cf_new_cflags=
17229 cf_new_cppflags=
17230 cf_new_extra_cppflags=
17231
17232 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17233 do
17234 case "$cf_fix_cppflags" in
17235 (no)
17236         case "$cf_add_cflags" in
17237         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17238                 case "$cf_add_cflags" in
17239                 (-D*)
17240                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17241
17242                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17243                                 && test -z "${cf_tst_cflags}" \
17244                                 && cf_fix_cppflags=yes
17245
17246                         if test "$cf_fix_cppflags" = yes ; then
17247
17248         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17249         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17250
17251                                 continue
17252                         elif test "${cf_tst_cflags}" = "\"'" ; then
17253
17254         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17255         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17256
17257                                 continue
17258                         fi
17259                         ;;
17260                 esac
17261                 case "$CPPFLAGS" in
17262                 (*$cf_add_cflags)
17263                         ;;
17264                 (*)
17265                         case "$cf_add_cflags" in
17266                         (-D*)
17267                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17268
17269 CPPFLAGS=`echo "$CPPFLAGS" | \
17270         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17271                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17272
17273                                 ;;
17274                         esac
17275
17276         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17277         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17278
17279                         ;;
17280                 esac
17281                 ;;
17282         (*)
17283
17284         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17285         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17286
17287                 ;;
17288         esac
17289         ;;
17290 (yes)
17291
17292         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17293         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17294
17295         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17296
17297         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17298                 && test -z "${cf_tst_cflags}" \
17299                 && cf_fix_cppflags=no
17300         ;;
17301 esac
17302 done
17303
17304 if test -n "$cf_new_cflags" ; then
17305
17306         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17307         CFLAGS="${CFLAGS}$cf_new_cflags"
17308
17309 fi
17310
17311 if test -n "$cf_new_cppflags" ; then
17312
17313         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17314         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17315
17316 fi
17317
17318 if test -n "$cf_new_extra_cppflags" ; then
17319
17320         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17321         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17322
17323 fi
17324
17325 cf_add_libs="$LIBS"
17326 # reverse order
17327 cf_add_0lib=
17328 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17329 # filter duplicates
17330 for cf_add_1lib in $cf_add_0lib; do
17331         for cf_add_2lib in $cf_add_libs; do
17332                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17333                         cf_add_1lib=
17334                         break
17335                 fi
17336         done
17337         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17338 done
17339 LIBS="$cf_add_libs"
17340
17341                 cat >"conftest.$ac_ext" <<_ACEOF
17342 #line 17342 "configure"
17343 #include "confdefs.h"
17344 #include <$FORM_NAME.h>
17345 int
17346 main (void)
17347 {
17348 (void) form_driver ( 0,0 );
17349   ;
17350   return 0;
17351 }
17352 _ACEOF
17353 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17354 if { (eval echo "$as_me:17354: \"$ac_link\"") >&5
17355   (eval $ac_link) 2>&5
17356   ac_status=$?
17357   echo "$as_me:17357: \$? = $ac_status" >&5
17358   (exit "$ac_status"); } &&
17359          { ac_try='test -s "conftest$ac_exeext"'
17360   { (eval echo "$as_me:17360: \"$ac_try\"") >&5
17361   (eval $ac_try) 2>&5
17362   ac_status=$?
17363   echo "$as_me:17363: \$? = $ac_status" >&5
17364   (exit "$ac_status"); }; }; then
17365   if test "$cross_compiling" = yes; then
17366   cf_have_curses_lib=maybe
17367 else
17368   cat >"conftest.$ac_ext" <<_ACEOF
17369 #line 17369 "configure"
17370 #include "confdefs.h"
17371 #include <$FORM_NAME.h>
17372                                 int main(void)
17373                                 { (void) form_driver ( 0,0 ); return 0; }
17374 _ACEOF
17375 rm -f "conftest$ac_exeext"
17376 if { (eval echo "$as_me:17376: \"$ac_link\"") >&5
17377   (eval $ac_link) 2>&5
17378   ac_status=$?
17379   echo "$as_me:17379: \$? = $ac_status" >&5
17380   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17381   { (eval echo "$as_me:17381: \"$ac_try\"") >&5
17382   (eval $ac_try) 2>&5
17383   ac_status=$?
17384   echo "$as_me:17384: \$? = $ac_status" >&5
17385   (exit "$ac_status"); }; }; then
17386   cf_have_curses_lib=yes
17387 else
17388   echo "$as_me: program exited with status $ac_status" >&5
17389 echo "$as_me: failed program was:" >&5
17390 cat "conftest.$ac_ext" >&5
17391 cf_have_curses_lib=no
17392 fi
17393 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17394 fi
17395 else
17396   echo "$as_me: failed program was:" >&5
17397 cat "conftest.$ac_ext" >&5
17398 cf_have_curses_lib=no
17399 fi
17400 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17401                 echo "$as_me:17401: result: $cf_have_curses_lib" >&5
17402 echo "${ECHO_T}$cf_have_curses_lib" >&6
17403                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17404                 if test "$cf_have_curses_lib" != "yes"
17405                 then
17406                         CPPFLAGS="$cf_save_CPPFLAGS"
17407                         LIBS="$cf_save_LIBS"
17408                 else
17409
17410 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17411
17412                         cat >>confdefs.h <<EOF
17413 #define $cf_upper 1
17414 EOF
17415
17416                 fi
17417         fi
17418 fi
17419 if test "$cf_have_curses_lib" = no; then
17420         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17421 echo "$as_me:17421: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17422 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17423 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17424   echo $ECHO_N "(cached) $ECHO_C" >&6
17425 else
17426   ac_check_lib_save_LIBS=$LIBS
17427 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17428 cat >"conftest.$ac_ext" <<_ACEOF
17429 #line 17429 "configure"
17430 #include "confdefs.h"
17431
17432 /* Override any gcc2 internal prototype to avoid an error.  */
17433 #ifdef __cplusplus
17434 extern "C"
17435 #endif
17436 /* We use char because int might match the return type of a gcc2
17437    builtin and then its argument prototype would still apply.  */
17438 char form_driver ();
17439 int
17440 main (void)
17441 {
17442 form_driver ();
17443   ;
17444   return 0;
17445 }
17446 _ACEOF
17447 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17448 if { (eval echo "$as_me:17448: \"$ac_link\"") >&5
17449   (eval $ac_link) 2>&5
17450   ac_status=$?
17451   echo "$as_me:17451: \$? = $ac_status" >&5
17452   (exit "$ac_status"); } &&
17453          { ac_try='test -s "conftest$ac_exeext"'
17454   { (eval echo "$as_me:17454: \"$ac_try\"") >&5
17455   (eval $ac_try) 2>&5
17456   ac_status=$?
17457   echo "$as_me:17457: \$? = $ac_status" >&5
17458   (exit "$ac_status"); }; }; then
17459   eval "$as_ac_Lib=yes"
17460 else
17461   echo "$as_me: failed program was:" >&5
17462 cat "conftest.$ac_ext" >&5
17463 eval "$as_ac_Lib=no"
17464 fi
17465 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17466 LIBS=$ac_check_lib_save_LIBS
17467 fi
17468 echo "$as_me:17468: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17469 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17470 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17471
17472 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17473
17474 cf_add_libs="$LIBS"
17475 # reverse order
17476 cf_add_0lib=
17477 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17478 # filter duplicates
17479 for cf_add_1lib in $cf_add_0lib; do
17480         for cf_add_2lib in $cf_add_libs; do
17481                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17482                         cf_add_1lib=
17483                         break
17484                 fi
17485         done
17486         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17487 done
17488 LIBS="$cf_add_libs"
17489
17490                 cat >>confdefs.h <<EOF
17491 #define $cf_upper 1
17492 EOF
17493
17494 fi
17495
17496 fi
17497
17498         cf_curses_headers="$cf_curses_headers form.h"
17499 fi
17500
17501 # look for curses-related headers
17502
17503 for ac_header in $cf_curses_headers
17504 do
17505 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17506 echo "$as_me:17506: checking for $ac_header" >&5
17507 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17508 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17509   echo $ECHO_N "(cached) $ECHO_C" >&6
17510 else
17511   cat >"conftest.$ac_ext" <<_ACEOF
17512 #line 17512 "configure"
17513 #include "confdefs.h"
17514 #include <$ac_header>
17515 _ACEOF
17516 if { (eval echo "$as_me:17516: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17517   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17518   ac_status=$?
17519   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17520   rm -f conftest.er1
17521   cat conftest.err >&5
17522   echo "$as_me:17522: \$? = $ac_status" >&5
17523   (exit "$ac_status"); } >/dev/null; then
17524   if test -s conftest.err; then
17525     ac_cpp_err=$ac_c_preproc_warn_flag
17526   else
17527     ac_cpp_err=
17528   fi
17529 else
17530   ac_cpp_err=yes
17531 fi
17532 if test -z "$ac_cpp_err"; then
17533   eval "$as_ac_Header=yes"
17534 else
17535   echo "$as_me: failed program was:" >&5
17536   cat "conftest.$ac_ext" >&5
17537   eval "$as_ac_Header=no"
17538 fi
17539 rm -f conftest.err "conftest.$ac_ext"
17540 fi
17541 echo "$as_me:17541: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17542 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17543 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17544   cat >>confdefs.h <<EOF
17545 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17546 EOF
17547
17548 fi
17549 done
17550
17551 echo "$as_me:17551: checking for ANSI C header files" >&5
17552 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17553 if test "${ac_cv_header_stdc+set}" = set; then
17554   echo $ECHO_N "(cached) $ECHO_C" >&6
17555 else
17556   cat >"conftest.$ac_ext" <<_ACEOF
17557 #line 17557 "configure"
17558 #include "confdefs.h"
17559 #include <stdlib.h>
17560 #include <stdarg.h>
17561 #include <string.h>
17562 #include <float.h>
17563
17564 _ACEOF
17565 if { (eval echo "$as_me:17565: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17566   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17567   ac_status=$?
17568   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17569   rm -f conftest.er1
17570   cat conftest.err >&5
17571   echo "$as_me:17571: \$? = $ac_status" >&5
17572   (exit "$ac_status"); } >/dev/null; then
17573   if test -s conftest.err; then
17574     ac_cpp_err=$ac_c_preproc_warn_flag
17575   else
17576     ac_cpp_err=
17577   fi
17578 else
17579   ac_cpp_err=yes
17580 fi
17581 if test -z "$ac_cpp_err"; then
17582   ac_cv_header_stdc=yes
17583 else
17584   echo "$as_me: failed program was:" >&5
17585   cat "conftest.$ac_ext" >&5
17586   ac_cv_header_stdc=no
17587 fi
17588 rm -f conftest.err "conftest.$ac_ext"
17589
17590 if test $ac_cv_header_stdc = yes; then
17591   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17592   cat >"conftest.$ac_ext" <<_ACEOF
17593 #line 17593 "configure"
17594 #include "confdefs.h"
17595 #include <string.h>
17596
17597 _ACEOF
17598 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17599   $EGREP "memchr" >/dev/null 2>&1; then
17600   :
17601 else
17602   ac_cv_header_stdc=no
17603 fi
17604 rm -rf conftest*
17605
17606 fi
17607
17608 if test $ac_cv_header_stdc = yes; then
17609   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17610   cat >"conftest.$ac_ext" <<_ACEOF
17611 #line 17611 "configure"
17612 #include "confdefs.h"
17613 #include <stdlib.h>
17614
17615 _ACEOF
17616 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17617   $EGREP "free" >/dev/null 2>&1; then
17618   :
17619 else
17620   ac_cv_header_stdc=no
17621 fi
17622 rm -rf conftest*
17623
17624 fi
17625
17626 if test $ac_cv_header_stdc = yes; then
17627   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17628   if test "$cross_compiling" = yes; then
17629   :
17630 else
17631   cat >"conftest.$ac_ext" <<_ACEOF
17632 #line 17632 "configure"
17633 #include "confdefs.h"
17634 #include <ctype.h>
17635 #if ((' ' & 0x0FF) == 0x020)
17636 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17637 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17638 #else
17639 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17640                      || ('j' <= (c) && (c) <= 'r') \
17641                      || ('s' <= (c) && (c) <= 'z'))
17642 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17643 #endif
17644
17645 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17646 int
17647 main (void)
17648 {
17649   int i;
17650   for (i = 0; i < 256; i++)
17651     if (XOR (islower (i), ISLOWER (i))
17652         || toupper (i) != TOUPPER (i))
17653       $ac_main_return(2);
17654   $ac_main_return (0);
17655 }
17656 _ACEOF
17657 rm -f "conftest$ac_exeext"
17658 if { (eval echo "$as_me:17658: \"$ac_link\"") >&5
17659   (eval $ac_link) 2>&5
17660   ac_status=$?
17661   echo "$as_me:17661: \$? = $ac_status" >&5
17662   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17663   { (eval echo "$as_me:17663: \"$ac_try\"") >&5
17664   (eval $ac_try) 2>&5
17665   ac_status=$?
17666   echo "$as_me:17666: \$? = $ac_status" >&5
17667   (exit "$ac_status"); }; }; then
17668   :
17669 else
17670   echo "$as_me: program exited with status $ac_status" >&5
17671 echo "$as_me: failed program was:" >&5
17672 cat "conftest.$ac_ext" >&5
17673 ac_cv_header_stdc=no
17674 fi
17675 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17676 fi
17677 fi
17678 fi
17679 echo "$as_me:17679: result: $ac_cv_header_stdc" >&5
17680 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17681 if test $ac_cv_header_stdc = yes; then
17682
17683 cat >>confdefs.h <<\EOF
17684 #define STDC_HEADERS 1
17685 EOF
17686
17687 fi
17688
17689 echo "$as_me:17689: checking whether time.h and sys/time.h may both be included" >&5
17690 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17691 if test "${ac_cv_header_time+set}" = set; then
17692   echo $ECHO_N "(cached) $ECHO_C" >&6
17693 else
17694   cat >"conftest.$ac_ext" <<_ACEOF
17695 #line 17695 "configure"
17696 #include "confdefs.h"
17697 #include <sys/types.h>
17698 #include <sys/time.h>
17699 #include <time.h>
17700
17701 int
17702 main (void)
17703 {
17704 if ((struct tm *) 0)
17705 return 0;
17706   ;
17707   return 0;
17708 }
17709 _ACEOF
17710 rm -f "conftest.$ac_objext"
17711 if { (eval echo "$as_me:17711: \"$ac_compile\"") >&5
17712   (eval $ac_compile) 2>&5
17713   ac_status=$?
17714   echo "$as_me:17714: \$? = $ac_status" >&5
17715   (exit "$ac_status"); } &&
17716          { ac_try='test -s "conftest.$ac_objext"'
17717   { (eval echo "$as_me:17717: \"$ac_try\"") >&5
17718   (eval $ac_try) 2>&5
17719   ac_status=$?
17720   echo "$as_me:17720: \$? = $ac_status" >&5
17721   (exit "$ac_status"); }; }; then
17722   ac_cv_header_time=yes
17723 else
17724   echo "$as_me: failed program was:" >&5
17725 cat "conftest.$ac_ext" >&5
17726 ac_cv_header_time=no
17727 fi
17728 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17729 fi
17730 echo "$as_me:17730: result: $ac_cv_header_time" >&5
17731 echo "${ECHO_T}$ac_cv_header_time" >&6
17732 if test $ac_cv_header_time = yes; then
17733
17734 cat >>confdefs.h <<\EOF
17735 #define TIME_WITH_SYS_TIME 1
17736 EOF
17737
17738 fi
17739
17740 for ac_header in \
17741 getopt.h \
17742 locale.h \
17743 math.h \
17744 stdarg.h \
17745 stdint.h \
17746 sys/ioctl.h \
17747 sys/select.h \
17748 sys/time.h \
17749 termios.h \
17750 unistd.h \
17751
17752 do
17753 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17754 echo "$as_me:17754: checking for $ac_header" >&5
17755 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17756 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17757   echo $ECHO_N "(cached) $ECHO_C" >&6
17758 else
17759   cat >"conftest.$ac_ext" <<_ACEOF
17760 #line 17760 "configure"
17761 #include "confdefs.h"
17762 #include <$ac_header>
17763 _ACEOF
17764 if { (eval echo "$as_me:17764: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17765   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17766   ac_status=$?
17767   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17768   rm -f conftest.er1
17769   cat conftest.err >&5
17770   echo "$as_me:17770: \$? = $ac_status" >&5
17771   (exit "$ac_status"); } >/dev/null; then
17772   if test -s conftest.err; then
17773     ac_cpp_err=$ac_c_preproc_warn_flag
17774   else
17775     ac_cpp_err=
17776   fi
17777 else
17778   ac_cpp_err=yes
17779 fi
17780 if test -z "$ac_cpp_err"; then
17781   eval "$as_ac_Header=yes"
17782 else
17783   echo "$as_me: failed program was:" >&5
17784   cat "conftest.$ac_ext" >&5
17785   eval "$as_ac_Header=no"
17786 fi
17787 rm -f conftest.err "conftest.$ac_ext"
17788 fi
17789 echo "$as_me:17789: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17790 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17791 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17792   cat >>confdefs.h <<EOF
17793 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17794 EOF
17795
17796 fi
17797 done
17798
17799 for ac_header in unistd.h getopt.h
17800 do
17801 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17802 echo "$as_me:17802: checking for $ac_header" >&5
17803 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17804 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17805   echo $ECHO_N "(cached) $ECHO_C" >&6
17806 else
17807   cat >"conftest.$ac_ext" <<_ACEOF
17808 #line 17808 "configure"
17809 #include "confdefs.h"
17810 #include <$ac_header>
17811 _ACEOF
17812 if { (eval echo "$as_me:17812: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17813   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17814   ac_status=$?
17815   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17816   rm -f conftest.er1
17817   cat conftest.err >&5
17818   echo "$as_me:17818: \$? = $ac_status" >&5
17819   (exit "$ac_status"); } >/dev/null; then
17820   if test -s conftest.err; then
17821     ac_cpp_err=$ac_c_preproc_warn_flag
17822   else
17823     ac_cpp_err=
17824   fi
17825 else
17826   ac_cpp_err=yes
17827 fi
17828 if test -z "$ac_cpp_err"; then
17829   eval "$as_ac_Header=yes"
17830 else
17831   echo "$as_me: failed program was:" >&5
17832   cat "conftest.$ac_ext" >&5
17833   eval "$as_ac_Header=no"
17834 fi
17835 rm -f conftest.err "conftest.$ac_ext"
17836 fi
17837 echo "$as_me:17837: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17838 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17839 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17840   cat >>confdefs.h <<EOF
17841 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17842 EOF
17843
17844 fi
17845 done
17846
17847 echo "$as_me:17847: checking for header declaring getopt variables" >&5
17848 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17849 if test "${cf_cv_getopt_header+set}" = set; then
17850   echo $ECHO_N "(cached) $ECHO_C" >&6
17851 else
17852
17853 cf_cv_getopt_header=none
17854 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17855 do
17856 cat >"conftest.$ac_ext" <<_ACEOF
17857 #line 17857 "configure"
17858 #include "confdefs.h"
17859
17860 #include <$cf_header>
17861 int
17862 main (void)
17863 {
17864 int x = optind; char *y = optarg
17865   ;
17866   return 0;
17867 }
17868 _ACEOF
17869 rm -f "conftest.$ac_objext"
17870 if { (eval echo "$as_me:17870: \"$ac_compile\"") >&5
17871   (eval $ac_compile) 2>&5
17872   ac_status=$?
17873   echo "$as_me:17873: \$? = $ac_status" >&5
17874   (exit "$ac_status"); } &&
17875          { ac_try='test -s "conftest.$ac_objext"'
17876   { (eval echo "$as_me:17876: \"$ac_try\"") >&5
17877   (eval $ac_try) 2>&5
17878   ac_status=$?
17879   echo "$as_me:17879: \$? = $ac_status" >&5
17880   (exit "$ac_status"); }; }; then
17881   cf_cv_getopt_header=$cf_header
17882  break
17883 else
17884   echo "$as_me: failed program was:" >&5
17885 cat "conftest.$ac_ext" >&5
17886 fi
17887 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17888 done
17889
17890 fi
17891 echo "$as_me:17891: result: $cf_cv_getopt_header" >&5
17892 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17893 if test "$cf_cv_getopt_header" != none ; then
17894
17895 cat >>confdefs.h <<\EOF
17896 #define HAVE_GETOPT_HEADER 1
17897 EOF
17898
17899 fi
17900 if test "$cf_cv_getopt_header" = getopt.h ; then
17901
17902 cat >>confdefs.h <<\EOF
17903 #define NEED_GETOPT_H 1
17904 EOF
17905
17906 fi
17907
17908 for ac_func in \
17909 getopt \
17910 gettimeofday \
17911 snprintf \
17912 strdup \
17913 strstr \
17914 tsearch \
17915
17916 do
17917 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17918 echo "$as_me:17918: checking for $ac_func" >&5
17919 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17920 if eval "test \"\${$as_ac_var+set}\" = set"; then
17921   echo $ECHO_N "(cached) $ECHO_C" >&6
17922 else
17923   cat >"conftest.$ac_ext" <<_ACEOF
17924 #line 17924 "configure"
17925 #include "confdefs.h"
17926 #define $ac_func autoconf_temporary
17927 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17928 #undef $ac_func
17929
17930 #ifdef __cplusplus
17931 extern "C"
17932 #endif
17933
17934 /* We use char because int might match the return type of a gcc2
17935    builtin and then its argument prototype would still apply.  */
17936 char $ac_func (void);
17937
17938 int
17939 main (void)
17940 {
17941
17942 /* The GNU C library defines stubs for functions which it implements
17943     to always fail with ENOSYS.  Some functions are actually named
17944     something starting with __ and the normal name is an alias.  */
17945 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17946 #error found stub for $ac_func
17947 #endif
17948
17949         return $ac_func ();
17950   ;
17951   return 0;
17952 }
17953 _ACEOF
17954 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17955 if { (eval echo "$as_me:17955: \"$ac_link\"") >&5
17956   (eval $ac_link) 2>&5
17957   ac_status=$?
17958   echo "$as_me:17958: \$? = $ac_status" >&5
17959   (exit "$ac_status"); } &&
17960          { ac_try='test -s "conftest$ac_exeext"'
17961   { (eval echo "$as_me:17961: \"$ac_try\"") >&5
17962   (eval $ac_try) 2>&5
17963   ac_status=$?
17964   echo "$as_me:17964: \$? = $ac_status" >&5
17965   (exit "$ac_status"); }; }; then
17966   eval "$as_ac_var=yes"
17967 else
17968   echo "$as_me: failed program was:" >&5
17969 cat "conftest.$ac_ext" >&5
17970 eval "$as_ac_var=no"
17971 fi
17972 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17973 fi
17974 echo "$as_me:17974: result: `eval echo '${'"$as_ac_var"'}'`" >&5
17975 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
17976 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
17977   cat >>confdefs.h <<EOF
17978 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17979 EOF
17980
17981 fi
17982 done
17983
17984 # use a compile-check to work with ncurses*-config and subdirectory includes
17985 echo "$as_me:17985: checking if we can use termcap.h" >&5
17986 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17987 if test "${cf_cv_have_termcap_h+set}" = set; then
17988   echo $ECHO_N "(cached) $ECHO_C" >&6
17989 else
17990
17991         cat >"conftest.$ac_ext" <<_ACEOF
17992 #line 17992 "configure"
17993 #include "confdefs.h"
17994
17995 #include <curses.h>
17996 #ifdef NCURSES_VERSION
17997 #undef NCURSES_VERSION
17998 #endif
17999 #include <termcap.h>
18000 #ifndef NCURSES_VERSION
18001 #error wrong header
18002 #endif
18003
18004 int
18005 main (void)
18006 {
18007 return 0;
18008   ;
18009   return 0;
18010 }
18011 _ACEOF
18012 rm -f "conftest.$ac_objext"
18013 if { (eval echo "$as_me:18013: \"$ac_compile\"") >&5
18014   (eval $ac_compile) 2>&5
18015   ac_status=$?
18016   echo "$as_me:18016: \$? = $ac_status" >&5
18017   (exit "$ac_status"); } &&
18018          { ac_try='test -s "conftest.$ac_objext"'
18019   { (eval echo "$as_me:18019: \"$ac_try\"") >&5
18020   (eval $ac_try) 2>&5
18021   ac_status=$?
18022   echo "$as_me:18022: \$? = $ac_status" >&5
18023   (exit "$ac_status"); }; }; then
18024   cf_cv_have_termcap_h=yes
18025 else
18026   echo "$as_me: failed program was:" >&5
18027 cat "conftest.$ac_ext" >&5
18028 cf_cv_have_termcap_h=no
18029 fi
18030 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18031 fi
18032 echo "$as_me:18032: result: $cf_cv_have_termcap_h" >&5
18033 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18034 if test "x$cf_cv_have_termcap_h" = xyes
18035 then
18036
18037 cat >>confdefs.h <<\EOF
18038 #define HAVE_TERMCAP_H 1
18039 EOF
18040
18041 else
18042 echo "$as_me:18042: checking if we can use ncurses/termcap.h" >&5
18043 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18044 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18045   echo $ECHO_N "(cached) $ECHO_C" >&6
18046 else
18047
18048         cat >"conftest.$ac_ext" <<_ACEOF
18049 #line 18049 "configure"
18050 #include "confdefs.h"
18051
18052 #include <ncurses/curses.h>
18053 #ifdef NCURSES_VERSION
18054 #undef NCURSES_VERSION
18055 #endif
18056 #include <ncurses/termcap.h>
18057 #ifndef NCURSES_VERSION
18058 #error wrong header
18059 #endif
18060
18061 int
18062 main (void)
18063 {
18064 return 0;
18065   ;
18066   return 0;
18067 }
18068 _ACEOF
18069 rm -f "conftest.$ac_objext"
18070 if { (eval echo "$as_me:18070: \"$ac_compile\"") >&5
18071   (eval $ac_compile) 2>&5
18072   ac_status=$?
18073   echo "$as_me:18073: \$? = $ac_status" >&5
18074   (exit "$ac_status"); } &&
18075          { ac_try='test -s "conftest.$ac_objext"'
18076   { (eval echo "$as_me:18076: \"$ac_try\"") >&5
18077   (eval $ac_try) 2>&5
18078   ac_status=$?
18079   echo "$as_me:18079: \$? = $ac_status" >&5
18080   (exit "$ac_status"); }; }; then
18081   cf_cv_have_ncurses_termcap_h=yes
18082 else
18083   echo "$as_me: failed program was:" >&5
18084 cat "conftest.$ac_ext" >&5
18085 cf_cv_have_ncurses_termcap_h=no
18086 fi
18087 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18088 fi
18089 echo "$as_me:18089: result: $cf_cv_have_ncurses_termcap_h" >&5
18090 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18091 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18092 cat >>confdefs.h <<\EOF
18093 #define HAVE_NCURSES_TERMCAP_H 1
18094 EOF
18095
18096 fi
18097
18098 if test "x$ac_cv_func_getopt" = xno; then
18099         { { echo "$as_me:18099: error: getopt is required for building programs" >&5
18100 echo "$as_me: error: getopt is required for building programs" >&2;}
18101    { (exit 1); exit 1; }; }
18102 fi
18103
18104 if test "$cf_enable_widec" = yes; then
18105
18106 for ac_func in \
18107 mblen \
18108 mbrlen \
18109 mbrtowc \
18110 mbsrtowcs \
18111 mbstowcs \
18112 mbtowc \
18113 wcsrtombs \
18114 wcstombs \
18115
18116 do
18117 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18118 echo "$as_me:18118: checking for $ac_func" >&5
18119 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18120 if eval "test \"\${$as_ac_var+set}\" = set"; then
18121   echo $ECHO_N "(cached) $ECHO_C" >&6
18122 else
18123   cat >"conftest.$ac_ext" <<_ACEOF
18124 #line 18124 "configure"
18125 #include "confdefs.h"
18126 #define $ac_func autoconf_temporary
18127 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18128 #undef $ac_func
18129
18130 #ifdef __cplusplus
18131 extern "C"
18132 #endif
18133
18134 /* We use char because int might match the return type of a gcc2
18135    builtin and then its argument prototype would still apply.  */
18136 char $ac_func (void);
18137
18138 int
18139 main (void)
18140 {
18141
18142 /* The GNU C library defines stubs for functions which it implements
18143     to always fail with ENOSYS.  Some functions are actually named
18144     something starting with __ and the normal name is an alias.  */
18145 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18146 #error found stub for $ac_func
18147 #endif
18148
18149         return $ac_func ();
18150   ;
18151   return 0;
18152 }
18153 _ACEOF
18154 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18155 if { (eval echo "$as_me:18155: \"$ac_link\"") >&5
18156   (eval $ac_link) 2>&5
18157   ac_status=$?
18158   echo "$as_me:18158: \$? = $ac_status" >&5
18159   (exit "$ac_status"); } &&
18160          { ac_try='test -s "conftest$ac_exeext"'
18161   { (eval echo "$as_me:18161: \"$ac_try\"") >&5
18162   (eval $ac_try) 2>&5
18163   ac_status=$?
18164   echo "$as_me:18164: \$? = $ac_status" >&5
18165   (exit "$ac_status"); }; }; then
18166   eval "$as_ac_var=yes"
18167 else
18168   echo "$as_me: failed program was:" >&5
18169 cat "conftest.$ac_ext" >&5
18170 eval "$as_ac_var=no"
18171 fi
18172 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18173 fi
18174 echo "$as_me:18174: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18175 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18176 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18177   cat >>confdefs.h <<EOF
18178 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18179 EOF
18180
18181 fi
18182 done
18183
18184 fi
18185
18186 echo "$as_me:18186: checking definition to turn on extended curses functions" >&5
18187 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18188 if test "${cf_cv_need_xopen_extension+set}" = set; then
18189   echo $ECHO_N "(cached) $ECHO_C" >&6
18190 else
18191
18192 cf_cv_need_xopen_extension=unknown
18193 cat >"conftest.$ac_ext" <<_ACEOF
18194 #line 18194 "configure"
18195 #include "confdefs.h"
18196
18197 #include <stdlib.h>
18198 #include <${cf_cv_ncurses_header:-curses.h}>
18199 int
18200 main (void)
18201 {
18202
18203 #if defined(NCURSES_VERSION_PATCH)
18204 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18205         make an error
18206 #endif
18207 #endif
18208 #ifdef NCURSES_VERSION
18209         cchar_t check;
18210         int check2 = curs_set((int)sizeof(check));
18211 #endif
18212         long x = winnstr(stdscr, "", 0);
18213         int x1, y1;
18214 #ifdef NCURSES_VERSION
18215         (void)check2;
18216 #endif
18217         getbegyx(stdscr, y1, x1);
18218         (void)x;
18219         (void)y1;
18220         (void)x1;
18221
18222   ;
18223   return 0;
18224 }
18225 _ACEOF
18226 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18227 if { (eval echo "$as_me:18227: \"$ac_link\"") >&5
18228   (eval $ac_link) 2>&5
18229   ac_status=$?
18230   echo "$as_me:18230: \$? = $ac_status" >&5
18231   (exit "$ac_status"); } &&
18232          { ac_try='test -s "conftest$ac_exeext"'
18233   { (eval echo "$as_me:18233: \"$ac_try\"") >&5
18234   (eval $ac_try) 2>&5
18235   ac_status=$?
18236   echo "$as_me:18236: \$? = $ac_status" >&5
18237   (exit "$ac_status"); }; }; then
18238   cf_cv_need_xopen_extension=none
18239 else
18240   echo "$as_me: failed program was:" >&5
18241 cat "conftest.$ac_ext" >&5
18242
18243         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18244         do
18245                 cat >"conftest.$ac_ext" <<_ACEOF
18246 #line 18246 "configure"
18247 #include "confdefs.h"
18248
18249 #define $cf_try_xopen_extension 1
18250 #include <stdlib.h>
18251 #include <${cf_cv_ncurses_header:-curses.h}>
18252 int
18253 main (void)
18254 {
18255
18256 #ifdef NCURSES_VERSION
18257                 cchar_t check;
18258                 int check2 = curs_set((int)sizeof(check));
18259 #endif
18260                 long x = winnstr(stdscr, "", 0);
18261                 int x1, y1;
18262                 getbegyx(stdscr, y1, x1);
18263 #ifdef NCURSES_VERSION
18264                 (void)check2;
18265 #endif
18266                 (void)x;
18267                 (void)y1;
18268                 (void)x1;
18269
18270   ;
18271   return 0;
18272 }
18273 _ACEOF
18274 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18275 if { (eval echo "$as_me:18275: \"$ac_link\"") >&5
18276   (eval $ac_link) 2>&5
18277   ac_status=$?
18278   echo "$as_me:18278: \$? = $ac_status" >&5
18279   (exit "$ac_status"); } &&
18280          { ac_try='test -s "conftest$ac_exeext"'
18281   { (eval echo "$as_me:18281: \"$ac_try\"") >&5
18282   (eval $ac_try) 2>&5
18283   ac_status=$?
18284   echo "$as_me:18284: \$? = $ac_status" >&5
18285   (exit "$ac_status"); }; }; then
18286   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18287 else
18288   echo "$as_me: failed program was:" >&5
18289 cat "conftest.$ac_ext" >&5
18290 fi
18291 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18292         done
18293
18294 fi
18295 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18296
18297 fi
18298 echo "$as_me:18298: result: $cf_cv_need_xopen_extension" >&5
18299 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18300
18301 case "$cf_cv_need_xopen_extension" in
18302 (*_*)
18303
18304         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18305         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18306
18307         ;;
18308 esac
18309
18310 echo "$as_me:18310: checking for term.h" >&5
18311 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18312 if test "${cf_cv_term_header+set}" = set; then
18313   echo $ECHO_N "(cached) $ECHO_C" >&6
18314 else
18315
18316 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18317 # for <term.h> if we do not find the variant.
18318
18319 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18320
18321 case "${cf_cv_ncurses_header:-curses.h}" in
18322 (*/*)
18323         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18324         cf_header_list="$cf_header_item $cf_header_list"
18325         ;;
18326 esac
18327
18328 for cf_header in $cf_header_list
18329 do
18330         cat >"conftest.$ac_ext" <<_ACEOF
18331 #line 18331 "configure"
18332 #include "confdefs.h"
18333
18334 #include <${cf_cv_ncurses_header:-curses.h}>
18335 #include <${cf_header}>
18336 int
18337 main (void)
18338 {
18339 WINDOW *x; (void)x
18340   ;
18341   return 0;
18342 }
18343 _ACEOF
18344 rm -f "conftest.$ac_objext"
18345 if { (eval echo "$as_me:18345: \"$ac_compile\"") >&5
18346   (eval $ac_compile) 2>&5
18347   ac_status=$?
18348   echo "$as_me:18348: \$? = $ac_status" >&5
18349   (exit "$ac_status"); } &&
18350          { ac_try='test -s "conftest.$ac_objext"'
18351   { (eval echo "$as_me:18351: \"$ac_try\"") >&5
18352   (eval $ac_try) 2>&5
18353   ac_status=$?
18354   echo "$as_me:18354: \$? = $ac_status" >&5
18355   (exit "$ac_status"); }; }; then
18356   cf_cv_term_header=$cf_header
18357          break
18358 else
18359   echo "$as_me: failed program was:" >&5
18360 cat "conftest.$ac_ext" >&5
18361 cf_cv_term_header=no
18362 fi
18363 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18364 done
18365
18366 case "$cf_cv_term_header" in
18367 (no)
18368         # If curses is ncurses, some packagers still mess it up by trying to make
18369         # us use GNU termcap.  This handles the most common case.
18370         for cf_header in ncurses/term.h ncursesw/term.h
18371         do
18372                 cat >"conftest.$ac_ext" <<_ACEOF
18373 #line 18373 "configure"
18374 #include "confdefs.h"
18375
18376 #include <${cf_cv_ncurses_header:-curses.h}>
18377 #ifdef NCURSES_VERSION
18378 #include <${cf_header}>
18379 #else
18380 make an error
18381 #endif
18382 int
18383 main (void)
18384 {
18385 WINDOW *x; (void)x
18386   ;
18387   return 0;
18388 }
18389 _ACEOF
18390 rm -f "conftest.$ac_objext"
18391 if { (eval echo "$as_me:18391: \"$ac_compile\"") >&5
18392   (eval $ac_compile) 2>&5
18393   ac_status=$?
18394   echo "$as_me:18394: \$? = $ac_status" >&5
18395   (exit "$ac_status"); } &&
18396          { ac_try='test -s "conftest.$ac_objext"'
18397   { (eval echo "$as_me:18397: \"$ac_try\"") >&5
18398   (eval $ac_try) 2>&5
18399   ac_status=$?
18400   echo "$as_me:18400: \$? = $ac_status" >&5
18401   (exit "$ac_status"); }; }; then
18402   cf_cv_term_header=$cf_header
18403                          break
18404 else
18405   echo "$as_me: failed program was:" >&5
18406 cat "conftest.$ac_ext" >&5
18407 cf_cv_term_header=no
18408 fi
18409 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18410         done
18411         ;;
18412 esac
18413
18414 fi
18415 echo "$as_me:18415: result: $cf_cv_term_header" >&5
18416 echo "${ECHO_T}$cf_cv_term_header" >&6
18417
18418 case "$cf_cv_term_header" in
18419 (term.h)
18420
18421 cat >>confdefs.h <<\EOF
18422 #define HAVE_TERM_H 1
18423 EOF
18424
18425         ;;
18426 (ncurses/term.h)
18427
18428 cat >>confdefs.h <<\EOF
18429 #define HAVE_NCURSES_TERM_H 1
18430 EOF
18431
18432         ;;
18433 (ncursesw/term.h)
18434
18435 cat >>confdefs.h <<\EOF
18436 #define HAVE_NCURSESW_TERM_H 1
18437 EOF
18438
18439         ;;
18440 esac
18441
18442 echo "$as_me:18442: checking for unctrl.h" >&5
18443 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18444 if test "${cf_cv_unctrl_header+set}" = set; then
18445   echo $ECHO_N "(cached) $ECHO_C" >&6
18446 else
18447
18448 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18449 # for <unctrl.h> if we do not find the variant.
18450
18451 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18452
18453 case "${cf_cv_ncurses_header:-curses.h}" in
18454 (*/*)
18455         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18456         cf_header_list="$cf_header_item $cf_header_list"
18457         ;;
18458 esac
18459
18460 for cf_header in $cf_header_list
18461 do
18462         cat >"conftest.$ac_ext" <<_ACEOF
18463 #line 18463 "configure"
18464 #include "confdefs.h"
18465
18466 #include <${cf_cv_ncurses_header:-curses.h}>
18467 #include <${cf_header}>
18468 int
18469 main (void)
18470 {
18471 WINDOW *x; (void)x
18472   ;
18473   return 0;
18474 }
18475 _ACEOF
18476 rm -f "conftest.$ac_objext"
18477 if { (eval echo "$as_me:18477: \"$ac_compile\"") >&5
18478   (eval $ac_compile) 2>&5
18479   ac_status=$?
18480   echo "$as_me:18480: \$? = $ac_status" >&5
18481   (exit "$ac_status"); } &&
18482          { ac_try='test -s "conftest.$ac_objext"'
18483   { (eval echo "$as_me:18483: \"$ac_try\"") >&5
18484   (eval $ac_try) 2>&5
18485   ac_status=$?
18486   echo "$as_me:18486: \$? = $ac_status" >&5
18487   (exit "$ac_status"); }; }; then
18488   cf_cv_unctrl_header=$cf_header
18489          break
18490 else
18491   echo "$as_me: failed program was:" >&5
18492 cat "conftest.$ac_ext" >&5
18493 cf_cv_unctrl_header=no
18494 fi
18495 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18496 done
18497
18498 fi
18499 echo "$as_me:18499: result: $cf_cv_unctrl_header" >&5
18500 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18501
18502 case "$cf_cv_unctrl_header" in
18503 (no)
18504         { echo "$as_me:18504: WARNING: unctrl.h header not found" >&5
18505 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18506         ;;
18507 esac
18508
18509 case "$cf_cv_unctrl_header" in
18510 (unctrl.h)
18511
18512 cat >>confdefs.h <<\EOF
18513 #define HAVE_UNCTRL_H 1
18514 EOF
18515
18516         ;;
18517 (ncurses/unctrl.h)
18518
18519 cat >>confdefs.h <<\EOF
18520 #define HAVE_NCURSES_UNCTRL_H 1
18521 EOF
18522
18523         ;;
18524 (ncursesw/unctrl.h)
18525
18526 cat >>confdefs.h <<\EOF
18527 #define HAVE_NCURSESW_UNCTRL_H 1
18528 EOF
18529
18530         ;;
18531 esac
18532
18533 for cf_func in \
18534 alloc_pair \
18535 assume_default_colors \
18536 chgat \
18537 color_content \
18538 color_set \
18539 copywin \
18540 delscreen \
18541 dupwin \
18542 exit_curses \
18543 exit_terminfo \
18544 filter \
18545 getbegx \
18546 getcurx \
18547 getmaxx \
18548 getnstr \
18549 getparx \
18550 getwin \
18551 halfdelay \
18552 init_extended_color \
18553 mvderwin \
18554 mvvline \
18555 mvwin \
18556 mvwvline \
18557 napms \
18558 newpad \
18559 putwin \
18560 reset_color_pairs \
18561 resize_term \
18562 resizeterm \
18563 restartterm \
18564 ripoffline \
18565 scr_dump \
18566 setupterm \
18567 slk_color \
18568 slk_init \
18569 termattrs \
18570 termname \
18571 tgetent \
18572 tigetnum \
18573 tigetstr \
18574 tputs_sp \
18575 typeahead \
18576 use_default_colors \
18577 use_env \
18578 use_extended_names \
18579 use_screen \
18580 use_window \
18581 vid_puts \
18582 vidputs \
18583 vsscanf \
18584 vw_printw \
18585 wchgat \
18586 winsdelln \
18587 winsstr \
18588 wresize \
18589 wsyncdown \
18590 _tracef \
18591
18592 do
18593
18594 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18595
18596         echo "$as_me:18596: checking for ${cf_func}" >&5
18597 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18598
18599 echo "${as_me:-configure}:18599: testing ${cf_func} ..." 1>&5
18600
18601         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18602   echo $ECHO_N "(cached) $ECHO_C" >&6
18603 else
18604
18605                 eval cf_result='$ac_cv_func_'$cf_func
18606                 if test ".$cf_result" != ".no"; then
18607                         cat >"conftest.$ac_ext" <<_ACEOF
18608 #line 18608 "configure"
18609 #include "confdefs.h"
18610
18611 #ifdef HAVE_XCURSES
18612 #include <xcurses.h>
18613 char * XCursesProgramName = "test";
18614 #else
18615 #include <${cf_cv_ncurses_header:-curses.h}>
18616 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18617 #include <ncursesw/term.h>
18618 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18619 #include <ncurses/term.h>
18620 #elif defined(HAVE_TERM_H)
18621 #include <term.h>
18622 #endif
18623 #endif
18624
18625 int
18626 main (void)
18627 {
18628
18629 #ifndef ${cf_func}
18630 long foo = (long)(&${cf_func});
18631 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18632 if (foo + 1234L > 5678L)
18633         ${cf_cv_main_return:-return}(foo != 0);
18634 #endif
18635
18636   ;
18637   return 0;
18638 }
18639 _ACEOF
18640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18641 if { (eval echo "$as_me:18641: \"$ac_link\"") >&5
18642   (eval $ac_link) 2>&5
18643   ac_status=$?
18644   echo "$as_me:18644: \$? = $ac_status" >&5
18645   (exit "$ac_status"); } &&
18646          { ac_try='test -s "conftest$ac_exeext"'
18647   { (eval echo "$as_me:18647: \"$ac_try\"") >&5
18648   (eval $ac_try) 2>&5
18649   ac_status=$?
18650   echo "$as_me:18650: \$? = $ac_status" >&5
18651   (exit "$ac_status"); }; }; then
18652   cf_result=yes
18653 else
18654   echo "$as_me: failed program was:" >&5
18655 cat "conftest.$ac_ext" >&5
18656 cf_result=no
18657 fi
18658 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18659                 fi
18660                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18661
18662 fi
18663
18664         # use the computed/retrieved cache-value:
18665         eval 'cf_result=$cf_cv_func_'$cf_func
18666         echo "$as_me:18666: result: $cf_result" >&5
18667 echo "${ECHO_T}$cf_result" >&6
18668         if test "$cf_result" != no; then
18669                 cat >>confdefs.h <<EOF
18670 #define HAVE_${cf_tr_func} 1
18671 EOF
18672
18673         fi
18674 done
18675
18676 for cf_func in tputs
18677 do
18678
18679 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18680
18681         echo "$as_me:18681: checking for ${cf_func}" >&5
18682 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18683
18684 echo "${as_me:-configure}:18684: testing ${cf_func} ..." 1>&5
18685
18686         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18687   echo $ECHO_N "(cached) $ECHO_C" >&6
18688 else
18689
18690                 eval cf_result='$ac_cv_func_'$cf_func
18691                 if test ".$cf_result" != ".no"; then
18692                         cat >"conftest.$ac_ext" <<_ACEOF
18693 #line 18693 "configure"
18694 #include "confdefs.h"
18695
18696 #ifdef HAVE_XCURSES
18697 #include <xcurses.h>
18698 char * XCursesProgramName = "test";
18699 #else
18700 #include <${cf_cv_ncurses_header:-curses.h}>
18701 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18702 #include <ncursesw/term.h>
18703 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18704 #include <ncurses/term.h>
18705 #elif defined(HAVE_TERM_H)
18706 #include <term.h>
18707 #endif
18708 #endif
18709
18710 int
18711 main (void)
18712 {
18713
18714 #ifndef ${cf_func}
18715 long foo = (long)(&${cf_func});
18716 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18717 if (foo + 1234L > 5678L)
18718         ${cf_cv_main_return:-return}(foo != 0);
18719 #endif
18720
18721   ;
18722   return 0;
18723 }
18724 _ACEOF
18725 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18726 if { (eval echo "$as_me:18726: \"$ac_link\"") >&5
18727   (eval $ac_link) 2>&5
18728   ac_status=$?
18729   echo "$as_me:18729: \$? = $ac_status" >&5
18730   (exit "$ac_status"); } &&
18731          { ac_try='test -s "conftest$ac_exeext"'
18732   { (eval echo "$as_me:18732: \"$ac_try\"") >&5
18733   (eval $ac_try) 2>&5
18734   ac_status=$?
18735   echo "$as_me:18735: \$? = $ac_status" >&5
18736   (exit "$ac_status"); }; }; then
18737   cf_result=yes
18738 else
18739   echo "$as_me: failed program was:" >&5
18740 cat "conftest.$ac_ext" >&5
18741 cf_result=no
18742 fi
18743 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18744                 fi
18745                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18746
18747 fi
18748
18749         # use the computed/retrieved cache-value:
18750         eval 'cf_result=$cf_cv_func_'$cf_func
18751         echo "$as_me:18751: result: $cf_result" >&5
18752 echo "${ECHO_T}$cf_result" >&6
18753         if test "$cf_result" != no; then
18754                 cat >>confdefs.h <<EOF
18755 #define HAVE_${cf_tr_func} 1
18756 EOF
18757
18758         fi
18759 done
18760
18761 if test "x$cf_cv_func_tputs" = xyes
18762 then
18763         cf_done=no
18764         for cf_arg in int char
18765         do
18766                 for cf_ret in int void
18767                 do
18768                         if test "$cf_ret" = void
18769                         then
18770                                 cf_return="/* nothing */"
18771                         else
18772                                 cf_return="return value"
18773                         fi
18774                         cat >"conftest.$ac_ext" <<_ACEOF
18775 #line 18775 "configure"
18776 #include "confdefs.h"
18777
18778 #include <${cf_cv_ncurses_header:-curses.h}>
18779 #include <$cf_cv_term_header>
18780
18781 static $cf_ret outc($cf_arg value) { $cf_return; }
18782
18783 int
18784 main (void)
18785 {
18786
18787         tputs("hello", 0, outc);
18788         ${cf_cv_main_return:-return}(0);
18789
18790   ;
18791   return 0;
18792 }
18793 _ACEOF
18794 rm -f "conftest.$ac_objext"
18795 if { (eval echo "$as_me:18795: \"$ac_compile\"") >&5
18796   (eval $ac_compile) 2>&5
18797   ac_status=$?
18798   echo "$as_me:18798: \$? = $ac_status" >&5
18799   (exit "$ac_status"); } &&
18800          { ac_try='test -s "conftest.$ac_objext"'
18801   { (eval echo "$as_me:18801: \"$ac_try\"") >&5
18802   (eval $ac_try) 2>&5
18803   ac_status=$?
18804   echo "$as_me:18804: \$? = $ac_status" >&5
18805   (exit "$ac_status"); }; }; then
18806
18807                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18808
18809 echo "${as_me:-configure}:18809: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18810
18811                 cat >>confdefs.h <<EOF
18812 #define TPUTS_ARG               $cf_arg
18813 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18814 #define TPUTS_RETURN(value)     $cf_return
18815 EOF
18816                 cf_done=yes
18817                 break
18818
18819 else
18820   echo "$as_me: failed program was:" >&5
18821 cat "conftest.$ac_ext" >&5
18822 fi
18823 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18824                 done
18825                 test "$cf_done" = yes && break
18826         done
18827 fi
18828
18829 echo "$as_me:18829: checking for ncurses extended functions" >&5
18830 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18831 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18832   echo $ECHO_N "(cached) $ECHO_C" >&6
18833 else
18834
18835 cat >"conftest.$ac_ext" <<_ACEOF
18836 #line 18836 "configure"
18837 #include "confdefs.h"
18838
18839 #include <${cf_cv_ncurses_header:-curses.h}>
18840 int
18841 main (void)
18842 {
18843
18844 int x = NCURSES_EXT_FUNCS
18845
18846   ;
18847   return 0;
18848 }
18849 _ACEOF
18850 rm -f "conftest.$ac_objext"
18851 if { (eval echo "$as_me:18851: \"$ac_compile\"") >&5
18852   (eval $ac_compile) 2>&5
18853   ac_status=$?
18854   echo "$as_me:18854: \$? = $ac_status" >&5
18855   (exit "$ac_status"); } &&
18856          { ac_try='test -s "conftest.$ac_objext"'
18857   { (eval echo "$as_me:18857: \"$ac_try\"") >&5
18858   (eval $ac_try) 2>&5
18859   ac_status=$?
18860   echo "$as_me:18860: \$? = $ac_status" >&5
18861   (exit "$ac_status"); }; }; then
18862   cf_cv_ncurses_ext_funcs=defined
18863 else
18864   echo "$as_me: failed program was:" >&5
18865 cat "conftest.$ac_ext" >&5
18866
18867 cat >"conftest.$ac_ext" <<_ACEOF
18868 #line 18868 "configure"
18869 #include "confdefs.h"
18870
18871 #include <${cf_cv_ncurses_header:-curses.h}>
18872 int
18873 main (void)
18874 {
18875
18876         (void) assume_default_colors (0, 0);
18877         (void) curses_version ();
18878         (void) define_key (0, 0);
18879         (void) is_term_resized (0, 0);
18880         (void) key_defined (0);
18881         (void) keybound (0, 0);
18882         (void) keyok (0, 0);
18883         (void) resize_term (0, 0);
18884         (void) resizeterm (0, 0);
18885         (void) use_default_colors ();
18886         (void) use_extended_names (0);
18887         (void) wresize (0, 0, 0);
18888   ;
18889   return 0;
18890 }
18891 _ACEOF
18892 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18893 if { (eval echo "$as_me:18893: \"$ac_link\"") >&5
18894   (eval $ac_link) 2>&5
18895   ac_status=$?
18896   echo "$as_me:18896: \$? = $ac_status" >&5
18897   (exit "$ac_status"); } &&
18898          { ac_try='test -s "conftest$ac_exeext"'
18899   { (eval echo "$as_me:18899: \"$ac_try\"") >&5
18900   (eval $ac_try) 2>&5
18901   ac_status=$?
18902   echo "$as_me:18902: \$? = $ac_status" >&5
18903   (exit "$ac_status"); }; }; then
18904   cf_cv_ncurses_ext_funcs=yes
18905 else
18906   echo "$as_me: failed program was:" >&5
18907 cat "conftest.$ac_ext" >&5
18908 cf_cv_ncurses_ext_funcs=no
18909 fi
18910 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18911
18912 fi
18913 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18914
18915 fi
18916 echo "$as_me:18916: result: $cf_cv_ncurses_ext_funcs" >&5
18917 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18918 test "$cf_cv_ncurses_ext_funcs" = yes &&
18919 cat >>confdefs.h <<\EOF
18920 #define NCURSES_EXT_FUNCS 1
18921 EOF
18922
18923 if test "$cf_enable_widec" = yes
18924 then
18925         # workaround for systems with ncurses before 20111029, due to change of
18926         # feature test macro from _XPG5 to _XOPEN_SOURCE
18927         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18928         then
18929                 cf_define_xpg5=no
18930                 echo "$as_me:18930: checking if _XPG5 should be defined to enable wide-characters" >&5
18931 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18932
18933                 cat >"conftest.$ac_ext" <<_ACEOF
18934 #line 18934 "configure"
18935 #include "confdefs.h"
18936
18937 #include <${cf_cv_ncurses_header:-curses.h}>
18938 int
18939 main (void)
18940 {
18941 int x = _XPG5
18942   ;
18943   return 0;
18944 }
18945 _ACEOF
18946 rm -f "conftest.$ac_objext"
18947 if { (eval echo "$as_me:18947: \"$ac_compile\"") >&5
18948   (eval $ac_compile) 2>&5
18949   ac_status=$?
18950   echo "$as_me:18950: \$? = $ac_status" >&5
18951   (exit "$ac_status"); } &&
18952          { ac_try='test -s "conftest.$ac_objext"'
18953   { (eval echo "$as_me:18953: \"$ac_try\"") >&5
18954   (eval $ac_try) 2>&5
18955   ac_status=$?
18956   echo "$as_me:18956: \$? = $ac_status" >&5
18957   (exit "$ac_status"); }; }; then
18958   :
18959 else
18960   echo "$as_me: failed program was:" >&5
18961 cat "conftest.$ac_ext" >&5
18962 cf_save_cppflags="$CPPFLAGS"
18963                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18964                          cat >"conftest.$ac_ext" <<_ACEOF
18965 #line 18965 "configure"
18966 #include "confdefs.h"
18967
18968 #include <${cf_cv_ncurses_header:-curses.h}>
18969 int
18970 main (void)
18971 {
18972 int x = _XPG5
18973   ;
18974   return 0;
18975 }
18976 _ACEOF
18977 rm -f "conftest.$ac_objext"
18978 if { (eval echo "$as_me:18978: \"$ac_compile\"") >&5
18979   (eval $ac_compile) 2>&5
18980   ac_status=$?
18981   echo "$as_me:18981: \$? = $ac_status" >&5
18982   (exit "$ac_status"); } &&
18983          { ac_try='test -s "conftest.$ac_objext"'
18984   { (eval echo "$as_me:18984: \"$ac_try\"") >&5
18985   (eval $ac_try) 2>&5
18986   ac_status=$?
18987   echo "$as_me:18987: \$? = $ac_status" >&5
18988   (exit "$ac_status"); }; }; then
18989   cf_define_xpg5=yes
18990 else
18991   echo "$as_me: failed program was:" >&5
18992 cat "conftest.$ac_ext" >&5
18993 fi
18994 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18995                          CPPFLAGS="$cf_save_cppflags"
18996 fi
18997 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18998                 echo "$as_me:18998: result: $cf_define_xpg5" >&5
18999 echo "${ECHO_T}$cf_define_xpg5" >&6
19000
19001                 if test "$cf_define_xpg5" = yes
19002                 then
19003                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19004                 fi
19005         fi
19006
19007         echo "$as_me:19007: checking for wide-character functions" >&5
19008 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19009 if test "${cf_cv_widechar_funcs+set}" = set; then
19010   echo $ECHO_N "(cached) $ECHO_C" >&6
19011 else
19012
19013         cat >"conftest.$ac_ext" <<_ACEOF
19014 #line 19014 "configure"
19015 #include "confdefs.h"
19016
19017 #include <${cf_cv_ncurses_header:-curses.h}>
19018 int
19019 main (void)
19020 {
19021
19022                 static wchar_t src_wchar[2];
19023                 static cchar_t dst_cchar;
19024                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19025
19026   ;
19027   return 0;
19028 }
19029 _ACEOF
19030 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19031 if { (eval echo "$as_me:19031: \"$ac_link\"") >&5
19032   (eval $ac_link) 2>&5
19033   ac_status=$?
19034   echo "$as_me:19034: \$? = $ac_status" >&5
19035   (exit "$ac_status"); } &&
19036          { ac_try='test -s "conftest$ac_exeext"'
19037   { (eval echo "$as_me:19037: \"$ac_try\"") >&5
19038   (eval $ac_try) 2>&5
19039   ac_status=$?
19040   echo "$as_me:19040: \$? = $ac_status" >&5
19041   (exit "$ac_status"); }; }; then
19042   cf_cv_widechar_funcs=yes
19043 else
19044   echo "$as_me: failed program was:" >&5
19045 cat "conftest.$ac_ext" >&5
19046 cf_cv_widechar_funcs=no
19047 fi
19048 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19049
19050 fi
19051 echo "$as_me:19051: result: $cf_cv_widechar_funcs" >&5
19052 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19053         if test "$cf_cv_widechar_funcs" != no ; then
19054
19055 cat >>confdefs.h <<\EOF
19056 #define USE_WIDEC_SUPPORT 1
19057 EOF
19058
19059         else
19060                 cat >>confdefs.h <<\EOF
19061 #define USE_WIDEC_SUPPORT 0
19062 EOF
19063
19064         fi
19065 else
19066         cat >>confdefs.h <<\EOF
19067 #define USE_WIDEC_SUPPORT 0
19068 EOF
19069
19070 fi
19071
19072 echo "$as_me:19072: checking if $cf_cv_screen library uses pthreads" >&5
19073 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19074 if test "${cf_cv_use_pthreads+set}" = set; then
19075   echo $ECHO_N "(cached) $ECHO_C" >&6
19076 else
19077
19078 cat >"conftest.$ac_ext" <<_ACEOF
19079 #line 19079 "configure"
19080 #include "confdefs.h"
19081
19082 #include <${cf_cv_ncurses_header:-curses.h}>
19083 extern void _nc_init_pthreads(void);
19084
19085 int
19086 main (void)
19087 {
19088
19089         initscr();
19090         _nc_init_pthreads();
19091
19092   ;
19093   return 0;
19094 }
19095 _ACEOF
19096 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19097 if { (eval echo "$as_me:19097: \"$ac_link\"") >&5
19098   (eval $ac_link) 2>&5
19099   ac_status=$?
19100   echo "$as_me:19100: \$? = $ac_status" >&5
19101   (exit "$ac_status"); } &&
19102          { ac_try='test -s "conftest$ac_exeext"'
19103   { (eval echo "$as_me:19103: \"$ac_try\"") >&5
19104   (eval $ac_try) 2>&5
19105   ac_status=$?
19106   echo "$as_me:19106: \$? = $ac_status" >&5
19107   (exit "$ac_status"); }; }; then
19108   cf_cv_use_pthreads=yes
19109 else
19110   echo "$as_me: failed program was:" >&5
19111 cat "conftest.$ac_ext" >&5
19112 cf_cv_use_pthreads=no
19113 fi
19114 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19115
19116 fi
19117 echo "$as_me:19117: result: $cf_cv_use_pthreads" >&5
19118 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19119 test $cf_cv_use_pthreads = yes &&
19120 cat >>confdefs.h <<\EOF
19121 #define USE_PTHREADS 1
19122 EOF
19123
19124 echo "$as_me:19124: checking if sys/time.h works with sys/select.h" >&5
19125 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19126 if test "${cf_cv_sys_time_select+set}" = set; then
19127   echo $ECHO_N "(cached) $ECHO_C" >&6
19128 else
19129
19130 cat >"conftest.$ac_ext" <<_ACEOF
19131 #line 19131 "configure"
19132 #include "confdefs.h"
19133
19134 #include <sys/types.h>
19135 #ifdef HAVE_SYS_TIME_H
19136 #include <sys/time.h>
19137 #endif
19138 #ifdef HAVE_SYS_SELECT_H
19139 #include <sys/select.h>
19140 #endif
19141
19142 int
19143 main (void)
19144 {
19145
19146   ;
19147   return 0;
19148 }
19149 _ACEOF
19150 rm -f "conftest.$ac_objext"
19151 if { (eval echo "$as_me:19151: \"$ac_compile\"") >&5
19152   (eval $ac_compile) 2>&5
19153   ac_status=$?
19154   echo "$as_me:19154: \$? = $ac_status" >&5
19155   (exit "$ac_status"); } &&
19156          { ac_try='test -s "conftest.$ac_objext"'
19157   { (eval echo "$as_me:19157: \"$ac_try\"") >&5
19158   (eval $ac_try) 2>&5
19159   ac_status=$?
19160   echo "$as_me:19160: \$? = $ac_status" >&5
19161   (exit "$ac_status"); }; }; then
19162   cf_cv_sys_time_select=yes
19163 else
19164   echo "$as_me: failed program was:" >&5
19165 cat "conftest.$ac_ext" >&5
19166 cf_cv_sys_time_select=no
19167 fi
19168 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19169
19170 fi
19171
19172 echo "$as_me:19172: result: $cf_cv_sys_time_select" >&5
19173 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19174 test "$cf_cv_sys_time_select" = yes &&
19175 cat >>confdefs.h <<\EOF
19176 #define HAVE_SYS_TIME_SELECT 1
19177 EOF
19178
19179 # special check for test/ditto.c
19180
19181 echo "$as_me:19181: checking for openpty in -lutil" >&5
19182 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19183 if test "${ac_cv_lib_util_openpty+set}" = set; then
19184   echo $ECHO_N "(cached) $ECHO_C" >&6
19185 else
19186   ac_check_lib_save_LIBS=$LIBS
19187 LIBS="-lutil  $LIBS"
19188 cat >"conftest.$ac_ext" <<_ACEOF
19189 #line 19189 "configure"
19190 #include "confdefs.h"
19191
19192 /* Override any gcc2 internal prototype to avoid an error.  */
19193 #ifdef __cplusplus
19194 extern "C"
19195 #endif
19196 /* We use char because int might match the return type of a gcc2
19197    builtin and then its argument prototype would still apply.  */
19198 char openpty ();
19199 int
19200 main (void)
19201 {
19202 openpty ();
19203   ;
19204   return 0;
19205 }
19206 _ACEOF
19207 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19208 if { (eval echo "$as_me:19208: \"$ac_link\"") >&5
19209   (eval $ac_link) 2>&5
19210   ac_status=$?
19211   echo "$as_me:19211: \$? = $ac_status" >&5
19212   (exit "$ac_status"); } &&
19213          { ac_try='test -s "conftest$ac_exeext"'
19214   { (eval echo "$as_me:19214: \"$ac_try\"") >&5
19215   (eval $ac_try) 2>&5
19216   ac_status=$?
19217   echo "$as_me:19217: \$? = $ac_status" >&5
19218   (exit "$ac_status"); }; }; then
19219   ac_cv_lib_util_openpty=yes
19220 else
19221   echo "$as_me: failed program was:" >&5
19222 cat "conftest.$ac_ext" >&5
19223 ac_cv_lib_util_openpty=no
19224 fi
19225 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19226 LIBS=$ac_check_lib_save_LIBS
19227 fi
19228 echo "$as_me:19228: result: $ac_cv_lib_util_openpty" >&5
19229 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19230 if test "$ac_cv_lib_util_openpty" = yes; then
19231   cf_cv_lib_util=yes
19232 else
19233   cf_cv_lib_util=no
19234 fi
19235
19236 echo "$as_me:19236: checking for openpty header" >&5
19237 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19238 if test "${cf_cv_func_openpty+set}" = set; then
19239   echo $ECHO_N "(cached) $ECHO_C" >&6
19240 else
19241
19242         cf_save_LIBS="$LIBS"
19243         test "$cf_cv_lib_util" = yes && {
19244 cf_add_libs="$LIBS"
19245 # reverse order
19246 cf_add_0lib=
19247 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19248 # filter duplicates
19249 for cf_add_1lib in $cf_add_0lib; do
19250         for cf_add_2lib in $cf_add_libs; do
19251                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19252                         cf_add_1lib=
19253                         break
19254                 fi
19255         done
19256         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19257 done
19258 LIBS="$cf_add_libs"
19259  }
19260         for cf_header in pty.h libutil.h util.h
19261         do
19262         cat >"conftest.$ac_ext" <<_ACEOF
19263 #line 19263 "configure"
19264 #include "confdefs.h"
19265
19266 #include <$cf_header>
19267
19268 int
19269 main (void)
19270 {
19271
19272         int x = openpty((int *)0, (int *)0, (char *)0,
19273                                    (struct termios *)0, (struct winsize *)0);
19274
19275   ;
19276   return 0;
19277 }
19278 _ACEOF
19279 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19280 if { (eval echo "$as_me:19280: \"$ac_link\"") >&5
19281   (eval $ac_link) 2>&5
19282   ac_status=$?
19283   echo "$as_me:19283: \$? = $ac_status" >&5
19284   (exit "$ac_status"); } &&
19285          { ac_try='test -s "conftest$ac_exeext"'
19286   { (eval echo "$as_me:19286: \"$ac_try\"") >&5
19287   (eval $ac_try) 2>&5
19288   ac_status=$?
19289   echo "$as_me:19289: \$? = $ac_status" >&5
19290   (exit "$ac_status"); }; }; then
19291
19292                 cf_cv_func_openpty=$cf_header
19293                 break
19294
19295 else
19296   echo "$as_me: failed program was:" >&5
19297 cat "conftest.$ac_ext" >&5
19298
19299                 cf_cv_func_openpty=no
19300
19301 fi
19302 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19303         done
19304         LIBS="$cf_save_LIBS"
19305
19306 fi
19307 echo "$as_me:19307: result: $cf_cv_func_openpty" >&5
19308 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19309
19310 if test "$cf_cv_func_openpty" != no ; then
19311
19312 cat >>confdefs.h <<EOF
19313 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19314 EOF
19315
19316 cat >>confdefs.h <<\EOF
19317 #define USE_XTERM_PTY 1
19318 EOF
19319
19320         if test "x$cf_cv_lib_util" = xyes ; then
19321
19322 cf_add_libs="$TEST_LIBS"
19323 # reverse order
19324 cf_add_0lib=
19325 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19326 # filter duplicates
19327 for cf_add_1lib in $cf_add_0lib; do
19328         for cf_add_2lib in $cf_add_libs; do
19329                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19330                         cf_add_1lib=
19331                         break
19332                 fi
19333         done
19334         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19335 done
19336 TEST_LIBS="$cf_add_libs"
19337
19338         fi
19339 fi
19340
19341 echo "$as_me:19341: checking for function curses_version" >&5
19342 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19343 if test "${cf_cv_func_curses_version+set}" = set; then
19344   echo $ECHO_N "(cached) $ECHO_C" >&6
19345 else
19346
19347 if test "$cross_compiling" = yes; then
19348   cf_cv_func_curses_version=unknown
19349 else
19350   cat >"conftest.$ac_ext" <<_ACEOF
19351 #line 19351 "configure"
19352 #include "confdefs.h"
19353
19354 #include <${cf_cv_ncurses_header:-curses.h}>
19355 int main(void)
19356 {
19357         char temp[1024];
19358         sprintf(temp, "%s\\n", curses_version());
19359         ${cf_cv_main_return:-return}(0);
19360 }
19361
19362 _ACEOF
19363 rm -f "conftest$ac_exeext"
19364 if { (eval echo "$as_me:19364: \"$ac_link\"") >&5
19365   (eval $ac_link) 2>&5
19366   ac_status=$?
19367   echo "$as_me:19367: \$? = $ac_status" >&5
19368   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19369   { (eval echo "$as_me:19369: \"$ac_try\"") >&5
19370   (eval $ac_try) 2>&5
19371   ac_status=$?
19372   echo "$as_me:19372: \$? = $ac_status" >&5
19373   (exit "$ac_status"); }; }; then
19374   cf_cv_func_curses_version=yes
19375
19376 else
19377   echo "$as_me: program exited with status $ac_status" >&5
19378 echo "$as_me: failed program was:" >&5
19379 cat "conftest.$ac_ext" >&5
19380 cf_cv_func_curses_version=no
19381
19382 fi
19383 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19384 fi
19385 rm -f core
19386 fi
19387 echo "$as_me:19387: result: $cf_cv_func_curses_version" >&5
19388 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19389 test "$cf_cv_func_curses_version" = yes &&
19390 cat >>confdefs.h <<\EOF
19391 #define HAVE_CURSES_VERSION 1
19392 EOF
19393
19394 echo "$as_me:19394: checking for alternate character set array" >&5
19395 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19396 if test "${cf_cv_curses_acs_map+set}" = set; then
19397   echo $ECHO_N "(cached) $ECHO_C" >&6
19398 else
19399
19400 cf_cv_curses_acs_map=unknown
19401 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19402 do
19403 cat >"conftest.$ac_ext" <<_ACEOF
19404 #line 19404 "configure"
19405 #include "confdefs.h"
19406
19407 #include <${cf_cv_ncurses_header:-curses.h}>
19408
19409 int
19410 main (void)
19411 {
19412
19413 ${name}['k'] = ACS_PLUS
19414
19415   ;
19416   return 0;
19417 }
19418 _ACEOF
19419 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19420 if { (eval echo "$as_me:19420: \"$ac_link\"") >&5
19421   (eval $ac_link) 2>&5
19422   ac_status=$?
19423   echo "$as_me:19423: \$? = $ac_status" >&5
19424   (exit "$ac_status"); } &&
19425          { ac_try='test -s "conftest$ac_exeext"'
19426   { (eval echo "$as_me:19426: \"$ac_try\"") >&5
19427   (eval $ac_try) 2>&5
19428   ac_status=$?
19429   echo "$as_me:19429: \$? = $ac_status" >&5
19430   (exit "$ac_status"); }; }; then
19431   cf_cv_curses_acs_map=$name; break
19432 else
19433   echo "$as_me: failed program was:" >&5
19434 cat "conftest.$ac_ext" >&5
19435 fi
19436 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19437 done
19438
19439 fi
19440 echo "$as_me:19440: result: $cf_cv_curses_acs_map" >&5
19441 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19442
19443 test "$cf_cv_curses_acs_map" != unknown &&
19444 cat >>confdefs.h <<EOF
19445 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19446 EOF
19447
19448 if test "$cf_enable_widec" = yes; then
19449
19450 echo "$as_me:19450: checking for wide alternate character set array" >&5
19451 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19452 if test "${cf_cv_curses_wacs_map+set}" = set; then
19453   echo $ECHO_N "(cached) $ECHO_C" >&6
19454 else
19455
19456         cf_cv_curses_wacs_map=unknown
19457         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19458         do
19459         cat >"conftest.$ac_ext" <<_ACEOF
19460 #line 19460 "configure"
19461 #include "confdefs.h"
19462
19463 #ifndef _XOPEN_SOURCE_EXTENDED
19464 #define _XOPEN_SOURCE_EXTENDED
19465 #endif
19466 #include <${cf_cv_ncurses_header:-curses.h}>
19467 int
19468 main (void)
19469 {
19470 void *foo = &(${name}['k']); (void)foo
19471   ;
19472   return 0;
19473 }
19474 _ACEOF
19475 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19476 if { (eval echo "$as_me:19476: \"$ac_link\"") >&5
19477   (eval $ac_link) 2>&5
19478   ac_status=$?
19479   echo "$as_me:19479: \$? = $ac_status" >&5
19480   (exit "$ac_status"); } &&
19481          { ac_try='test -s "conftest$ac_exeext"'
19482   { (eval echo "$as_me:19482: \"$ac_try\"") >&5
19483   (eval $ac_try) 2>&5
19484   ac_status=$?
19485   echo "$as_me:19485: \$? = $ac_status" >&5
19486   (exit "$ac_status"); }; }; then
19487   cf_cv_curses_wacs_map=$name
19488          break
19489 else
19490   echo "$as_me: failed program was:" >&5
19491 cat "conftest.$ac_ext" >&5
19492 fi
19493 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19494         done
19495 fi
19496 echo "$as_me:19496: result: $cf_cv_curses_wacs_map" >&5
19497 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19498
19499 test "$cf_cv_curses_wacs_map" != unknown &&
19500 cat >>confdefs.h <<EOF
19501 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19502 EOF
19503
19504 echo "$as_me:19504: checking for wide alternate character constants" >&5
19505 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19506 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19507   echo $ECHO_N "(cached) $ECHO_C" >&6
19508 else
19509
19510 cf_cv_curses_wacs_symbols=no
19511 if test "$cf_cv_curses_wacs_map" != unknown
19512 then
19513         cat >"conftest.$ac_ext" <<_ACEOF
19514 #line 19514 "configure"
19515 #include "confdefs.h"
19516
19517 #ifndef _XOPEN_SOURCE_EXTENDED
19518 #define _XOPEN_SOURCE_EXTENDED
19519 #endif
19520 #include <${cf_cv_ncurses_header:-curses.h}>
19521 int
19522 main (void)
19523 {
19524 cchar_t *foo = WACS_PLUS;
19525          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
19526   ;
19527   return 0;
19528 }
19529 _ACEOF
19530 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19531 if { (eval echo "$as_me:19531: \"$ac_link\"") >&5
19532   (eval $ac_link) 2>&5
19533   ac_status=$?
19534   echo "$as_me:19534: \$? = $ac_status" >&5
19535   (exit "$ac_status"); } &&
19536          { ac_try='test -s "conftest$ac_exeext"'
19537   { (eval echo "$as_me:19537: \"$ac_try\"") >&5
19538   (eval $ac_try) 2>&5
19539   ac_status=$?
19540   echo "$as_me:19540: \$? = $ac_status" >&5
19541   (exit "$ac_status"); }; }; then
19542   cf_cv_curses_wacs_symbols=yes
19543 else
19544   echo "$as_me: failed program was:" >&5
19545 cat "conftest.$ac_ext" >&5
19546 fi
19547 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19548 else
19549         cat >"conftest.$ac_ext" <<_ACEOF
19550 #line 19550 "configure"
19551 #include "confdefs.h"
19552
19553 #ifndef _XOPEN_SOURCE_EXTENDED
19554 #define _XOPEN_SOURCE_EXTENDED
19555 #endif
19556 #include <${cf_cv_ncurses_header:-curses.h}>
19557 int
19558 main (void)
19559 {
19560 cchar_t *foo = WACS_PLUS; (void)foo
19561   ;
19562   return 0;
19563 }
19564 _ACEOF
19565 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19566 if { (eval echo "$as_me:19566: \"$ac_link\"") >&5
19567   (eval $ac_link) 2>&5
19568   ac_status=$?
19569   echo "$as_me:19569: \$? = $ac_status" >&5
19570   (exit "$ac_status"); } &&
19571          { ac_try='test -s "conftest$ac_exeext"'
19572   { (eval echo "$as_me:19572: \"$ac_try\"") >&5
19573   (eval $ac_try) 2>&5
19574   ac_status=$?
19575   echo "$as_me:19575: \$? = $ac_status" >&5
19576   (exit "$ac_status"); }; }; then
19577   cf_cv_curses_wacs_symbols=yes
19578 else
19579   echo "$as_me: failed program was:" >&5
19580 cat "conftest.$ac_ext" >&5
19581 fi
19582 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19583 fi
19584
19585 fi
19586 echo "$as_me:19586: result: $cf_cv_curses_wacs_symbols" >&5
19587 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19588
19589 test "$cf_cv_curses_wacs_symbols" != no &&
19590 cat >>confdefs.h <<\EOF
19591 #define CURSES_WACS_SYMBOLS 1
19592 EOF
19593
19594 fi
19595
19596 echo "$as_me:19596: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19597 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19598 cat >"conftest.$ac_ext" <<_ACEOF
19599 #line 19599 "configure"
19600 #include "confdefs.h"
19601
19602 #ifndef _XOPEN_SOURCE_EXTENDED
19603 #define _XOPEN_SOURCE_EXTENDED
19604 #endif
19605 #include <${cf_cv_ncurses_header:-curses.h}>
19606 int
19607 main (void)
19608 {
19609
19610 attr_t foo
19611
19612   ;
19613   return 0;
19614 }
19615 _ACEOF
19616 rm -f "conftest.$ac_objext"
19617 if { (eval echo "$as_me:19617: \"$ac_compile\"") >&5
19618   (eval $ac_compile) 2>&5
19619   ac_status=$?
19620   echo "$as_me:19620: \$? = $ac_status" >&5
19621   (exit "$ac_status"); } &&
19622          { ac_try='test -s "conftest.$ac_objext"'
19623   { (eval echo "$as_me:19623: \"$ac_try\"") >&5
19624   (eval $ac_try) 2>&5
19625   ac_status=$?
19626   echo "$as_me:19626: \$? = $ac_status" >&5
19627   (exit "$ac_status"); }; }; then
19628   cf_result=yes
19629 else
19630   echo "$as_me: failed program was:" >&5
19631 cat "conftest.$ac_ext" >&5
19632 cf_result=no
19633 fi
19634 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19635 echo "$as_me:19635: result: $cf_result" >&5
19636 echo "${ECHO_T}$cf_result" >&6
19637 if test "$cf_result" = yes ; then
19638
19639 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19640
19641 cat >>confdefs.h <<EOF
19642 #define $cf_result 1
19643 EOF
19644
19645 else
19646
19647 cat >>confdefs.h <<EOF
19648 #define attr_t long
19649 EOF
19650
19651 fi
19652
19653 if test "$cf_enable_widec" = yes; then
19654
19655 # This is needed on Tru64 5.0 to declare mbstate_t
19656 echo "$as_me:19656: checking if we must include wchar.h to declare mbstate_t" >&5
19657 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19658 if test "${cf_cv_mbstate_t+set}" = set; then
19659   echo $ECHO_N "(cached) $ECHO_C" >&6
19660 else
19661
19662 cat >"conftest.$ac_ext" <<_ACEOF
19663 #line 19663 "configure"
19664 #include "confdefs.h"
19665
19666 #include <stdlib.h>
19667 #include <stdarg.h>
19668 #include <stdio.h>
19669 #ifdef HAVE_LIBUTF8_H
19670 #include <libutf8.h>
19671 #endif
19672 int
19673 main (void)
19674 {
19675 mbstate_t state
19676   ;
19677   return 0;
19678 }
19679 _ACEOF
19680 rm -f "conftest.$ac_objext"
19681 if { (eval echo "$as_me:19681: \"$ac_compile\"") >&5
19682   (eval $ac_compile) 2>&5
19683   ac_status=$?
19684   echo "$as_me:19684: \$? = $ac_status" >&5
19685   (exit "$ac_status"); } &&
19686          { ac_try='test -s "conftest.$ac_objext"'
19687   { (eval echo "$as_me:19687: \"$ac_try\"") >&5
19688   (eval $ac_try) 2>&5
19689   ac_status=$?
19690   echo "$as_me:19690: \$? = $ac_status" >&5
19691   (exit "$ac_status"); }; }; then
19692   cf_cv_mbstate_t=no
19693 else
19694   echo "$as_me: failed program was:" >&5
19695 cat "conftest.$ac_ext" >&5
19696 cat >"conftest.$ac_ext" <<_ACEOF
19697 #line 19697 "configure"
19698 #include "confdefs.h"
19699
19700 #include <stdlib.h>
19701 #include <stdarg.h>
19702 #include <stdio.h>
19703 #include <wchar.h>
19704 #ifdef HAVE_LIBUTF8_H
19705 #include <libutf8.h>
19706 #endif
19707 int
19708 main (void)
19709 {
19710 mbstate_t value
19711   ;
19712   return 0;
19713 }
19714 _ACEOF
19715 rm -f "conftest.$ac_objext"
19716 if { (eval echo "$as_me:19716: \"$ac_compile\"") >&5
19717   (eval $ac_compile) 2>&5
19718   ac_status=$?
19719   echo "$as_me:19719: \$? = $ac_status" >&5
19720   (exit "$ac_status"); } &&
19721          { ac_try='test -s "conftest.$ac_objext"'
19722   { (eval echo "$as_me:19722: \"$ac_try\"") >&5
19723   (eval $ac_try) 2>&5
19724   ac_status=$?
19725   echo "$as_me:19725: \$? = $ac_status" >&5
19726   (exit "$ac_status"); }; }; then
19727   cf_cv_mbstate_t=yes
19728 else
19729   echo "$as_me: failed program was:" >&5
19730 cat "conftest.$ac_ext" >&5
19731 cf_cv_mbstate_t=unknown
19732 fi
19733 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19734 fi
19735 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19736 fi
19737 echo "$as_me:19737: result: $cf_cv_mbstate_t" >&5
19738 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19739
19740 if test "$cf_cv_mbstate_t" = yes ; then
19741
19742 cat >>confdefs.h <<\EOF
19743 #define NEED_WCHAR_H 1
19744 EOF
19745
19746         NEED_WCHAR_H=1
19747 fi
19748
19749 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19750 if test "$cf_cv_mbstate_t" = unknown ; then
19751         NCURSES_MBSTATE_T=1
19752 fi
19753
19754 # if we find mbstate_t in either place, use substitution to provide a fallback.
19755 if test "$cf_cv_mbstate_t" != unknown ; then
19756         NCURSES_OK_MBSTATE_T=1
19757 fi
19758
19759 # This is needed on Tru64 5.0 to declare wchar_t
19760 echo "$as_me:19760: checking if we must include wchar.h to declare wchar_t" >&5
19761 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19762 if test "${cf_cv_wchar_t+set}" = set; then
19763   echo $ECHO_N "(cached) $ECHO_C" >&6
19764 else
19765
19766 cat >"conftest.$ac_ext" <<_ACEOF
19767 #line 19767 "configure"
19768 #include "confdefs.h"
19769
19770 #include <stdlib.h>
19771 #include <stdarg.h>
19772 #include <stdio.h>
19773 #ifdef HAVE_LIBUTF8_H
19774 #include <libutf8.h>
19775 #endif
19776 int
19777 main (void)
19778 {
19779 wchar_t state
19780   ;
19781   return 0;
19782 }
19783 _ACEOF
19784 rm -f "conftest.$ac_objext"
19785 if { (eval echo "$as_me:19785: \"$ac_compile\"") >&5
19786   (eval $ac_compile) 2>&5
19787   ac_status=$?
19788   echo "$as_me:19788: \$? = $ac_status" >&5
19789   (exit "$ac_status"); } &&
19790          { ac_try='test -s "conftest.$ac_objext"'
19791   { (eval echo "$as_me:19791: \"$ac_try\"") >&5
19792   (eval $ac_try) 2>&5
19793   ac_status=$?
19794   echo "$as_me:19794: \$? = $ac_status" >&5
19795   (exit "$ac_status"); }; }; then
19796   cf_cv_wchar_t=no
19797 else
19798   echo "$as_me: failed program was:" >&5
19799 cat "conftest.$ac_ext" >&5
19800 cat >"conftest.$ac_ext" <<_ACEOF
19801 #line 19801 "configure"
19802 #include "confdefs.h"
19803
19804 #include <stdlib.h>
19805 #include <stdarg.h>
19806 #include <stdio.h>
19807 #include <wchar.h>
19808 #ifdef HAVE_LIBUTF8_H
19809 #include <libutf8.h>
19810 #endif
19811 int
19812 main (void)
19813 {
19814 wchar_t value
19815   ;
19816   return 0;
19817 }
19818 _ACEOF
19819 rm -f "conftest.$ac_objext"
19820 if { (eval echo "$as_me:19820: \"$ac_compile\"") >&5
19821   (eval $ac_compile) 2>&5
19822   ac_status=$?
19823   echo "$as_me:19823: \$? = $ac_status" >&5
19824   (exit "$ac_status"); } &&
19825          { ac_try='test -s "conftest.$ac_objext"'
19826   { (eval echo "$as_me:19826: \"$ac_try\"") >&5
19827   (eval $ac_try) 2>&5
19828   ac_status=$?
19829   echo "$as_me:19829: \$? = $ac_status" >&5
19830   (exit "$ac_status"); }; }; then
19831   cf_cv_wchar_t=yes
19832 else
19833   echo "$as_me: failed program was:" >&5
19834 cat "conftest.$ac_ext" >&5
19835 cf_cv_wchar_t=unknown
19836 fi
19837 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19838 fi
19839 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19840 fi
19841 echo "$as_me:19841: result: $cf_cv_wchar_t" >&5
19842 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19843
19844 if test "$cf_cv_wchar_t" = yes ; then
19845
19846 cat >>confdefs.h <<\EOF
19847 #define NEED_WCHAR_H 1
19848 EOF
19849
19850         NEED_WCHAR_H=1
19851 fi
19852
19853 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19854 if test "$cf_cv_wchar_t" = unknown ; then
19855         NCURSES_WCHAR_T=1
19856 fi
19857
19858 # if we find wchar_t in either place, use substitution to provide a fallback.
19859 if test "$cf_cv_wchar_t" != unknown ; then
19860         NCURSES_OK_WCHAR_T=1
19861 fi
19862
19863 # This is needed on Tru64 5.0 to declare wint_t
19864 echo "$as_me:19864: checking if we must include wchar.h to declare wint_t" >&5
19865 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19866 if test "${cf_cv_wint_t+set}" = set; then
19867   echo $ECHO_N "(cached) $ECHO_C" >&6
19868 else
19869
19870 cat >"conftest.$ac_ext" <<_ACEOF
19871 #line 19871 "configure"
19872 #include "confdefs.h"
19873
19874 #include <stdlib.h>
19875 #include <stdarg.h>
19876 #include <stdio.h>
19877 #ifdef HAVE_LIBUTF8_H
19878 #include <libutf8.h>
19879 #endif
19880 int
19881 main (void)
19882 {
19883 wint_t state
19884   ;
19885   return 0;
19886 }
19887 _ACEOF
19888 rm -f "conftest.$ac_objext"
19889 if { (eval echo "$as_me:19889: \"$ac_compile\"") >&5
19890   (eval $ac_compile) 2>&5
19891   ac_status=$?
19892   echo "$as_me:19892: \$? = $ac_status" >&5
19893   (exit "$ac_status"); } &&
19894          { ac_try='test -s "conftest.$ac_objext"'
19895   { (eval echo "$as_me:19895: \"$ac_try\"") >&5
19896   (eval $ac_try) 2>&5
19897   ac_status=$?
19898   echo "$as_me:19898: \$? = $ac_status" >&5
19899   (exit "$ac_status"); }; }; then
19900   cf_cv_wint_t=no
19901 else
19902   echo "$as_me: failed program was:" >&5
19903 cat "conftest.$ac_ext" >&5
19904 cat >"conftest.$ac_ext" <<_ACEOF
19905 #line 19905 "configure"
19906 #include "confdefs.h"
19907
19908 #include <stdlib.h>
19909 #include <stdarg.h>
19910 #include <stdio.h>
19911 #include <wchar.h>
19912 #ifdef HAVE_LIBUTF8_H
19913 #include <libutf8.h>
19914 #endif
19915 int
19916 main (void)
19917 {
19918 wint_t value
19919   ;
19920   return 0;
19921 }
19922 _ACEOF
19923 rm -f "conftest.$ac_objext"
19924 if { (eval echo "$as_me:19924: \"$ac_compile\"") >&5
19925   (eval $ac_compile) 2>&5
19926   ac_status=$?
19927   echo "$as_me:19927: \$? = $ac_status" >&5
19928   (exit "$ac_status"); } &&
19929          { ac_try='test -s "conftest.$ac_objext"'
19930   { (eval echo "$as_me:19930: \"$ac_try\"") >&5
19931   (eval $ac_try) 2>&5
19932   ac_status=$?
19933   echo "$as_me:19933: \$? = $ac_status" >&5
19934   (exit "$ac_status"); }; }; then
19935   cf_cv_wint_t=yes
19936 else
19937   echo "$as_me: failed program was:" >&5
19938 cat "conftest.$ac_ext" >&5
19939 cf_cv_wint_t=unknown
19940 fi
19941 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19942 fi
19943 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19944 fi
19945 echo "$as_me:19945: result: $cf_cv_wint_t" >&5
19946 echo "${ECHO_T}$cf_cv_wint_t" >&6
19947
19948 if test "$cf_cv_wint_t" = yes ; then
19949
19950 cat >>confdefs.h <<\EOF
19951 #define NEED_WCHAR_H 1
19952 EOF
19953
19954         NEED_WCHAR_H=1
19955 fi
19956
19957 # if we do not find wint_t in either place, use substitution to provide a fallback.
19958 if test "$cf_cv_wint_t" = unknown ; then
19959         NCURSES_WINT_T=1
19960 fi
19961
19962 # if we find wint_t in either place, use substitution to provide a fallback.
19963 if test "$cf_cv_wint_t" != unknown ; then
19964         NCURSES_OK_WINT_T=1
19965 fi
19966
19967         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19968
19969 echo "$as_me:19969: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19970 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19971 cat >"conftest.$ac_ext" <<_ACEOF
19972 #line 19972 "configure"
19973 #include "confdefs.h"
19974
19975 #ifndef _XOPEN_SOURCE_EXTENDED
19976 #define _XOPEN_SOURCE_EXTENDED
19977 #endif
19978 #include <${cf_cv_ncurses_header:-curses.h}>
19979 int
19980 main (void)
19981 {
19982
19983 mbstate_t foo
19984
19985   ;
19986   return 0;
19987 }
19988 _ACEOF
19989 rm -f "conftest.$ac_objext"
19990 if { (eval echo "$as_me:19990: \"$ac_compile\"") >&5
19991   (eval $ac_compile) 2>&5
19992   ac_status=$?
19993   echo "$as_me:19993: \$? = $ac_status" >&5
19994   (exit "$ac_status"); } &&
19995          { ac_try='test -s "conftest.$ac_objext"'
19996   { (eval echo "$as_me:19996: \"$ac_try\"") >&5
19997   (eval $ac_try) 2>&5
19998   ac_status=$?
19999   echo "$as_me:19999: \$? = $ac_status" >&5
20000   (exit "$ac_status"); }; }; then
20001   cf_result=yes
20002 else
20003   echo "$as_me: failed program was:" >&5
20004 cat "conftest.$ac_ext" >&5
20005 cf_result=no
20006 fi
20007 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20008 echo "$as_me:20008: result: $cf_result" >&5
20009 echo "${ECHO_T}$cf_result" >&6
20010 if test "$cf_result" = yes ; then
20011
20012 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20013
20014 cat >>confdefs.h <<EOF
20015 #define $cf_result 1
20016 EOF
20017
20018 else
20019
20020 cat >>confdefs.h <<EOF
20021 #define mbstate_t long
20022 EOF
20023
20024 fi
20025
20026         fi
20027
20028         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20029
20030 echo "$as_me:20030: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20031 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20032 cat >"conftest.$ac_ext" <<_ACEOF
20033 #line 20033 "configure"
20034 #include "confdefs.h"
20035
20036 #ifndef _XOPEN_SOURCE_EXTENDED
20037 #define _XOPEN_SOURCE_EXTENDED
20038 #endif
20039 #include <${cf_cv_ncurses_header:-curses.h}>
20040 int
20041 main (void)
20042 {
20043
20044 wchar_t foo
20045
20046   ;
20047   return 0;
20048 }
20049 _ACEOF
20050 rm -f "conftest.$ac_objext"
20051 if { (eval echo "$as_me:20051: \"$ac_compile\"") >&5
20052   (eval $ac_compile) 2>&5
20053   ac_status=$?
20054   echo "$as_me:20054: \$? = $ac_status" >&5
20055   (exit "$ac_status"); } &&
20056          { ac_try='test -s "conftest.$ac_objext"'
20057   { (eval echo "$as_me:20057: \"$ac_try\"") >&5
20058   (eval $ac_try) 2>&5
20059   ac_status=$?
20060   echo "$as_me:20060: \$? = $ac_status" >&5
20061   (exit "$ac_status"); }; }; then
20062   cf_result=yes
20063 else
20064   echo "$as_me: failed program was:" >&5
20065 cat "conftest.$ac_ext" >&5
20066 cf_result=no
20067 fi
20068 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20069 echo "$as_me:20069: result: $cf_result" >&5
20070 echo "${ECHO_T}$cf_result" >&6
20071 if test "$cf_result" = yes ; then
20072
20073 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20074
20075 cat >>confdefs.h <<EOF
20076 #define $cf_result 1
20077 EOF
20078
20079 else
20080
20081 cat >>confdefs.h <<EOF
20082 #define wchar_t long
20083 EOF
20084
20085 fi
20086
20087         fi
20088
20089         if test "$NCURSES_OK_WINT_T" = 0 ; then
20090
20091 echo "$as_me:20091: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20092 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20093 cat >"conftest.$ac_ext" <<_ACEOF
20094 #line 20094 "configure"
20095 #include "confdefs.h"
20096
20097 #ifndef _XOPEN_SOURCE_EXTENDED
20098 #define _XOPEN_SOURCE_EXTENDED
20099 #endif
20100 #include <${cf_cv_ncurses_header:-curses.h}>
20101 int
20102 main (void)
20103 {
20104
20105 wint_t foo
20106
20107   ;
20108   return 0;
20109 }
20110 _ACEOF
20111 rm -f "conftest.$ac_objext"
20112 if { (eval echo "$as_me:20112: \"$ac_compile\"") >&5
20113   (eval $ac_compile) 2>&5
20114   ac_status=$?
20115   echo "$as_me:20115: \$? = $ac_status" >&5
20116   (exit "$ac_status"); } &&
20117          { ac_try='test -s "conftest.$ac_objext"'
20118   { (eval echo "$as_me:20118: \"$ac_try\"") >&5
20119   (eval $ac_try) 2>&5
20120   ac_status=$?
20121   echo "$as_me:20121: \$? = $ac_status" >&5
20122   (exit "$ac_status"); }; }; then
20123   cf_result=yes
20124 else
20125   echo "$as_me: failed program was:" >&5
20126 cat "conftest.$ac_ext" >&5
20127 cf_result=no
20128 fi
20129 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20130 echo "$as_me:20130: result: $cf_result" >&5
20131 echo "${ECHO_T}$cf_result" >&6
20132 if test "$cf_result" = yes ; then
20133
20134 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20135
20136 cat >>confdefs.h <<EOF
20137 #define $cf_result 1
20138 EOF
20139
20140 else
20141
20142 cat >>confdefs.h <<EOF
20143 #define wint_t long
20144 EOF
20145
20146 fi
20147
20148         fi
20149 fi
20150
20151 for cf_data in \
20152 TABSIZE \
20153 curscr \
20154 ospeed \
20155 boolnames \
20156 boolfnames \
20157 ttytype
20158 do
20159 echo "$as_me:20159: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20160 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20161
20162 cat >"conftest.$ac_ext" <<_ACEOF
20163 #line 20163 "configure"
20164 #include "confdefs.h"
20165
20166 #ifdef HAVE_XCURSES
20167 #include <xcurses.h>
20168 char * XCursesProgramName = "test";
20169 #else
20170 #include <${cf_cv_ncurses_header:-curses.h}>
20171 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20172 #include <ncursesw/term.h>
20173 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20174 #include <ncurses/term.h>
20175 #elif defined(HAVE_TERM_H)
20176 #include <term.h>
20177 #endif
20178 #endif
20179
20180 int
20181 main (void)
20182 {
20183
20184 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20185         const void *foo = (const void *)($cf_data);
20186 #else
20187         const void *foo = &($cf_data);
20188 #endif
20189         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20190
20191   ;
20192   return 0;
20193 }
20194 _ACEOF
20195 rm -f "conftest.$ac_objext"
20196 if { (eval echo "$as_me:20196: \"$ac_compile\"") >&5
20197   (eval $ac_compile) 2>&5
20198   ac_status=$?
20199   echo "$as_me:20199: \$? = $ac_status" >&5
20200   (exit "$ac_status"); } &&
20201          { ac_try='test -s "conftest.$ac_objext"'
20202   { (eval echo "$as_me:20202: \"$ac_try\"") >&5
20203   (eval $ac_try) 2>&5
20204   ac_status=$?
20205   echo "$as_me:20205: \$? = $ac_status" >&5
20206   (exit "$ac_status"); }; }; then
20207   cf_result=yes
20208
20209 else
20210   echo "$as_me: failed program was:" >&5
20211 cat "conftest.$ac_ext" >&5
20212 cf_result=no
20213 fi
20214 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20215 echo "$as_me:20215: result: $cf_result" >&5
20216 echo "${ECHO_T}$cf_result" >&6
20217
20218 if test "$cf_result" = yes ; then
20219
20220 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20221
20222         cat >>confdefs.h <<EOF
20223 #define $cf_result 1
20224 EOF
20225
20226 else
20227         echo "$as_me:20227: checking for data $cf_data in library" >&5
20228 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20229         # BSD linkers insist on making weak linkage, but resolve at runtime.
20230         if test "$cross_compiling" = yes; then
20231
20232         # cross-compiling
20233         cat >"conftest.$ac_ext" <<_ACEOF
20234 #line 20234 "configure"
20235 #include "confdefs.h"
20236
20237 #ifdef HAVE_XCURSES
20238 #include <xcurses.h>
20239 char * XCursesProgramName = "test";
20240 #else
20241 #include <${cf_cv_ncurses_header:-curses.h}>
20242 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20243 #include <ncursesw/term.h>
20244 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20245 #include <ncurses/term.h>
20246 #elif defined(HAVE_TERM_H)
20247 #include <term.h>
20248 #endif
20249 #endif
20250
20251 extern char $cf_data;
20252 int
20253 main (void)
20254 {
20255
20256         do {
20257
20258 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20259         const void *foo = (const void *)($cf_data);
20260 #else
20261         const void *foo = &($cf_data);
20262 #endif
20263         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20264
20265                 ${cf_cv_main_return:-return}(foo == 0);
20266         } while (0)
20267
20268   ;
20269   return 0;
20270 }
20271 _ACEOF
20272 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20273 if { (eval echo "$as_me:20273: \"$ac_link\"") >&5
20274   (eval $ac_link) 2>&5
20275   ac_status=$?
20276   echo "$as_me:20276: \$? = $ac_status" >&5
20277   (exit "$ac_status"); } &&
20278          { ac_try='test -s "conftest$ac_exeext"'
20279   { (eval echo "$as_me:20279: \"$ac_try\"") >&5
20280   (eval $ac_try) 2>&5
20281   ac_status=$?
20282   echo "$as_me:20282: \$? = $ac_status" >&5
20283   (exit "$ac_status"); }; }; then
20284   cf_result=yes
20285 else
20286   echo "$as_me: failed program was:" >&5
20287 cat "conftest.$ac_ext" >&5
20288 cf_result=no
20289 fi
20290 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20291
20292 else
20293   cat >"conftest.$ac_ext" <<_ACEOF
20294 #line 20294 "configure"
20295 #include "confdefs.h"
20296
20297 #ifdef HAVE_XCURSES
20298 #include <xcurses.h>
20299 char * XCursesProgramName = "test";
20300 #else
20301 #include <${cf_cv_ncurses_header:-curses.h}>
20302 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20303 #include <ncursesw/term.h>
20304 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20305 #include <ncurses/term.h>
20306 #elif defined(HAVE_TERM_H)
20307 #include <term.h>
20308 #endif
20309 #endif
20310
20311 extern char $cf_data;
20312 int main(void)
20313 {
20314
20315 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20316         const void *foo = (const void *)($cf_data);
20317 #else
20318         const void *foo = &($cf_data);
20319 #endif
20320         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20321
20322         ${cf_cv_main_return:-return}(foo == 0);
20323 }
20324 _ACEOF
20325 rm -f "conftest$ac_exeext"
20326 if { (eval echo "$as_me:20326: \"$ac_link\"") >&5
20327   (eval $ac_link) 2>&5
20328   ac_status=$?
20329   echo "$as_me:20329: \$? = $ac_status" >&5
20330   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20331   { (eval echo "$as_me:20331: \"$ac_try\"") >&5
20332   (eval $ac_try) 2>&5
20333   ac_status=$?
20334   echo "$as_me:20334: \$? = $ac_status" >&5
20335   (exit "$ac_status"); }; }; then
20336   cf_result=yes
20337
20338 else
20339   echo "$as_me: program exited with status $ac_status" >&5
20340 echo "$as_me: failed program was:" >&5
20341 cat "conftest.$ac_ext" >&5
20342 cf_result=no
20343 fi
20344 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20345 fi
20346         echo "$as_me:20346: result: $cf_result" >&5
20347 echo "${ECHO_T}$cf_result" >&6
20348         if test "$cf_result" = yes ; then
20349
20350 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20351
20352                 cat >>confdefs.h <<EOF
20353 #define $cf_result 1
20354 EOF
20355
20356                 # do not exit loop here, since we prefer system's declarations
20357         fi
20358 fi
20359 done
20360
20361 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20362 then
20363         echo "$as_me:20363: checking for X" >&5
20364 echo $ECHO_N "checking for X... $ECHO_C" >&6
20365
20366 # Check whether --with-x or --without-x was given.
20367 if test "${with_x+set}" = set; then
20368   withval="$with_x"
20369
20370 fi;
20371 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20372 if test "x$with_x" = xno; then
20373   # The user explicitly disabled X.
20374   have_x=disabled
20375 else
20376   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20377     # Both variables are already set.
20378     have_x=yes
20379   else
20380     if test "${ac_cv_have_x+set}" = set; then
20381   echo $ECHO_N "(cached) $ECHO_C" >&6
20382 else
20383   # One or both of the vars are not set, and there is no cached value.
20384 ac_x_includes=no ac_x_libraries=no
20385 rm -fr conftest.dir
20386 if mkdir conftest.dir; then
20387   cd conftest.dir
20388   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20389   cat >Imakefile <<'EOF'
20390 acfindx:
20391         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20392 EOF
20393   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20394     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20395     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20396     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20397     for ac_extension in a so sl dylib dll; do
20398       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20399          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20400         ac_im_usrlibdir=$ac_im_libdir; break
20401       fi
20402     done
20403     # Screen out bogus values from the imake configuration.  They are
20404     # bogus both because they are the default anyway, and because
20405     # using them would break gcc on systems where it needs fixed includes.
20406     case $ac_im_incroot in
20407         /usr/include) ;;
20408         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20409     esac
20410     case $ac_im_usrlibdir in
20411         /usr/lib | /lib) ;;
20412         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20413     esac
20414   fi
20415   cd ..
20416   rm -fr conftest.dir
20417 fi
20418
20419 # Standard set of common directories for X headers.
20420 # Check X11 before X11Rn because it is often a symlink to the current release.
20421 ac_x_header_dirs='
20422 /usr/X11/include
20423 /usr/X11R7/include
20424 /usr/X11R6/include
20425 /usr/X11R5/include
20426 /usr/X11R4/include
20427
20428 /opt/local/include
20429 /opt/X11/include
20430
20431 /usr/include/X11
20432 /usr/include/X11R7
20433 /usr/include/X11R6
20434 /usr/include/X11R5
20435 /usr/include/X11R4
20436
20437 /usr/local/X11/include
20438 /usr/local/X11R7/include
20439 /usr/local/X11R6/include
20440 /usr/local/X11R5/include
20441 /usr/local/X11R4/include
20442
20443 /usr/local/include/X11
20444 /usr/local/include/X11R7
20445 /usr/local/include/X11R6
20446 /usr/local/include/X11R5
20447 /usr/local/include/X11R4
20448
20449 /usr/X386/include
20450 /usr/x386/include
20451 /usr/XFree86/include/X11
20452
20453 /usr/include
20454 /usr/local/include
20455 /usr/unsupported/include
20456 /usr/athena/include
20457 /usr/local/x11r5/include
20458 /usr/lpp/Xamples/include
20459
20460 /usr/openwin/include
20461 /usr/openwin/share/include'
20462
20463 if test "$ac_x_includes" = no; then
20464   # Guess where to find include files, by looking for Intrinsic.h.
20465   # First, try using that file with no special directory specified.
20466   cat >"conftest.$ac_ext" <<_ACEOF
20467 #line 20467 "configure"
20468 #include "confdefs.h"
20469 #include <X11/Intrinsic.h>
20470 _ACEOF
20471 if { (eval echo "$as_me:20471: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20472   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20473   ac_status=$?
20474   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20475   rm -f conftest.er1
20476   cat conftest.err >&5
20477   echo "$as_me:20477: \$? = $ac_status" >&5
20478   (exit "$ac_status"); } >/dev/null; then
20479   if test -s conftest.err; then
20480     ac_cpp_err=$ac_c_preproc_warn_flag
20481   else
20482     ac_cpp_err=
20483   fi
20484 else
20485   ac_cpp_err=yes
20486 fi
20487 if test -z "$ac_cpp_err"; then
20488   # We can compile using X headers with no special include directory.
20489 ac_x_includes=
20490 else
20491   echo "$as_me: failed program was:" >&5
20492   cat "conftest.$ac_ext" >&5
20493   for ac_dir in $ac_x_header_dirs; do
20494   if test -r "$ac_dir/X11/Intrinsic.h"; then
20495     ac_x_includes=$ac_dir
20496     break
20497   fi
20498 done
20499 fi
20500 rm -f conftest.err "conftest.$ac_ext"
20501 fi # $ac_x_includes = no
20502
20503 if test "$ac_x_libraries" = no; then
20504   # Check for the libraries.
20505   # See if we find them without any special options.
20506   # Don't add to $LIBS permanently.
20507   ac_save_LIBS=$LIBS
20508   LIBS="-lXt $LIBS"
20509   cat >"conftest.$ac_ext" <<_ACEOF
20510 #line 20510 "configure"
20511 #include "confdefs.h"
20512 #include <X11/Intrinsic.h>
20513 int
20514 main (void)
20515 {
20516 XtMalloc (0)
20517   ;
20518   return 0;
20519 }
20520 _ACEOF
20521 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20522 if { (eval echo "$as_me:20522: \"$ac_link\"") >&5
20523   (eval $ac_link) 2>&5
20524   ac_status=$?
20525   echo "$as_me:20525: \$? = $ac_status" >&5
20526   (exit "$ac_status"); } &&
20527          { ac_try='test -s "conftest$ac_exeext"'
20528   { (eval echo "$as_me:20528: \"$ac_try\"") >&5
20529   (eval $ac_try) 2>&5
20530   ac_status=$?
20531   echo "$as_me:20531: \$? = $ac_status" >&5
20532   (exit "$ac_status"); }; }; then
20533   LIBS=$ac_save_LIBS
20534 # We can link X programs with no special library path.
20535 ac_x_libraries=
20536 else
20537   echo "$as_me: failed program was:" >&5
20538 cat "conftest.$ac_ext" >&5
20539 LIBS=$ac_save_LIBS
20540 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20541 do
20542   # Don't even attempt the hair of trying to link an X program!
20543   for ac_extension in a so sl dylib dll; do
20544     if test -r "$ac_dir/libXt.$ac_extension"; then
20545       ac_x_libraries=$ac_dir
20546       break 2
20547     fi
20548   done
20549 done
20550 fi
20551 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20552 fi # $ac_x_libraries = no
20553
20554 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20555   # Didn't find X anywhere.  Cache the known absence of X.
20556   ac_cv_have_x="have_x=no"
20557 else
20558   # Record where we found X for the cache.
20559   ac_cv_have_x="have_x=yes \
20560                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20561 fi
20562 fi
20563
20564   fi
20565   eval "$ac_cv_have_x"
20566 fi # $with_x != no
20567
20568 if test "$have_x" != yes; then
20569   echo "$as_me:20569: result: $have_x" >&5
20570 echo "${ECHO_T}$have_x" >&6
20571   no_x=yes
20572 else
20573   # If each of the values was on the command line, it overrides each guess.
20574   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20575   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20576   # Update the cache value to reflect the command line values.
20577   ac_cv_have_x="have_x=yes \
20578                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20579   echo "$as_me:20579: result: libraries $x_libraries, headers $x_includes" >&5
20580 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20581 fi
20582
20583         if test "$no_x" = yes; then
20584   # Not all programs may use this symbol, but it does not hurt to define it.
20585
20586 cat >>confdefs.h <<\EOF
20587 #define X_DISPLAY_MISSING 1
20588 EOF
20589
20590   X_CFLAGS=
20591   X_PRE_LIBS=
20592   X_LIBS=
20593   X_EXTRA_LIBS=
20594 else
20595   if test -n "$x_includes"; then
20596     X_CFLAGS="$X_CFLAGS -I$x_includes"
20597   fi
20598
20599   # It would also be nice to do this for all -L options, not just this one.
20600   if test -n "$x_libraries"; then
20601     X_LIBS="$X_LIBS -L$x_libraries"
20602     # For Solaris; some versions of Sun CC require a space after -R and
20603     # others require no space.  Words are not sufficient . . . .
20604     case `(uname -sr) 2>/dev/null` in
20605     "SunOS 5"*)
20606       echo "$as_me:20606: checking whether -R must be followed by a space" >&5
20607 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20608       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20609       cat >"conftest.$ac_ext" <<_ACEOF
20610 #line 20610 "configure"
20611 #include "confdefs.h"
20612
20613 int
20614 main (void)
20615 {
20616
20617   ;
20618   return 0;
20619 }
20620 _ACEOF
20621 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20622 if { (eval echo "$as_me:20622: \"$ac_link\"") >&5
20623   (eval $ac_link) 2>&5
20624   ac_status=$?
20625   echo "$as_me:20625: \$? = $ac_status" >&5
20626   (exit "$ac_status"); } &&
20627          { ac_try='test -s "conftest$ac_exeext"'
20628   { (eval echo "$as_me:20628: \"$ac_try\"") >&5
20629   (eval $ac_try) 2>&5
20630   ac_status=$?
20631   echo "$as_me:20631: \$? = $ac_status" >&5
20632   (exit "$ac_status"); }; }; then
20633   ac_R_nospace=yes
20634 else
20635   echo "$as_me: failed program was:" >&5
20636 cat "conftest.$ac_ext" >&5
20637 ac_R_nospace=no
20638 fi
20639 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20640       if test $ac_R_nospace = yes; then
20641         echo "$as_me:20641: result: no" >&5
20642 echo "${ECHO_T}no" >&6
20643         X_LIBS="$X_LIBS -R$x_libraries"
20644       else
20645         LIBS="$ac_xsave_LIBS -R $x_libraries"
20646         cat >"conftest.$ac_ext" <<_ACEOF
20647 #line 20647 "configure"
20648 #include "confdefs.h"
20649
20650 int
20651 main (void)
20652 {
20653
20654   ;
20655   return 0;
20656 }
20657 _ACEOF
20658 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20659 if { (eval echo "$as_me:20659: \"$ac_link\"") >&5
20660   (eval $ac_link) 2>&5
20661   ac_status=$?
20662   echo "$as_me:20662: \$? = $ac_status" >&5
20663   (exit "$ac_status"); } &&
20664          { ac_try='test -s "conftest$ac_exeext"'
20665   { (eval echo "$as_me:20665: \"$ac_try\"") >&5
20666   (eval $ac_try) 2>&5
20667   ac_status=$?
20668   echo "$as_me:20668: \$? = $ac_status" >&5
20669   (exit "$ac_status"); }; }; then
20670   ac_R_space=yes
20671 else
20672   echo "$as_me: failed program was:" >&5
20673 cat "conftest.$ac_ext" >&5
20674 ac_R_space=no
20675 fi
20676 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20677         if test $ac_R_space = yes; then
20678           echo "$as_me:20678: result: yes" >&5
20679 echo "${ECHO_T}yes" >&6
20680           X_LIBS="$X_LIBS -R $x_libraries"
20681         else
20682           echo "$as_me:20682: result: neither works" >&5
20683 echo "${ECHO_T}neither works" >&6
20684         fi
20685       fi
20686       LIBS=$ac_xsave_LIBS
20687     esac
20688   fi
20689
20690   # Check for system-dependent libraries X programs must link with.
20691   # Do this before checking for the system-independent R6 libraries
20692   # (-lICE), since we may need -lsocket or whatever for X linking.
20693
20694   if test "$ISC" = yes; then
20695     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20696   else
20697     # Martyn Johnson says this is needed for Ultrix, if the X
20698     # libraries were built with DECnet support.  And Karl Berry says
20699     # the Alpha needs dnet_stub (dnet does not exist).
20700     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20701     cat >"conftest.$ac_ext" <<_ACEOF
20702 #line 20702 "configure"
20703 #include "confdefs.h"
20704
20705 /* Override any gcc2 internal prototype to avoid an error.  */
20706 #ifdef __cplusplus
20707 extern "C"
20708 #endif
20709 /* We use char because int might match the return type of a gcc2
20710    builtin and then its argument prototype would still apply.  */
20711 char XOpenDisplay ();
20712 int
20713 main (void)
20714 {
20715 XOpenDisplay ();
20716   ;
20717   return 0;
20718 }
20719 _ACEOF
20720 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20721 if { (eval echo "$as_me:20721: \"$ac_link\"") >&5
20722   (eval $ac_link) 2>&5
20723   ac_status=$?
20724   echo "$as_me:20724: \$? = $ac_status" >&5
20725   (exit "$ac_status"); } &&
20726          { ac_try='test -s "conftest$ac_exeext"'
20727   { (eval echo "$as_me:20727: \"$ac_try\"") >&5
20728   (eval $ac_try) 2>&5
20729   ac_status=$?
20730   echo "$as_me:20730: \$? = $ac_status" >&5
20731   (exit "$ac_status"); }; }; then
20732   :
20733 else
20734   echo "$as_me: failed program was:" >&5
20735 cat "conftest.$ac_ext" >&5
20736 echo "$as_me:20736: checking for dnet_ntoa in -ldnet" >&5
20737 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20738 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20739   echo $ECHO_N "(cached) $ECHO_C" >&6
20740 else
20741   ac_check_lib_save_LIBS=$LIBS
20742 LIBS="-ldnet  $LIBS"
20743 cat >"conftest.$ac_ext" <<_ACEOF
20744 #line 20744 "configure"
20745 #include "confdefs.h"
20746
20747 /* Override any gcc2 internal prototype to avoid an error.  */
20748 #ifdef __cplusplus
20749 extern "C"
20750 #endif
20751 /* We use char because int might match the return type of a gcc2
20752    builtin and then its argument prototype would still apply.  */
20753 char dnet_ntoa ();
20754 int
20755 main (void)
20756 {
20757 dnet_ntoa ();
20758   ;
20759   return 0;
20760 }
20761 _ACEOF
20762 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20763 if { (eval echo "$as_me:20763: \"$ac_link\"") >&5
20764   (eval $ac_link) 2>&5
20765   ac_status=$?
20766   echo "$as_me:20766: \$? = $ac_status" >&5
20767   (exit "$ac_status"); } &&
20768          { ac_try='test -s "conftest$ac_exeext"'
20769   { (eval echo "$as_me:20769: \"$ac_try\"") >&5
20770   (eval $ac_try) 2>&5
20771   ac_status=$?
20772   echo "$as_me:20772: \$? = $ac_status" >&5
20773   (exit "$ac_status"); }; }; then
20774   ac_cv_lib_dnet_dnet_ntoa=yes
20775 else
20776   echo "$as_me: failed program was:" >&5
20777 cat "conftest.$ac_ext" >&5
20778 ac_cv_lib_dnet_dnet_ntoa=no
20779 fi
20780 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20781 LIBS=$ac_check_lib_save_LIBS
20782 fi
20783 echo "$as_me:20783: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20784 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20785 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
20786   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20787 fi
20788
20789     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20790       echo "$as_me:20790: checking for dnet_ntoa in -ldnet_stub" >&5
20791 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20792 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20793   echo $ECHO_N "(cached) $ECHO_C" >&6
20794 else
20795   ac_check_lib_save_LIBS=$LIBS
20796 LIBS="-ldnet_stub  $LIBS"
20797 cat >"conftest.$ac_ext" <<_ACEOF
20798 #line 20798 "configure"
20799 #include "confdefs.h"
20800
20801 /* Override any gcc2 internal prototype to avoid an error.  */
20802 #ifdef __cplusplus
20803 extern "C"
20804 #endif
20805 /* We use char because int might match the return type of a gcc2
20806    builtin and then its argument prototype would still apply.  */
20807 char dnet_ntoa ();
20808 int
20809 main (void)
20810 {
20811 dnet_ntoa ();
20812   ;
20813   return 0;
20814 }
20815 _ACEOF
20816 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20817 if { (eval echo "$as_me:20817: \"$ac_link\"") >&5
20818   (eval $ac_link) 2>&5
20819   ac_status=$?
20820   echo "$as_me:20820: \$? = $ac_status" >&5
20821   (exit "$ac_status"); } &&
20822          { ac_try='test -s "conftest$ac_exeext"'
20823   { (eval echo "$as_me:20823: \"$ac_try\"") >&5
20824   (eval $ac_try) 2>&5
20825   ac_status=$?
20826   echo "$as_me:20826: \$? = $ac_status" >&5
20827   (exit "$ac_status"); }; }; then
20828   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20829 else
20830   echo "$as_me: failed program was:" >&5
20831 cat "conftest.$ac_ext" >&5
20832 ac_cv_lib_dnet_stub_dnet_ntoa=no
20833 fi
20834 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20835 LIBS=$ac_check_lib_save_LIBS
20836 fi
20837 echo "$as_me:20837: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20838 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20839 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
20840   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20841 fi
20842
20843     fi
20844 fi
20845 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20846     LIBS="$ac_xsave_LIBS"
20847
20848     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20849     # to get the SysV transport functions.
20850     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20851     # needs -lnsl.
20852     # The nsl library prevents programs from opening the X display
20853     # on Irix 5.2, according to T.E. Dickey.
20854     # The functions gethostbyname, getservbyname, and inet_addr are
20855     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20856     echo "$as_me:20856: checking for gethostbyname" >&5
20857 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20858 if test "${ac_cv_func_gethostbyname+set}" = set; then
20859   echo $ECHO_N "(cached) $ECHO_C" >&6
20860 else
20861   cat >"conftest.$ac_ext" <<_ACEOF
20862 #line 20862 "configure"
20863 #include "confdefs.h"
20864 #define gethostbyname autoconf_temporary
20865 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20866 #undef gethostbyname
20867
20868 #ifdef __cplusplus
20869 extern "C"
20870 #endif
20871
20872 /* We use char because int might match the return type of a gcc2
20873    builtin and then its argument prototype would still apply.  */
20874 char gethostbyname (void);
20875
20876 int
20877 main (void)
20878 {
20879
20880 /* The GNU C library defines stubs for functions which it implements
20881     to always fail with ENOSYS.  Some functions are actually named
20882     something starting with __ and the normal name is an alias.  */
20883 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
20884 #error found stub for gethostbyname
20885 #endif
20886
20887         return gethostbyname ();
20888   ;
20889   return 0;
20890 }
20891 _ACEOF
20892 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20893 if { (eval echo "$as_me:20893: \"$ac_link\"") >&5
20894   (eval $ac_link) 2>&5
20895   ac_status=$?
20896   echo "$as_me:20896: \$? = $ac_status" >&5
20897   (exit "$ac_status"); } &&
20898          { ac_try='test -s "conftest$ac_exeext"'
20899   { (eval echo "$as_me:20899: \"$ac_try\"") >&5
20900   (eval $ac_try) 2>&5
20901   ac_status=$?
20902   echo "$as_me:20902: \$? = $ac_status" >&5
20903   (exit "$ac_status"); }; }; then
20904   ac_cv_func_gethostbyname=yes
20905 else
20906   echo "$as_me: failed program was:" >&5
20907 cat "conftest.$ac_ext" >&5
20908 ac_cv_func_gethostbyname=no
20909 fi
20910 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20911 fi
20912 echo "$as_me:20912: result: $ac_cv_func_gethostbyname" >&5
20913 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
20914
20915     if test $ac_cv_func_gethostbyname = no; then
20916       echo "$as_me:20916: checking for gethostbyname in -lnsl" >&5
20917 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
20918 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
20919   echo $ECHO_N "(cached) $ECHO_C" >&6
20920 else
20921   ac_check_lib_save_LIBS=$LIBS
20922 LIBS="-lnsl  $LIBS"
20923 cat >"conftest.$ac_ext" <<_ACEOF
20924 #line 20924 "configure"
20925 #include "confdefs.h"
20926
20927 /* Override any gcc2 internal prototype to avoid an error.  */
20928 #ifdef __cplusplus
20929 extern "C"
20930 #endif
20931 /* We use char because int might match the return type of a gcc2
20932    builtin and then its argument prototype would still apply.  */
20933 char gethostbyname ();
20934 int
20935 main (void)
20936 {
20937 gethostbyname ();
20938   ;
20939   return 0;
20940 }
20941 _ACEOF
20942 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20943 if { (eval echo "$as_me:20943: \"$ac_link\"") >&5
20944   (eval $ac_link) 2>&5
20945   ac_status=$?
20946   echo "$as_me:20946: \$? = $ac_status" >&5
20947   (exit "$ac_status"); } &&
20948          { ac_try='test -s "conftest$ac_exeext"'
20949   { (eval echo "$as_me:20949: \"$ac_try\"") >&5
20950   (eval $ac_try) 2>&5
20951   ac_status=$?
20952   echo "$as_me:20952: \$? = $ac_status" >&5
20953   (exit "$ac_status"); }; }; then
20954   ac_cv_lib_nsl_gethostbyname=yes
20955 else
20956   echo "$as_me: failed program was:" >&5
20957 cat "conftest.$ac_ext" >&5
20958 ac_cv_lib_nsl_gethostbyname=no
20959 fi
20960 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20961 LIBS=$ac_check_lib_save_LIBS
20962 fi
20963 echo "$as_me:20963: result: $ac_cv_lib_nsl_gethostbyname" >&5
20964 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
20965 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
20966   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
20967 fi
20968
20969       if test $ac_cv_lib_nsl_gethostbyname = no; then
20970         echo "$as_me:20970: checking for gethostbyname in -lbsd" >&5
20971 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
20972 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
20973   echo $ECHO_N "(cached) $ECHO_C" >&6
20974 else
20975   ac_check_lib_save_LIBS=$LIBS
20976 LIBS="-lbsd  $LIBS"
20977 cat >"conftest.$ac_ext" <<_ACEOF
20978 #line 20978 "configure"
20979 #include "confdefs.h"
20980
20981 /* Override any gcc2 internal prototype to avoid an error.  */
20982 #ifdef __cplusplus
20983 extern "C"
20984 #endif
20985 /* We use char because int might match the return type of a gcc2
20986    builtin and then its argument prototype would still apply.  */
20987 char gethostbyname ();
20988 int
20989 main (void)
20990 {
20991 gethostbyname ();
20992   ;
20993   return 0;
20994 }
20995 _ACEOF
20996 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20997 if { (eval echo "$as_me:20997: \"$ac_link\"") >&5
20998   (eval $ac_link) 2>&5
20999   ac_status=$?
21000   echo "$as_me:21000: \$? = $ac_status" >&5
21001   (exit "$ac_status"); } &&
21002          { ac_try='test -s "conftest$ac_exeext"'
21003   { (eval echo "$as_me:21003: \"$ac_try\"") >&5
21004   (eval $ac_try) 2>&5
21005   ac_status=$?
21006   echo "$as_me:21006: \$? = $ac_status" >&5
21007   (exit "$ac_status"); }; }; then
21008   ac_cv_lib_bsd_gethostbyname=yes
21009 else
21010   echo "$as_me: failed program was:" >&5
21011 cat "conftest.$ac_ext" >&5
21012 ac_cv_lib_bsd_gethostbyname=no
21013 fi
21014 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21015 LIBS=$ac_check_lib_save_LIBS
21016 fi
21017 echo "$as_me:21017: result: $ac_cv_lib_bsd_gethostbyname" >&5
21018 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21019 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21020   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21021 fi
21022
21023       fi
21024     fi
21025
21026     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21027     # socket/setsockopt and other routines are undefined under SCO ODT
21028     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21029     # on later versions), says Simon Leinen: it contains gethostby*
21030     # variants that don't use the nameserver (or something).  -lsocket
21031     # must be given before -lnsl if both are needed.  We assume that
21032     # if connect needs -lnsl, so does gethostbyname.
21033     echo "$as_me:21033: checking for connect" >&5
21034 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21035 if test "${ac_cv_func_connect+set}" = set; then
21036   echo $ECHO_N "(cached) $ECHO_C" >&6
21037 else
21038   cat >"conftest.$ac_ext" <<_ACEOF
21039 #line 21039 "configure"
21040 #include "confdefs.h"
21041 #define connect autoconf_temporary
21042 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21043 #undef connect
21044
21045 #ifdef __cplusplus
21046 extern "C"
21047 #endif
21048
21049 /* We use char because int might match the return type of a gcc2
21050    builtin and then its argument prototype would still apply.  */
21051 char connect (void);
21052
21053 int
21054 main (void)
21055 {
21056
21057 /* The GNU C library defines stubs for functions which it implements
21058     to always fail with ENOSYS.  Some functions are actually named
21059     something starting with __ and the normal name is an alias.  */
21060 #if defined (__stub_connect) || defined (__stub___connect)
21061 #error found stub for connect
21062 #endif
21063
21064         return connect ();
21065   ;
21066   return 0;
21067 }
21068 _ACEOF
21069 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21070 if { (eval echo "$as_me:21070: \"$ac_link\"") >&5
21071   (eval $ac_link) 2>&5
21072   ac_status=$?
21073   echo "$as_me:21073: \$? = $ac_status" >&5
21074   (exit "$ac_status"); } &&
21075          { ac_try='test -s "conftest$ac_exeext"'
21076   { (eval echo "$as_me:21076: \"$ac_try\"") >&5
21077   (eval $ac_try) 2>&5
21078   ac_status=$?
21079   echo "$as_me:21079: \$? = $ac_status" >&5
21080   (exit "$ac_status"); }; }; then
21081   ac_cv_func_connect=yes
21082 else
21083   echo "$as_me: failed program was:" >&5
21084 cat "conftest.$ac_ext" >&5
21085 ac_cv_func_connect=no
21086 fi
21087 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21088 fi
21089 echo "$as_me:21089: result: $ac_cv_func_connect" >&5
21090 echo "${ECHO_T}$ac_cv_func_connect" >&6
21091
21092     if test $ac_cv_func_connect = no; then
21093       echo "$as_me:21093: checking for connect in -lsocket" >&5
21094 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21095 if test "${ac_cv_lib_socket_connect+set}" = set; then
21096   echo $ECHO_N "(cached) $ECHO_C" >&6
21097 else
21098   ac_check_lib_save_LIBS=$LIBS
21099 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21100 cat >"conftest.$ac_ext" <<_ACEOF
21101 #line 21101 "configure"
21102 #include "confdefs.h"
21103
21104 /* Override any gcc2 internal prototype to avoid an error.  */
21105 #ifdef __cplusplus
21106 extern "C"
21107 #endif
21108 /* We use char because int might match the return type of a gcc2
21109    builtin and then its argument prototype would still apply.  */
21110 char connect ();
21111 int
21112 main (void)
21113 {
21114 connect ();
21115   ;
21116   return 0;
21117 }
21118 _ACEOF
21119 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21120 if { (eval echo "$as_me:21120: \"$ac_link\"") >&5
21121   (eval $ac_link) 2>&5
21122   ac_status=$?
21123   echo "$as_me:21123: \$? = $ac_status" >&5
21124   (exit "$ac_status"); } &&
21125          { ac_try='test -s "conftest$ac_exeext"'
21126   { (eval echo "$as_me:21126: \"$ac_try\"") >&5
21127   (eval $ac_try) 2>&5
21128   ac_status=$?
21129   echo "$as_me:21129: \$? = $ac_status" >&5
21130   (exit "$ac_status"); }; }; then
21131   ac_cv_lib_socket_connect=yes
21132 else
21133   echo "$as_me: failed program was:" >&5
21134 cat "conftest.$ac_ext" >&5
21135 ac_cv_lib_socket_connect=no
21136 fi
21137 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21138 LIBS=$ac_check_lib_save_LIBS
21139 fi
21140 echo "$as_me:21140: result: $ac_cv_lib_socket_connect" >&5
21141 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21142 if test "$ac_cv_lib_socket_connect" = yes; then
21143   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21144 fi
21145
21146     fi
21147
21148     # Guillermo Gomez says -lposix is necessary on A/UX.
21149     echo "$as_me:21149: checking for remove" >&5
21150 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21151 if test "${ac_cv_func_remove+set}" = set; then
21152   echo $ECHO_N "(cached) $ECHO_C" >&6
21153 else
21154   cat >"conftest.$ac_ext" <<_ACEOF
21155 #line 21155 "configure"
21156 #include "confdefs.h"
21157 #define remove autoconf_temporary
21158 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21159 #undef remove
21160
21161 #ifdef __cplusplus
21162 extern "C"
21163 #endif
21164
21165 /* We use char because int might match the return type of a gcc2
21166    builtin and then its argument prototype would still apply.  */
21167 char remove (void);
21168
21169 int
21170 main (void)
21171 {
21172
21173 /* The GNU C library defines stubs for functions which it implements
21174     to always fail with ENOSYS.  Some functions are actually named
21175     something starting with __ and the normal name is an alias.  */
21176 #if defined (__stub_remove) || defined (__stub___remove)
21177 #error found stub for remove
21178 #endif
21179
21180         return remove ();
21181   ;
21182   return 0;
21183 }
21184 _ACEOF
21185 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21186 if { (eval echo "$as_me:21186: \"$ac_link\"") >&5
21187   (eval $ac_link) 2>&5
21188   ac_status=$?
21189   echo "$as_me:21189: \$? = $ac_status" >&5
21190   (exit "$ac_status"); } &&
21191          { ac_try='test -s "conftest$ac_exeext"'
21192   { (eval echo "$as_me:21192: \"$ac_try\"") >&5
21193   (eval $ac_try) 2>&5
21194   ac_status=$?
21195   echo "$as_me:21195: \$? = $ac_status" >&5
21196   (exit "$ac_status"); }; }; then
21197   ac_cv_func_remove=yes
21198 else
21199   echo "$as_me: failed program was:" >&5
21200 cat "conftest.$ac_ext" >&5
21201 ac_cv_func_remove=no
21202 fi
21203 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21204 fi
21205 echo "$as_me:21205: result: $ac_cv_func_remove" >&5
21206 echo "${ECHO_T}$ac_cv_func_remove" >&6
21207
21208     if test $ac_cv_func_remove = no; then
21209       echo "$as_me:21209: checking for remove in -lposix" >&5
21210 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21211 if test "${ac_cv_lib_posix_remove+set}" = set; then
21212   echo $ECHO_N "(cached) $ECHO_C" >&6
21213 else
21214   ac_check_lib_save_LIBS=$LIBS
21215 LIBS="-lposix  $LIBS"
21216 cat >"conftest.$ac_ext" <<_ACEOF
21217 #line 21217 "configure"
21218 #include "confdefs.h"
21219
21220 /* Override any gcc2 internal prototype to avoid an error.  */
21221 #ifdef __cplusplus
21222 extern "C"
21223 #endif
21224 /* We use char because int might match the return type of a gcc2
21225    builtin and then its argument prototype would still apply.  */
21226 char remove ();
21227 int
21228 main (void)
21229 {
21230 remove ();
21231   ;
21232   return 0;
21233 }
21234 _ACEOF
21235 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21236 if { (eval echo "$as_me:21236: \"$ac_link\"") >&5
21237   (eval $ac_link) 2>&5
21238   ac_status=$?
21239   echo "$as_me:21239: \$? = $ac_status" >&5
21240   (exit "$ac_status"); } &&
21241          { ac_try='test -s "conftest$ac_exeext"'
21242   { (eval echo "$as_me:21242: \"$ac_try\"") >&5
21243   (eval $ac_try) 2>&5
21244   ac_status=$?
21245   echo "$as_me:21245: \$? = $ac_status" >&5
21246   (exit "$ac_status"); }; }; then
21247   ac_cv_lib_posix_remove=yes
21248 else
21249   echo "$as_me: failed program was:" >&5
21250 cat "conftest.$ac_ext" >&5
21251 ac_cv_lib_posix_remove=no
21252 fi
21253 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21254 LIBS=$ac_check_lib_save_LIBS
21255 fi
21256 echo "$as_me:21256: result: $ac_cv_lib_posix_remove" >&5
21257 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21258 if test "$ac_cv_lib_posix_remove" = yes; then
21259   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21260 fi
21261
21262     fi
21263
21264     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21265     echo "$as_me:21265: checking for shmat" >&5
21266 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21267 if test "${ac_cv_func_shmat+set}" = set; then
21268   echo $ECHO_N "(cached) $ECHO_C" >&6
21269 else
21270   cat >"conftest.$ac_ext" <<_ACEOF
21271 #line 21271 "configure"
21272 #include "confdefs.h"
21273 #define shmat autoconf_temporary
21274 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21275 #undef shmat
21276
21277 #ifdef __cplusplus
21278 extern "C"
21279 #endif
21280
21281 /* We use char because int might match the return type of a gcc2
21282    builtin and then its argument prototype would still apply.  */
21283 char shmat (void);
21284
21285 int
21286 main (void)
21287 {
21288
21289 /* The GNU C library defines stubs for functions which it implements
21290     to always fail with ENOSYS.  Some functions are actually named
21291     something starting with __ and the normal name is an alias.  */
21292 #if defined (__stub_shmat) || defined (__stub___shmat)
21293 #error found stub for shmat
21294 #endif
21295
21296         return shmat ();
21297   ;
21298   return 0;
21299 }
21300 _ACEOF
21301 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21302 if { (eval echo "$as_me:21302: \"$ac_link\"") >&5
21303   (eval $ac_link) 2>&5
21304   ac_status=$?
21305   echo "$as_me:21305: \$? = $ac_status" >&5
21306   (exit "$ac_status"); } &&
21307          { ac_try='test -s "conftest$ac_exeext"'
21308   { (eval echo "$as_me:21308: \"$ac_try\"") >&5
21309   (eval $ac_try) 2>&5
21310   ac_status=$?
21311   echo "$as_me:21311: \$? = $ac_status" >&5
21312   (exit "$ac_status"); }; }; then
21313   ac_cv_func_shmat=yes
21314 else
21315   echo "$as_me: failed program was:" >&5
21316 cat "conftest.$ac_ext" >&5
21317 ac_cv_func_shmat=no
21318 fi
21319 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21320 fi
21321 echo "$as_me:21321: result: $ac_cv_func_shmat" >&5
21322 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21323
21324     if test $ac_cv_func_shmat = no; then
21325       echo "$as_me:21325: checking for shmat in -lipc" >&5
21326 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21327 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21328   echo $ECHO_N "(cached) $ECHO_C" >&6
21329 else
21330   ac_check_lib_save_LIBS=$LIBS
21331 LIBS="-lipc  $LIBS"
21332 cat >"conftest.$ac_ext" <<_ACEOF
21333 #line 21333 "configure"
21334 #include "confdefs.h"
21335
21336 /* Override any gcc2 internal prototype to avoid an error.  */
21337 #ifdef __cplusplus
21338 extern "C"
21339 #endif
21340 /* We use char because int might match the return type of a gcc2
21341    builtin and then its argument prototype would still apply.  */
21342 char shmat ();
21343 int
21344 main (void)
21345 {
21346 shmat ();
21347   ;
21348   return 0;
21349 }
21350 _ACEOF
21351 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21352 if { (eval echo "$as_me:21352: \"$ac_link\"") >&5
21353   (eval $ac_link) 2>&5
21354   ac_status=$?
21355   echo "$as_me:21355: \$? = $ac_status" >&5
21356   (exit "$ac_status"); } &&
21357          { ac_try='test -s "conftest$ac_exeext"'
21358   { (eval echo "$as_me:21358: \"$ac_try\"") >&5
21359   (eval $ac_try) 2>&5
21360   ac_status=$?
21361   echo "$as_me:21361: \$? = $ac_status" >&5
21362   (exit "$ac_status"); }; }; then
21363   ac_cv_lib_ipc_shmat=yes
21364 else
21365   echo "$as_me: failed program was:" >&5
21366 cat "conftest.$ac_ext" >&5
21367 ac_cv_lib_ipc_shmat=no
21368 fi
21369 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21370 LIBS=$ac_check_lib_save_LIBS
21371 fi
21372 echo "$as_me:21372: result: $ac_cv_lib_ipc_shmat" >&5
21373 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21374 if test "$ac_cv_lib_ipc_shmat" = yes; then
21375   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21376 fi
21377
21378     fi
21379   fi
21380
21381   # Check for libraries that X11R6 Xt/Xaw programs need.
21382   ac_save_LDFLAGS=$LDFLAGS
21383   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21384   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21385   # check for ICE first), but we must link in the order -lSM -lICE or
21386   # we get undefined symbols.  So assume we have SM if we have ICE.
21387   # These have to be linked with before -lX11, unlike the other
21388   # libraries we check for below, so use a different variable.
21389   # John Interrante, Karl Berry
21390   echo "$as_me:21390: checking for IceConnectionNumber in -lICE" >&5
21391 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21392 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21393   echo $ECHO_N "(cached) $ECHO_C" >&6
21394 else
21395   ac_check_lib_save_LIBS=$LIBS
21396 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21397 cat >"conftest.$ac_ext" <<_ACEOF
21398 #line 21398 "configure"
21399 #include "confdefs.h"
21400
21401 /* Override any gcc2 internal prototype to avoid an error.  */
21402 #ifdef __cplusplus
21403 extern "C"
21404 #endif
21405 /* We use char because int might match the return type of a gcc2
21406    builtin and then its argument prototype would still apply.  */
21407 char IceConnectionNumber ();
21408 int
21409 main (void)
21410 {
21411 IceConnectionNumber ();
21412   ;
21413   return 0;
21414 }
21415 _ACEOF
21416 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21417 if { (eval echo "$as_me:21417: \"$ac_link\"") >&5
21418   (eval $ac_link) 2>&5
21419   ac_status=$?
21420   echo "$as_me:21420: \$? = $ac_status" >&5
21421   (exit "$ac_status"); } &&
21422          { ac_try='test -s "conftest$ac_exeext"'
21423   { (eval echo "$as_me:21423: \"$ac_try\"") >&5
21424   (eval $ac_try) 2>&5
21425   ac_status=$?
21426   echo "$as_me:21426: \$? = $ac_status" >&5
21427   (exit "$ac_status"); }; }; then
21428   ac_cv_lib_ICE_IceConnectionNumber=yes
21429 else
21430   echo "$as_me: failed program was:" >&5
21431 cat "conftest.$ac_ext" >&5
21432 ac_cv_lib_ICE_IceConnectionNumber=no
21433 fi
21434 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21435 LIBS=$ac_check_lib_save_LIBS
21436 fi
21437 echo "$as_me:21437: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21438 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21439 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21440   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21441 fi
21442
21443   LDFLAGS=$ac_save_LDFLAGS
21444
21445 fi
21446
21447 fi
21448
21449 if test "$GCC" = yes || test "$GXX" = yes
21450 then
21451
21452 if test "$GCC" = yes || test "$GXX" = yes
21453 then
21454         case $CFLAGS in
21455         (*-Werror=*)
21456                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21457
21458 echo "${as_me:-configure}:21458: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21459
21460                 cf_temp_flags=
21461                 for cf_temp_scan in $CFLAGS
21462                 do
21463                         case "x$cf_temp_scan" in
21464                         (x-Werror=*)
21465
21466         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21467         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21468
21469                                 ;;
21470                         (*)
21471
21472         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21473         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21474
21475                                 ;;
21476                         esac
21477                 done
21478                 CFLAGS="$cf_temp_flags"
21479                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21480
21481 echo "${as_me:-configure}:21481: testing ... fixed $CFLAGS ..." 1>&5
21482
21483                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21484
21485 echo "${as_me:-configure}:21485: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21486
21487                 ;;
21488         esac
21489 fi
21490
21491 if test "$GCC" = yes || test "$GXX" = yes
21492 then
21493         case $CPPFLAGS in
21494         (*-Werror=*)
21495                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21496
21497 echo "${as_me:-configure}:21497: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21498
21499                 cf_temp_flags=
21500                 for cf_temp_scan in $CPPFLAGS
21501                 do
21502                         case "x$cf_temp_scan" in
21503                         (x-Werror=*)
21504
21505         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21506         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21507
21508                                 ;;
21509                         (*)
21510
21511         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21512         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21513
21514                                 ;;
21515                         esac
21516                 done
21517                 CPPFLAGS="$cf_temp_flags"
21518                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21519
21520 echo "${as_me:-configure}:21520: testing ... fixed $CPPFLAGS ..." 1>&5
21521
21522                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21523
21524 echo "${as_me:-configure}:21524: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21525
21526                 ;;
21527         esac
21528 fi
21529
21530 if test "$GCC" = yes || test "$GXX" = yes
21531 then
21532         case $LDFLAGS in
21533         (*-Werror=*)
21534                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21535
21536 echo "${as_me:-configure}:21536: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21537
21538                 cf_temp_flags=
21539                 for cf_temp_scan in $LDFLAGS
21540                 do
21541                         case "x$cf_temp_scan" in
21542                         (x-Werror=*)
21543
21544         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21545         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21546
21547                                 ;;
21548                         (*)
21549
21550         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21551         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21552
21553                                 ;;
21554                         esac
21555                 done
21556                 LDFLAGS="$cf_temp_flags"
21557                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21558
21559 echo "${as_me:-configure}:21559: testing ... fixed $LDFLAGS ..." 1>&5
21560
21561                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21562
21563 echo "${as_me:-configure}:21563: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21564
21565                 ;;
21566         esac
21567 fi
21568
21569 echo "$as_me:21569: checking if you want to turn on gcc warnings" >&5
21570 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21571
21572 # Check whether --enable-warnings or --disable-warnings was given.
21573 if test "${enable_warnings+set}" = set; then
21574   enableval="$enable_warnings"
21575   test "$enableval" != yes && enableval=no
21576         if test "$enableval" != "no" ; then
21577     enable_warnings=yes
21578         else
21579                 enable_warnings=no
21580         fi
21581 else
21582   enableval=no
21583         enable_warnings=no
21584
21585 fi;
21586 echo "$as_me:21586: result: $enable_warnings" >&5
21587 echo "${ECHO_T}$enable_warnings" >&6
21588 if test "$enable_warnings" = "yes"
21589 then
21590
21591 if test "$GCC" = yes || test "$GXX" = yes
21592 then
21593 cat > conftest.i <<EOF
21594 #ifndef GCC_PRINTF
21595 #define GCC_PRINTF 0
21596 #endif
21597 #ifndef GCC_SCANF
21598 #define GCC_SCANF 0
21599 #endif
21600 #ifndef GCC_NORETURN
21601 #define GCC_NORETURN /* nothing */
21602 #endif
21603 #ifndef GCC_UNUSED
21604 #define GCC_UNUSED /* nothing */
21605 #endif
21606 EOF
21607 if test "$GCC" = yes
21608 then
21609         { echo "$as_me:21609: checking for $CC __attribute__ directives..." >&5
21610 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21611 cat > "conftest.$ac_ext" <<EOF
21612 #line 21612 "${as_me:-configure}"
21613 #include "confdefs.h"
21614 #include "conftest.h"
21615 #include "conftest.i"
21616 #if     GCC_PRINTF
21617 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21618 #else
21619 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21620 #endif
21621 #if     GCC_SCANF
21622 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21623 #else
21624 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21625 #endif
21626 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21627 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
21628 extern GCC_NORETURN void foo(void);
21629 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21630 EOF
21631         cf_printf_attribute=no
21632         cf_scanf_attribute=no
21633         for cf_attribute in scanf printf unused noreturn
21634         do
21635
21636 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21637
21638                 cf_directive="__attribute__(($cf_attribute))"
21639                 echo "checking for $CC $cf_directive" 1>&5
21640
21641                 case "$cf_attribute" in
21642                 (printf)
21643                         cf_printf_attribute=yes
21644                         cat >conftest.h <<EOF
21645 #define GCC_$cf_ATTRIBUTE 1
21646 EOF
21647                         ;;
21648                 (scanf)
21649                         cf_scanf_attribute=yes
21650                         cat >conftest.h <<EOF
21651 #define GCC_$cf_ATTRIBUTE 1
21652 EOF
21653                         ;;
21654                 (*)
21655                         cat >conftest.h <<EOF
21656 #define GCC_$cf_ATTRIBUTE $cf_directive
21657 EOF
21658                         ;;
21659                 esac
21660
21661                 if { (eval echo "$as_me:21661: \"$ac_compile\"") >&5
21662   (eval $ac_compile) 2>&5
21663   ac_status=$?
21664   echo "$as_me:21664: \$? = $ac_status" >&5
21665   (exit "$ac_status"); }; then
21666                         test -n "$verbose" && echo "$as_me:21666: result: ... $cf_attribute" >&5
21667 echo "${ECHO_T}... $cf_attribute" >&6
21668                         cat conftest.h >>confdefs.h
21669                         case "$cf_attribute" in
21670                         (noreturn)
21671
21672 cat >>confdefs.h <<EOF
21673 #define GCC_NORETURN $cf_directive
21674 EOF
21675
21676                                 ;;
21677                         (printf)
21678                                 cf_value='/* nothing */'
21679                                 if test "$cf_printf_attribute" != no ; then
21680                                         cf_value='__attribute__((format(printf,fmt,var)))'
21681
21682 cat >>confdefs.h <<\EOF
21683 #define GCC_PRINTF 1
21684 EOF
21685
21686                                 fi
21687
21688 cat >>confdefs.h <<EOF
21689 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21690 EOF
21691
21692                                 ;;
21693                         (scanf)
21694                                 cf_value='/* nothing */'
21695                                 if test "$cf_scanf_attribute" != no ; then
21696                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21697
21698 cat >>confdefs.h <<\EOF
21699 #define GCC_SCANF 1
21700 EOF
21701
21702                                 fi
21703
21704 cat >>confdefs.h <<EOF
21705 #define GCC_SCANFLIKE(fmt,var) $cf_value
21706 EOF
21707
21708                                 ;;
21709                         (unused)
21710
21711 cat >>confdefs.h <<EOF
21712 #define GCC_UNUSED $cf_directive
21713 EOF
21714
21715                                 ;;
21716                         esac
21717                 fi
21718         done
21719 else
21720         ${FGREP-fgrep} define conftest.i >>confdefs.h
21721 fi
21722 rm -rf ./conftest*
21723 fi
21724
21725 if test "x$have_x" = xyes; then
21726
21727 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21728 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21729 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21730 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21731 for cf_X_CFLAGS in $X_CFLAGS
21732 do
21733         case "x$cf_X_CFLAGS" in
21734         x-[IUD]*)
21735                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21736                 ;;
21737         *)
21738                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21739                 ;;
21740         esac
21741 done
21742
21743 cat >"conftest.$ac_ext" <<_ACEOF
21744 #line 21744 "configure"
21745 #include "confdefs.h"
21746
21747 #include <stdlib.h>
21748 #include <X11/Intrinsic.h>
21749
21750 int
21751 main (void)
21752 {
21753 String foo = malloc(1); (void)foo
21754   ;
21755   return 0;
21756 }
21757 _ACEOF
21758 rm -f "conftest.$ac_objext"
21759 if { (eval echo "$as_me:21759: \"$ac_compile\"") >&5
21760   (eval $ac_compile) 2>&5
21761   ac_status=$?
21762   echo "$as_me:21762: \$? = $ac_status" >&5
21763   (exit "$ac_status"); } &&
21764          { ac_try='test -s "conftest.$ac_objext"'
21765   { (eval echo "$as_me:21765: \"$ac_try\"") >&5
21766   (eval $ac_try) 2>&5
21767   ac_status=$?
21768   echo "$as_me:21768: \$? = $ac_status" >&5
21769   (exit "$ac_status"); }; }; then
21770
21771 echo "$as_me:21771: checking for X11/Xt const-feature" >&5
21772 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21773 if test "${cf_cv_const_x_string+set}" = set; then
21774   echo $ECHO_N "(cached) $ECHO_C" >&6
21775 else
21776
21777         cat >"conftest.$ac_ext" <<_ACEOF
21778 #line 21778 "configure"
21779 #include "confdefs.h"
21780
21781 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21782 #undef  XTSTRINGDEFINES /* X11R5 and later */
21783 #include <stdlib.h>
21784 #include <X11/Intrinsic.h>
21785
21786 int
21787 main (void)
21788 {
21789 String foo = malloc(1); *foo = 0
21790   ;
21791   return 0;
21792 }
21793 _ACEOF
21794 rm -f "conftest.$ac_objext"
21795 if { (eval echo "$as_me:21795: \"$ac_compile\"") >&5
21796   (eval $ac_compile) 2>&5
21797   ac_status=$?
21798   echo "$as_me:21798: \$? = $ac_status" >&5
21799   (exit "$ac_status"); } &&
21800          { ac_try='test -s "conftest.$ac_objext"'
21801   { (eval echo "$as_me:21801: \"$ac_try\"") >&5
21802   (eval $ac_try) 2>&5
21803   ac_status=$?
21804   echo "$as_me:21804: \$? = $ac_status" >&5
21805   (exit "$ac_status"); }; }; then
21806
21807                         cf_cv_const_x_string=no
21808
21809 else
21810   echo "$as_me: failed program was:" >&5
21811 cat "conftest.$ac_ext" >&5
21812
21813                         cf_cv_const_x_string=yes
21814
21815 fi
21816 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21817
21818 fi
21819 echo "$as_me:21819: result: $cf_cv_const_x_string" >&5
21820 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21821
21822 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21823 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21824 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21825
21826 case "$cf_cv_const_x_string" in
21827 (no)
21828
21829         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21830         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21831
21832         ;;
21833 (*)
21834
21835         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21836         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21837
21838         ;;
21839 esac
21840
21841 else
21842   echo "$as_me: failed program was:" >&5
21843 cat "conftest.$ac_ext" >&5
21844 fi
21845 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21846  fi
21847 cat > "conftest.$ac_ext" <<EOF
21848 #line 21848 "${as_me:-configure}"
21849 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21850 EOF
21851 if test "$INTEL_COMPILER" = yes
21852 then
21853 # The "-wdXXX" options suppress warnings:
21854 # remark #1419: external declaration in primary source file
21855 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21856 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21857 # remark #193: zero used for undefined preprocessing identifier
21858 # remark #593: variable "curs_sb_left_arrow" was set but never used
21859 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21860 # remark #869: parameter "tw" was never referenced
21861 # remark #981: operands are evaluated in unspecified order
21862 # warning #279: controlling expression is constant
21863
21864         { echo "$as_me:21864: checking for $CC warning options..." >&5
21865 echo "$as_me: checking for $CC warning options..." >&6;}
21866         cf_save_CFLAGS="$CFLAGS"
21867         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21868         for cf_opt in \
21869                 wd1419 \
21870                 wd1683 \
21871                 wd1684 \
21872                 wd193 \
21873                 wd593 \
21874                 wd279 \
21875                 wd810 \
21876                 wd869 \
21877                 wd981
21878         do
21879                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21880                 if { (eval echo "$as_me:21880: \"$ac_compile\"") >&5
21881   (eval $ac_compile) 2>&5
21882   ac_status=$?
21883   echo "$as_me:21883: \$? = $ac_status" >&5
21884   (exit "$ac_status"); }; then
21885                         test -n "$verbose" && echo "$as_me:21885: result: ... -$cf_opt" >&5
21886 echo "${ECHO_T}... -$cf_opt" >&6
21887                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21888                 fi
21889         done
21890         CFLAGS="$cf_save_CFLAGS"
21891 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
21892 then
21893         { echo "$as_me:21893: checking for $CC warning options..." >&5
21894 echo "$as_me: checking for $CC warning options..." >&6;}
21895         cf_save_CFLAGS="$CFLAGS"
21896         cf_warn_CONST=""
21897         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
21898         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
21899         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
21900         for cf_opt in W Wall \
21901                 Wbad-function-cast \
21902                 Wcast-align \
21903                 Wcast-qual \
21904                 Wdeclaration-after-statement \
21905                 Wextra \
21906                 Winline \
21907                 Wmissing-declarations \
21908                 Wmissing-prototypes \
21909                 Wnested-externs \
21910                 Wpointer-arith \
21911                 Wshadow \
21912                 Wstrict-prototypes \
21913                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
21914         do
21915                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21916                 if { (eval echo "$as_me:21916: \"$ac_compile\"") >&5
21917   (eval $ac_compile) 2>&5
21918   ac_status=$?
21919   echo "$as_me:21919: \$? = $ac_status" >&5
21920   (exit "$ac_status"); }; then
21921                         test -n "$verbose" && echo "$as_me:21921: result: ... -$cf_opt" >&5
21922 echo "${ECHO_T}... -$cf_opt" >&6
21923                         case "$cf_opt" in
21924                         (Winline)
21925                                 case "$GCC_VERSION" in
21926                                 ([34].*)
21927                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21928
21929 echo "${as_me:-configure}:21929: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21930
21931                                         continue;;
21932                                 esac
21933                                 ;;
21934                         (Wpointer-arith)
21935                                 case "$GCC_VERSION" in
21936                                 ([12].*)
21937                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21938
21939 echo "${as_me:-configure}:21939: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21940
21941                                         continue;;
21942                                 esac
21943                                 ;;
21944                         esac
21945                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21946                 fi
21947         done
21948         CFLAGS="$cf_save_CFLAGS"
21949 fi
21950 rm -rf ./conftest*
21951
21952 fi
21953
21954 fi
21955
21956 echo "$as_me:21956: checking if you want to use dmalloc for testing" >&5
21957 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
21958
21959 # Check whether --with-dmalloc or --without-dmalloc was given.
21960 if test "${with_dmalloc+set}" = set; then
21961   withval="$with_dmalloc"
21962
21963 cat >>confdefs.h <<EOF
21964 #define USE_DMALLOC 1
21965 EOF
21966
21967         : "${with_cflags:=-g}"
21968         : "${enable_leaks:=no}"
21969          with_dmalloc=yes
21970 else
21971   with_dmalloc=
21972 fi;
21973 echo "$as_me:21973: result: ${with_dmalloc:-no}" >&5
21974 echo "${ECHO_T}${with_dmalloc:-no}" >&6
21975
21976 case ".$with_cflags" in
21977 (.*-g*)
21978         case .$CFLAGS in
21979         (.*-g*)
21980                 ;;
21981         (*)
21982
21983 cf_fix_cppflags=no
21984 cf_new_cflags=
21985 cf_new_cppflags=
21986 cf_new_extra_cppflags=
21987
21988 for cf_add_cflags in -g
21989 do
21990 case "$cf_fix_cppflags" in
21991 (no)
21992         case "$cf_add_cflags" in
21993         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21994                 case "$cf_add_cflags" in
21995                 (-D*)
21996                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21997
21998                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21999                                 && test -z "${cf_tst_cflags}" \
22000                                 && cf_fix_cppflags=yes
22001
22002                         if test "$cf_fix_cppflags" = yes ; then
22003
22004         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22005         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22006
22007                                 continue
22008                         elif test "${cf_tst_cflags}" = "\"'" ; then
22009
22010         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22011         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22012
22013                                 continue
22014                         fi
22015                         ;;
22016                 esac
22017                 case "$CPPFLAGS" in
22018                 (*$cf_add_cflags)
22019                         ;;
22020                 (*)
22021                         case "$cf_add_cflags" in
22022                         (-D*)
22023                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22024
22025 CPPFLAGS=`echo "$CPPFLAGS" | \
22026         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22027                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22028
22029                                 ;;
22030                         esac
22031
22032         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22033         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22034
22035                         ;;
22036                 esac
22037                 ;;
22038         (*)
22039
22040         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22041         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22042
22043                 ;;
22044         esac
22045         ;;
22046 (yes)
22047
22048         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22049         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22050
22051         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22052
22053         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22054                 && test -z "${cf_tst_cflags}" \
22055                 && cf_fix_cppflags=no
22056         ;;
22057 esac
22058 done
22059
22060 if test -n "$cf_new_cflags" ; then
22061
22062         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22063         CFLAGS="${CFLAGS}$cf_new_cflags"
22064
22065 fi
22066
22067 if test -n "$cf_new_cppflags" ; then
22068
22069         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22070         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22071
22072 fi
22073
22074 if test -n "$cf_new_extra_cppflags" ; then
22075
22076         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22077         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22078
22079 fi
22080
22081                 ;;
22082         esac
22083         ;;
22084 esac
22085
22086 if test "$with_dmalloc" = yes ; then
22087         echo "$as_me:22087: checking for dmalloc.h" >&5
22088 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22089 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22090   echo $ECHO_N "(cached) $ECHO_C" >&6
22091 else
22092   cat >"conftest.$ac_ext" <<_ACEOF
22093 #line 22093 "configure"
22094 #include "confdefs.h"
22095 #include <dmalloc.h>
22096 _ACEOF
22097 if { (eval echo "$as_me:22097: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22098   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22099   ac_status=$?
22100   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22101   rm -f conftest.er1
22102   cat conftest.err >&5
22103   echo "$as_me:22103: \$? = $ac_status" >&5
22104   (exit "$ac_status"); } >/dev/null; then
22105   if test -s conftest.err; then
22106     ac_cpp_err=$ac_c_preproc_warn_flag
22107   else
22108     ac_cpp_err=
22109   fi
22110 else
22111   ac_cpp_err=yes
22112 fi
22113 if test -z "$ac_cpp_err"; then
22114   ac_cv_header_dmalloc_h=yes
22115 else
22116   echo "$as_me: failed program was:" >&5
22117   cat "conftest.$ac_ext" >&5
22118   ac_cv_header_dmalloc_h=no
22119 fi
22120 rm -f conftest.err "conftest.$ac_ext"
22121 fi
22122 echo "$as_me:22122: result: $ac_cv_header_dmalloc_h" >&5
22123 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22124 if test "$ac_cv_header_dmalloc_h" = yes; then
22125
22126 echo "$as_me:22126: checking for dmalloc_debug in -ldmalloc" >&5
22127 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22128 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22129   echo $ECHO_N "(cached) $ECHO_C" >&6
22130 else
22131   ac_check_lib_save_LIBS=$LIBS
22132 LIBS="-ldmalloc  $LIBS"
22133 cat >"conftest.$ac_ext" <<_ACEOF
22134 #line 22134 "configure"
22135 #include "confdefs.h"
22136
22137 /* Override any gcc2 internal prototype to avoid an error.  */
22138 #ifdef __cplusplus
22139 extern "C"
22140 #endif
22141 /* We use char because int might match the return type of a gcc2
22142    builtin and then its argument prototype would still apply.  */
22143 char dmalloc_debug ();
22144 int
22145 main (void)
22146 {
22147 dmalloc_debug ();
22148   ;
22149   return 0;
22150 }
22151 _ACEOF
22152 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22153 if { (eval echo "$as_me:22153: \"$ac_link\"") >&5
22154   (eval $ac_link) 2>&5
22155   ac_status=$?
22156   echo "$as_me:22156: \$? = $ac_status" >&5
22157   (exit "$ac_status"); } &&
22158          { ac_try='test -s "conftest$ac_exeext"'
22159   { (eval echo "$as_me:22159: \"$ac_try\"") >&5
22160   (eval $ac_try) 2>&5
22161   ac_status=$?
22162   echo "$as_me:22162: \$? = $ac_status" >&5
22163   (exit "$ac_status"); }; }; then
22164   ac_cv_lib_dmalloc_dmalloc_debug=yes
22165 else
22166   echo "$as_me: failed program was:" >&5
22167 cat "conftest.$ac_ext" >&5
22168 ac_cv_lib_dmalloc_dmalloc_debug=no
22169 fi
22170 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22171 LIBS=$ac_check_lib_save_LIBS
22172 fi
22173 echo "$as_me:22173: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22174 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22175 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22176   cat >>confdefs.h <<EOF
22177 #define HAVE_LIBDMALLOC 1
22178 EOF
22179
22180   LIBS="-ldmalloc $LIBS"
22181
22182 fi
22183
22184 fi
22185
22186 fi
22187
22188 echo "$as_me:22188: checking if you want to use dbmalloc for testing" >&5
22189 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22190
22191 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22192 if test "${with_dbmalloc+set}" = set; then
22193   withval="$with_dbmalloc"
22194
22195 cat >>confdefs.h <<EOF
22196 #define USE_DBMALLOC 1
22197 EOF
22198
22199         : "${with_cflags:=-g}"
22200         : "${enable_leaks:=no}"
22201          with_dbmalloc=yes
22202 else
22203   with_dbmalloc=
22204 fi;
22205 echo "$as_me:22205: result: ${with_dbmalloc:-no}" >&5
22206 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22207
22208 case ".$with_cflags" in
22209 (.*-g*)
22210         case .$CFLAGS in
22211         (.*-g*)
22212                 ;;
22213         (*)
22214
22215 cf_fix_cppflags=no
22216 cf_new_cflags=
22217 cf_new_cppflags=
22218 cf_new_extra_cppflags=
22219
22220 for cf_add_cflags in -g
22221 do
22222 case "$cf_fix_cppflags" in
22223 (no)
22224         case "$cf_add_cflags" in
22225         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22226                 case "$cf_add_cflags" in
22227                 (-D*)
22228                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22229
22230                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22231                                 && test -z "${cf_tst_cflags}" \
22232                                 && cf_fix_cppflags=yes
22233
22234                         if test "$cf_fix_cppflags" = yes ; then
22235
22236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22238
22239                                 continue
22240                         elif test "${cf_tst_cflags}" = "\"'" ; then
22241
22242         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22243         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22244
22245                                 continue
22246                         fi
22247                         ;;
22248                 esac
22249                 case "$CPPFLAGS" in
22250                 (*$cf_add_cflags)
22251                         ;;
22252                 (*)
22253                         case "$cf_add_cflags" in
22254                         (-D*)
22255                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22256
22257 CPPFLAGS=`echo "$CPPFLAGS" | \
22258         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22259                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22260
22261                                 ;;
22262                         esac
22263
22264         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22265         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22266
22267                         ;;
22268                 esac
22269                 ;;
22270         (*)
22271
22272         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22273         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22274
22275                 ;;
22276         esac
22277         ;;
22278 (yes)
22279
22280         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22281         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22282
22283         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22284
22285         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22286                 && test -z "${cf_tst_cflags}" \
22287                 && cf_fix_cppflags=no
22288         ;;
22289 esac
22290 done
22291
22292 if test -n "$cf_new_cflags" ; then
22293
22294         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22295         CFLAGS="${CFLAGS}$cf_new_cflags"
22296
22297 fi
22298
22299 if test -n "$cf_new_cppflags" ; then
22300
22301         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22302         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22303
22304 fi
22305
22306 if test -n "$cf_new_extra_cppflags" ; then
22307
22308         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22309         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22310
22311 fi
22312
22313                 ;;
22314         esac
22315         ;;
22316 esac
22317
22318 if test "$with_dbmalloc" = yes ; then
22319         echo "$as_me:22319: checking for dbmalloc.h" >&5
22320 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22321 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22322   echo $ECHO_N "(cached) $ECHO_C" >&6
22323 else
22324   cat >"conftest.$ac_ext" <<_ACEOF
22325 #line 22325 "configure"
22326 #include "confdefs.h"
22327 #include <dbmalloc.h>
22328 _ACEOF
22329 if { (eval echo "$as_me:22329: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22330   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22331   ac_status=$?
22332   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22333   rm -f conftest.er1
22334   cat conftest.err >&5
22335   echo "$as_me:22335: \$? = $ac_status" >&5
22336   (exit "$ac_status"); } >/dev/null; then
22337   if test -s conftest.err; then
22338     ac_cpp_err=$ac_c_preproc_warn_flag
22339   else
22340     ac_cpp_err=
22341   fi
22342 else
22343   ac_cpp_err=yes
22344 fi
22345 if test -z "$ac_cpp_err"; then
22346   ac_cv_header_dbmalloc_h=yes
22347 else
22348   echo "$as_me: failed program was:" >&5
22349   cat "conftest.$ac_ext" >&5
22350   ac_cv_header_dbmalloc_h=no
22351 fi
22352 rm -f conftest.err "conftest.$ac_ext"
22353 fi
22354 echo "$as_me:22354: result: $ac_cv_header_dbmalloc_h" >&5
22355 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22356 if test "$ac_cv_header_dbmalloc_h" = yes; then
22357
22358 echo "$as_me:22358: checking for debug_malloc in -ldbmalloc" >&5
22359 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22360 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22361   echo $ECHO_N "(cached) $ECHO_C" >&6
22362 else
22363   ac_check_lib_save_LIBS=$LIBS
22364 LIBS="-ldbmalloc  $LIBS"
22365 cat >"conftest.$ac_ext" <<_ACEOF
22366 #line 22366 "configure"
22367 #include "confdefs.h"
22368
22369 /* Override any gcc2 internal prototype to avoid an error.  */
22370 #ifdef __cplusplus
22371 extern "C"
22372 #endif
22373 /* We use char because int might match the return type of a gcc2
22374    builtin and then its argument prototype would still apply.  */
22375 char debug_malloc ();
22376 int
22377 main (void)
22378 {
22379 debug_malloc ();
22380   ;
22381   return 0;
22382 }
22383 _ACEOF
22384 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22385 if { (eval echo "$as_me:22385: \"$ac_link\"") >&5
22386   (eval $ac_link) 2>&5
22387   ac_status=$?
22388   echo "$as_me:22388: \$? = $ac_status" >&5
22389   (exit "$ac_status"); } &&
22390          { ac_try='test -s "conftest$ac_exeext"'
22391   { (eval echo "$as_me:22391: \"$ac_try\"") >&5
22392   (eval $ac_try) 2>&5
22393   ac_status=$?
22394   echo "$as_me:22394: \$? = $ac_status" >&5
22395   (exit "$ac_status"); }; }; then
22396   ac_cv_lib_dbmalloc_debug_malloc=yes
22397 else
22398   echo "$as_me: failed program was:" >&5
22399 cat "conftest.$ac_ext" >&5
22400 ac_cv_lib_dbmalloc_debug_malloc=no
22401 fi
22402 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22403 LIBS=$ac_check_lib_save_LIBS
22404 fi
22405 echo "$as_me:22405: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22406 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22407 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22408   cat >>confdefs.h <<EOF
22409 #define HAVE_LIBDBMALLOC 1
22410 EOF
22411
22412   LIBS="-ldbmalloc $LIBS"
22413
22414 fi
22415
22416 fi
22417
22418 fi
22419
22420 echo "$as_me:22420: checking if you want to use valgrind for testing" >&5
22421 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22422
22423 # Check whether --with-valgrind or --without-valgrind was given.
22424 if test "${with_valgrind+set}" = set; then
22425   withval="$with_valgrind"
22426
22427 cat >>confdefs.h <<EOF
22428 #define USE_VALGRIND 1
22429 EOF
22430
22431         : "${with_cflags:=-g}"
22432         : "${enable_leaks:=no}"
22433          with_valgrind=yes
22434 else
22435   with_valgrind=
22436 fi;
22437 echo "$as_me:22437: result: ${with_valgrind:-no}" >&5
22438 echo "${ECHO_T}${with_valgrind:-no}" >&6
22439
22440 case ".$with_cflags" in
22441 (.*-g*)
22442         case .$CFLAGS in
22443         (.*-g*)
22444                 ;;
22445         (*)
22446
22447 cf_fix_cppflags=no
22448 cf_new_cflags=
22449 cf_new_cppflags=
22450 cf_new_extra_cppflags=
22451
22452 for cf_add_cflags in -g
22453 do
22454 case "$cf_fix_cppflags" in
22455 (no)
22456         case "$cf_add_cflags" in
22457         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22458                 case "$cf_add_cflags" in
22459                 (-D*)
22460                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22461
22462                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22463                                 && test -z "${cf_tst_cflags}" \
22464                                 && cf_fix_cppflags=yes
22465
22466                         if test "$cf_fix_cppflags" = yes ; then
22467
22468         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22469         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22470
22471                                 continue
22472                         elif test "${cf_tst_cflags}" = "\"'" ; then
22473
22474         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22475         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22476
22477                                 continue
22478                         fi
22479                         ;;
22480                 esac
22481                 case "$CPPFLAGS" in
22482                 (*$cf_add_cflags)
22483                         ;;
22484                 (*)
22485                         case "$cf_add_cflags" in
22486                         (-D*)
22487                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22488
22489 CPPFLAGS=`echo "$CPPFLAGS" | \
22490         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22491                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22492
22493                                 ;;
22494                         esac
22495
22496         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22497         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22498
22499                         ;;
22500                 esac
22501                 ;;
22502         (*)
22503
22504         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22505         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22506
22507                 ;;
22508         esac
22509         ;;
22510 (yes)
22511
22512         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22513         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22514
22515         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22516
22517         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22518                 && test -z "${cf_tst_cflags}" \
22519                 && cf_fix_cppflags=no
22520         ;;
22521 esac
22522 done
22523
22524 if test -n "$cf_new_cflags" ; then
22525
22526         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22527         CFLAGS="${CFLAGS}$cf_new_cflags"
22528
22529 fi
22530
22531 if test -n "$cf_new_cppflags" ; then
22532
22533         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22534         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22535
22536 fi
22537
22538 if test -n "$cf_new_extra_cppflags" ; then
22539
22540         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22541         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22542
22543 fi
22544
22545                 ;;
22546         esac
22547         ;;
22548 esac
22549
22550 echo "$as_me:22550: checking if you want to perform memory-leak testing" >&5
22551 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22552
22553 # Check whether --enable-leaks or --disable-leaks was given.
22554 if test "${enable_leaks+set}" = set; then
22555   enableval="$enable_leaks"
22556   enable_leaks=no
22557 else
22558   enable_leaks=yes
22559 fi;
22560 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22561 echo "$as_me:22561: result: $with_no_leaks" >&5
22562 echo "${ECHO_T}$with_no_leaks" >&6
22563
22564 if test "$enable_leaks" = no ; then
22565
22566 cat >>confdefs.h <<\EOF
22567 #define NO_LEAKS 1
22568 EOF
22569
22570 cat >>confdefs.h <<\EOF
22571 #define YY_NO_LEAKS 1
22572 EOF
22573
22574 fi
22575
22576 LD_RPATH_OPT=
22577 if test "x$cf_cv_enable_rpath" != xno
22578 then
22579         echo "$as_me:22579: checking for an rpath option" >&5
22580 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22581         case "$cf_cv_system_name" in
22582         (irix*)
22583                 if test "$GCC" = yes; then
22584                         LD_RPATH_OPT="-Wl,-rpath,"
22585                 else
22586                         LD_RPATH_OPT="-rpath "
22587                 fi
22588                 ;;
22589         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22590                 LD_RPATH_OPT="-Wl,-rpath,"
22591                 ;;
22592         (openbsd[2-9].*|mirbsd*)
22593                 LD_RPATH_OPT="-Wl,-rpath,"
22594                 ;;
22595         (dragonfly*)
22596                 LD_RPATH_OPT="-rpath "
22597                 ;;
22598         (netbsd*)
22599                 LD_RPATH_OPT="-Wl,-rpath,"
22600                 ;;
22601         (osf*|mls+*)
22602                 LD_RPATH_OPT="-rpath "
22603                 ;;
22604         (solaris2*)
22605                 LD_RPATH_OPT="-R"
22606                 ;;
22607         (*)
22608                 ;;
22609         esac
22610         echo "$as_me:22610: result: $LD_RPATH_OPT" >&5
22611 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22612
22613         case "x$LD_RPATH_OPT" in
22614         (x-R*)
22615                 echo "$as_me:22615: checking if we need a space after rpath option" >&5
22616 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22617                 cf_save_LIBS="$LIBS"
22618
22619 cf_add_libs="$LIBS"
22620 # reverse order
22621 cf_add_0lib=
22622 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22623 # filter duplicates
22624 for cf_add_1lib in $cf_add_0lib; do
22625         for cf_add_2lib in $cf_add_libs; do
22626                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22627                         cf_add_1lib=
22628                         break
22629                 fi
22630         done
22631         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22632 done
22633 LIBS="$cf_add_libs"
22634
22635                 cat >"conftest.$ac_ext" <<_ACEOF
22636 #line 22636 "configure"
22637 #include "confdefs.h"
22638
22639 int
22640 main (void)
22641 {
22642
22643   ;
22644   return 0;
22645 }
22646 _ACEOF
22647 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22648 if { (eval echo "$as_me:22648: \"$ac_link\"") >&5
22649   (eval $ac_link) 2>&5
22650   ac_status=$?
22651   echo "$as_me:22651: \$? = $ac_status" >&5
22652   (exit "$ac_status"); } &&
22653          { ac_try='test -s "conftest$ac_exeext"'
22654   { (eval echo "$as_me:22654: \"$ac_try\"") >&5
22655   (eval $ac_try) 2>&5
22656   ac_status=$?
22657   echo "$as_me:22657: \$? = $ac_status" >&5
22658   (exit "$ac_status"); }; }; then
22659   cf_rpath_space=no
22660 else
22661   echo "$as_me: failed program was:" >&5
22662 cat "conftest.$ac_ext" >&5
22663 cf_rpath_space=yes
22664 fi
22665 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22666                 LIBS="$cf_save_LIBS"
22667                 echo "$as_me:22667: result: $cf_rpath_space" >&5
22668 echo "${ECHO_T}$cf_rpath_space" >&6
22669                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22670                 ;;
22671         esac
22672 fi
22673
22674 echo "$as_me:22674: checking if rpath-hack should be disabled" >&5
22675 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22676
22677 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22678 if test "${enable_rpath_hack+set}" = set; then
22679   enableval="$enable_rpath_hack"
22680   test "$enableval" != no && enableval=yes
22681         if test "$enableval" != "yes" ; then
22682     enable_rpath_hack=no
22683         else
22684                 enable_rpath_hack=yes
22685         fi
22686 else
22687   enableval=yes
22688         enable_rpath_hack=yes
22689
22690 fi;
22691 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
22692 echo "$as_me:22692: result: $cf_disable_rpath_hack" >&5
22693 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22694
22695 if test "$enable_rpath_hack" = yes ; then
22696
22697 echo "$as_me:22697: checking for updated LDFLAGS" >&5
22698 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22699 if test -n "$LD_RPATH_OPT" ; then
22700         echo "$as_me:22700: result: maybe" >&5
22701 echo "${ECHO_T}maybe" >&6
22702
22703         for ac_prog in ldd
22704 do
22705   # Extract the first word of "$ac_prog", so it can be a program name with args.
22706 set dummy $ac_prog; ac_word=$2
22707 echo "$as_me:22707: checking for $ac_word" >&5
22708 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22709 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22710   echo $ECHO_N "(cached) $ECHO_C" >&6
22711 else
22712   if test -n "$cf_ldd_prog"; then
22713   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22714 else
22715   ac_save_IFS=$IFS; IFS=$ac_path_separator
22716 ac_dummy="$PATH"
22717 for ac_dir in $ac_dummy; do
22718   IFS=$ac_save_IFS
22719   test -z "$ac_dir" && ac_dir=.
22720   $as_executable_p "$ac_dir/$ac_word" || continue
22721 ac_cv_prog_cf_ldd_prog="$ac_prog"
22722 echo "$as_me:22722: found $ac_dir/$ac_word" >&5
22723 break
22724 done
22725
22726 fi
22727 fi
22728 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22729 if test -n "$cf_ldd_prog"; then
22730   echo "$as_me:22730: result: $cf_ldd_prog" >&5
22731 echo "${ECHO_T}$cf_ldd_prog" >&6
22732 else
22733   echo "$as_me:22733: result: no" >&5
22734 echo "${ECHO_T}no" >&6
22735 fi
22736
22737   test -n "$cf_ldd_prog" && break
22738 done
22739 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22740
22741         cf_rpath_list="/usr/lib /lib"
22742         if test "$cf_ldd_prog" != no
22743         then
22744                 cf_rpath_oops=
22745
22746 cat >"conftest.$ac_ext" <<_ACEOF
22747 #line 22747 "configure"
22748 #include "confdefs.h"
22749 #include <stdio.h>
22750 int
22751 main (void)
22752 {
22753 printf("Hello");
22754   ;
22755   return 0;
22756 }
22757 _ACEOF
22758 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22759 if { (eval echo "$as_me:22759: \"$ac_link\"") >&5
22760   (eval $ac_link) 2>&5
22761   ac_status=$?
22762   echo "$as_me:22762: \$? = $ac_status" >&5
22763   (exit "$ac_status"); } &&
22764          { ac_try='test -s "conftest$ac_exeext"'
22765   { (eval echo "$as_me:22765: \"$ac_try\"") >&5
22766   (eval $ac_try) 2>&5
22767   ac_status=$?
22768   echo "$as_me:22768: \$? = $ac_status" >&5
22769   (exit "$ac_status"); }; }; then
22770   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22771                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22772 else
22773   echo "$as_me: failed program was:" >&5
22774 cat "conftest.$ac_ext" >&5
22775 fi
22776 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22777
22778                 # If we passed the link-test, but get a "not found" on a given library,
22779                 # this could be due to inept reconfiguration of gcc to make it only
22780                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22781                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22782                 # /usr/local libraries.
22783                 if test -n "$cf_rpath_oops"
22784                 then
22785                         for cf_rpath_src in $cf_rpath_oops
22786                         do
22787                                 for cf_rpath_dir in \
22788                                         /usr/local \
22789                                         /usr/pkg \
22790                                         /opt/sfw
22791                                 do
22792                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
22793                                         then
22794                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22795
22796 echo "${as_me:-configure}:22796: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22797
22798                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22799                                                 break
22800                                         fi
22801                                 done
22802                         done
22803                 fi
22804         fi
22805
22806         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22807
22808 echo "${as_me:-configure}:22808: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22809
22810 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22811
22812 echo "${as_me:-configure}:22812: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22813
22814 cf_rpath_dst=
22815 for cf_rpath_src in $LDFLAGS
22816 do
22817         case "$cf_rpath_src" in
22818         (-L*)
22819
22820                 # check if this refers to a directory which we will ignore
22821                 cf_rpath_skip=no
22822                 if test -n "$cf_rpath_list"
22823                 then
22824                         for cf_rpath_item in $cf_rpath_list
22825                         do
22826                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22827                                 then
22828                                         cf_rpath_skip=yes
22829                                         break
22830                                 fi
22831                         done
22832                 fi
22833
22834                 if test "$cf_rpath_skip" = no
22835                 then
22836                         # transform the option
22837                         if test "$LD_RPATH_OPT" = "-R " ; then
22838                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22839                         else
22840                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22841                         fi
22842
22843                         # if we have not already added this, add it now
22844                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22845                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22846                         then
22847                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22848
22849 echo "${as_me:-configure}:22849: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22850
22851                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22852                         fi
22853                 fi
22854                 ;;
22855         esac
22856         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22857 done
22858 LDFLAGS=$cf_rpath_dst
22859
22860 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22861
22862 echo "${as_me:-configure}:22862: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22863
22864 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
22865
22866 echo "${as_me:-configure}:22866: testing ...checking LIBS $LIBS ..." 1>&5
22867
22868 cf_rpath_dst=
22869 for cf_rpath_src in $LIBS
22870 do
22871         case "$cf_rpath_src" in
22872         (-L*)
22873
22874                 # check if this refers to a directory which we will ignore
22875                 cf_rpath_skip=no
22876                 if test -n "$cf_rpath_list"
22877                 then
22878                         for cf_rpath_item in $cf_rpath_list
22879                         do
22880                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22881                                 then
22882                                         cf_rpath_skip=yes
22883                                         break
22884                                 fi
22885                         done
22886                 fi
22887
22888                 if test "$cf_rpath_skip" = no
22889                 then
22890                         # transform the option
22891                         if test "$LD_RPATH_OPT" = "-R " ; then
22892                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22893                         else
22894                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22895                         fi
22896
22897                         # if we have not already added this, add it now
22898                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22899                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22900                         then
22901                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22902
22903 echo "${as_me:-configure}:22903: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22904
22905                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22906                         fi
22907                 fi
22908                 ;;
22909         esac
22910         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22911 done
22912 LIBS=$cf_rpath_dst
22913
22914 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
22915
22916 echo "${as_me:-configure}:22916: testing ...checked LIBS $LIBS ..." 1>&5
22917
22918         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22919
22920 echo "${as_me:-configure}:22920: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22921
22922 else
22923         echo "$as_me:22923: result: no" >&5
22924 echo "${ECHO_T}no" >&6
22925 fi
22926
22927 fi
22928
22929 TEST_ARGS="$LIBS"
22930 LIBS=
22931
22932 ac_config_files="$ac_config_files Makefile"
22933 ac_config_commands="$ac_config_commands default"
22934 cat >confcache <<\_ACEOF
22935 # This file is a shell script that caches the results of configure
22936 # tests run on this system so they can be shared between configure
22937 # scripts and configure runs, see configure's option --config-cache.
22938 # It is not useful on other systems.  If it contains results you don't
22939 # want to keep, you may remove or edit it.
22940 #
22941 # config.status only pays attention to the cache file if you give it
22942 # the --recheck option to rerun configure.
22943 #
22944 # `ac_cv_env_foo' variables (set or unset) will be overriden when
22945 # loading this file, other *unset* `ac_cv_foo' will be assigned the
22946 # following values.
22947
22948 _ACEOF
22949
22950 # The following way of writing the cache mishandles newlines in values,
22951 # but we know of no workaround that is simple, portable, and efficient.
22952 # So, don't put newlines in cache variables' values.
22953 # Ultrix sh set writes to stderr and can't be redirected directly,
22954 # and sets the high bit in the cache file unless we assign to the vars.
22955 {
22956   (set) 2>&1 |
22957     case `(ac_space=' '; set | grep ac_space) 2>&1` in
22958     *ac_space=\ *)
22959       # `set' does not quote correctly, so add quotes (double-quote
22960       # substitution turns \\\\ into \\, and sed turns \\ into \).
22961       sed -n \
22962         "s/'/'\\\\''/g;
22963           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
22964       ;;
22965     *)
22966       # `set' quotes correctly as required by POSIX, so do not add quotes.
22967       sed -n \
22968         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
22969       ;;
22970     esac;
22971 } |
22972   sed '
22973      t clear
22974      : clear
22975      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
22976      t end
22977      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
22978      : end' >>confcache
22979 if cmp -s $cache_file confcache; then :; else
22980   if test -w $cache_file; then
22981     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
22982     cat confcache >$cache_file
22983   else
22984     echo "not updating unwritable cache $cache_file"
22985   fi
22986 fi
22987 rm -f confcache
22988
22989 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22990 # Let make expand exec_prefix.
22991 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22992
22993 # VPATH may cause trouble with some makes, so we remove $(srcdir),
22994 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
22995 # trailing colons and then remove the whole line if VPATH becomes empty
22996 # (actually we leave an empty line to preserve line numbers).
22997 if test "x$srcdir" = x.; then
22998   ac_vpsub='/^[         ]*VPATH[        ]*=/{
22999 s/:*\$(srcdir):*/:/;
23000 s/:*\${srcdir}:*/:/;
23001 s/:*@srcdir@:*/:/;
23002 s/^\([^=]*=[    ]*\):*/\1/;
23003 s/:*$//;
23004 s/^[^=]*=[      ]*$//;
23005 }'
23006 fi
23007
23008 DEFS=-DHAVE_CONFIG_H
23009
23010 : "${CONFIG_STATUS=./config.status}"
23011 ac_clean_files_save=$ac_clean_files
23012 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23013 { echo "$as_me:23013: creating $CONFIG_STATUS" >&5
23014 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23015 cat >"$CONFIG_STATUS" <<_ACEOF
23016 #! $SHELL
23017 # Generated automatically by configure.
23018 # Run this file to recreate the current configuration.
23019 # Compiler output produced by configure, useful for debugging
23020 # configure, is in config.log if it exists.
23021
23022 debug=false
23023 SHELL=\${CONFIG_SHELL-$SHELL}
23024 ac_cs_invocation="\$0 \$@"
23025
23026 CLICOLOR_FORCE= GREP_OPTIONS=
23027 unset CLICOLOR_FORCE GREP_OPTIONS
23028 _ACEOF
23029
23030 cat >>"$CONFIG_STATUS" <<\_ACEOF
23031 # Be Bourne compatible
23032 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23033   emulate sh
23034   NULLCMD=:
23035 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23036   set -o posix
23037 fi
23038
23039 # Name of the executable.
23040 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23041
23042 if expr a : '\(a\)' >/dev/null 2>&1; then
23043   as_expr=expr
23044 else
23045   as_expr=false
23046 fi
23047
23048 rm -f conf$$ conf$$.exe conf$$.file
23049 echo >conf$$.file
23050 if ln -s conf$$.file conf$$ 2>/dev/null; then
23051   # We could just check for DJGPP; but this test a) works b) is more generic
23052   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23053   if test -f conf$$.exe; then
23054     # Don't use ln at all; we don't have any links
23055     as_ln_s='cp -p'
23056   else
23057     as_ln_s='ln -s'
23058   fi
23059 elif ln conf$$.file conf$$ 2>/dev/null; then
23060   as_ln_s=ln
23061 else
23062   as_ln_s='cp -p'
23063 fi
23064 rm -f conf$$ conf$$.exe conf$$.file
23065
23066 as_executable_p="test -f"
23067
23068 # Support unset when possible.
23069 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23070   as_unset="unset"
23071 else
23072   as_unset="false"
23073 fi
23074
23075 # NLS nuisances.
23076 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23077 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23078 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23079 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23080 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23081 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23082 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23083 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23084
23085 # IFS
23086 # We need space, tab and new line, in precisely that order.
23087 as_nl='
23088 '
23089 IFS="   $as_nl"
23090
23091 # CDPATH.
23092 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23093
23094 exec 6>&1
23095
23096 _ACEOF
23097
23098 # Files that config.status was made for.
23099 if test -n "$ac_config_files"; then
23100   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23101 fi
23102
23103 if test -n "$ac_config_headers"; then
23104   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23105 fi
23106
23107 if test -n "$ac_config_links"; then
23108   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23109 fi
23110
23111 if test -n "$ac_config_commands"; then
23112   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23113 fi
23114
23115 cat >>"$CONFIG_STATUS" <<\EOF
23116
23117 ac_cs_usage="\
23118 \`$as_me' instantiates files from templates according to the
23119 current configuration.
23120
23121 Usage: $0 [OPTIONS] [FILE]...
23122
23123   -h, --help       print this help, then exit
23124   -V, --version    print version number, then exit
23125   -d, --debug      don't remove temporary files
23126       --recheck    update $as_me by reconfiguring in the same conditions
23127   --file=FILE[:TEMPLATE]
23128                    instantiate the configuration file FILE
23129   --header=FILE[:TEMPLATE]
23130                    instantiate the configuration header FILE
23131
23132 Configuration files:
23133 $config_files
23134
23135 Configuration headers:
23136 $config_headers
23137
23138 Configuration commands:
23139 $config_commands
23140
23141 Report bugs to <dickey@invisible-island.net>."
23142 EOF
23143
23144 cat >>"$CONFIG_STATUS" <<EOF
23145 ac_cs_version="\\
23146 config.status
23147 configured by $0, generated by GNU Autoconf 2.52.20210105,
23148   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23149
23150 Copyright 2003-2020,2021        Thomas E. Dickey
23151 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23152 Free Software Foundation, Inc.
23153 This config.status script is free software; the Free Software Foundation
23154 gives unlimited permission to copy, distribute and modify it."
23155 srcdir="$srcdir"
23156 INSTALL="$INSTALL"
23157 EOF
23158
23159 cat >>"$CONFIG_STATUS" <<\EOF
23160 # If no file are specified by the user, then we need to provide default
23161 # value.  By we need to know if files were specified by the user.
23162 ac_need_defaults=:
23163 while test $# != 0
23164 do
23165   case $1 in
23166   --*=*)
23167     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23168     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23169     shift
23170     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23171     shift
23172     ;;
23173   -*);;
23174   *) # This is not an option, so the user has probably given explicit
23175      # arguments.
23176      ac_need_defaults=false;;
23177   esac
23178
23179   case $1 in
23180   # Handling of the options.
23181 EOF
23182 cat >>"$CONFIG_STATUS" <<EOF
23183   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23184     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23185     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23186 EOF
23187 cat >>"$CONFIG_STATUS" <<\EOF
23188   --version | --vers* | -V )
23189     echo "$ac_cs_version"; exit 0 ;;
23190   --he | --h)
23191     # Conflict between --help and --header
23192     { { echo "$as_me:23192: error: ambiguous option: $1
23193 Try \`$0 --help' for more information." >&5
23194 echo "$as_me: error: ambiguous option: $1
23195 Try \`$0 --help' for more information." >&2;}
23196    { (exit 1); exit 1; }; };;
23197   --help | --hel | -h )
23198     echo "$ac_cs_usage"; exit 0 ;;
23199   --debug | --d* | -d )
23200     debug=: ;;
23201   --file | --fil | --fi | --f )
23202     shift
23203     CONFIG_FILES="$CONFIG_FILES $1"
23204     ac_need_defaults=false;;
23205   --header | --heade | --head | --hea )
23206     shift
23207     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23208     ac_need_defaults=false;;
23209
23210   # This is an error.
23211   -*) { { echo "$as_me:23211: error: unrecognized option: $1
23212 Try \`$0 --help' for more information." >&5
23213 echo "$as_me: error: unrecognized option: $1
23214 Try \`$0 --help' for more information." >&2;}
23215    { (exit 1); exit 1; }; } ;;
23216
23217   *) ac_config_targets="$ac_config_targets $1" ;;
23218
23219   esac
23220   shift
23221 done
23222
23223 exec 5>>config.log
23224 cat >&5 << _ACEOF
23225
23226 ## ----------------------- ##
23227 ## Running config.status.  ##
23228 ## ----------------------- ##
23229
23230 This file was extended by $as_me 2.52.20210105, executed with
23231   CONFIG_FILES    = $CONFIG_FILES
23232   CONFIG_HEADERS  = $CONFIG_HEADERS
23233   CONFIG_LINKS    = $CONFIG_LINKS
23234   CONFIG_COMMANDS = $CONFIG_COMMANDS
23235   > "$ac_cs_invocation"
23236 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23237
23238 _ACEOF
23239 EOF
23240
23241 cat >>"$CONFIG_STATUS" <<EOF
23242 #
23243 # INIT-COMMANDS section.
23244 #
23245
23246 AWK="$AWK"
23247 ECHO_CC="$ECHO_CC"
23248 ECHO_LD="$ECHO_LD"
23249 SHOW_CC="$SHOW_LD"
23250
23251 EOF
23252
23253 cat >>"$CONFIG_STATUS" <<\EOF
23254 for ac_config_target in $ac_config_targets
23255 do
23256   case "$ac_config_target" in
23257   # Handling of arguments.
23258   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23259   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23260   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23261   *) { { echo "$as_me:23261: error: invalid argument: $ac_config_target" >&5
23262 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23263    { (exit 1); exit 1; }; };;
23264   esac
23265 done
23266
23267 # If the user did not use the arguments to specify the items to instantiate,
23268 # then the envvar interface is used.  Set only those that are not.
23269 # We use the long form for the default assignment because of an extremely
23270 # bizarre bug on SunOS 4.1.3.
23271 if "$ac_need_defaults"; then
23272   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23273   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23274   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23275 fi
23276
23277 # Create a temporary directory, and hook for its removal unless debugging.
23278 $debug ||
23279 {
23280   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23281   trap '{ (exit 1); exit 1; }' 1 2 13 15
23282 }
23283
23284 # Create a (secure) tmp directory for tmp files.
23285 : ${TMPDIR=/tmp}
23286 {
23287   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23288   test -n "$tmp" && test -d "$tmp"
23289 }  ||
23290 {
23291   tmp=$TMPDIR/cs$$-$RANDOM
23292   (umask 077 && mkdir $tmp)
23293 } ||
23294 {
23295    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23296    { (exit 1); exit 1; }
23297 }
23298
23299 EOF
23300
23301 cat >>"$CONFIG_STATUS" <<EOF
23302
23303 #
23304 # CONFIG_FILES section.
23305 #
23306
23307 # No need to generate the scripts if there are no CONFIG_FILES.
23308 # This happens for instance when ./config.status config.h
23309 if test -n "\$CONFIG_FILES"; then
23310   # Protect against being on the right side of a sed subst in config.status.
23311   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23312    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23313 s,@SHELL@,$SHELL,;t t
23314 s,@exec_prefix@,$exec_prefix,;t t
23315 s,@prefix@,$prefix,;t t
23316 s,@program_transform_name@,$program_transform_name,;t t
23317 s,@bindir@,$bindir,;t t
23318 s,@sbindir@,$sbindir,;t t
23319 s,@libexecdir@,$libexecdir,;t t
23320 s,@datarootdir@,$datarootdir,;t t
23321 s,@datadir@,$datadir,;t t
23322 s,@sysconfdir@,$sysconfdir,;t t
23323 s,@sharedstatedir@,$sharedstatedir,;t t
23324 s,@localstatedir@,$localstatedir,;t t
23325 s,@runstatedir@,$runstatedir,;t t
23326 s,@libdir@,$libdir,;t t
23327 s,@includedir@,$includedir,;t t
23328 s,@oldincludedir@,$oldincludedir,;t t
23329 s,@infodir@,$infodir,;t t
23330 s,@mandir@,$mandir,;t t
23331 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23332 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23333 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23334 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23335 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23336 s,@build_alias@,$build_alias,;t t
23337 s,@host_alias@,$host_alias,;t t
23338 s,@target_alias@,$target_alias,;t t
23339 s,@ECHO_C@,$ECHO_C,;t t
23340 s,@ECHO_N@,$ECHO_N,;t t
23341 s,@ECHO_T@,$ECHO_T,;t t
23342 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23343 s,@DEFS@,$DEFS,;t t
23344 s,@LIBS@,$LIBS,;t t
23345 s,@build@,$build,;t t
23346 s,@build_cpu@,$build_cpu,;t t
23347 s,@build_vendor@,$build_vendor,;t t
23348 s,@build_os@,$build_os,;t t
23349 s,@host@,$host,;t t
23350 s,@host_cpu@,$host_cpu,;t t
23351 s,@host_vendor@,$host_vendor,;t t
23352 s,@host_os@,$host_os,;t t
23353 s,@SET_MAKE@,$SET_MAKE,;t t
23354 s,@CC@,$CC,;t t
23355 s,@CFLAGS@,$CFLAGS,;t t
23356 s,@LDFLAGS@,$LDFLAGS,;t t
23357 s,@CPPFLAGS@,$CPPFLAGS,;t t
23358 s,@ac_ct_CC@,$ac_ct_CC,;t t
23359 s,@EXEEXT@,$EXEEXT,;t t
23360 s,@OBJEXT@,$OBJEXT,;t t
23361 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23362 s,@CPP@,$CPP,;t t
23363 s,@GREP@,$GREP,;t t
23364 s,@EGREP@,$EGREP,;t t
23365 s,@AWK@,$AWK,;t t
23366 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23367 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23368 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23369 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23370 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23371 s,@LINT@,$LINT,;t t
23372 s,@LINT_OPTS@,$LINT_OPTS,;t t
23373 s,@CTAGS@,$CTAGS,;t t
23374 s,@ETAGS@,$ETAGS,;t t
23375 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23376 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23377 s,@MATH_LIB@,$MATH_LIB,;t t
23378 s,@top_builddir@,$top_builddir,;t t
23379 s,@CC_G_OPT@,$CC_G_OPT,;t t
23380 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23381 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23382 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23383 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23384 s,@LD@,$LD,;t t
23385 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23386 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23387 s,@LD_MODEL@,$LD_MODEL,;t t
23388 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23389 s,@LIBTOOL@,$LIBTOOL,;t t
23390 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23391 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23392 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23393 s,@LIB_LINK@,$LIB_LINK,;t t
23394 s,@LINK_TESTS@,$LINK_TESTS,;t t
23395 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23396 s,@PACKAGE@,$PACKAGE,;t t
23397 s,@PTHREAD@,$PTHREAD,;t t
23398 s,@TEST_ARGS@,$TEST_ARGS,;t t
23399 s,@TEST_DEPS@,$TEST_DEPS,;t t
23400 s,@TEST_LIBS@,$TEST_LIBS,;t t
23401 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23402 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23403 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23404 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23405 s,@includesubdir@,$includesubdir,;t t
23406 s,@FGREP@,$FGREP,;t t
23407 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23408 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23409 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23410 s,@ECHO_LT@,$ECHO_LT,;t t
23411 s,@ECHO_LD@,$ECHO_LD,;t t
23412 s,@RULE_CC@,$RULE_CC,;t t
23413 s,@SHOW_CC@,$SHOW_CC,;t t
23414 s,@ECHO_CC@,$ECHO_CC,;t t
23415 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23416 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23417 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23418 s,@X_CFLAGS@,$X_CFLAGS,;t t
23419 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23420 s,@X_LIBS@,$X_LIBS,;t t
23421 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23422 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23423 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23424 s,@RGB_PATH@,$RGB_PATH,;t t
23425 s,@no_x11_rgb@,$no_x11_rgb,;t t
23426 s,@FORM_NAME@,$FORM_NAME,;t t
23427 s,@MENU_NAME@,$MENU_NAME,;t t
23428 s,@PANEL_NAME@,$PANEL_NAME,;t t
23429 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23430 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23431 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23432 CEOF
23433
23434 EOF
23435
23436   cat >>"$CONFIG_STATUS" <<\EOF
23437   # Split the substitutions into bite-sized pieces for seds with
23438   # small command number limits, like on Digital OSF/1 and HP-UX.
23439   ac_max_sed_lines=48
23440   ac_sed_frag=1 # Number of current file.
23441   ac_beg=1 # First line for current file.
23442   ac_end=$ac_max_sed_lines # Line after last line for current file.
23443   ac_more_lines=:
23444   ac_sed_cmds=
23445   while "$ac_more_lines"; do
23446     if test "$ac_beg" -gt 1; then
23447       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23448     else
23449       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23450     fi
23451     if test ! -s $tmp/subs.frag; then
23452       ac_more_lines=false
23453     else
23454       # The purpose of the label and of the branching condition is to
23455       # speed up the sed processing (if there are no `@' at all, there
23456       # is no need to browse any of the substitutions).
23457       # These are the two extra sed commands mentioned above.
23458       (echo ':t
23459   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23460       # It is possible to make a multiline substitution using escaped newlines.
23461       # Ensure that we do not split the substitution between script fragments.
23462       ac_BEG=$ac_end
23463       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23464       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23465       if test -s $tmp/subs.next; then
23466         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23467         if test ! -s $tmp/subs.edit; then
23468           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23469           if test ! -s $tmp/subs.edit; then
23470             if test "$ac_beg" -gt 1; then
23471               ac_end=`expr "$ac_end" - 1`
23472               continue
23473             fi
23474           fi
23475         fi
23476       fi
23477
23478       if test -z "$ac_sed_cmds"; then
23479         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23480       else
23481         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23482       fi
23483       ac_sed_frag=`expr "$ac_sed_frag" + 1`
23484       ac_beg=$ac_end
23485       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
23486     fi
23487   done
23488   if test -z "$ac_sed_cmds"; then
23489     ac_sed_cmds=cat
23490   fi
23491 fi # test -n "$CONFIG_FILES"
23492
23493 EOF
23494 cat >>"$CONFIG_STATUS" <<\EOF
23495 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23496   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23497   case "$ac_file" in
23498   - | *:- | *:-:* ) # input from stdin
23499         cat >$tmp/stdin
23500         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23501         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23502   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23503         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23504   * )   ac_file_in=$ac_file.in ;;
23505   esac
23506
23507   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23508   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23509          X"$ac_file" : 'X\(//\)[^/]' \| \
23510          X"$ac_file" : 'X\(//\)$' \| \
23511          X"$ac_file" : 'X\(/\)' \| \
23512          .     : '\(.\)' 2>/dev/null ||
23513 echo X"$ac_file" |
23514     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23515           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23516           /^X\(\/\/\)$/{ s//\1/; q; }
23517           /^X\(\/\).*/{ s//\1/; q; }
23518           s/.*/./; q'`
23519   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23520     { case "$ac_dir" in
23521   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23522   *)                      as_incr_dir=.;;
23523 esac
23524 as_dummy="$ac_dir"
23525 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23526   case $as_mkdir_dir in
23527     # Skip DOS drivespec
23528     ?:) as_incr_dir=$as_mkdir_dir ;;
23529     *)
23530       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23531       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23532     ;;
23533   esac
23534 done; }
23535
23536     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23537     # A "../" for each directory in $ac_dir_suffix.
23538     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23539   else
23540     ac_dir_suffix= ac_dots=
23541   fi
23542
23543   case "$srcdir" in
23544   .)  ac_srcdir=.
23545       if test -z "$ac_dots"; then
23546          ac_top_srcdir=.
23547       else
23548          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
23549       fi ;;
23550   [\\/]* | ?:[\\/]* )
23551       ac_srcdir="$srcdir$ac_dir_suffix";
23552       ac_top_srcdir="$srcdir" ;;
23553   *) # Relative path.
23554     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
23555     ac_top_srcdir="$ac_dots$srcdir" ;;
23556   esac
23557
23558   case $INSTALL in
23559   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23560   *) ac_INSTALL=$ac_dots$INSTALL ;;
23561   esac
23562
23563   if test x"$ac_file" != x-; then
23564     { echo "$as_me:23564: creating $ac_file" >&5
23565 echo "$as_me: creating $ac_file" >&6;}
23566     rm -f "$ac_file"
23567   fi
23568   # Let's still pretend it is `configure' which instantiates (i.e., don't
23569   # use $as_me), people would be surprised to read:
23570   #    /* config.h.  Generated automatically by config.status.  */
23571   configure_input="Generated automatically from `echo $ac_file_in |
23572                                                  sed 's,.*/,,'` by configure."
23573
23574   # First look for the input files in the build tree, otherwise in the
23575   # src tree.
23576   ac_file_inputs=`IFS=:
23577     for f in $ac_file_in; do
23578       case $f in
23579       -) echo $tmp/stdin ;;
23580       [\\/$]*)
23581          # Absolute (can't be DOS-style, as IFS=:)
23582          test -f "$f" || { { echo "$as_me:23582: error: cannot find input file: $f" >&5
23583 echo "$as_me: error: cannot find input file: $f" >&2;}
23584    { (exit 1); exit 1; }; }
23585          echo $f;;
23586       *) # Relative
23587          if test -f "$f"; then
23588            # Build tree
23589            echo $f
23590          elif test -f "$srcdir/$f"; then
23591            # Source tree
23592            echo "$srcdir/$f"
23593          else
23594            # /dev/null tree
23595            { { echo "$as_me:23595: error: cannot find input file: $f" >&5
23596 echo "$as_me: error: cannot find input file: $f" >&2;}
23597    { (exit 1); exit 1; }; }
23598          fi;;
23599       esac
23600     done` || { (exit 1); exit 1; }
23601 EOF
23602 cat >>"$CONFIG_STATUS" <<\EOF
23603   ac_warn_datarootdir=no
23604   if test x"$ac_file" != x-; then
23605     for ac_item in $ac_file_inputs
23606     do
23607       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
23608       if test -n "$ac_seen"; then
23609         ac_used=`grep '@datarootdir@' "$ac_item"`
23610         if test -z "$ac_used"; then
23611           { echo "$as_me:23611: WARNING: datarootdir was used implicitly but not set:
23612 $ac_seen" >&5
23613 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23614 $ac_seen" >&2;}
23615           ac_warn_datarootdir=yes
23616         fi
23617       fi
23618       ac_seen=`grep '${datarootdir}' "$ac_item"`
23619       if test -n "$ac_seen"; then
23620         { echo "$as_me:23620: WARNING: datarootdir was used explicitly but not set:
23621 $ac_seen" >&5
23622 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23623 $ac_seen" >&2;}
23624         ac_warn_datarootdir=yes
23625       fi
23626     done
23627   fi
23628
23629 if test "x$ac_warn_datarootdir" = xyes; then
23630   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23631 fi
23632
23633 EOF
23634 cat >>"$CONFIG_STATUS" <<EOF
23635   sed "$ac_vpsub
23636 $extrasub
23637 EOF
23638 cat >>"$CONFIG_STATUS" <<\EOF
23639 :t
23640 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23641 s,@configure_input@,$configure_input,;t t
23642 s,@srcdir@,$ac_srcdir,;t t
23643 s,@top_srcdir@,$ac_top_srcdir,;t t
23644 s,@INSTALL@,$ac_INSTALL,;t t
23645 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23646   rm -f $tmp/stdin
23647   if test x"$ac_file" != x-; then
23648     cp "$tmp/out" "$ac_file"
23649
23650     for ac_name in prefix exec_prefix datarootdir
23651     do
23652         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
23653         if test -n "$ac_seen"; then
23654             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
23655             if test -z "$ac_init"; then
23656               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23657               { echo "$as_me:23657: WARNING: Variable $ac_name is used but was not set:
23658 $ac_seen" >&5
23659 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23660 $ac_seen" >&2;}
23661             fi
23662         fi
23663     done
23664     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
23665     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
23666     if test -s $tmp/out; then
23667       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23668       { echo "$as_me:23668: WARNING: Some variables may not be substituted:
23669 $ac_seen" >&5
23670 echo "$as_me: WARNING: Some variables may not be substituted:
23671 $ac_seen" >&2;}
23672     fi
23673   else
23674     cat $tmp/out
23675   fi
23676   rm -f $tmp/out
23677
23678 done
23679 EOF
23680 cat >>"$CONFIG_STATUS" <<\EOF
23681
23682 #
23683 # CONFIG_HEADER section.
23684 #
23685
23686 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23687 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23688 #
23689 # ac_d sets the value in "#define NAME VALUE" lines.
23690 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23691 ac_dB='[        ].*$,\1#\2'
23692 ac_dC=' '
23693 ac_dD=',;t'
23694 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23695 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23696 ac_iB='\([      ]\),\1#\2define\3'
23697 ac_iC=' '
23698 ac_iD='\4,;t'
23699 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23700 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23701 ac_uB='$,\1#\2define\3'
23702 ac_uC=' '
23703 ac_uD=',;t'
23704
23705 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23706   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23707   case "$ac_file" in
23708   - | *:- | *:-:* ) # input from stdin
23709         cat >$tmp/stdin
23710         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23711         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23712   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23713         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23714   * )   ac_file_in=$ac_file.in ;;
23715   esac
23716
23717   test x"$ac_file" != x- && { echo "$as_me:23717: creating $ac_file" >&5
23718 echo "$as_me: creating $ac_file" >&6;}
23719
23720   # First look for the input files in the build tree, otherwise in the
23721   # src tree.
23722   ac_file_inputs=`IFS=:
23723     for f in $ac_file_in; do
23724       case $f in
23725       -) echo $tmp/stdin ;;
23726       [\\/$]*)
23727          # Absolute (can't be DOS-style, as IFS=:)
23728          test -f "$f" || { { echo "$as_me:23728: error: cannot find input file: $f" >&5
23729 echo "$as_me: error: cannot find input file: $f" >&2;}
23730    { (exit 1); exit 1; }; }
23731          echo $f;;
23732       *) # Relative
23733          if test -f "$f"; then
23734            # Build tree
23735            echo $f
23736          elif test -f "$srcdir/$f"; then
23737            # Source tree
23738            echo "$srcdir/$f"
23739          else
23740            # /dev/null tree
23741            { { echo "$as_me:23741: error: cannot find input file: $f" >&5
23742 echo "$as_me: error: cannot find input file: $f" >&2;}
23743    { (exit 1); exit 1; }; }
23744          fi;;
23745       esac
23746     done` || { (exit 1); exit 1; }
23747   # Remove the trailing spaces.
23748   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23749
23750 EOF
23751
23752 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23753 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23754 # be either 'cat' or 'sort'.
23755 cat confdefs.h | uniq >conftest.vals
23756
23757 # Break up conftest.vals because some shells have a limit on
23758 # the size of here documents, and old seds have small limits too.
23759
23760 rm -f conftest.tail
23761 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
23762 while grep . conftest.vals >/dev/null
23763 do
23764   # Write chunks of a limited-size here document to conftest.frag.
23765   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
23766   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
23767   echo 'CEOF' >> "$CONFIG_STATUS"
23768   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
23769   rm -f conftest.vals
23770   mv conftest.tail conftest.vals
23771 done
23772 rm -f conftest.vals
23773
23774 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23775 # marker @DEFS@.
23776 echo '  cat >> conftest.edit <<CEOF
23777 /@DEFS@/r conftest.frag
23778 /@DEFS@/d
23779 CEOF
23780 sed -f conftest.edit $tmp/in > $tmp/out
23781 rm -f $tmp/in
23782 mv $tmp/out $tmp/in
23783 rm -f conftest.edit conftest.frag
23784 ' >> "$CONFIG_STATUS"
23785
23786 cat >>"$CONFIG_STATUS" <<\EOF
23787   # Let's still pretend it is `configure' which instantiates (i.e., don't
23788   # use $as_me), people would be surprised to read:
23789   #    /* config.h.  Generated automatically by config.status.  */
23790   if test x"$ac_file" = x-; then
23791     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23792   else
23793     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23794   fi
23795   cat $tmp/in >>$tmp/config.h
23796   rm -f $tmp/in
23797   if test x"$ac_file" != x-; then
23798     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
23799       { echo "$as_me:23799: $ac_file is unchanged" >&5
23800 echo "$as_me: $ac_file is unchanged" >&6;}
23801     else
23802       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23803          X"$ac_file" : 'X\(//\)[^/]' \| \
23804          X"$ac_file" : 'X\(//\)$' \| \
23805          X"$ac_file" : 'X\(/\)' \| \
23806          .     : '\(.\)' 2>/dev/null ||
23807 echo X"$ac_file" |
23808     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23809           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23810           /^X\(\/\/\)$/{ s//\1/; q; }
23811           /^X\(\/\).*/{ s//\1/; q; }
23812           s/.*/./; q'`
23813       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23814         { case "$ac_dir" in
23815   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23816   *)                      as_incr_dir=.;;
23817 esac
23818 as_dummy="$ac_dir"
23819 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23820   case $as_mkdir_dir in
23821     # Skip DOS drivespec
23822     ?:) as_incr_dir=$as_mkdir_dir ;;
23823     *)
23824       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23825       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23826     ;;
23827   esac
23828 done; }
23829
23830       fi
23831       rm -f "$ac_file"
23832       mv "$tmp/config.h" "$ac_file"
23833     fi
23834   else
23835     cat $tmp/config.h
23836     rm -f $tmp/config.h
23837   fi
23838 done
23839 EOF
23840 cat >>"$CONFIG_STATUS" <<\EOF
23841 #
23842 # CONFIG_COMMANDS section.
23843 #
23844 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23845   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23846   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23847
23848   case "$ac_dest" in
23849     default )
23850
23851 for cf_dir in .
23852 do
23853         if test ! -d "$srcdir/$cf_dir" ; then
23854                 continue
23855         elif test -f "$srcdir/$cf_dir/programs" ; then
23856                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
23857         fi
23858 done
23859
23860         cat >>Makefile <<TEST_EOF
23861
23862 # These rules are generated so we do not rely on suffix rules, which do not
23863 # work consistently for different make-programs (the '\$(MODEL)/' confuses
23864 # some, and the '\$x' confuses others).
23865 TEST_EOF
23866
23867 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
23868 for N in $LIST
23869 do
23870         cat >>Makefile <<TEST_EOF
23871
23872 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
23873         \$(srcdir)/test.priv.h \\
23874         ncurses_cfg.h
23875         $SHOW_CC
23876         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
23877 TEST_EOF
23878 done
23879
23880 if test -f ../config.guess && test -f ../config.sub
23881 then
23882         cat >>Makefile <<TEST_EOF
23883
23884 # if we used CF_INHERIT for getting these files, we can remove them
23885 distclean::
23886         rm -f config.guess config.sub
23887 TEST_EOF
23888 fi
23889  ;;
23890   esac
23891 done
23892 EOF
23893
23894 cat >>"$CONFIG_STATUS" <<\EOF
23895
23896 { (exit 0); exit 0; }
23897 EOF
23898 chmod +x "$CONFIG_STATUS"
23899 ac_clean_files=$ac_clean_files_save
23900
23901 # configure is writing to config.log, and then calls config.status.
23902 # config.status does its own redirection, appending to config.log.
23903 # Unfortunately, on DOS this fails, as config.log is still kept open
23904 # by configure, so config.status won't be able to write to it; its
23905 # output is simply discarded.  So we exec the FD to /dev/null,
23906 # effectively closing config.log, so it can be properly (re)opened and
23907 # appended to by config.status.  When coming back to configure, we
23908 # need to make the FD available again.
23909 if test "$no_create" != yes; then
23910   ac_cs_success=:
23911   exec 5>/dev/null
23912   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
23913   exec 5>>config.log
23914   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
23915   # would make configure fail if this is the last instruction.
23916   "$ac_cs_success" || { (exit 1); exit 1; }
23917 fi
23918