]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20210320
[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-string-hacks   work around bogus compiler/loader warnings
673   --with-pkg-config{=path} enable/disable use of pkg-config
674   --disable-echo          do not display "compiling" commands
675 Curses Version-dependent Options:
676   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
677   --disable-widec         disable checks for wide-character functions
678   --with-curses-dir=DIR   directory in which (n)curses is installed
679   --with-screen=XXX       use specified curses-libraries
680   --with-ncursesw         use wide ncurses-libraries
681   --with-ncurses          use ncurses-libraries
682   --with-pdcurses         compile/link with pdcurses X11 library
683   --with-curses-colr      compile/link with HPUX 10.x color-curses
684   --with-curses-5lib      compile/link with SunOS 5lib curses
685   --with-Xaw3d            link with Xaw 3d library
686   --with-Xaw3dxft         link with Xaw 3d xft library
687   --with-neXtaw           link with neXT Athena library
688   --with-XawPlus          link with Athena-Plus library
689   --with-x                use the X Window System
690   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
691   --with-form-libname=XXX override form basename of library
692   --with-menu-libname=XXX override menu basename of library
693   --with-panel-libname=XXX override panel basename of library
694   --disable-panel         disable checks for panel functions
695   --disable-menu          disable checks for menu functions
696   --disable-form          disable checks for form functions
697 Testing/development Options:
698   --enable-warnings       test: turn on gcc compiler warnings
699   --with-dmalloc          test: use Gray Watson's dmalloc library
700   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
701   --with-valgrind         test: use valgrind
702   --disable-leaks         test: free permanent memory, analyze leaks
703   --disable-rpath-hack    don't add rpath options for additional libraries
704
705 Some influential environment variables:
706   CC          C compiler command
707   CFLAGS      C compiler flags
708   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
709               nonstandard directory <lib dir>
710   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
711               headers in a nonstandard directory <include dir>
712   CPP         C preprocessor
713
714 Use these variables to override the choices made by `configure' or to help
715 it to find libraries and programs with nonstandard names/locations.
716
717 EOF
718 fi
719
720 if test "$ac_init_help" = "recursive"; then
721   # If there are subdirs, report their specific --help.
722   ac_popdir=`pwd`
723   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
724     cd "$ac_subdir"
725     # A "../" for each directory in /$ac_subdir.
726     ac_dots=`echo "$ac_subdir" |
727              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
728
729     case "$srcdir" in
730     .) # No --srcdir option.  We are building in place.
731       ac_sub_srcdir="$srcdir" ;;
732     [\\/]* | ?:[\\/]* ) # Absolute path.
733       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
734     *) # Relative path.
735       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
736     esac
737
738     # Check for guested configure; otherwise get Cygnus style configure.
739     if test -f "$ac_sub_srcdir/configure.gnu"; then
740       echo
741       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
742     elif test -f "$ac_sub_srcdir/configure"; then
743       echo
744       $SHELL "$ac_sub_srcdir/configure" --help=recursive
745     elif test -f "$ac_sub_srcdir/configure.ac" ||
746            test -f "$ac_sub_srcdir/configure.in"; then
747       echo
748       "$ac_configure" --help
749     else
750       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
751     fi
752     cd "$ac_popdir"
753   done
754 fi
755
756 test -n "$ac_init_help" && exit 0
757 if "$ac_init_version"; then
758   cat <<\EOF
759
760 Copyright 2003-2020,2021        Thomas E. Dickey
761 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
762 Free Software Foundation, Inc.
763 This configure script is free software; the Free Software Foundation
764 gives unlimited permission to copy, distribute and modify it.
765 EOF
766   exit 0
767 fi
768 exec 5>config.log
769 cat >&5 <<EOF
770 This file contains any messages produced by compilers while
771 running configure, to aid debugging if configure makes a mistake.
772
773 It was created by $as_me, which was
774 generated by GNU Autoconf 2.52.20210105.  Invocation command line was
775
776   $ $0 $@
777
778 EOF
779 {
780 cat <<_ASUNAME
781 ## ---------- ##
782 ## Platform.  ##
783 ## ---------- ##
784
785 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
786 uname -m = `(uname -m) 2>/dev/null || echo unknown`
787 uname -r = `(uname -r) 2>/dev/null || echo unknown`
788 uname -s = `(uname -s) 2>/dev/null || echo unknown`
789 uname -v = `(uname -v) 2>/dev/null || echo unknown`
790
791 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
792 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
793
794 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
795 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
796 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
797 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
798 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
799 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
800 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
801
802 PATH = $PATH
803
804 _ASUNAME
805 } >&5
806
807 cat >&5 <<EOF
808 ## ------------ ##
809 ## Core tests.  ##
810 ## ------------ ##
811
812 EOF
813
814 # Keep a trace of the command line.
815 # Strip out --no-create and --no-recursion so they do not pile up.
816 # Also quote any args containing shell meta-characters.
817 ac_configure_args=
818 ac_sep=
819 for ac_arg
820 do
821   case "$ac_arg" in
822   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
823   | --no-cr | --no-c) ;;
824   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
825   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
826   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
827     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
828     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
829     ac_sep=" " ;;
830   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
831      ac_sep=" " ;;
832   esac
833   # Get rid of the leading space.
834 done
835
836 # When interrupted or exit'd, cleanup temporary files, and complete
837 # config.log.  We remove comments because anyway the quotes in there
838 # would cause problems or look ugly.
839 trap 'exit_status=$?
840   # Save into config.log some information that might help in debugging.
841   echo >&5
842   echo "## ----------------- ##" >&5
843   echo "## Cache variables.  ##" >&5
844   echo "## ----------------- ##" >&5
845   echo >&5
846   # The following way of writing the cache mishandles newlines in values,
847 {
848   (set) 2>&1 |
849     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
850     *ac_space=\ *)
851       sed -n \
852         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
853           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
854       ;;
855     *)
856       sed -n \
857         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
858       ;;
859     esac;
860 } >&5
861   sed "/^$/d" confdefs.h >conftest.log
862   if test -s conftest.log; then
863     echo >&5
864     echo "## ------------ ##" >&5
865     echo "## confdefs.h.  ##" >&5
866     echo "## ------------ ##" >&5
867     echo >&5
868     cat conftest.log >&5
869   fi
870   (echo; echo) >&5
871   test "$ac_signal" != 0 &&
872     echo "$as_me: caught signal $ac_signal" >&5
873   echo "$as_me: exit $exit_status" >&5
874   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
875     exit $exit_status
876      ' 0
877 for ac_signal in 1 2 13 15; do
878   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
879 done
880 ac_signal=0
881
882 # confdefs.h avoids OS command line length limits that DEFS can exceed.
883 rm -rf conftest* confdefs.h
884 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
885 echo >confdefs.h
886
887 # Let the site file select an alternate cache file if it wants to.
888 # Prefer explicitly selected file to automatically selected ones.
889 if test -z "$CONFIG_SITE"; then
890   if test "x$prefix" != xNONE; then
891     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
892   else
893     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
894   fi
895 fi
896 for ac_site_file in $CONFIG_SITE; do
897   if test -r "$ac_site_file"; then
898     { echo "$as_me:898: loading site script $ac_site_file" >&5
899 echo "$as_me: loading site script $ac_site_file" >&6;}
900     cat "$ac_site_file" >&5
901     . "$ac_site_file"
902   fi
903 done
904
905 if test -r "$cache_file"; then
906   # Some versions of bash will fail to source /dev/null (special
907   # files actually), so we avoid doing that.
908   if test -f "$cache_file"; then
909     { echo "$as_me:909: loading cache $cache_file" >&5
910 echo "$as_me: loading cache $cache_file" >&6;}
911     case $cache_file in
912       [\\/]* | ?:[\\/]* ) . $cache_file;;
913       *)                      . ./$cache_file;;
914     esac
915   fi
916 else
917   { echo "$as_me:917: creating cache $cache_file" >&5
918 echo "$as_me: creating cache $cache_file" >&6;}
919   >$cache_file
920 fi
921
922 # Check that the precious variables saved in the cache have kept the same
923 # value.
924 ac_cache_corrupted=false
925 for ac_var in `(set) 2>&1 |
926                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
927   eval ac_old_set=\$ac_cv_env_${ac_var}_set
928   eval ac_new_set=\$ac_env_${ac_var}_set
929   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
930   eval ac_new_val="\$ac_env_${ac_var}_value"
931   case "$ac_old_set,$ac_new_set" in
932     set,)
933       { echo "$as_me:933: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
934 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
935       ac_cache_corrupted=: ;;
936     ,set)
937       { echo "$as_me:937: error: \`$ac_var' was not set in the previous run" >&5
938 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
939       ac_cache_corrupted=: ;;
940     ,);;
941     *)
942       if test "x$ac_old_val" != "x$ac_new_val"; then
943         { echo "$as_me:943: error: \`$ac_var' has changed since the previous run:" >&5
944 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
945         { echo "$as_me:945:   former value:  $ac_old_val" >&5
946 echo "$as_me:   former value:  $ac_old_val" >&2;}
947         { echo "$as_me:947:   current value: $ac_new_val" >&5
948 echo "$as_me:   current value: $ac_new_val" >&2;}
949         ac_cache_corrupted=:
950       fi;;
951   esac
952   # Pass precious variables to config.status.  It doesn't matter if
953   # we pass some twice (in addition to the command line arguments).
954   if test "$ac_new_set" = set; then
955     case "$ac_new_val" in
956     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
957       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
958       ac_configure_args="$ac_configure_args '$ac_arg'"
959       ;;
960     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
961        ;;
962     esac
963   fi
964 done
965 if "$ac_cache_corrupted"; then
966   { echo "$as_me:966: error: changes in the environment can compromise the build" >&5
967 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
968   { { echo "$as_me:968: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
969 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
970    { (exit 1); exit 1; }; }
971 fi
972
973 ac_ext=c
974 ac_cpp='$CPP $CPPFLAGS'
975 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
976 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
977 ac_compiler_gnu=$ac_cv_c_compiler_gnu
978 ac_main_return="return"
979
980 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
981   *c*,-n*) ECHO_N=
982            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
983            ECHO_T='     '
984            ;;
985   *c*,*  ) ECHO_N=-n
986            ECHO_C=
987            ECHO_T=
988            ;;
989   *)       ECHO_N=
990            ECHO_C='\c'
991            ECHO_T=
992            ;;
993 esac
994 echo "#! $SHELL" >conftest.sh
995 echo  "exit 0"   >>conftest.sh
996 chmod +x conftest.sh
997 if { (echo "$as_me:997: PATH=\".;.\"; conftest.sh") >&5
998   (PATH=".;."; conftest.sh) 2>&5
999   ac_status=$?
1000   echo "$as_me:1000: \$? = $ac_status" >&5
1001   (exit "$ac_status"); }; then
1002   ac_path_separator=';'
1003 else
1004   ac_path_separator=:
1005 fi
1006 PATH_SEPARATOR="$ac_path_separator"
1007 rm -f conftest.sh
1008
1009 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
1010
1011 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1012
1013 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1014
1015 ac_aux_dir=
1016 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1017   if test -f "$ac_dir/install-sh"; then
1018     ac_aux_dir=$ac_dir
1019     ac_install_sh="$ac_aux_dir/install-sh -c"
1020     break
1021   elif test -f "$ac_dir/install.sh"; then
1022     ac_aux_dir=$ac_dir
1023     ac_install_sh="$ac_aux_dir/install.sh -c"
1024     break
1025   elif test -f "$ac_dir/shtool"; then
1026     ac_aux_dir=$ac_dir
1027     ac_install_sh="$ac_aux_dir/shtool install -c"
1028     break
1029   fi
1030 done
1031 if test -z "$ac_aux_dir"; then
1032   { { echo "$as_me:1032: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1033 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1034    { (exit 1); exit 1; }; }
1035 fi
1036 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1037 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1038 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1039
1040 # Make sure we can run config.sub.
1041 $ac_config_sub sun4 >/dev/null 2>&1 ||
1042   { { echo "$as_me:1042: error: cannot run $ac_config_sub" >&5
1043 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1044    { (exit 1); exit 1; }; }
1045
1046 echo "$as_me:1046: checking build system type" >&5
1047 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1048 if test "${ac_cv_build+set}" = set; then
1049   echo $ECHO_N "(cached) $ECHO_C" >&6
1050 else
1051   ac_cv_build_alias=$build_alias
1052 test -z "$ac_cv_build_alias" &&
1053   ac_cv_build_alias=`$ac_config_guess`
1054 test -z "$ac_cv_build_alias" &&
1055   { { echo "$as_me:1055: error: cannot guess build type; you must specify one" >&5
1056 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1057    { (exit 1); exit 1; }; }
1058 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1059   { { echo "$as_me:1059: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1060 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1061    { (exit 1); exit 1; }; }
1062
1063 fi
1064 echo "$as_me:1064: result: $ac_cv_build" >&5
1065 echo "${ECHO_T}$ac_cv_build" >&6
1066 build=$ac_cv_build
1067 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1068 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1069 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1070
1071 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1072         echo "$as_me:1072: checking host system type" >&5
1073 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1074 if test "${ac_cv_host+set}" = set; then
1075   echo $ECHO_N "(cached) $ECHO_C" >&6
1076 else
1077   ac_cv_host_alias=$host_alias
1078 test -z "$ac_cv_host_alias" &&
1079   ac_cv_host_alias=$ac_cv_build_alias
1080 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1081   { { echo "$as_me:1081: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1082 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1083    { (exit 1); exit 1; }; }
1084
1085 fi
1086 echo "$as_me:1086: result: $ac_cv_host" >&5
1087 echo "${ECHO_T}$ac_cv_host" >&6
1088 host=$ac_cv_host
1089 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1090 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1091 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1092
1093         system_name="$host_os"
1094 else
1095         system_name="`(uname -s -r) 2>/dev/null`"
1096         if test -z "$system_name" ; then
1097                 system_name="`(hostname) 2>/dev/null`"
1098         fi
1099 fi
1100 test -n "$system_name" &&
1101 cat >>confdefs.h <<EOF
1102 #define SYSTEM_NAME "$system_name"
1103 EOF
1104
1105 if test "${cf_cv_system_name+set}" = set; then
1106   echo $ECHO_N "(cached) $ECHO_C" >&6
1107 else
1108   cf_cv_system_name="$system_name"
1109 fi
1110
1111 test -z "$system_name" && system_name="$cf_cv_system_name"
1112 test -n "$cf_cv_system_name" && echo "$as_me:1112: result: Configuring for $cf_cv_system_name" >&5
1113 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1114
1115 if test ".$system_name" != ".$cf_cv_system_name" ; then
1116         echo "$as_me:1116: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1117 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1118         { { echo "$as_me:1118: error: \"Please remove config.cache and try again.\"" >&5
1119 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1120    { (exit 1); exit 1; }; }
1121 fi
1122
1123 test "$program_prefix" != NONE &&
1124   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1125 # Use a double $ so make ignores it.
1126 test "$program_suffix" != NONE &&
1127   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1128 # Double any \ or $.  echo might interpret backslashes.
1129 # By default was `s,x,x', remove it if useless.
1130 cat <<\_ACEOF >conftest.sed
1131 s/[\\$]/&&/g;s/;s,x,x,$//
1132 _ACEOF
1133 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1134 rm conftest.sed
1135
1136 echo "$as_me:1136: checking whether ${MAKE-make} sets \${MAKE}" >&5
1137 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1138 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1139 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1140   echo $ECHO_N "(cached) $ECHO_C" >&6
1141 else
1142   cat >conftest.make <<\EOF
1143 all:
1144         @echo 'ac_maketemp="${MAKE}"'
1145 EOF
1146 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1147 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1148 if test -n "$ac_maketemp"; then
1149   eval ac_cv_prog_make_${ac_make}_set=yes
1150 else
1151   eval ac_cv_prog_make_${ac_make}_set=no
1152 fi
1153 rm -f conftest.make
1154 fi
1155 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1156   echo "$as_me:1156: result: yes" >&5
1157 echo "${ECHO_T}yes" >&6
1158   SET_MAKE=
1159 else
1160   echo "$as_me:1160: result: no" >&5
1161 echo "${ECHO_T}no" >&6
1162   SET_MAKE="MAKE=${MAKE-make}"
1163 fi
1164
1165 ac_ext=c
1166 ac_cpp='$CPP $CPPFLAGS'
1167 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1168 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1169 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1170 ac_main_return="return"
1171 if test -n "$ac_tool_prefix"; then
1172   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1173 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1174 echo "$as_me:1174: checking for $ac_word" >&5
1175 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1176 if test "${ac_cv_prog_CC+set}" = set; then
1177   echo $ECHO_N "(cached) $ECHO_C" >&6
1178 else
1179   if test -n "$CC"; then
1180   ac_cv_prog_CC="$CC" # Let the user override the test.
1181 else
1182   ac_save_IFS=$IFS; IFS=$ac_path_separator
1183 ac_dummy="$PATH"
1184 for ac_dir in $ac_dummy; do
1185   IFS=$ac_save_IFS
1186   test -z "$ac_dir" && ac_dir=.
1187   $as_executable_p "$ac_dir/$ac_word" || continue
1188 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1189 echo "$as_me:1189: found $ac_dir/$ac_word" >&5
1190 break
1191 done
1192
1193 fi
1194 fi
1195 CC=$ac_cv_prog_CC
1196 if test -n "$CC"; then
1197   echo "$as_me:1197: result: $CC" >&5
1198 echo "${ECHO_T}$CC" >&6
1199 else
1200   echo "$as_me:1200: result: no" >&5
1201 echo "${ECHO_T}no" >&6
1202 fi
1203
1204 fi
1205 if test -z "$ac_cv_prog_CC"; then
1206   ac_ct_CC=$CC
1207   # Extract the first word of "gcc", so it can be a program name with args.
1208 set dummy gcc; ac_word=$2
1209 echo "$as_me:1209: checking for $ac_word" >&5
1210 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1211 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1212   echo $ECHO_N "(cached) $ECHO_C" >&6
1213 else
1214   if test -n "$ac_ct_CC"; then
1215   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1216 else
1217   ac_save_IFS=$IFS; IFS=$ac_path_separator
1218 ac_dummy="$PATH"
1219 for ac_dir in $ac_dummy; do
1220   IFS=$ac_save_IFS
1221   test -z "$ac_dir" && ac_dir=.
1222   $as_executable_p "$ac_dir/$ac_word" || continue
1223 ac_cv_prog_ac_ct_CC="gcc"
1224 echo "$as_me:1224: found $ac_dir/$ac_word" >&5
1225 break
1226 done
1227
1228 fi
1229 fi
1230 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1231 if test -n "$ac_ct_CC"; then
1232   echo "$as_me:1232: result: $ac_ct_CC" >&5
1233 echo "${ECHO_T}$ac_ct_CC" >&6
1234 else
1235   echo "$as_me:1235: result: no" >&5
1236 echo "${ECHO_T}no" >&6
1237 fi
1238
1239   CC=$ac_ct_CC
1240 else
1241   CC="$ac_cv_prog_CC"
1242 fi
1243
1244 if test -z "$CC"; then
1245   if test -n "$ac_tool_prefix"; then
1246   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1247 set dummy ${ac_tool_prefix}cc; ac_word=$2
1248 echo "$as_me:1248: checking for $ac_word" >&5
1249 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1250 if test "${ac_cv_prog_CC+set}" = set; then
1251   echo $ECHO_N "(cached) $ECHO_C" >&6
1252 else
1253   if test -n "$CC"; then
1254   ac_cv_prog_CC="$CC" # Let the user override the test.
1255 else
1256   ac_save_IFS=$IFS; IFS=$ac_path_separator
1257 ac_dummy="$PATH"
1258 for ac_dir in $ac_dummy; do
1259   IFS=$ac_save_IFS
1260   test -z "$ac_dir" && ac_dir=.
1261   $as_executable_p "$ac_dir/$ac_word" || continue
1262 ac_cv_prog_CC="${ac_tool_prefix}cc"
1263 echo "$as_me:1263: found $ac_dir/$ac_word" >&5
1264 break
1265 done
1266
1267 fi
1268 fi
1269 CC=$ac_cv_prog_CC
1270 if test -n "$CC"; then
1271   echo "$as_me:1271: result: $CC" >&5
1272 echo "${ECHO_T}$CC" >&6
1273 else
1274   echo "$as_me:1274: result: no" >&5
1275 echo "${ECHO_T}no" >&6
1276 fi
1277
1278 fi
1279 if test -z "$ac_cv_prog_CC"; then
1280   ac_ct_CC=$CC
1281   # Extract the first word of "cc", so it can be a program name with args.
1282 set dummy cc; ac_word=$2
1283 echo "$as_me:1283: checking for $ac_word" >&5
1284 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1285 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1286   echo $ECHO_N "(cached) $ECHO_C" >&6
1287 else
1288   if test -n "$ac_ct_CC"; then
1289   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1290 else
1291   ac_save_IFS=$IFS; IFS=$ac_path_separator
1292 ac_dummy="$PATH"
1293 for ac_dir in $ac_dummy; do
1294   IFS=$ac_save_IFS
1295   test -z "$ac_dir" && ac_dir=.
1296   $as_executable_p "$ac_dir/$ac_word" || continue
1297 ac_cv_prog_ac_ct_CC="cc"
1298 echo "$as_me:1298: found $ac_dir/$ac_word" >&5
1299 break
1300 done
1301
1302 fi
1303 fi
1304 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1305 if test -n "$ac_ct_CC"; then
1306   echo "$as_me:1306: result: $ac_ct_CC" >&5
1307 echo "${ECHO_T}$ac_ct_CC" >&6
1308 else
1309   echo "$as_me:1309: result: no" >&5
1310 echo "${ECHO_T}no" >&6
1311 fi
1312
1313   CC=$ac_ct_CC
1314 else
1315   CC="$ac_cv_prog_CC"
1316 fi
1317
1318 fi
1319 if test -z "$CC"; then
1320   # Extract the first word of "cc", so it can be a program name with args.
1321 set dummy cc; ac_word=$2
1322 echo "$as_me:1322: checking for $ac_word" >&5
1323 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1324 if test "${ac_cv_prog_CC+set}" = set; then
1325   echo $ECHO_N "(cached) $ECHO_C" >&6
1326 else
1327   if test -n "$CC"; then
1328   ac_cv_prog_CC="$CC" # Let the user override the test.
1329 else
1330   ac_prog_rejected=no
1331   ac_save_IFS=$IFS; IFS=$ac_path_separator
1332 ac_dummy="$PATH"
1333 for ac_dir in $ac_dummy; do
1334   IFS=$ac_save_IFS
1335   test -z "$ac_dir" && ac_dir=.
1336   $as_executable_p "$ac_dir/$ac_word" || continue
1337 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1338   ac_prog_rejected=yes
1339   continue
1340 fi
1341 ac_cv_prog_CC="cc"
1342 echo "$as_me:1342: found $ac_dir/$ac_word" >&5
1343 break
1344 done
1345
1346 if test "$ac_prog_rejected" = yes; then
1347   # We found a bogon in the path, so make sure we never use it.
1348   set dummy $ac_cv_prog_CC
1349   shift
1350   if test $# != 0; then
1351     # We chose a different compiler from the bogus one.
1352     # However, it has the same basename, so the bogon will be chosen
1353     # first if we set CC to just the basename; use the full file name.
1354     shift
1355     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1356     shift
1357     ac_cv_prog_CC="$@"
1358   fi
1359 fi
1360 fi
1361 fi
1362 CC=$ac_cv_prog_CC
1363 if test -n "$CC"; then
1364   echo "$as_me:1364: result: $CC" >&5
1365 echo "${ECHO_T}$CC" >&6
1366 else
1367   echo "$as_me:1367: result: no" >&5
1368 echo "${ECHO_T}no" >&6
1369 fi
1370
1371 fi
1372 if test -z "$CC"; then
1373   if test -n "$ac_tool_prefix"; then
1374   for ac_prog in cl
1375   do
1376     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1377 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1378 echo "$as_me:1378: checking for $ac_word" >&5
1379 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1380 if test "${ac_cv_prog_CC+set}" = set; then
1381   echo $ECHO_N "(cached) $ECHO_C" >&6
1382 else
1383   if test -n "$CC"; then
1384   ac_cv_prog_CC="$CC" # Let the user override the test.
1385 else
1386   ac_save_IFS=$IFS; IFS=$ac_path_separator
1387 ac_dummy="$PATH"
1388 for ac_dir in $ac_dummy; do
1389   IFS=$ac_save_IFS
1390   test -z "$ac_dir" && ac_dir=.
1391   $as_executable_p "$ac_dir/$ac_word" || continue
1392 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1393 echo "$as_me:1393: found $ac_dir/$ac_word" >&5
1394 break
1395 done
1396
1397 fi
1398 fi
1399 CC=$ac_cv_prog_CC
1400 if test -n "$CC"; then
1401   echo "$as_me:1401: result: $CC" >&5
1402 echo "${ECHO_T}$CC" >&6
1403 else
1404   echo "$as_me:1404: result: no" >&5
1405 echo "${ECHO_T}no" >&6
1406 fi
1407
1408     test -n "$CC" && break
1409   done
1410 fi
1411 if test -z "$CC"; then
1412   ac_ct_CC=$CC
1413   for ac_prog in cl
1414 do
1415   # Extract the first word of "$ac_prog", so it can be a program name with args.
1416 set dummy $ac_prog; ac_word=$2
1417 echo "$as_me:1417: checking for $ac_word" >&5
1418 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1419 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1420   echo $ECHO_N "(cached) $ECHO_C" >&6
1421 else
1422   if test -n "$ac_ct_CC"; then
1423   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1424 else
1425   ac_save_IFS=$IFS; IFS=$ac_path_separator
1426 ac_dummy="$PATH"
1427 for ac_dir in $ac_dummy; do
1428   IFS=$ac_save_IFS
1429   test -z "$ac_dir" && ac_dir=.
1430   $as_executable_p "$ac_dir/$ac_word" || continue
1431 ac_cv_prog_ac_ct_CC="$ac_prog"
1432 echo "$as_me:1432: found $ac_dir/$ac_word" >&5
1433 break
1434 done
1435
1436 fi
1437 fi
1438 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1439 if test -n "$ac_ct_CC"; then
1440   echo "$as_me:1440: result: $ac_ct_CC" >&5
1441 echo "${ECHO_T}$ac_ct_CC" >&6
1442 else
1443   echo "$as_me:1443: result: no" >&5
1444 echo "${ECHO_T}no" >&6
1445 fi
1446
1447   test -n "$ac_ct_CC" && break
1448 done
1449
1450   CC=$ac_ct_CC
1451 fi
1452
1453 fi
1454
1455 test -z "$CC" && { { echo "$as_me:1455: error: no acceptable cc found in \$PATH" >&5
1456 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1457    { (exit 1); exit 1; }; }
1458
1459 # Provide some information about the compiler.
1460 echo "$as_me:1460:" \
1461      "checking for C compiler version" >&5
1462 ac_compiler=`set X $ac_compile; echo "$2"`
1463 { (eval echo "$as_me:1463: \"$ac_compiler --version </dev/null >&5\"") >&5
1464   (eval $ac_compiler --version </dev/null >&5) 2>&5
1465   ac_status=$?
1466   echo "$as_me:1466: \$? = $ac_status" >&5
1467   (exit "$ac_status"); }
1468 { (eval echo "$as_me:1468: \"$ac_compiler -v </dev/null >&5\"") >&5
1469   (eval $ac_compiler -v </dev/null >&5) 2>&5
1470   ac_status=$?
1471   echo "$as_me:1471: \$? = $ac_status" >&5
1472   (exit "$ac_status"); }
1473 { (eval echo "$as_me:1473: \"$ac_compiler -V </dev/null >&5\"") >&5
1474   (eval $ac_compiler -V </dev/null >&5) 2>&5
1475   ac_status=$?
1476   echo "$as_me:1476: \$? = $ac_status" >&5
1477   (exit "$ac_status"); }
1478
1479 cat >"conftest.$ac_ext" <<_ACEOF
1480 #line 1480 "configure"
1481 #include "confdefs.h"
1482
1483 int
1484 main (void)
1485 {
1486
1487   ;
1488   return 0;
1489 }
1490 _ACEOF
1491 ac_clean_files_save=$ac_clean_files
1492 ac_clean_files="$ac_clean_files a.out a.exe"
1493 # Try to create an executable without -o first, disregard a.out.
1494 # It will help us diagnose broken compilers, and finding out an intuition
1495 # of exeext.
1496 echo "$as_me:1496: checking for C compiler default output" >&5
1497 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1498 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1499 if { (eval echo "$as_me:1499: \"$ac_link_default\"") >&5
1500   (eval $ac_link_default) 2>&5
1501   ac_status=$?
1502   echo "$as_me:1502: \$? = $ac_status" >&5
1503   (exit "$ac_status"); }; then
1504   # Find the output, starting from the most likely.  This scheme is
1505 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1506 # resort.
1507 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1508                 ls a.out conftest 2>/dev/null;
1509                 ls a.* conftest.* 2>/dev/null`; do
1510   case $ac_file in
1511     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1512     a.out ) # We found the default executable, but exeext='' is most
1513             # certainly right.
1514             break;;
1515     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1516           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1517           export ac_cv_exeext
1518           break;;
1519     * ) break;;
1520   esac
1521 done
1522 else
1523   echo "$as_me: failed program was:" >&5
1524 cat "conftest.$ac_ext" >&5
1525 { { echo "$as_me:1525: error: C compiler cannot create executables" >&5
1526 echo "$as_me: error: C compiler cannot create executables" >&2;}
1527    { (exit 77); exit 77; }; }
1528 fi
1529
1530 ac_exeext=$ac_cv_exeext
1531 echo "$as_me:1531: result: $ac_file" >&5
1532 echo "${ECHO_T}$ac_file" >&6
1533
1534 # Check the compiler produces executables we can run.  If not, either
1535 # the compiler is broken, or we cross compile.
1536 echo "$as_me:1536: checking whether the C compiler works" >&5
1537 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1538 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1539 # If not cross compiling, check that we can run a simple program.
1540 if test "$cross_compiling" != yes; then
1541   if { ac_try='./$ac_file'
1542   { (eval echo "$as_me:1542: \"$ac_try\"") >&5
1543   (eval $ac_try) 2>&5
1544   ac_status=$?
1545   echo "$as_me:1545: \$? = $ac_status" >&5
1546   (exit "$ac_status"); }; }; then
1547     cross_compiling=no
1548   else
1549     if test "$cross_compiling" = maybe; then
1550         cross_compiling=yes
1551     else
1552         { { echo "$as_me:1552: error: cannot run C compiled programs.
1553 If you meant to cross compile, use \`--host'." >&5
1554 echo "$as_me: error: cannot run C compiled programs.
1555 If you meant to cross compile, use \`--host'." >&2;}
1556    { (exit 1); exit 1; }; }
1557     fi
1558   fi
1559 fi
1560 echo "$as_me:1560: result: yes" >&5
1561 echo "${ECHO_T}yes" >&6
1562
1563 rm -f a.out a.exe "conftest$ac_cv_exeext"
1564 ac_clean_files=$ac_clean_files_save
1565 # Check the compiler produces executables we can run.  If not, either
1566 # the compiler is broken, or we cross compile.
1567 echo "$as_me:1567: checking whether we are cross compiling" >&5
1568 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1569 echo "$as_me:1569: result: $cross_compiling" >&5
1570 echo "${ECHO_T}$cross_compiling" >&6
1571
1572 echo "$as_me:1572: checking for executable suffix" >&5
1573 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1574 if { (eval echo "$as_me:1574: \"$ac_link\"") >&5
1575   (eval $ac_link) 2>&5
1576   ac_status=$?
1577   echo "$as_me:1577: \$? = $ac_status" >&5
1578   (exit "$ac_status"); }; then
1579   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1580 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1581 # work properly (i.e., refer to `conftest.exe'), while it won't with
1582 # `rm'.
1583 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1584   case $ac_file in
1585     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1586     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1587           export ac_cv_exeext
1588           break;;
1589     * ) break;;
1590   esac
1591 done
1592 else
1593   { { echo "$as_me:1593: error: cannot compute EXEEXT: cannot compile and link" >&5
1594 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1595    { (exit 1); exit 1; }; }
1596 fi
1597
1598 rm -f "conftest$ac_cv_exeext"
1599 echo "$as_me:1599: result: $ac_cv_exeext" >&5
1600 echo "${ECHO_T}$ac_cv_exeext" >&6
1601
1602 rm -f "conftest.$ac_ext"
1603 EXEEXT=$ac_cv_exeext
1604 ac_exeext=$EXEEXT
1605 echo "$as_me:1605: checking for object suffix" >&5
1606 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1607 if test "${ac_cv_objext+set}" = set; then
1608   echo $ECHO_N "(cached) $ECHO_C" >&6
1609 else
1610   cat >"conftest.$ac_ext" <<_ACEOF
1611 #line 1611 "configure"
1612 #include "confdefs.h"
1613
1614 int
1615 main (void)
1616 {
1617
1618   ;
1619   return 0;
1620 }
1621 _ACEOF
1622 rm -f conftest.o conftest.obj
1623 if { (eval echo "$as_me:1623: \"$ac_compile\"") >&5
1624   (eval $ac_compile) 2>&5
1625   ac_status=$?
1626   echo "$as_me:1626: \$? = $ac_status" >&5
1627   (exit "$ac_status"); }; then
1628   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1629   case $ac_file in
1630     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1631     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1632        break;;
1633   esac
1634 done
1635 else
1636   echo "$as_me: failed program was:" >&5
1637 cat "conftest.$ac_ext" >&5
1638 { { echo "$as_me:1638: error: cannot compute OBJEXT: cannot compile" >&5
1639 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1640    { (exit 1); exit 1; }; }
1641 fi
1642
1643 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1644 fi
1645 echo "$as_me:1645: result: $ac_cv_objext" >&5
1646 echo "${ECHO_T}$ac_cv_objext" >&6
1647 OBJEXT=$ac_cv_objext
1648 ac_objext=$OBJEXT
1649 echo "$as_me:1649: checking whether we are using the GNU C compiler" >&5
1650 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1651 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1652   echo $ECHO_N "(cached) $ECHO_C" >&6
1653 else
1654   cat >"conftest.$ac_ext" <<_ACEOF
1655 #line 1655 "configure"
1656 #include "confdefs.h"
1657
1658 int
1659 main (void)
1660 {
1661 #ifndef __GNUC__
1662        choke me
1663 #endif
1664
1665   ;
1666   return 0;
1667 }
1668 _ACEOF
1669 rm -f "conftest.$ac_objext"
1670 if { (eval echo "$as_me:1670: \"$ac_compile\"") >&5
1671   (eval $ac_compile) 2>&5
1672   ac_status=$?
1673   echo "$as_me:1673: \$? = $ac_status" >&5
1674   (exit "$ac_status"); } &&
1675          { ac_try='test -s "conftest.$ac_objext"'
1676   { (eval echo "$as_me:1676: \"$ac_try\"") >&5
1677   (eval $ac_try) 2>&5
1678   ac_status=$?
1679   echo "$as_me:1679: \$? = $ac_status" >&5
1680   (exit "$ac_status"); }; }; then
1681   ac_compiler_gnu=yes
1682 else
1683   echo "$as_me: failed program was:" >&5
1684 cat "conftest.$ac_ext" >&5
1685 ac_compiler_gnu=no
1686 fi
1687 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1688 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1689
1690 fi
1691 echo "$as_me:1691: result: $ac_cv_c_compiler_gnu" >&5
1692 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1693 GCC=`test $ac_compiler_gnu = yes && echo yes`
1694 ac_test_CFLAGS=${CFLAGS+set}
1695 ac_save_CFLAGS=$CFLAGS
1696 CFLAGS="-g"
1697 echo "$as_me:1697: checking whether $CC accepts -g" >&5
1698 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1699 if test "${ac_cv_prog_cc_g+set}" = set; then
1700   echo $ECHO_N "(cached) $ECHO_C" >&6
1701 else
1702   cat >"conftest.$ac_ext" <<_ACEOF
1703 #line 1703 "configure"
1704 #include "confdefs.h"
1705
1706 int
1707 main (void)
1708 {
1709
1710   ;
1711   return 0;
1712 }
1713 _ACEOF
1714 rm -f "conftest.$ac_objext"
1715 if { (eval echo "$as_me:1715: \"$ac_compile\"") >&5
1716   (eval $ac_compile) 2>&5
1717   ac_status=$?
1718   echo "$as_me:1718: \$? = $ac_status" >&5
1719   (exit "$ac_status"); } &&
1720          { ac_try='test -s "conftest.$ac_objext"'
1721   { (eval echo "$as_me:1721: \"$ac_try\"") >&5
1722   (eval $ac_try) 2>&5
1723   ac_status=$?
1724   echo "$as_me:1724: \$? = $ac_status" >&5
1725   (exit "$ac_status"); }; }; then
1726   ac_cv_prog_cc_g=yes
1727 else
1728   echo "$as_me: failed program was:" >&5
1729 cat "conftest.$ac_ext" >&5
1730 ac_cv_prog_cc_g=no
1731 fi
1732 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1733 fi
1734 echo "$as_me:1734: result: $ac_cv_prog_cc_g" >&5
1735 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1736 if test "$ac_test_CFLAGS" = set; then
1737   CFLAGS=$ac_save_CFLAGS
1738 elif test $ac_cv_prog_cc_g = yes; then
1739   if test "$GCC" = yes; then
1740     CFLAGS="-g -O2"
1741   else
1742     CFLAGS="-g"
1743   fi
1744 else
1745   if test "$GCC" = yes; then
1746     CFLAGS="-O2"
1747   else
1748     CFLAGS=
1749   fi
1750 fi
1751 # Some people use a C++ compiler to compile C.  Since we use `exit',
1752 # in C++ we need to declare it.  In case someone uses the same compiler
1753 # for both compiling C and C++ we need to have the C++ compiler decide
1754 # the declaration of exit, since it's the most demanding environment.
1755 cat >"conftest.$ac_ext" <<_ACEOF
1756 #ifndef __cplusplus
1757   choke me
1758 #endif
1759 _ACEOF
1760 rm -f "conftest.$ac_objext"
1761 if { (eval echo "$as_me:1761: \"$ac_compile\"") >&5
1762   (eval $ac_compile) 2>&5
1763   ac_status=$?
1764   echo "$as_me:1764: \$? = $ac_status" >&5
1765   (exit "$ac_status"); } &&
1766          { ac_try='test -s "conftest.$ac_objext"'
1767   { (eval echo "$as_me:1767: \"$ac_try\"") >&5
1768   (eval $ac_try) 2>&5
1769   ac_status=$?
1770   echo "$as_me:1770: \$? = $ac_status" >&5
1771   (exit "$ac_status"); }; }; then
1772   for ac_declaration in \
1773    ''\
1774    '#include <stdlib.h>' \
1775    'extern "C" void std::exit (int) throw (); using std::exit;' \
1776    'extern "C" void std::exit (int); using std::exit;' \
1777    'extern "C" void exit (int) throw ();' \
1778    'extern "C" void exit (int);' \
1779    'void exit (int);'
1780 do
1781   cat >"conftest.$ac_ext" <<_ACEOF
1782 #line 1782 "configure"
1783 #include "confdefs.h"
1784 #include <stdlib.h>
1785 $ac_declaration
1786 int
1787 main (void)
1788 {
1789 exit (42);
1790   ;
1791   return 0;
1792 }
1793 _ACEOF
1794 rm -f "conftest.$ac_objext"
1795 if { (eval echo "$as_me:1795: \"$ac_compile\"") >&5
1796   (eval $ac_compile) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit "$ac_status"); } &&
1800          { ac_try='test -s "conftest.$ac_objext"'
1801   { (eval echo "$as_me:1801: \"$ac_try\"") >&5
1802   (eval $ac_try) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit "$ac_status"); }; }; then
1806   :
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat "conftest.$ac_ext" >&5
1810 continue
1811 fi
1812 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1813   cat >"conftest.$ac_ext" <<_ACEOF
1814 #line 1814 "configure"
1815 #include "confdefs.h"
1816 $ac_declaration
1817 int
1818 main (void)
1819 {
1820 exit (42);
1821   ;
1822   return 0;
1823 }
1824 _ACEOF
1825 rm -f "conftest.$ac_objext"
1826 if { (eval echo "$as_me:1826: \"$ac_compile\"") >&5
1827   (eval $ac_compile) 2>&5
1828   ac_status=$?
1829   echo "$as_me:1829: \$? = $ac_status" >&5
1830   (exit "$ac_status"); } &&
1831          { ac_try='test -s "conftest.$ac_objext"'
1832   { (eval echo "$as_me:1832: \"$ac_try\"") >&5
1833   (eval $ac_try) 2>&5
1834   ac_status=$?
1835   echo "$as_me:1835: \$? = $ac_status" >&5
1836   (exit "$ac_status"); }; }; then
1837   break
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat "conftest.$ac_ext" >&5
1841 fi
1842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1843 done
1844 rm -rf conftest*
1845 if test -n "$ac_declaration"; then
1846   echo '#ifdef __cplusplus' >>confdefs.h
1847   echo "$ac_declaration"    >>confdefs.h
1848   echo '#endif'             >>confdefs.h
1849 fi
1850
1851 else
1852   echo "$as_me: failed program was:" >&5
1853 cat "conftest.$ac_ext" >&5
1854 fi
1855 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1856 ac_ext=c
1857 ac_cpp='$CPP $CPPFLAGS'
1858 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1859 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1860 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1861 ac_main_return="return"
1862
1863 GCC_VERSION=none
1864 if test "$GCC" = yes ; then
1865         echo "$as_me:1865: checking version of $CC" >&5
1866 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1867         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.].*//'`"
1868         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1869         echo "$as_me:1869: result: $GCC_VERSION" >&5
1870 echo "${ECHO_T}$GCC_VERSION" >&6
1871 fi
1872
1873 INTEL_COMPILER=no
1874
1875 if test "$GCC" = yes ; then
1876         case "$host_os" in
1877         (linux*|gnu*)
1878                 echo "$as_me:1878: checking if this is really Intel C compiler" >&5
1879 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1880                 cf_save_CFLAGS="$CFLAGS"
1881                 CFLAGS="$CFLAGS -no-gcc"
1882                 cat >"conftest.$ac_ext" <<_ACEOF
1883 #line 1883 "configure"
1884 #include "confdefs.h"
1885
1886 int
1887 main (void)
1888 {
1889
1890 #ifdef __INTEL_COMPILER
1891 #else
1892 make an error
1893 #endif
1894
1895   ;
1896   return 0;
1897 }
1898 _ACEOF
1899 rm -f "conftest.$ac_objext"
1900 if { (eval echo "$as_me:1900: \"$ac_compile\"") >&5
1901   (eval $ac_compile) 2>&5
1902   ac_status=$?
1903   echo "$as_me:1903: \$? = $ac_status" >&5
1904   (exit "$ac_status"); } &&
1905          { ac_try='test -s "conftest.$ac_objext"'
1906   { (eval echo "$as_me:1906: \"$ac_try\"") >&5
1907   (eval $ac_try) 2>&5
1908   ac_status=$?
1909   echo "$as_me:1909: \$? = $ac_status" >&5
1910   (exit "$ac_status"); }; }; then
1911   INTEL_COMPILER=yes
1912 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1913
1914 else
1915   echo "$as_me: failed program was:" >&5
1916 cat "conftest.$ac_ext" >&5
1917 fi
1918 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1919                 CFLAGS="$cf_save_CFLAGS"
1920                 echo "$as_me:1920: result: $INTEL_COMPILER" >&5
1921 echo "${ECHO_T}$INTEL_COMPILER" >&6
1922                 ;;
1923         esac
1924 fi
1925
1926 CLANG_COMPILER=no
1927
1928 if test "$GCC" = yes ; then
1929         echo "$as_me:1929: checking if this is really Clang C compiler" >&5
1930 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1931         cf_save_CFLAGS="$CFLAGS"
1932         cat >"conftest.$ac_ext" <<_ACEOF
1933 #line 1933 "configure"
1934 #include "confdefs.h"
1935
1936 int
1937 main (void)
1938 {
1939
1940 #ifdef __clang__
1941 #else
1942 make an error
1943 #endif
1944
1945   ;
1946   return 0;
1947 }
1948 _ACEOF
1949 rm -f "conftest.$ac_objext"
1950 if { (eval echo "$as_me:1950: \"$ac_compile\"") >&5
1951   (eval $ac_compile) 2>&5
1952   ac_status=$?
1953   echo "$as_me:1953: \$? = $ac_status" >&5
1954   (exit "$ac_status"); } &&
1955          { ac_try='test -s "conftest.$ac_objext"'
1956   { (eval echo "$as_me:1956: \"$ac_try\"") >&5
1957   (eval $ac_try) 2>&5
1958   ac_status=$?
1959   echo "$as_me:1959: \$? = $ac_status" >&5
1960   (exit "$ac_status"); }; }; then
1961   CLANG_COMPILER=yes
1962
1963 else
1964   echo "$as_me: failed program was:" >&5
1965 cat "conftest.$ac_ext" >&5
1966 fi
1967 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1968         CFLAGS="$cf_save_CFLAGS"
1969         echo "$as_me:1969: result: $CLANG_COMPILER" >&5
1970 echo "${ECHO_T}$CLANG_COMPILER" >&6
1971 fi
1972
1973 CLANG_VERSION=none
1974
1975 if test "x$CLANG_COMPILER" = "xyes" ; then
1976         case "$CC" in
1977         (c[1-9][0-9]|*/c[1-9][0-9])
1978                 { echo "$as_me:1978: WARNING: replacing broken compiler alias $CC" >&5
1979 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1980                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1981                 CC=clang
1982                 ;;
1983         esac
1984
1985         echo "$as_me:1985: checking version of $CC" >&5
1986 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1987         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.].*//'`"
1988         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1989         echo "$as_me:1989: result: $CLANG_VERSION" >&5
1990 echo "${ECHO_T}$CLANG_VERSION" >&6
1991
1992         for cf_clang_opt in \
1993                 -Qunused-arguments \
1994                 -Wno-error=implicit-function-declaration
1995         do
1996                 echo "$as_me:1996: checking if option $cf_clang_opt works" >&5
1997 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1998                 cf_save_CFLAGS="$CFLAGS"
1999                 CFLAGS="$CFLAGS $cf_clang_opt"
2000                 cat >"conftest.$ac_ext" <<_ACEOF
2001 #line 2001 "configure"
2002 #include "confdefs.h"
2003
2004                         #include <stdio.h>
2005 int
2006 main (void)
2007 {
2008
2009                         printf("hello!\\n");
2010   ;
2011   return 0;
2012 }
2013 _ACEOF
2014 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2015 if { (eval echo "$as_me:2015: \"$ac_link\"") >&5
2016   (eval $ac_link) 2>&5
2017   ac_status=$?
2018   echo "$as_me:2018: \$? = $ac_status" >&5
2019   (exit "$ac_status"); } &&
2020          { ac_try='test -s "conftest$ac_exeext"'
2021   { (eval echo "$as_me:2021: \"$ac_try\"") >&5
2022   (eval $ac_try) 2>&5
2023   ac_status=$?
2024   echo "$as_me:2024: \$? = $ac_status" >&5
2025   (exit "$ac_status"); }; }; then
2026
2027                         cf_clang_optok=yes
2028 else
2029   echo "$as_me: failed program was:" >&5
2030 cat "conftest.$ac_ext" >&5
2031
2032                         cf_clang_optok=no
2033 fi
2034 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2035                 echo "$as_me:2035: result: $cf_clang_optok" >&5
2036 echo "${ECHO_T}$cf_clang_optok" >&6
2037                 CFLAGS="$cf_save_CFLAGS"
2038                 if test "$cf_clang_optok" = yes; then
2039                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2040
2041 echo "${as_me:-configure}:2041: testing adding option $cf_clang_opt ..." 1>&5
2042
2043         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2044         CFLAGS="${CFLAGS}$cf_clang_opt"
2045
2046                 fi
2047         done
2048 fi
2049
2050 echo "$as_me:2050: checking for $CC option to accept ANSI C" >&5
2051 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2052 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2053   echo $ECHO_N "(cached) $ECHO_C" >&6
2054 else
2055   ac_cv_prog_cc_stdc=no
2056 ac_save_CC=$CC
2057 cat >"conftest.$ac_ext" <<_ACEOF
2058 #line 2058 "configure"
2059 #include "confdefs.h"
2060 #include <stdarg.h>
2061 #include <stdio.h>
2062 #include <sys/types.h>
2063 #include <sys/stat.h>
2064 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2065 struct buf { int x; };
2066 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2067 static char *e (p, i)
2068      char **p;
2069      int i;
2070 {
2071   return p[i];
2072 }
2073 static char *f (char * (*g) (char **, int), char **p, ...)
2074 {
2075   char *s;
2076   va_list v;
2077   va_start (v,p);
2078   s = g (p, va_arg (v,int));
2079   va_end (v);
2080   return s;
2081 }
2082 int test (int i, double x);
2083 struct s1 {int (*f) (int a);};
2084 struct s2 {int (*f) (double a);};
2085 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2086 int argc;
2087 char **argv;
2088 int
2089 main (void)
2090 {
2091 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2092   ;
2093   return 0;
2094 }
2095 _ACEOF
2096 # Don't try gcc -ansi; that turns off useful extensions and
2097 # breaks some systems' header files.
2098 # AIX                   -qlanglvl=ansi
2099 # Ultrix and OSF/1      -std1
2100 # HP-UX 10.20 and later -Ae
2101 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2102 # SVR4                  -Xc -D__EXTENSIONS__
2103 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2104 do
2105   CC="$ac_save_CC $ac_arg"
2106   rm -f "conftest.$ac_objext"
2107 if { (eval echo "$as_me:2107: \"$ac_compile\"") >&5
2108   (eval $ac_compile) 2>&5
2109   ac_status=$?
2110   echo "$as_me:2110: \$? = $ac_status" >&5
2111   (exit "$ac_status"); } &&
2112          { ac_try='test -s "conftest.$ac_objext"'
2113   { (eval echo "$as_me:2113: \"$ac_try\"") >&5
2114   (eval $ac_try) 2>&5
2115   ac_status=$?
2116   echo "$as_me:2116: \$? = $ac_status" >&5
2117   (exit "$ac_status"); }; }; then
2118   ac_cv_prog_cc_stdc=$ac_arg
2119 break
2120 else
2121   echo "$as_me: failed program was:" >&5
2122 cat "conftest.$ac_ext" >&5
2123 fi
2124 rm -f "conftest.$ac_objext"
2125 done
2126 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2127 CC=$ac_save_CC
2128
2129 fi
2130
2131 case "x$ac_cv_prog_cc_stdc" in
2132   x|xno)
2133     echo "$as_me:2133: result: none needed" >&5
2134 echo "${ECHO_T}none needed" >&6 ;;
2135   *)
2136     echo "$as_me:2136: result: $ac_cv_prog_cc_stdc" >&5
2137 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2138     CC="$CC $ac_cv_prog_cc_stdc" ;;
2139 esac
2140
2141 # This should have been defined by AC_PROG_CC
2142 : "${CC:=cc}"
2143
2144 echo "$as_me:2144: checking \$CFLAGS variable" >&5
2145 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2146 case "x$CFLAGS" in
2147 (*-[IUD]*)
2148         echo "$as_me:2148: result: broken" >&5
2149 echo "${ECHO_T}broken" >&6
2150         { echo "$as_me:2150: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2151 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2152         cf_flags="$CFLAGS"
2153         CFLAGS=
2154         for cf_arg in $cf_flags
2155         do
2156
2157 cf_fix_cppflags=no
2158 cf_new_cflags=
2159 cf_new_cppflags=
2160 cf_new_extra_cppflags=
2161
2162 for cf_add_cflags in $cf_arg
2163 do
2164 case "$cf_fix_cppflags" in
2165 (no)
2166         case "$cf_add_cflags" in
2167         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2168                 case "$cf_add_cflags" in
2169                 (-D*)
2170                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2171
2172                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2173                                 && test -z "${cf_tst_cflags}" \
2174                                 && cf_fix_cppflags=yes
2175
2176                         if test "$cf_fix_cppflags" = yes ; then
2177
2178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2180
2181                                 continue
2182                         elif test "${cf_tst_cflags}" = "\"'" ; then
2183
2184         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2185         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2186
2187                                 continue
2188                         fi
2189                         ;;
2190                 esac
2191                 case "$CPPFLAGS" in
2192                 (*$cf_add_cflags)
2193                         ;;
2194                 (*)
2195                         case "$cf_add_cflags" in
2196                         (-D*)
2197                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2198
2199 CPPFLAGS=`echo "$CPPFLAGS" | \
2200         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2201                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2202
2203                                 ;;
2204                         esac
2205
2206         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2207         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2208
2209                         ;;
2210                 esac
2211                 ;;
2212         (*)
2213
2214         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2215         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2216
2217                 ;;
2218         esac
2219         ;;
2220 (yes)
2221
2222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2224
2225         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2226
2227         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2228                 && test -z "${cf_tst_cflags}" \
2229                 && cf_fix_cppflags=no
2230         ;;
2231 esac
2232 done
2233
2234 if test -n "$cf_new_cflags" ; then
2235
2236         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2237         CFLAGS="${CFLAGS}$cf_new_cflags"
2238
2239 fi
2240
2241 if test -n "$cf_new_cppflags" ; then
2242
2243         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2244         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2245
2246 fi
2247
2248 if test -n "$cf_new_extra_cppflags" ; then
2249
2250         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2251         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2252
2253 fi
2254
2255         done
2256         ;;
2257 (*)
2258         echo "$as_me:2258: result: ok" >&5
2259 echo "${ECHO_T}ok" >&6
2260         ;;
2261 esac
2262
2263 echo "$as_me:2263: checking \$CC variable" >&5
2264 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2265 case "$CC" in
2266 (*[\ \  ]-*)
2267         echo "$as_me:2267: result: broken" >&5
2268 echo "${ECHO_T}broken" >&6
2269         { echo "$as_me:2269: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2270 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2271         # humor him...
2272         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2273         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2274         CC="$cf_prog"
2275         for cf_arg in $cf_flags
2276         do
2277                 case "x$cf_arg" in
2278                 (x-[IUDfgOW]*)
2279
2280 cf_fix_cppflags=no
2281 cf_new_cflags=
2282 cf_new_cppflags=
2283 cf_new_extra_cppflags=
2284
2285 for cf_add_cflags in $cf_arg
2286 do
2287 case "$cf_fix_cppflags" in
2288 (no)
2289         case "$cf_add_cflags" in
2290         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2291                 case "$cf_add_cflags" in
2292                 (-D*)
2293                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2294
2295                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2296                                 && test -z "${cf_tst_cflags}" \
2297                                 && cf_fix_cppflags=yes
2298
2299                         if test "$cf_fix_cppflags" = yes ; then
2300
2301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2303
2304                                 continue
2305                         elif test "${cf_tst_cflags}" = "\"'" ; then
2306
2307         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2308         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2309
2310                                 continue
2311                         fi
2312                         ;;
2313                 esac
2314                 case "$CPPFLAGS" in
2315                 (*$cf_add_cflags)
2316                         ;;
2317                 (*)
2318                         case "$cf_add_cflags" in
2319                         (-D*)
2320                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2321
2322 CPPFLAGS=`echo "$CPPFLAGS" | \
2323         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2324                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2325
2326                                 ;;
2327                         esac
2328
2329         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2330         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2331
2332                         ;;
2333                 esac
2334                 ;;
2335         (*)
2336
2337         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2338         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2339
2340                 ;;
2341         esac
2342         ;;
2343 (yes)
2344
2345         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2346         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2347
2348         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2349
2350         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2351                 && test -z "${cf_tst_cflags}" \
2352                 && cf_fix_cppflags=no
2353         ;;
2354 esac
2355 done
2356
2357 if test -n "$cf_new_cflags" ; then
2358
2359         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2360         CFLAGS="${CFLAGS}$cf_new_cflags"
2361
2362 fi
2363
2364 if test -n "$cf_new_cppflags" ; then
2365
2366         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2367         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2368
2369 fi
2370
2371 if test -n "$cf_new_extra_cppflags" ; then
2372
2373         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2374         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2375
2376 fi
2377
2378                         ;;
2379                 (*)
2380                         CC="$CC $cf_arg"
2381                         ;;
2382                 esac
2383         done
2384         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2385
2386 echo "${as_me:-configure}:2386: testing resulting CC: '$CC' ..." 1>&5
2387
2388         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2389
2390 echo "${as_me:-configure}:2390: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2391
2392         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2393
2394 echo "${as_me:-configure}:2394: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2395
2396         ;;
2397 (*)
2398         echo "$as_me:2398: result: ok" >&5
2399 echo "${ECHO_T}ok" >&6
2400         ;;
2401 esac
2402
2403 echo "$as_me:2403: checking for inline" >&5
2404 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2405 if test "${ac_cv_c_inline+set}" = set; then
2406   echo $ECHO_N "(cached) $ECHO_C" >&6
2407 else
2408   ac_cv_c_inline=no
2409 for ac_kw in inline __inline__ __inline; do
2410   cat >"conftest.$ac_ext" <<_ACEOF
2411 #line 2411 "configure"
2412 #include "confdefs.h"
2413 #ifndef __cplusplus
2414 static $ac_kw int static_foo () {return 0; }
2415 $ac_kw int foo () {return 0; }
2416 #endif
2417
2418 _ACEOF
2419 rm -f "conftest.$ac_objext"
2420 if { (eval echo "$as_me:2420: \"$ac_compile\"") >&5
2421   (eval $ac_compile) 2>&5
2422   ac_status=$?
2423   echo "$as_me:2423: \$? = $ac_status" >&5
2424   (exit "$ac_status"); } &&
2425          { ac_try='test -s "conftest.$ac_objext"'
2426   { (eval echo "$as_me:2426: \"$ac_try\"") >&5
2427   (eval $ac_try) 2>&5
2428   ac_status=$?
2429   echo "$as_me:2429: \$? = $ac_status" >&5
2430   (exit "$ac_status"); }; }; then
2431   ac_cv_c_inline=$ac_kw; break
2432 else
2433   echo "$as_me: failed program was:" >&5
2434 cat "conftest.$ac_ext" >&5
2435 fi
2436 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2437 done
2438
2439 fi
2440 echo "$as_me:2440: result: $ac_cv_c_inline" >&5
2441 echo "${ECHO_T}$ac_cv_c_inline" >&6
2442 case $ac_cv_c_inline in
2443   inline | yes) ;;
2444   no)
2445 cat >>confdefs.h <<\EOF
2446 #define inline
2447 EOF
2448  ;;
2449   *)  cat >>confdefs.h <<EOF
2450 #define inline $ac_cv_c_inline
2451 EOF
2452  ;;
2453 esac
2454
2455 for ac_prog in ggrep grep
2456 do
2457   # Extract the first word of "$ac_prog", so it can be a program name with args.
2458 set dummy $ac_prog; ac_word=$2
2459 echo "$as_me:2459: checking for $ac_word" >&5
2460 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2461 if test "${ac_cv_prog_GREP+set}" = set; then
2462   echo $ECHO_N "(cached) $ECHO_C" >&6
2463 else
2464   if test -n "$GREP"; then
2465   ac_cv_prog_GREP="$GREP" # Let the user override the test.
2466 else
2467   ac_save_IFS=$IFS; IFS=$ac_path_separator
2468 ac_dummy="$PATH"
2469 for ac_dir in $ac_dummy; do
2470   IFS=$ac_save_IFS
2471   test -z "$ac_dir" && ac_dir=.
2472   $as_executable_p "$ac_dir/$ac_word" || continue
2473 ac_cv_prog_GREP="$ac_prog"
2474 echo "$as_me:2474: found $ac_dir/$ac_word" >&5
2475 break
2476 done
2477
2478 fi
2479 fi
2480 GREP=$ac_cv_prog_GREP
2481 if test -n "$GREP"; then
2482   echo "$as_me:2482: result: $GREP" >&5
2483 echo "${ECHO_T}$GREP" >&6
2484 else
2485   echo "$as_me:2485: result: no" >&5
2486 echo "${ECHO_T}no" >&6
2487 fi
2488
2489   test -n "$GREP" && break
2490 done
2491 test -n "$GREP" || GREP=": "
2492
2493 echo "$as_me:2493: checking for egrep" >&5
2494 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2495 if test "${ac_cv_path_EGREP+set}" = set; then
2496   echo $ECHO_N "(cached) $ECHO_C" >&6
2497 else
2498   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2499    then ac_cv_path_EGREP="$GREP -E"
2500    else
2501      for ac_prog in gegrep egrep
2502 do
2503   # Extract the first word of "$ac_prog", so it can be a program name with args.
2504 set dummy $ac_prog; ac_word=$2
2505 echo "$as_me:2505: checking for $ac_word" >&5
2506 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2507 if test "${ac_cv_path_EGREP+set}" = set; then
2508   echo $ECHO_N "(cached) $ECHO_C" >&6
2509 else
2510   case $EGREP in
2511   [\\/]* | ?:[\\/]*)
2512   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2513   ;;
2514   *)
2515   ac_save_IFS=$IFS; IFS=$ac_path_separator
2516 ac_dummy="$PATH"
2517 for ac_dir in $ac_dummy; do
2518   IFS=$ac_save_IFS
2519   test -z "$ac_dir" && ac_dir=.
2520   if $as_executable_p "$ac_dir/$ac_word"; then
2521    ac_cv_path_EGREP="$ac_dir/$ac_word"
2522    echo "$as_me:2522: found $ac_dir/$ac_word" >&5
2523    break
2524 fi
2525 done
2526
2527   ;;
2528 esac
2529 fi
2530 EGREP=$ac_cv_path_EGREP
2531
2532 if test -n "$EGREP"; then
2533   echo "$as_me:2533: result: $EGREP" >&5
2534 echo "${ECHO_T}$EGREP" >&6
2535 else
2536   echo "$as_me:2536: result: no" >&5
2537 echo "${ECHO_T}no" >&6
2538 fi
2539
2540   test -n "$EGREP" && break
2541 done
2542 test -n "$EGREP" || EGREP=": "
2543
2544      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2544: error: cannot find workable egrep" >&5
2545 echo "$as_me: error: cannot find workable egrep" >&2;}
2546    { (exit 1); exit 1; }; }
2547    fi
2548 fi
2549 echo "$as_me:2549: result: $ac_cv_path_EGREP" >&5
2550 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2551  EGREP="$ac_cv_path_EGREP"
2552
2553 ac_ext=c
2554 ac_cpp='$CPP $CPPFLAGS'
2555 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2556 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2557 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2558 ac_main_return="return"
2559 echo "$as_me:2559: checking how to run the C preprocessor" >&5
2560 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2561 # On Suns, sometimes $CPP names a directory.
2562 if test -n "$CPP" && test -d "$CPP"; then
2563   CPP=
2564 fi
2565 if test -z "$CPP"; then
2566   if test "${ac_cv_prog_CPP+set}" = set; then
2567   echo $ECHO_N "(cached) $ECHO_C" >&6
2568 else
2569       # Double quotes because CPP needs to be expanded
2570     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2571     do
2572       ac_preproc_ok=false
2573 for ac_c_preproc_warn_flag in '' yes
2574 do
2575   # Use a header file that comes with gcc, so configuring glibc
2576   # with a fresh cross-compiler works.
2577   # On the NeXT, cc -E runs the code through the compiler's parser,
2578   # not just through cpp. "Syntax error" is here to catch this case.
2579   cat >"conftest.$ac_ext" <<_ACEOF
2580 #line 2580 "configure"
2581 #include "confdefs.h"
2582 #include <assert.h>
2583                      Syntax error
2584 _ACEOF
2585 if { (eval echo "$as_me:2585: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2586   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2587   ac_status=$?
2588   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2589   rm -f conftest.er1
2590   cat conftest.err >&5
2591   echo "$as_me:2591: \$? = $ac_status" >&5
2592   (exit "$ac_status"); } >/dev/null; then
2593   if test -s conftest.err; then
2594     ac_cpp_err=$ac_c_preproc_warn_flag
2595   else
2596     ac_cpp_err=
2597   fi
2598 else
2599   ac_cpp_err=yes
2600 fi
2601 if test -z "$ac_cpp_err"; then
2602   :
2603 else
2604   echo "$as_me: failed program was:" >&5
2605   cat "conftest.$ac_ext" >&5
2606   # Broken: fails on valid input.
2607 continue
2608 fi
2609 rm -f conftest.err "conftest.$ac_ext"
2610
2611   # OK, works on sane cases.  Now check whether non-existent headers
2612   # can be detected and how.
2613   cat >"conftest.$ac_ext" <<_ACEOF
2614 #line 2614 "configure"
2615 #include "confdefs.h"
2616 #include <ac_nonexistent.h>
2617 _ACEOF
2618 if { (eval echo "$as_me:2618: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2619   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2620   ac_status=$?
2621   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2622   rm -f conftest.er1
2623   cat conftest.err >&5
2624   echo "$as_me:2624: \$? = $ac_status" >&5
2625   (exit "$ac_status"); } >/dev/null; then
2626   if test -s conftest.err; then
2627     ac_cpp_err=$ac_c_preproc_warn_flag
2628   else
2629     ac_cpp_err=
2630   fi
2631 else
2632   ac_cpp_err=yes
2633 fi
2634 if test -z "$ac_cpp_err"; then
2635   # Broken: success on invalid input.
2636 continue
2637 else
2638   echo "$as_me: failed program was:" >&5
2639   cat "conftest.$ac_ext" >&5
2640   # Passes both tests.
2641 ac_preproc_ok=:
2642 break
2643 fi
2644 rm -f conftest.err "conftest.$ac_ext"
2645
2646 done
2647 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2648 rm -f conftest.err "conftest.$ac_ext"
2649 if $ac_preproc_ok; then
2650   break
2651 fi
2652
2653     done
2654     ac_cv_prog_CPP=$CPP
2655
2656 fi
2657   CPP=$ac_cv_prog_CPP
2658 else
2659   ac_cv_prog_CPP=$CPP
2660 fi
2661 echo "$as_me:2661: result: $CPP" >&5
2662 echo "${ECHO_T}$CPP" >&6
2663 ac_preproc_ok=false
2664 for ac_c_preproc_warn_flag in '' yes
2665 do
2666   # Use a header file that comes with gcc, so configuring glibc
2667   # with a fresh cross-compiler works.
2668   # On the NeXT, cc -E runs the code through the compiler's parser,
2669   # not just through cpp. "Syntax error" is here to catch this case.
2670   cat >"conftest.$ac_ext" <<_ACEOF
2671 #line 2671 "configure"
2672 #include "confdefs.h"
2673 #include <assert.h>
2674                      Syntax error
2675 _ACEOF
2676 if { (eval echo "$as_me:2676: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2677   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2678   ac_status=$?
2679   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2680   rm -f conftest.er1
2681   cat conftest.err >&5
2682   echo "$as_me:2682: \$? = $ac_status" >&5
2683   (exit "$ac_status"); } >/dev/null; then
2684   if test -s conftest.err; then
2685     ac_cpp_err=$ac_c_preproc_warn_flag
2686   else
2687     ac_cpp_err=
2688   fi
2689 else
2690   ac_cpp_err=yes
2691 fi
2692 if test -z "$ac_cpp_err"; then
2693   :
2694 else
2695   echo "$as_me: failed program was:" >&5
2696   cat "conftest.$ac_ext" >&5
2697   # Broken: fails on valid input.
2698 continue
2699 fi
2700 rm -f conftest.err "conftest.$ac_ext"
2701
2702   # OK, works on sane cases.  Now check whether non-existent headers
2703   # can be detected and how.
2704   cat >"conftest.$ac_ext" <<_ACEOF
2705 #line 2705 "configure"
2706 #include "confdefs.h"
2707 #include <ac_nonexistent.h>
2708 _ACEOF
2709 if { (eval echo "$as_me:2709: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2710   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2711   ac_status=$?
2712   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2713   rm -f conftest.er1
2714   cat conftest.err >&5
2715   echo "$as_me:2715: \$? = $ac_status" >&5
2716   (exit "$ac_status"); } >/dev/null; then
2717   if test -s conftest.err; then
2718     ac_cpp_err=$ac_c_preproc_warn_flag
2719   else
2720     ac_cpp_err=
2721   fi
2722 else
2723   ac_cpp_err=yes
2724 fi
2725 if test -z "$ac_cpp_err"; then
2726   # Broken: success on invalid input.
2727 continue
2728 else
2729   echo "$as_me: failed program was:" >&5
2730   cat "conftest.$ac_ext" >&5
2731   # Passes both tests.
2732 ac_preproc_ok=:
2733 break
2734 fi
2735 rm -f conftest.err "conftest.$ac_ext"
2736
2737 done
2738 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2739 rm -f conftest.err "conftest.$ac_ext"
2740 if $ac_preproc_ok; then
2741   :
2742 else
2743   { { echo "$as_me:2743: error: C preprocessor \"$CPP\" fails sanity check" >&5
2744 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2745    { (exit 1); exit 1; }; }
2746 fi
2747
2748 ac_ext=c
2749 ac_cpp='$CPP $CPPFLAGS'
2750 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2751 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2752 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2753 ac_main_return="return"
2754
2755 for ac_prog in mawk gawk nawk awk
2756 do
2757   # Extract the first word of "$ac_prog", so it can be a program name with args.
2758 set dummy $ac_prog; ac_word=$2
2759 echo "$as_me:2759: checking for $ac_word" >&5
2760 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2761 if test "${ac_cv_prog_AWK+set}" = set; then
2762   echo $ECHO_N "(cached) $ECHO_C" >&6
2763 else
2764   if test -n "$AWK"; then
2765   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2766 else
2767   ac_save_IFS=$IFS; IFS=$ac_path_separator
2768 ac_dummy="$PATH"
2769 for ac_dir in $ac_dummy; do
2770   IFS=$ac_save_IFS
2771   test -z "$ac_dir" && ac_dir=.
2772   $as_executable_p "$ac_dir/$ac_word" || continue
2773 ac_cv_prog_AWK="$ac_prog"
2774 echo "$as_me:2774: found $ac_dir/$ac_word" >&5
2775 break
2776 done
2777
2778 fi
2779 fi
2780 AWK=$ac_cv_prog_AWK
2781 if test -n "$AWK"; then
2782   echo "$as_me:2782: result: $AWK" >&5
2783 echo "${ECHO_T}$AWK" >&6
2784 else
2785   echo "$as_me:2785: result: no" >&5
2786 echo "${ECHO_T}no" >&6
2787 fi
2788
2789   test -n "$AWK" && break
2790 done
2791
2792 # Find a good install program.  We prefer a C program (faster),
2793 # so one script is as good as another.  But avoid the broken or
2794 # incompatible versions:
2795 # SysV /etc/install, /usr/sbin/install
2796 # SunOS /usr/etc/install
2797 # IRIX /sbin/install
2798 # AIX /bin/install
2799 # AmigaOS /C/install, which installs bootblocks on floppy discs
2800 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2801 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2802 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2803 # ./install, which can be erroneously created by make from ./install.sh.
2804 echo "$as_me:2804: checking for a BSD compatible install" >&5
2805 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2806 if test -z "$INSTALL"; then
2807 if test "${ac_cv_path_install+set}" = set; then
2808   echo $ECHO_N "(cached) $ECHO_C" >&6
2809 else
2810     ac_save_IFS=$IFS; IFS=$ac_path_separator
2811   for ac_dir in $PATH; do
2812     IFS=$ac_save_IFS
2813     # Account for people who put trailing slashes in PATH elements.
2814     case $ac_dir/ in
2815     / | ./ | .// | /cC/* \
2816     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2817     | /usr/ucb/* ) ;;
2818     *)
2819       # OSF1 and SCO ODT 3.0 have their own names for install.
2820       # Don't use installbsd from OSF since it installs stuff as root
2821       # by default.
2822       for ac_prog in ginstall scoinst install; do
2823         if $as_executable_p "$ac_dir/$ac_prog"; then
2824           if test $ac_prog = install &&
2825             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2826             # AIX install.  It has an incompatible calling convention.
2827             :
2828           elif test $ac_prog = install &&
2829             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2830             # program-specific install script used by HP pwplus--don't use.
2831             :
2832           else
2833             ac_cv_path_install="$ac_dir/$ac_prog -c"
2834             break 2
2835           fi
2836         fi
2837       done
2838       ;;
2839     esac
2840   done
2841
2842 fi
2843   if test "${ac_cv_path_install+set}" = set; then
2844     INSTALL=$ac_cv_path_install
2845   else
2846     # As a last resort, use the slow shell script.  We don't cache a
2847     # path for INSTALL within a source directory, because that will
2848     # break other packages using the cache if that directory is
2849     # removed, or if the path is relative.
2850     INSTALL=$ac_install_sh
2851   fi
2852 fi
2853 echo "$as_me:2853: result: $INSTALL" >&5
2854 echo "${ECHO_T}$INSTALL" >&6
2855
2856 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2857 # It thinks the first close brace ends the variable substitution.
2858 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2859
2860 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2861
2862 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2863
2864 case $INSTALL in
2865 (/*)
2866         ;;
2867 (*)
2868         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2869         test -z "$cf_dir" && cf_dir=.
2870         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2871         ;;
2872 esac
2873
2874 echo "$as_me:2874: checking if you want to install stripped executables" >&5
2875 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2876
2877 # Check whether --enable-stripping or --disable-stripping was given.
2878 if test "${enable_stripping+set}" = set; then
2879   enableval="$enable_stripping"
2880   test "$enableval" != no && enableval=yes
2881         if test "$enableval" != "yes" ; then
2882     enable_stripping=no
2883         else
2884                 enable_stripping=yes
2885         fi
2886 else
2887   enableval=yes
2888         enable_stripping=yes
2889
2890 fi;
2891 echo "$as_me:2891: result: $enable_stripping" >&5
2892 echo "${ECHO_T}$enable_stripping" >&6
2893
2894 if test "$enable_stripping" = yes
2895 then
2896         INSTALL_OPT_S="-s"
2897 else
2898         INSTALL_OPT_S=
2899 fi
2900
2901 : "${INSTALL:=install}"
2902 echo "$as_me:2902: checking if install accepts -p option" >&5
2903 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2904 if test "${cf_cv_install_p+set}" = set; then
2905   echo $ECHO_N "(cached) $ECHO_C" >&6
2906 else
2907
2908         rm -rf ./conftest*
2909         date >conftest.in
2910         mkdir conftest.out
2911         sleep 3
2912         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2913         then
2914                 if test -f conftest.out/conftest.in
2915                 then
2916                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2917                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2918                         if test -s conftest.err
2919                         then
2920                                 cf_cv_install_p=no
2921                         else
2922                                 cf_cv_install_p=yes
2923                         fi
2924                 else
2925                         cf_cv_install_p=no
2926                 fi
2927         else
2928                 cf_cv_install_p=no
2929         fi
2930         rm -rf ./conftest*
2931
2932 fi
2933 echo "$as_me:2933: result: $cf_cv_install_p" >&5
2934 echo "${ECHO_T}$cf_cv_install_p" >&6
2935
2936 echo "$as_me:2936: checking if install needs to be told about ownership" >&5
2937 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2938 case `$ac_config_guess` in
2939 (*minix)
2940         with_install_o=yes
2941         ;;
2942 (*)
2943         with_install_o=no
2944         ;;
2945 esac
2946
2947 echo "$as_me:2947: result: $with_install_o" >&5
2948 echo "${ECHO_T}$with_install_o" >&6
2949 if test "x$with_install_o" = xyes
2950 then
2951         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'`"
2952 else
2953         INSTALL_OPT_O=
2954 fi
2955
2956 for ac_prog in lint cppcheck splint
2957 do
2958   # Extract the first word of "$ac_prog", so it can be a program name with args.
2959 set dummy $ac_prog; ac_word=$2
2960 echo "$as_me:2960: checking for $ac_word" >&5
2961 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2962 if test "${ac_cv_prog_LINT+set}" = set; then
2963   echo $ECHO_N "(cached) $ECHO_C" >&6
2964 else
2965   if test -n "$LINT"; then
2966   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2967 else
2968   ac_save_IFS=$IFS; IFS=$ac_path_separator
2969 ac_dummy="$PATH"
2970 for ac_dir in $ac_dummy; do
2971   IFS=$ac_save_IFS
2972   test -z "$ac_dir" && ac_dir=.
2973   $as_executable_p "$ac_dir/$ac_word" || continue
2974 ac_cv_prog_LINT="$ac_prog"
2975 echo "$as_me:2975: found $ac_dir/$ac_word" >&5
2976 break
2977 done
2978
2979 fi
2980 fi
2981 LINT=$ac_cv_prog_LINT
2982 if test -n "$LINT"; then
2983   echo "$as_me:2983: result: $LINT" >&5
2984 echo "${ECHO_T}$LINT" >&6
2985 else
2986   echo "$as_me:2986: result: no" >&5
2987 echo "${ECHO_T}no" >&6
2988 fi
2989
2990   test -n "$LINT" && break
2991 done
2992
2993 case "x$LINT" in
2994 (xcppcheck|x*/cppcheck)
2995         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2996         ;;
2997 esac
2998
2999 echo "$as_me:2999: checking if filesystem supports mixed-case filenames" >&5
3000 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3001 if test "${cf_cv_mixedcase+set}" = set; then
3002   echo $ECHO_N "(cached) $ECHO_C" >&6
3003 else
3004
3005 if test "$cross_compiling" = yes ; then
3006         case "$target_alias" in
3007         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3008                 cf_cv_mixedcase=no
3009                 ;;
3010         (*)
3011                 cf_cv_mixedcase=yes
3012                 ;;
3013         esac
3014 else
3015         rm -f conftest CONFTEST
3016         echo test >conftest
3017         if test -f CONFTEST ; then
3018                 cf_cv_mixedcase=no
3019         else
3020                 cf_cv_mixedcase=yes
3021         fi
3022         rm -f conftest CONFTEST
3023 fi
3024
3025 fi
3026 echo "$as_me:3026: result: $cf_cv_mixedcase" >&5
3027 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3028 test "$cf_cv_mixedcase" = yes &&
3029 cat >>confdefs.h <<\EOF
3030 #define MIXEDCASE_FILENAMES 1
3031 EOF
3032
3033 for ac_prog in exctags ctags
3034 do
3035   # Extract the first word of "$ac_prog", so it can be a program name with args.
3036 set dummy $ac_prog; ac_word=$2
3037 echo "$as_me:3037: checking for $ac_word" >&5
3038 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3039 if test "${ac_cv_prog_CTAGS+set}" = set; then
3040   echo $ECHO_N "(cached) $ECHO_C" >&6
3041 else
3042   if test -n "$CTAGS"; then
3043   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3044 else
3045   ac_save_IFS=$IFS; IFS=$ac_path_separator
3046 ac_dummy="$PATH"
3047 for ac_dir in $ac_dummy; do
3048   IFS=$ac_save_IFS
3049   test -z "$ac_dir" && ac_dir=.
3050   $as_executable_p "$ac_dir/$ac_word" || continue
3051 ac_cv_prog_CTAGS="$ac_prog"
3052 echo "$as_me:3052: found $ac_dir/$ac_word" >&5
3053 break
3054 done
3055
3056 fi
3057 fi
3058 CTAGS=$ac_cv_prog_CTAGS
3059 if test -n "$CTAGS"; then
3060   echo "$as_me:3060: result: $CTAGS" >&5
3061 echo "${ECHO_T}$CTAGS" >&6
3062 else
3063   echo "$as_me:3063: result: no" >&5
3064 echo "${ECHO_T}no" >&6
3065 fi
3066
3067   test -n "$CTAGS" && break
3068 done
3069
3070 for ac_prog in exetags etags
3071 do
3072   # Extract the first word of "$ac_prog", so it can be a program name with args.
3073 set dummy $ac_prog; ac_word=$2
3074 echo "$as_me:3074: checking for $ac_word" >&5
3075 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3076 if test "${ac_cv_prog_ETAGS+set}" = set; then
3077   echo $ECHO_N "(cached) $ECHO_C" >&6
3078 else
3079   if test -n "$ETAGS"; then
3080   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3081 else
3082   ac_save_IFS=$IFS; IFS=$ac_path_separator
3083 ac_dummy="$PATH"
3084 for ac_dir in $ac_dummy; do
3085   IFS=$ac_save_IFS
3086   test -z "$ac_dir" && ac_dir=.
3087   $as_executable_p "$ac_dir/$ac_word" || continue
3088 ac_cv_prog_ETAGS="$ac_prog"
3089 echo "$as_me:3089: found $ac_dir/$ac_word" >&5
3090 break
3091 done
3092
3093 fi
3094 fi
3095 ETAGS=$ac_cv_prog_ETAGS
3096 if test -n "$ETAGS"; then
3097   echo "$as_me:3097: result: $ETAGS" >&5
3098 echo "${ECHO_T}$ETAGS" >&6
3099 else
3100   echo "$as_me:3100: result: no" >&5
3101 echo "${ECHO_T}no" >&6
3102 fi
3103
3104   test -n "$ETAGS" && break
3105 done
3106
3107 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3108 set dummy ${CTAGS:-ctags}; ac_word=$2
3109 echo "$as_me:3109: checking for $ac_word" >&5
3110 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3111 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3112   echo $ECHO_N "(cached) $ECHO_C" >&6
3113 else
3114   if test -n "$MAKE_LOWER_TAGS"; then
3115   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3116 else
3117   ac_save_IFS=$IFS; IFS=$ac_path_separator
3118 ac_dummy="$PATH"
3119 for ac_dir in $ac_dummy; do
3120   IFS=$ac_save_IFS
3121   test -z "$ac_dir" && ac_dir=.
3122   $as_executable_p "$ac_dir/$ac_word" || continue
3123 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3124 echo "$as_me:3124: found $ac_dir/$ac_word" >&5
3125 break
3126 done
3127
3128   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3129 fi
3130 fi
3131 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3132 if test -n "$MAKE_LOWER_TAGS"; then
3133   echo "$as_me:3133: result: $MAKE_LOWER_TAGS" >&5
3134 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3135 else
3136   echo "$as_me:3136: result: no" >&5
3137 echo "${ECHO_T}no" >&6
3138 fi
3139
3140 if test "$cf_cv_mixedcase" = yes ; then
3141         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3142 set dummy ${ETAGS:-etags}; ac_word=$2
3143 echo "$as_me:3143: checking for $ac_word" >&5
3144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3145 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3146   echo $ECHO_N "(cached) $ECHO_C" >&6
3147 else
3148   if test -n "$MAKE_UPPER_TAGS"; then
3149   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3150 else
3151   ac_save_IFS=$IFS; IFS=$ac_path_separator
3152 ac_dummy="$PATH"
3153 for ac_dir in $ac_dummy; do
3154   IFS=$ac_save_IFS
3155   test -z "$ac_dir" && ac_dir=.
3156   $as_executable_p "$ac_dir/$ac_word" || continue
3157 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3158 echo "$as_me:3158: found $ac_dir/$ac_word" >&5
3159 break
3160 done
3161
3162   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3163 fi
3164 fi
3165 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3166 if test -n "$MAKE_UPPER_TAGS"; then
3167   echo "$as_me:3167: result: $MAKE_UPPER_TAGS" >&5
3168 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3169 else
3170   echo "$as_me:3170: result: no" >&5
3171 echo "${ECHO_T}no" >&6
3172 fi
3173
3174 else
3175         MAKE_UPPER_TAGS=no
3176 fi
3177
3178 if test "$MAKE_UPPER_TAGS" = yes ; then
3179         MAKE_UPPER_TAGS=
3180 else
3181         MAKE_UPPER_TAGS="#"
3182 fi
3183
3184 if test "$MAKE_LOWER_TAGS" = yes ; then
3185         MAKE_LOWER_TAGS=
3186 else
3187         MAKE_LOWER_TAGS="#"
3188 fi
3189
3190 echo "$as_me:3190: checking if -lm needed for math functions" >&5
3191 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3192 if test "${cf_cv_need_libm+set}" = set; then
3193   echo $ECHO_N "(cached) $ECHO_C" >&6
3194 else
3195
3196         cat >"conftest.$ac_ext" <<_ACEOF
3197 #line 3197 "configure"
3198 #include "confdefs.h"
3199
3200         #include <stdio.h>
3201         #include <stdlib.h>
3202         #include <math.h>
3203
3204 int
3205 main (void)
3206 {
3207 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3208   ;
3209   return 0;
3210 }
3211 _ACEOF
3212 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3213 if { (eval echo "$as_me:3213: \"$ac_link\"") >&5
3214   (eval $ac_link) 2>&5
3215   ac_status=$?
3216   echo "$as_me:3216: \$? = $ac_status" >&5
3217   (exit "$ac_status"); } &&
3218          { ac_try='test -s "conftest$ac_exeext"'
3219   { (eval echo "$as_me:3219: \"$ac_try\"") >&5
3220   (eval $ac_try) 2>&5
3221   ac_status=$?
3222   echo "$as_me:3222: \$? = $ac_status" >&5
3223   (exit "$ac_status"); }; }; then
3224   cf_cv_need_libm=no
3225 else
3226   echo "$as_me: failed program was:" >&5
3227 cat "conftest.$ac_ext" >&5
3228 cf_cv_need_libm=yes
3229 fi
3230 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3231 fi
3232 echo "$as_me:3232: result: $cf_cv_need_libm" >&5
3233 echo "${ECHO_T}$cf_cv_need_libm" >&6
3234 if test "$cf_cv_need_libm" = yes
3235 then
3236 MATH_LIB=-lm
3237 fi
3238
3239 top_builddir=`pwd`
3240
3241 CC_G_OPT="-g"
3242 CC_SHARED_OPTS=unknown
3243 CPPFLAGS="$CPPFLAGS"
3244 DFT_DEP_SUFFIX=""
3245 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3246 DFT_UPR_MODEL="NORMAL"
3247 LD="ld"
3248 LDFLAGS_SHARED=""
3249 LDFLAGS_STATIC=""
3250 LD_MODEL=""
3251 LD_SHARED_OPTS=""
3252 LIBTOOL=""
3253 LIBTOOL_OPTS=""
3254 LIB_CLEAN=""
3255 LIB_COMPILE=""
3256 LIB_LINK='${CC}'
3257 LINK_TESTS=""
3258 LOCAL_LDFLAGS=""
3259 PACKAGE="ncurses-examples"
3260 PTHREAD="-lm"
3261 TEST_ARGS=""
3262 TEST_DEPS=""
3263 TEST_LIBS=""
3264 TINFO_LDFLAGS=''
3265 TINFO_LIBS='$(LIBS_CURSES)'
3266 cf_cv_abi_version=""
3267 cf_cv_rel_version=""
3268 includesubdir=""
3269
3270 cf_cv_screen=curses
3271 cf_cv_libtype=
3272
3273 echo "$as_me:3273: checking for fgrep" >&5
3274 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3275 if test "${ac_cv_path_FGREP+set}" = set; then
3276   echo $ECHO_N "(cached) $ECHO_C" >&6
3277 else
3278   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3279    then ac_cv_path_FGREP="$GREP -F"
3280    else
3281      for ac_prog in gfgrep fgrep
3282 do
3283   # Extract the first word of "$ac_prog", so it can be a program name with args.
3284 set dummy $ac_prog; ac_word=$2
3285 echo "$as_me:3285: checking for $ac_word" >&5
3286 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3287 if test "${ac_cv_path_FGREP+set}" = set; then
3288   echo $ECHO_N "(cached) $ECHO_C" >&6
3289 else
3290   case $FGREP in
3291   [\\/]* | ?:[\\/]*)
3292   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3293   ;;
3294   *)
3295   ac_save_IFS=$IFS; IFS=$ac_path_separator
3296 ac_dummy="$PATH"
3297 for ac_dir in $ac_dummy; do
3298   IFS=$ac_save_IFS
3299   test -z "$ac_dir" && ac_dir=.
3300   if $as_executable_p "$ac_dir/$ac_word"; then
3301    ac_cv_path_FGREP="$ac_dir/$ac_word"
3302    echo "$as_me:3302: found $ac_dir/$ac_word" >&5
3303    break
3304 fi
3305 done
3306
3307   ;;
3308 esac
3309 fi
3310 FGREP=$ac_cv_path_FGREP
3311
3312 if test -n "$FGREP"; then
3313   echo "$as_me:3313: result: $FGREP" >&5
3314 echo "${ECHO_T}$FGREP" >&6
3315 else
3316   echo "$as_me:3316: result: no" >&5
3317 echo "${ECHO_T}no" >&6
3318 fi
3319
3320   test -n "$FGREP" && break
3321 done
3322 test -n "$FGREP" || FGREP=": "
3323
3324      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3324: error: cannot find workable fgrep" >&5
3325 echo "$as_me: error: cannot find workable fgrep" >&2;}
3326    { (exit 1); exit 1; }; }
3327    fi
3328 fi
3329 echo "$as_me:3329: result: $ac_cv_path_FGREP" >&5
3330 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3331  FGREP="$ac_cv_path_FGREP"
3332
3333 echo "$as_me:3333: checking for C11 _Noreturn feature" >&5
3334 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3335 if test "${cf_cv_c11_noreturn+set}" = set; then
3336   echo $ECHO_N "(cached) $ECHO_C" >&6
3337 else
3338   cat >"conftest.$ac_ext" <<_ACEOF
3339 #line 3339 "configure"
3340 #include "confdefs.h"
3341
3342 #include <stdio.h>
3343 #include <stdlib.h>
3344 #include <stdnoreturn.h>
3345 static void giveup(void) { exit(0); }
3346
3347 int
3348 main (void)
3349 {
3350 if (feof(stdin)) giveup()
3351   ;
3352   return 0;
3353 }
3354 _ACEOF
3355 rm -f "conftest.$ac_objext"
3356 if { (eval echo "$as_me:3356: \"$ac_compile\"") >&5
3357   (eval $ac_compile) 2>&5
3358   ac_status=$?
3359   echo "$as_me:3359: \$? = $ac_status" >&5
3360   (exit "$ac_status"); } &&
3361          { ac_try='test -s "conftest.$ac_objext"'
3362   { (eval echo "$as_me:3362: \"$ac_try\"") >&5
3363   (eval $ac_try) 2>&5
3364   ac_status=$?
3365   echo "$as_me:3365: \$? = $ac_status" >&5
3366   (exit "$ac_status"); }; }; then
3367   cf_cv_c11_noreturn=yes
3368 else
3369   echo "$as_me: failed program was:" >&5
3370 cat "conftest.$ac_ext" >&5
3371 cf_cv_c11_noreturn=no
3372 fi
3373 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3374
3375 fi
3376 echo "$as_me:3376: result: $cf_cv_c11_noreturn" >&5
3377 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3378
3379 if test "$cf_cv_c11_noreturn" = yes; then
3380         cat >>confdefs.h <<\EOF
3381 #define HAVE_STDNORETURN_H 1
3382 EOF
3383
3384 cat >>confdefs.h <<EOF
3385 #define STDC_NORETURN _Noreturn
3386 EOF
3387
3388         HAVE_STDNORETURN_H=1
3389 else
3390         HAVE_STDNORETURN_H=0
3391 fi
3392
3393 if test "$GCC" = yes || test "$GXX" = yes
3394 then
3395 cat > conftest.i <<EOF
3396 #ifndef GCC_PRINTF
3397 #define GCC_PRINTF 0
3398 #endif
3399 #ifndef GCC_SCANF
3400 #define GCC_SCANF 0
3401 #endif
3402 #ifndef GCC_NORETURN
3403 #define GCC_NORETURN /* nothing */
3404 #endif
3405 #ifndef GCC_UNUSED
3406 #define GCC_UNUSED /* nothing */
3407 #endif
3408 EOF
3409 if test "$GCC" = yes
3410 then
3411         { echo "$as_me:3411: checking for $CC __attribute__ directives..." >&5
3412 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3413 cat > "conftest.$ac_ext" <<EOF
3414 #line 3414 "${as_me:-configure}"
3415 #include "confdefs.h"
3416 #include "conftest.h"
3417 #include "conftest.i"
3418 #if     GCC_PRINTF
3419 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3420 #else
3421 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3422 #endif
3423 #if     GCC_SCANF
3424 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3425 #else
3426 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3427 #endif
3428 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3429 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3430 extern GCC_NORETURN void foo(void);
3431 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3432 EOF
3433         cf_printf_attribute=no
3434         cf_scanf_attribute=no
3435         for cf_attribute in scanf printf unused noreturn
3436         do
3437
3438 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3439
3440                 cf_directive="__attribute__(($cf_attribute))"
3441                 echo "checking for $CC $cf_directive" 1>&5
3442
3443                 case "$cf_attribute" in
3444                 (printf)
3445                         cf_printf_attribute=yes
3446                         cat >conftest.h <<EOF
3447 #define GCC_$cf_ATTRIBUTE 1
3448 EOF
3449                         ;;
3450                 (scanf)
3451                         cf_scanf_attribute=yes
3452                         cat >conftest.h <<EOF
3453 #define GCC_$cf_ATTRIBUTE 1
3454 EOF
3455                         ;;
3456                 (*)
3457                         cat >conftest.h <<EOF
3458 #define GCC_$cf_ATTRIBUTE $cf_directive
3459 EOF
3460                         ;;
3461                 esac
3462
3463                 if { (eval echo "$as_me:3463: \"$ac_compile\"") >&5
3464   (eval $ac_compile) 2>&5
3465   ac_status=$?
3466   echo "$as_me:3466: \$? = $ac_status" >&5
3467   (exit "$ac_status"); }; then
3468                         test -n "$verbose" && echo "$as_me:3468: result: ... $cf_attribute" >&5
3469 echo "${ECHO_T}... $cf_attribute" >&6
3470                         cat conftest.h >>confdefs.h
3471                         case "$cf_attribute" in
3472                         (noreturn)
3473
3474 cat >>confdefs.h <<EOF
3475 #define GCC_NORETURN $cf_directive
3476 EOF
3477
3478                                 ;;
3479                         (printf)
3480                                 cf_value='/* nothing */'
3481                                 if test "$cf_printf_attribute" != no ; then
3482                                         cf_value='__attribute__((format(printf,fmt,var)))'
3483
3484 cat >>confdefs.h <<\EOF
3485 #define GCC_PRINTF 1
3486 EOF
3487
3488                                 fi
3489
3490 cat >>confdefs.h <<EOF
3491 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3492 EOF
3493
3494                                 ;;
3495                         (scanf)
3496                                 cf_value='/* nothing */'
3497                                 if test "$cf_scanf_attribute" != no ; then
3498                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3499
3500 cat >>confdefs.h <<\EOF
3501 #define GCC_SCANF 1
3502 EOF
3503
3504                                 fi
3505
3506 cat >>confdefs.h <<EOF
3507 #define GCC_SCANFLIKE(fmt,var) $cf_value
3508 EOF
3509
3510                                 ;;
3511                         (unused)
3512
3513 cat >>confdefs.h <<EOF
3514 #define GCC_UNUSED $cf_directive
3515 EOF
3516
3517                                 ;;
3518                         esac
3519                 fi
3520         done
3521 else
3522         ${FGREP-fgrep} define conftest.i >>confdefs.h
3523 fi
3524 rm -rf ./conftest*
3525 fi
3526
3527 echo "$as_me:3527: checking if you want to work around bogus compiler/loader warnings" >&5
3528 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3529
3530 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3531 if test "${enable_string_hacks+set}" = set; then
3532   enableval="$enable_string_hacks"
3533   enable_string_hacks=$enableval
3534 else
3535   enable_string_hacks=no
3536 fi;
3537 echo "$as_me:3537: result: $enable_string_hacks" >&5
3538 echo "${ECHO_T}$enable_string_hacks" >&6
3539
3540 if test "x$enable_string_hacks" = "xyes"; then
3541
3542 cat >>confdefs.h <<\EOF
3543 #define USE_STRING_HACKS 1
3544 EOF
3545
3546         { echo "$as_me:3546: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3547 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3548         echo "$as_me:3548: checking for strlcat" >&5
3549 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3550 if test "${ac_cv_func_strlcat+set}" = set; then
3551   echo $ECHO_N "(cached) $ECHO_C" >&6
3552 else
3553   cat >"conftest.$ac_ext" <<_ACEOF
3554 #line 3554 "configure"
3555 #include "confdefs.h"
3556 #define strlcat autoconf_temporary
3557 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3558 #undef strlcat
3559
3560 #ifdef __cplusplus
3561 extern "C"
3562 #endif
3563
3564 /* We use char because int might match the return type of a gcc2
3565    builtin and then its argument prototype would still apply.  */
3566 char strlcat (void);
3567
3568 int
3569 main (void)
3570 {
3571
3572 /* The GNU C library defines stubs for functions which it implements
3573     to always fail with ENOSYS.  Some functions are actually named
3574     something starting with __ and the normal name is an alias.  */
3575 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3576 #error found stub for strlcat
3577 #endif
3578
3579         return strlcat ();
3580   ;
3581   return 0;
3582 }
3583 _ACEOF
3584 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3585 if { (eval echo "$as_me:3585: \"$ac_link\"") >&5
3586   (eval $ac_link) 2>&5
3587   ac_status=$?
3588   echo "$as_me:3588: \$? = $ac_status" >&5
3589   (exit "$ac_status"); } &&
3590          { ac_try='test -s "conftest$ac_exeext"'
3591   { (eval echo "$as_me:3591: \"$ac_try\"") >&5
3592   (eval $ac_try) 2>&5
3593   ac_status=$?
3594   echo "$as_me:3594: \$? = $ac_status" >&5
3595   (exit "$ac_status"); }; }; then
3596   ac_cv_func_strlcat=yes
3597 else
3598   echo "$as_me: failed program was:" >&5
3599 cat "conftest.$ac_ext" >&5
3600 ac_cv_func_strlcat=no
3601 fi
3602 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3603 fi
3604 echo "$as_me:3604: result: $ac_cv_func_strlcat" >&5
3605 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3606 if test "$ac_cv_func_strlcat" = yes; then
3607
3608 cat >>confdefs.h <<\EOF
3609 #define HAVE_STRLCAT 1
3610 EOF
3611
3612 else
3613
3614                 echo "$as_me:3614: checking for strlcat in -lbsd" >&5
3615 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3616 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3617   echo $ECHO_N "(cached) $ECHO_C" >&6
3618 else
3619   ac_check_lib_save_LIBS=$LIBS
3620 LIBS="-lbsd  $LIBS"
3621 cat >"conftest.$ac_ext" <<_ACEOF
3622 #line 3622 "configure"
3623 #include "confdefs.h"
3624
3625 /* Override any gcc2 internal prototype to avoid an error.  */
3626 #ifdef __cplusplus
3627 extern "C"
3628 #endif
3629 /* We use char because int might match the return type of a gcc2
3630    builtin and then its argument prototype would still apply.  */
3631 char strlcat ();
3632 int
3633 main (void)
3634 {
3635 strlcat ();
3636   ;
3637   return 0;
3638 }
3639 _ACEOF
3640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3641 if { (eval echo "$as_me:3641: \"$ac_link\"") >&5
3642   (eval $ac_link) 2>&5
3643   ac_status=$?
3644   echo "$as_me:3644: \$? = $ac_status" >&5
3645   (exit "$ac_status"); } &&
3646          { ac_try='test -s "conftest$ac_exeext"'
3647   { (eval echo "$as_me:3647: \"$ac_try\"") >&5
3648   (eval $ac_try) 2>&5
3649   ac_status=$?
3650   echo "$as_me:3650: \$? = $ac_status" >&5
3651   (exit "$ac_status"); }; }; then
3652   ac_cv_lib_bsd_strlcat=yes
3653 else
3654   echo "$as_me: failed program was:" >&5
3655 cat "conftest.$ac_ext" >&5
3656 ac_cv_lib_bsd_strlcat=no
3657 fi
3658 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3659 LIBS=$ac_check_lib_save_LIBS
3660 fi
3661 echo "$as_me:3661: result: $ac_cv_lib_bsd_strlcat" >&5
3662 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3663 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3664
3665 cf_add_libs="$LIBS"
3666 # reverse order
3667 cf_add_0lib=
3668 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3669 # filter duplicates
3670 for cf_add_1lib in $cf_add_0lib; do
3671         for cf_add_2lib in $cf_add_libs; do
3672                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3673                         cf_add_1lib=
3674                         break
3675                 fi
3676         done
3677         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3678 done
3679 LIBS="$cf_add_libs"
3680
3681 for ac_header in bsd/string.h
3682 do
3683 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3684 echo "$as_me:3684: checking for $ac_header" >&5
3685 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3686 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3687   echo $ECHO_N "(cached) $ECHO_C" >&6
3688 else
3689   cat >"conftest.$ac_ext" <<_ACEOF
3690 #line 3690 "configure"
3691 #include "confdefs.h"
3692 #include <$ac_header>
3693 _ACEOF
3694 if { (eval echo "$as_me:3694: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3695   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3696   ac_status=$?
3697   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3698   rm -f conftest.er1
3699   cat conftest.err >&5
3700   echo "$as_me:3700: \$? = $ac_status" >&5
3701   (exit "$ac_status"); } >/dev/null; then
3702   if test -s conftest.err; then
3703     ac_cpp_err=$ac_c_preproc_warn_flag
3704   else
3705     ac_cpp_err=
3706   fi
3707 else
3708   ac_cpp_err=yes
3709 fi
3710 if test -z "$ac_cpp_err"; then
3711   eval "$as_ac_Header=yes"
3712 else
3713   echo "$as_me: failed program was:" >&5
3714   cat "conftest.$ac_ext" >&5
3715   eval "$as_ac_Header=no"
3716 fi
3717 rm -f conftest.err "conftest.$ac_ext"
3718 fi
3719 echo "$as_me:3719: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3720 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3721 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3722   cat >>confdefs.h <<EOF
3723 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3724 EOF
3725
3726 fi
3727 done
3728
3729 cat >>confdefs.h <<\EOF
3730 #define HAVE_STRLCAT 1
3731 EOF
3732
3733 fi
3734
3735 fi
3736
3737 for ac_func in strlcpy snprintf
3738 do
3739 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3740 echo "$as_me:3740: checking for $ac_func" >&5
3741 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3742 if eval "test \"\${$as_ac_var+set}\" = set"; then
3743   echo $ECHO_N "(cached) $ECHO_C" >&6
3744 else
3745   cat >"conftest.$ac_ext" <<_ACEOF
3746 #line 3746 "configure"
3747 #include "confdefs.h"
3748 #define $ac_func autoconf_temporary
3749 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3750 #undef $ac_func
3751
3752 #ifdef __cplusplus
3753 extern "C"
3754 #endif
3755
3756 /* We use char because int might match the return type of a gcc2
3757    builtin and then its argument prototype would still apply.  */
3758 char $ac_func (void);
3759
3760 int
3761 main (void)
3762 {
3763
3764 /* The GNU C library defines stubs for functions which it implements
3765     to always fail with ENOSYS.  Some functions are actually named
3766     something starting with __ and the normal name is an alias.  */
3767 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3768 #error found stub for $ac_func
3769 #endif
3770
3771         return $ac_func ();
3772   ;
3773   return 0;
3774 }
3775 _ACEOF
3776 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3777 if { (eval echo "$as_me:3777: \"$ac_link\"") >&5
3778   (eval $ac_link) 2>&5
3779   ac_status=$?
3780   echo "$as_me:3780: \$? = $ac_status" >&5
3781   (exit "$ac_status"); } &&
3782          { ac_try='test -s "conftest$ac_exeext"'
3783   { (eval echo "$as_me:3783: \"$ac_try\"") >&5
3784   (eval $ac_try) 2>&5
3785   ac_status=$?
3786   echo "$as_me:3786: \$? = $ac_status" >&5
3787   (exit "$ac_status"); }; }; then
3788   eval "$as_ac_var=yes"
3789 else
3790   echo "$as_me: failed program was:" >&5
3791 cat "conftest.$ac_ext" >&5
3792 eval "$as_ac_var=no"
3793 fi
3794 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3795 fi
3796 echo "$as_me:3796: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3797 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3798 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3799   cat >>confdefs.h <<EOF
3800 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3801 EOF
3802
3803 fi
3804 done
3805
3806 fi
3807
3808 echo "$as_me:3808: checking if the POSIX test-macros are already defined" >&5
3809 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3810 if test "${cf_cv_posix_visible+set}" = set; then
3811   echo $ECHO_N "(cached) $ECHO_C" >&6
3812 else
3813
3814 cat >"conftest.$ac_ext" <<_ACEOF
3815 #line 3815 "configure"
3816 #include "confdefs.h"
3817 #include <stdio.h>
3818 int
3819 main (void)
3820 {
3821
3822 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3823         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3824         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3825         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3826 #error conflicting symbols found
3827 #endif
3828
3829   ;
3830   return 0;
3831 }
3832 _ACEOF
3833 rm -f "conftest.$ac_objext"
3834 if { (eval echo "$as_me:3834: \"$ac_compile\"") >&5
3835   (eval $ac_compile) 2>&5
3836   ac_status=$?
3837   echo "$as_me:3837: \$? = $ac_status" >&5
3838   (exit "$ac_status"); } &&
3839          { ac_try='test -s "conftest.$ac_objext"'
3840   { (eval echo "$as_me:3840: \"$ac_try\"") >&5
3841   (eval $ac_try) 2>&5
3842   ac_status=$?
3843   echo "$as_me:3843: \$? = $ac_status" >&5
3844   (exit "$ac_status"); }; }; then
3845   cf_cv_posix_visible=no
3846 else
3847   echo "$as_me: failed program was:" >&5
3848 cat "conftest.$ac_ext" >&5
3849 cf_cv_posix_visible=yes
3850 fi
3851 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3852
3853 fi
3854 echo "$as_me:3854: result: $cf_cv_posix_visible" >&5
3855 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3856
3857 if test "$cf_cv_posix_visible" = no; then
3858
3859 cf_XOPEN_SOURCE=600
3860 cf_POSIX_C_SOURCE=199506L
3861 cf_xopen_source=
3862
3863 case "$host_os" in
3864 (aix[4-7]*)
3865         cf_xopen_source="-D_ALL_SOURCE"
3866         ;;
3867 (msys)
3868         cf_XOPEN_SOURCE=600
3869         ;;
3870 (darwin[0-8].*)
3871         cf_xopen_source="-D_APPLE_C_SOURCE"
3872         ;;
3873 (darwin*)
3874         cf_xopen_source="-D_DARWIN_C_SOURCE"
3875         cf_XOPEN_SOURCE=
3876         ;;
3877 (freebsd*|dragonfly*|midnightbsd*)
3878         # 5.x headers associate
3879         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3880         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3881         cf_POSIX_C_SOURCE=200112L
3882         cf_XOPEN_SOURCE=600
3883         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3884         ;;
3885 (hpux11*)
3886         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3887         ;;
3888 (hpux*)
3889         cf_xopen_source="-D_HPUX_SOURCE"
3890         ;;
3891 (irix[56].*)
3892         cf_xopen_source="-D_SGI_SOURCE"
3893         cf_XOPEN_SOURCE=
3894         ;;
3895 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3896
3897 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3898
3899 echo "$as_me:3899: checking if this is the GNU C library" >&5
3900 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3901 if test "${cf_cv_gnu_library+set}" = set; then
3902   echo $ECHO_N "(cached) $ECHO_C" >&6
3903 else
3904
3905 cat >"conftest.$ac_ext" <<_ACEOF
3906 #line 3906 "configure"
3907 #include "confdefs.h"
3908 #include <sys/types.h>
3909 int
3910 main (void)
3911 {
3912
3913         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3914                 return 0;
3915         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3916                 return 0;
3917         #else
3918         #       error not GNU C library
3919         #endif
3920   ;
3921   return 0;
3922 }
3923 _ACEOF
3924 rm -f "conftest.$ac_objext"
3925 if { (eval echo "$as_me:3925: \"$ac_compile\"") >&5
3926   (eval $ac_compile) 2>&5
3927   ac_status=$?
3928   echo "$as_me:3928: \$? = $ac_status" >&5
3929   (exit "$ac_status"); } &&
3930          { ac_try='test -s "conftest.$ac_objext"'
3931   { (eval echo "$as_me:3931: \"$ac_try\"") >&5
3932   (eval $ac_try) 2>&5
3933   ac_status=$?
3934   echo "$as_me:3934: \$? = $ac_status" >&5
3935   (exit "$ac_status"); }; }; then
3936   cf_cv_gnu_library=yes
3937 else
3938   echo "$as_me: failed program was:" >&5
3939 cat "conftest.$ac_ext" >&5
3940 cf_cv_gnu_library=no
3941 fi
3942 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3943
3944 fi
3945 echo "$as_me:3945: result: $cf_cv_gnu_library" >&5
3946 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3947
3948 if test x$cf_cv_gnu_library = xyes; then
3949
3950         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3951         # was changed to help a little.  newlib incorporated the change about 4
3952         # years later.
3953         echo "$as_me:3953: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3954 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3955 if test "${cf_cv_gnu_library_219+set}" = set; then
3956   echo $ECHO_N "(cached) $ECHO_C" >&6
3957 else
3958
3959                 cf_save="$CPPFLAGS"
3960
3961         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3962         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3963
3964                 cat >"conftest.$ac_ext" <<_ACEOF
3965 #line 3965 "configure"
3966 #include "confdefs.h"
3967 #include <sys/types.h>
3968 int
3969 main (void)
3970 {
3971
3972                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3973                                 return 0;
3974                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3975                                 return 0;
3976                         #else
3977                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3978                         #endif
3979   ;
3980   return 0;
3981 }
3982 _ACEOF
3983 rm -f "conftest.$ac_objext"
3984 if { (eval echo "$as_me:3984: \"$ac_compile\"") >&5
3985   (eval $ac_compile) 2>&5
3986   ac_status=$?
3987   echo "$as_me:3987: \$? = $ac_status" >&5
3988   (exit "$ac_status"); } &&
3989          { ac_try='test -s "conftest.$ac_objext"'
3990   { (eval echo "$as_me:3990: \"$ac_try\"") >&5
3991   (eval $ac_try) 2>&5
3992   ac_status=$?
3993   echo "$as_me:3993: \$? = $ac_status" >&5
3994   (exit "$ac_status"); }; }; then
3995   cf_cv_gnu_library_219=yes
3996 else
3997   echo "$as_me: failed program was:" >&5
3998 cat "conftest.$ac_ext" >&5
3999 cf_cv_gnu_library_219=no
4000 fi
4001 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4002                 CPPFLAGS="$cf_save"
4003
4004 fi
4005 echo "$as_me:4005: result: $cf_cv_gnu_library_219" >&5
4006 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4007
4008         if test "x$cf_cv_gnu_library_219" = xyes; then
4009                 cf_save="$CPPFLAGS"
4010                 echo "$as_me:4010: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4011 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4012 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4013   echo $ECHO_N "(cached) $ECHO_C" >&6
4014 else
4015
4016 cf_fix_cppflags=no
4017 cf_new_cflags=
4018 cf_new_cppflags=
4019 cf_new_extra_cppflags=
4020
4021 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4022 do
4023 case "$cf_fix_cppflags" in
4024 (no)
4025         case "$cf_add_cflags" in
4026         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4027                 case "$cf_add_cflags" in
4028                 (-D*)
4029                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4030
4031                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4032                                 && test -z "${cf_tst_cflags}" \
4033                                 && cf_fix_cppflags=yes
4034
4035                         if test "$cf_fix_cppflags" = yes ; then
4036
4037         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4038         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4039
4040                                 continue
4041                         elif test "${cf_tst_cflags}" = "\"'" ; then
4042
4043         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4044         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4045
4046                                 continue
4047                         fi
4048                         ;;
4049                 esac
4050                 case "$CPPFLAGS" in
4051                 (*$cf_add_cflags)
4052                         ;;
4053                 (*)
4054                         case "$cf_add_cflags" in
4055                         (-D*)
4056                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4057
4058 CPPFLAGS=`echo "$CPPFLAGS" | \
4059         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4060                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4061
4062                                 ;;
4063                         esac
4064
4065         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4066         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4067
4068                         ;;
4069                 esac
4070                 ;;
4071         (*)
4072
4073         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4074         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4075
4076                 ;;
4077         esac
4078         ;;
4079 (yes)
4080
4081         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4082         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4083
4084         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4085
4086         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4087                 && test -z "${cf_tst_cflags}" \
4088                 && cf_fix_cppflags=no
4089         ;;
4090 esac
4091 done
4092
4093 if test -n "$cf_new_cflags" ; then
4094
4095         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4096         CFLAGS="${CFLAGS}$cf_new_cflags"
4097
4098 fi
4099
4100 if test -n "$cf_new_cppflags" ; then
4101
4102         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4103         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4104
4105 fi
4106
4107 if test -n "$cf_new_extra_cppflags" ; then
4108
4109         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4110         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4111
4112 fi
4113
4114                         cat >"conftest.$ac_ext" <<_ACEOF
4115 #line 4115 "configure"
4116 #include "confdefs.h"
4117
4118                                 #include <limits.h>
4119                                 #include <sys/types.h>
4120
4121 int
4122 main (void)
4123 {
4124
4125                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4126                                         return 0;
4127                                 #else
4128                                 #       error GNU C library is too old
4129                                 #endif
4130   ;
4131   return 0;
4132 }
4133 _ACEOF
4134 rm -f "conftest.$ac_objext"
4135 if { (eval echo "$as_me:4135: \"$ac_compile\"") >&5
4136   (eval $ac_compile) 2>&5
4137   ac_status=$?
4138   echo "$as_me:4138: \$? = $ac_status" >&5
4139   (exit "$ac_status"); } &&
4140          { ac_try='test -s "conftest.$ac_objext"'
4141   { (eval echo "$as_me:4141: \"$ac_try\"") >&5
4142   (eval $ac_try) 2>&5
4143   ac_status=$?
4144   echo "$as_me:4144: \$? = $ac_status" >&5
4145   (exit "$ac_status"); }; }; then
4146   cf_cv_gnu_dftsrc_219=yes
4147 else
4148   echo "$as_me: failed program was:" >&5
4149 cat "conftest.$ac_ext" >&5
4150 cf_cv_gnu_dftsrc_219=no
4151 fi
4152 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4153
4154 fi
4155 echo "$as_me:4155: result: $cf_cv_gnu_dftsrc_219" >&5
4156 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4157                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4158         else
4159                 cf_cv_gnu_dftsrc_219=maybe
4160         fi
4161
4162         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4163
4164                 echo "$as_me:4164: checking if we must define _GNU_SOURCE" >&5
4165 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4166 if test "${cf_cv_gnu_source+set}" = set; then
4167   echo $ECHO_N "(cached) $ECHO_C" >&6
4168 else
4169
4170                 cat >"conftest.$ac_ext" <<_ACEOF
4171 #line 4171 "configure"
4172 #include "confdefs.h"
4173 #include <sys/types.h>
4174 int
4175 main (void)
4176 {
4177
4178                         #ifndef _XOPEN_SOURCE
4179                         #error  expected _XOPEN_SOURCE to be defined
4180                         #endif
4181   ;
4182   return 0;
4183 }
4184 _ACEOF
4185 rm -f "conftest.$ac_objext"
4186 if { (eval echo "$as_me:4186: \"$ac_compile\"") >&5
4187   (eval $ac_compile) 2>&5
4188   ac_status=$?
4189   echo "$as_me:4189: \$? = $ac_status" >&5
4190   (exit "$ac_status"); } &&
4191          { ac_try='test -s "conftest.$ac_objext"'
4192   { (eval echo "$as_me:4192: \"$ac_try\"") >&5
4193   (eval $ac_try) 2>&5
4194   ac_status=$?
4195   echo "$as_me:4195: \$? = $ac_status" >&5
4196   (exit "$ac_status"); }; }; then
4197   cf_cv_gnu_source=no
4198 else
4199   echo "$as_me: failed program was:" >&5
4200 cat "conftest.$ac_ext" >&5
4201 cf_save="$CPPFLAGS"
4202
4203 cf_fix_cppflags=no
4204 cf_new_cflags=
4205 cf_new_cppflags=
4206 cf_new_extra_cppflags=
4207
4208 for cf_add_cflags in -D_GNU_SOURCE
4209 do
4210 case "$cf_fix_cppflags" in
4211 (no)
4212         case "$cf_add_cflags" in
4213         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4214                 case "$cf_add_cflags" in
4215                 (-D*)
4216                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4217
4218                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4219                                 && test -z "${cf_tst_cflags}" \
4220                                 && cf_fix_cppflags=yes
4221
4222                         if test "$cf_fix_cppflags" = yes ; then
4223
4224         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4225         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4226
4227                                 continue
4228                         elif test "${cf_tst_cflags}" = "\"'" ; then
4229
4230         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4231         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4232
4233                                 continue
4234                         fi
4235                         ;;
4236                 esac
4237                 case "$CPPFLAGS" in
4238                 (*$cf_add_cflags)
4239                         ;;
4240                 (*)
4241                         case "$cf_add_cflags" in
4242                         (-D*)
4243                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4244
4245 CPPFLAGS=`echo "$CPPFLAGS" | \
4246         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4247                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4248
4249                                 ;;
4250                         esac
4251
4252         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4253         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4254
4255                         ;;
4256                 esac
4257                 ;;
4258         (*)
4259
4260         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4261         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4262
4263                 ;;
4264         esac
4265         ;;
4266 (yes)
4267
4268         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4269         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4270
4271         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4272
4273         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4274                 && test -z "${cf_tst_cflags}" \
4275                 && cf_fix_cppflags=no
4276         ;;
4277 esac
4278 done
4279
4280 if test -n "$cf_new_cflags" ; then
4281
4282         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4283         CFLAGS="${CFLAGS}$cf_new_cflags"
4284
4285 fi
4286
4287 if test -n "$cf_new_cppflags" ; then
4288
4289         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4290         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4291
4292 fi
4293
4294 if test -n "$cf_new_extra_cppflags" ; then
4295
4296         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4297         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4298
4299 fi
4300
4301                          cat >"conftest.$ac_ext" <<_ACEOF
4302 #line 4302 "configure"
4303 #include "confdefs.h"
4304 #include <sys/types.h>
4305 int
4306 main (void)
4307 {
4308
4309                                 #ifdef _XOPEN_SOURCE
4310                                 #error  expected _XOPEN_SOURCE to be undefined
4311                                 #endif
4312   ;
4313   return 0;
4314 }
4315 _ACEOF
4316 rm -f "conftest.$ac_objext"
4317 if { (eval echo "$as_me:4317: \"$ac_compile\"") >&5
4318   (eval $ac_compile) 2>&5
4319   ac_status=$?
4320   echo "$as_me:4320: \$? = $ac_status" >&5
4321   (exit "$ac_status"); } &&
4322          { ac_try='test -s "conftest.$ac_objext"'
4323   { (eval echo "$as_me:4323: \"$ac_try\"") >&5
4324   (eval $ac_try) 2>&5
4325   ac_status=$?
4326   echo "$as_me:4326: \$? = $ac_status" >&5
4327   (exit "$ac_status"); }; }; then
4328   cf_cv_gnu_source=no
4329 else
4330   echo "$as_me: failed program was:" >&5
4331 cat "conftest.$ac_ext" >&5
4332 cf_cv_gnu_source=yes
4333 fi
4334 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4335                         CPPFLAGS="$cf_save"
4336
4337 fi
4338 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4339
4340 fi
4341 echo "$as_me:4341: result: $cf_cv_gnu_source" >&5
4342 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4343
4344                 if test "$cf_cv_gnu_source" = yes
4345                 then
4346                 echo "$as_me:4346: checking if we should also define _DEFAULT_SOURCE" >&5
4347 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4348 if test "${cf_cv_default_source+set}" = set; then
4349   echo $ECHO_N "(cached) $ECHO_C" >&6
4350 else
4351
4352         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4353         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4354
4355                         cat >"conftest.$ac_ext" <<_ACEOF
4356 #line 4356 "configure"
4357 #include "confdefs.h"
4358 #include <sys/types.h>
4359 int
4360 main (void)
4361 {
4362
4363                                 #ifdef _DEFAULT_SOURCE
4364                                 #error  expected _DEFAULT_SOURCE to be undefined
4365                                 #endif
4366   ;
4367   return 0;
4368 }
4369 _ACEOF
4370 rm -f "conftest.$ac_objext"
4371 if { (eval echo "$as_me:4371: \"$ac_compile\"") >&5
4372   (eval $ac_compile) 2>&5
4373   ac_status=$?
4374   echo "$as_me:4374: \$? = $ac_status" >&5
4375   (exit "$ac_status"); } &&
4376          { ac_try='test -s "conftest.$ac_objext"'
4377   { (eval echo "$as_me:4377: \"$ac_try\"") >&5
4378   (eval $ac_try) 2>&5
4379   ac_status=$?
4380   echo "$as_me:4380: \$? = $ac_status" >&5
4381   (exit "$ac_status"); }; }; then
4382   cf_cv_default_source=no
4383 else
4384   echo "$as_me: failed program was:" >&5
4385 cat "conftest.$ac_ext" >&5
4386 cf_cv_default_source=yes
4387 fi
4388 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4389
4390 fi
4391 echo "$as_me:4391: result: $cf_cv_default_source" >&5
4392 echo "${ECHO_T}$cf_cv_default_source" >&6
4393                         if test "$cf_cv_default_source" = yes
4394                         then
4395
4396         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4397         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4398
4399                         fi
4400                 fi
4401         fi
4402
4403 fi
4404
4405         ;;
4406 (minix*)
4407         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4408         ;;
4409 (mirbsd*)
4410         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4411         cf_XOPEN_SOURCE=
4412
4413 if test "$cf_cv_posix_visible" = no; then
4414
4415 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4416
4417 cf_save_CFLAGS="$CFLAGS"
4418 cf_save_CPPFLAGS="$CPPFLAGS"
4419
4420 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4421         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4422                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4423
4424 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4425         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4426                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4427
4428 echo "$as_me:4428: checking if we should define _POSIX_C_SOURCE" >&5
4429 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4430 if test "${cf_cv_posix_c_source+set}" = set; then
4431   echo $ECHO_N "(cached) $ECHO_C" >&6
4432 else
4433
4434 echo "${as_me:-configure}:4434: testing if the symbol is already defined go no further ..." 1>&5
4435
4436         cat >"conftest.$ac_ext" <<_ACEOF
4437 #line 4437 "configure"
4438 #include "confdefs.h"
4439 #include <sys/types.h>
4440 int
4441 main (void)
4442 {
4443
4444 #ifndef _POSIX_C_SOURCE
4445 make an error
4446 #endif
4447   ;
4448   return 0;
4449 }
4450 _ACEOF
4451 rm -f "conftest.$ac_objext"
4452 if { (eval echo "$as_me:4452: \"$ac_compile\"") >&5
4453   (eval $ac_compile) 2>&5
4454   ac_status=$?
4455   echo "$as_me:4455: \$? = $ac_status" >&5
4456   (exit "$ac_status"); } &&
4457          { ac_try='test -s "conftest.$ac_objext"'
4458   { (eval echo "$as_me:4458: \"$ac_try\"") >&5
4459   (eval $ac_try) 2>&5
4460   ac_status=$?
4461   echo "$as_me:4461: \$? = $ac_status" >&5
4462   (exit "$ac_status"); }; }; then
4463   cf_cv_posix_c_source=no
4464 else
4465   echo "$as_me: failed program was:" >&5
4466 cat "conftest.$ac_ext" >&5
4467 cf_want_posix_source=no
4468          case .$cf_POSIX_C_SOURCE in
4469          (.[12]??*)
4470                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4471                 ;;
4472          (.2)
4473                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4474                 cf_want_posix_source=yes
4475                 ;;
4476          (.*)
4477                 cf_want_posix_source=yes
4478                 ;;
4479          esac
4480          if test "$cf_want_posix_source" = yes ; then
4481                 cat >"conftest.$ac_ext" <<_ACEOF
4482 #line 4482 "configure"
4483 #include "confdefs.h"
4484 #include <sys/types.h>
4485 int
4486 main (void)
4487 {
4488
4489 #ifdef _POSIX_SOURCE
4490 make an error
4491 #endif
4492   ;
4493   return 0;
4494 }
4495 _ACEOF
4496 rm -f "conftest.$ac_objext"
4497 if { (eval echo "$as_me:4497: \"$ac_compile\"") >&5
4498   (eval $ac_compile) 2>&5
4499   ac_status=$?
4500   echo "$as_me:4500: \$? = $ac_status" >&5
4501   (exit "$ac_status"); } &&
4502          { ac_try='test -s "conftest.$ac_objext"'
4503   { (eval echo "$as_me:4503: \"$ac_try\"") >&5
4504   (eval $ac_try) 2>&5
4505   ac_status=$?
4506   echo "$as_me:4506: \$? = $ac_status" >&5
4507   (exit "$ac_status"); }; }; then
4508   :
4509 else
4510   echo "$as_me: failed program was:" >&5
4511 cat "conftest.$ac_ext" >&5
4512 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4513 fi
4514 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4515          fi
4516
4517 echo "${as_me:-configure}:4517: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4518
4519          CFLAGS="$cf_trim_CFLAGS"
4520          CPPFLAGS="$cf_trim_CPPFLAGS"
4521
4522         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4523         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4524
4525 echo "${as_me:-configure}:4525: testing if the second compile does not leave our definition intact error ..." 1>&5
4526
4527          cat >"conftest.$ac_ext" <<_ACEOF
4528 #line 4528 "configure"
4529 #include "confdefs.h"
4530 #include <sys/types.h>
4531 int
4532 main (void)
4533 {
4534
4535 #ifndef _POSIX_C_SOURCE
4536 make an error
4537 #endif
4538   ;
4539   return 0;
4540 }
4541 _ACEOF
4542 rm -f "conftest.$ac_objext"
4543 if { (eval echo "$as_me:4543: \"$ac_compile\"") >&5
4544   (eval $ac_compile) 2>&5
4545   ac_status=$?
4546   echo "$as_me:4546: \$? = $ac_status" >&5
4547   (exit "$ac_status"); } &&
4548          { ac_try='test -s "conftest.$ac_objext"'
4549   { (eval echo "$as_me:4549: \"$ac_try\"") >&5
4550   (eval $ac_try) 2>&5
4551   ac_status=$?
4552   echo "$as_me:4552: \$? = $ac_status" >&5
4553   (exit "$ac_status"); }; }; then
4554   :
4555 else
4556   echo "$as_me: failed program was:" >&5
4557 cat "conftest.$ac_ext" >&5
4558 cf_cv_posix_c_source=no
4559 fi
4560 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4561          CFLAGS="$cf_save_CFLAGS"
4562          CPPFLAGS="$cf_save_CPPFLAGS"
4563
4564 fi
4565 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4566
4567 fi
4568 echo "$as_me:4568: result: $cf_cv_posix_c_source" >&5
4569 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4570
4571 if test "$cf_cv_posix_c_source" != no ; then
4572         CFLAGS="$cf_trim_CFLAGS"
4573         CPPFLAGS="$cf_trim_CPPFLAGS"
4574
4575 cf_fix_cppflags=no
4576 cf_new_cflags=
4577 cf_new_cppflags=
4578 cf_new_extra_cppflags=
4579
4580 for cf_add_cflags in $cf_cv_posix_c_source
4581 do
4582 case "$cf_fix_cppflags" in
4583 (no)
4584         case "$cf_add_cflags" in
4585         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4586                 case "$cf_add_cflags" in
4587                 (-D*)
4588                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4589
4590                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4591                                 && test -z "${cf_tst_cflags}" \
4592                                 && cf_fix_cppflags=yes
4593
4594                         if test "$cf_fix_cppflags" = yes ; then
4595
4596         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4597         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4598
4599                                 continue
4600                         elif test "${cf_tst_cflags}" = "\"'" ; then
4601
4602         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4603         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4604
4605                                 continue
4606                         fi
4607                         ;;
4608                 esac
4609                 case "$CPPFLAGS" in
4610                 (*$cf_add_cflags)
4611                         ;;
4612                 (*)
4613                         case "$cf_add_cflags" in
4614                         (-D*)
4615                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4616
4617 CPPFLAGS=`echo "$CPPFLAGS" | \
4618         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4619                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4620
4621                                 ;;
4622                         esac
4623
4624         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4625         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4626
4627                         ;;
4628                 esac
4629                 ;;
4630         (*)
4631
4632         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4633         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4634
4635                 ;;
4636         esac
4637         ;;
4638 (yes)
4639
4640         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4641         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4642
4643         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4644
4645         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4646                 && test -z "${cf_tst_cflags}" \
4647                 && cf_fix_cppflags=no
4648         ;;
4649 esac
4650 done
4651
4652 if test -n "$cf_new_cflags" ; then
4653
4654         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4655         CFLAGS="${CFLAGS}$cf_new_cflags"
4656
4657 fi
4658
4659 if test -n "$cf_new_cppflags" ; then
4660
4661         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4662         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4663
4664 fi
4665
4666 if test -n "$cf_new_extra_cppflags" ; then
4667
4668         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4669         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4670
4671 fi
4672
4673 fi
4674
4675 fi # cf_cv_posix_visible
4676
4677         ;;
4678 (netbsd*)
4679         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4680         ;;
4681 (openbsd[4-9]*)
4682         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4683         cf_xopen_source="-D_BSD_SOURCE"
4684         cf_XOPEN_SOURCE=600
4685         ;;
4686 (openbsd*)
4687         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4688         ;;
4689 (osf[45]*)
4690         cf_xopen_source="-D_OSF_SOURCE"
4691         ;;
4692 (nto-qnx*)
4693         cf_xopen_source="-D_QNX_SOURCE"
4694         ;;
4695 (sco*)
4696         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4697         ;;
4698 (solaris2.*)
4699         cf_xopen_source="-D__EXTENSIONS__"
4700         cf_cv_xopen_source=broken
4701         ;;
4702 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4703         cf_XOPEN_SOURCE=
4704         cf_POSIX_C_SOURCE=
4705         ;;
4706 (*)
4707
4708 echo "$as_me:4708: checking if we should define _XOPEN_SOURCE" >&5
4709 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4710 if test "${cf_cv_xopen_source+set}" = set; then
4711   echo $ECHO_N "(cached) $ECHO_C" >&6
4712 else
4713
4714         cat >"conftest.$ac_ext" <<_ACEOF
4715 #line 4715 "configure"
4716 #include "confdefs.h"
4717
4718 #include <stdlib.h>
4719 #include <string.h>
4720 #include <sys/types.h>
4721
4722 int
4723 main (void)
4724 {
4725
4726 #ifndef _XOPEN_SOURCE
4727 make an error
4728 #endif
4729   ;
4730   return 0;
4731 }
4732 _ACEOF
4733 rm -f "conftest.$ac_objext"
4734 if { (eval echo "$as_me:4734: \"$ac_compile\"") >&5
4735   (eval $ac_compile) 2>&5
4736   ac_status=$?
4737   echo "$as_me:4737: \$? = $ac_status" >&5
4738   (exit "$ac_status"); } &&
4739          { ac_try='test -s "conftest.$ac_objext"'
4740   { (eval echo "$as_me:4740: \"$ac_try\"") >&5
4741   (eval $ac_try) 2>&5
4742   ac_status=$?
4743   echo "$as_me:4743: \$? = $ac_status" >&5
4744   (exit "$ac_status"); }; }; then
4745   cf_cv_xopen_source=no
4746 else
4747   echo "$as_me: failed program was:" >&5
4748 cat "conftest.$ac_ext" >&5
4749 cf_save="$CPPFLAGS"
4750
4751         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4752         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4753
4754          cat >"conftest.$ac_ext" <<_ACEOF
4755 #line 4755 "configure"
4756 #include "confdefs.h"
4757
4758 #include <stdlib.h>
4759 #include <string.h>
4760 #include <sys/types.h>
4761
4762 int
4763 main (void)
4764 {
4765
4766 #ifdef _XOPEN_SOURCE
4767 make an error
4768 #endif
4769   ;
4770   return 0;
4771 }
4772 _ACEOF
4773 rm -f "conftest.$ac_objext"
4774 if { (eval echo "$as_me:4774: \"$ac_compile\"") >&5
4775   (eval $ac_compile) 2>&5
4776   ac_status=$?
4777   echo "$as_me:4777: \$? = $ac_status" >&5
4778   (exit "$ac_status"); } &&
4779          { ac_try='test -s "conftest.$ac_objext"'
4780   { (eval echo "$as_me:4780: \"$ac_try\"") >&5
4781   (eval $ac_try) 2>&5
4782   ac_status=$?
4783   echo "$as_me:4783: \$? = $ac_status" >&5
4784   (exit "$ac_status"); }; }; then
4785   cf_cv_xopen_source=no
4786 else
4787   echo "$as_me: failed program was:" >&5
4788 cat "conftest.$ac_ext" >&5
4789 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4790 fi
4791 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4792         CPPFLAGS="$cf_save"
4793
4794 fi
4795 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4796
4797 fi
4798 echo "$as_me:4798: result: $cf_cv_xopen_source" >&5
4799 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4800
4801 if test "$cf_cv_xopen_source" != no ; then
4802
4803 CFLAGS=`echo "$CFLAGS" | \
4804         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4805                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4806
4807 CPPFLAGS=`echo "$CPPFLAGS" | \
4808         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4809                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4810
4811         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4812
4813 cf_fix_cppflags=no
4814 cf_new_cflags=
4815 cf_new_cppflags=
4816 cf_new_extra_cppflags=
4817
4818 for cf_add_cflags in $cf_temp_xopen_source
4819 do
4820 case "$cf_fix_cppflags" in
4821 (no)
4822         case "$cf_add_cflags" in
4823         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4824                 case "$cf_add_cflags" in
4825                 (-D*)
4826                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4827
4828                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4829                                 && test -z "${cf_tst_cflags}" \
4830                                 && cf_fix_cppflags=yes
4831
4832                         if test "$cf_fix_cppflags" = yes ; then
4833
4834         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4835         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4836
4837                                 continue
4838                         elif test "${cf_tst_cflags}" = "\"'" ; then
4839
4840         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4841         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4842
4843                                 continue
4844                         fi
4845                         ;;
4846                 esac
4847                 case "$CPPFLAGS" in
4848                 (*$cf_add_cflags)
4849                         ;;
4850                 (*)
4851                         case "$cf_add_cflags" in
4852                         (-D*)
4853                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4854
4855 CPPFLAGS=`echo "$CPPFLAGS" | \
4856         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4857                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4858
4859                                 ;;
4860                         esac
4861
4862         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4863         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4864
4865                         ;;
4866                 esac
4867                 ;;
4868         (*)
4869
4870         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4871         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4872
4873                 ;;
4874         esac
4875         ;;
4876 (yes)
4877
4878         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4879         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4880
4881         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4882
4883         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4884                 && test -z "${cf_tst_cflags}" \
4885                 && cf_fix_cppflags=no
4886         ;;
4887 esac
4888 done
4889
4890 if test -n "$cf_new_cflags" ; then
4891
4892         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4893         CFLAGS="${CFLAGS}$cf_new_cflags"
4894
4895 fi
4896
4897 if test -n "$cf_new_cppflags" ; then
4898
4899         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4900         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4901
4902 fi
4903
4904 if test -n "$cf_new_extra_cppflags" ; then
4905
4906         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4907         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4908
4909 fi
4910
4911 fi
4912
4913 if test "$cf_cv_posix_visible" = no; then
4914
4915 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4916
4917 cf_save_CFLAGS="$CFLAGS"
4918 cf_save_CPPFLAGS="$CPPFLAGS"
4919
4920 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4921         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4922                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4923
4924 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4925         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4926                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4927
4928 echo "$as_me:4928: checking if we should define _POSIX_C_SOURCE" >&5
4929 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4930 if test "${cf_cv_posix_c_source+set}" = set; then
4931   echo $ECHO_N "(cached) $ECHO_C" >&6
4932 else
4933
4934 echo "${as_me:-configure}:4934: testing if the symbol is already defined go no further ..." 1>&5
4935
4936         cat >"conftest.$ac_ext" <<_ACEOF
4937 #line 4937 "configure"
4938 #include "confdefs.h"
4939 #include <sys/types.h>
4940 int
4941 main (void)
4942 {
4943
4944 #ifndef _POSIX_C_SOURCE
4945 make an error
4946 #endif
4947   ;
4948   return 0;
4949 }
4950 _ACEOF
4951 rm -f "conftest.$ac_objext"
4952 if { (eval echo "$as_me:4952: \"$ac_compile\"") >&5
4953   (eval $ac_compile) 2>&5
4954   ac_status=$?
4955   echo "$as_me:4955: \$? = $ac_status" >&5
4956   (exit "$ac_status"); } &&
4957          { ac_try='test -s "conftest.$ac_objext"'
4958   { (eval echo "$as_me:4958: \"$ac_try\"") >&5
4959   (eval $ac_try) 2>&5
4960   ac_status=$?
4961   echo "$as_me:4961: \$? = $ac_status" >&5
4962   (exit "$ac_status"); }; }; then
4963   cf_cv_posix_c_source=no
4964 else
4965   echo "$as_me: failed program was:" >&5
4966 cat "conftest.$ac_ext" >&5
4967 cf_want_posix_source=no
4968          case .$cf_POSIX_C_SOURCE in
4969          (.[12]??*)
4970                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4971                 ;;
4972          (.2)
4973                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4974                 cf_want_posix_source=yes
4975                 ;;
4976          (.*)
4977                 cf_want_posix_source=yes
4978                 ;;
4979          esac
4980          if test "$cf_want_posix_source" = yes ; then
4981                 cat >"conftest.$ac_ext" <<_ACEOF
4982 #line 4982 "configure"
4983 #include "confdefs.h"
4984 #include <sys/types.h>
4985 int
4986 main (void)
4987 {
4988
4989 #ifdef _POSIX_SOURCE
4990 make an error
4991 #endif
4992   ;
4993   return 0;
4994 }
4995 _ACEOF
4996 rm -f "conftest.$ac_objext"
4997 if { (eval echo "$as_me:4997: \"$ac_compile\"") >&5
4998   (eval $ac_compile) 2>&5
4999   ac_status=$?
5000   echo "$as_me:5000: \$? = $ac_status" >&5
5001   (exit "$ac_status"); } &&
5002          { ac_try='test -s "conftest.$ac_objext"'
5003   { (eval echo "$as_me:5003: \"$ac_try\"") >&5
5004   (eval $ac_try) 2>&5
5005   ac_status=$?
5006   echo "$as_me:5006: \$? = $ac_status" >&5
5007   (exit "$ac_status"); }; }; then
5008   :
5009 else
5010   echo "$as_me: failed program was:" >&5
5011 cat "conftest.$ac_ext" >&5
5012 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5013 fi
5014 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5015          fi
5016
5017 echo "${as_me:-configure}:5017: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5018
5019          CFLAGS="$cf_trim_CFLAGS"
5020          CPPFLAGS="$cf_trim_CPPFLAGS"
5021
5022         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5023         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5024
5025 echo "${as_me:-configure}:5025: testing if the second compile does not leave our definition intact error ..." 1>&5
5026
5027          cat >"conftest.$ac_ext" <<_ACEOF
5028 #line 5028 "configure"
5029 #include "confdefs.h"
5030 #include <sys/types.h>
5031 int
5032 main (void)
5033 {
5034
5035 #ifndef _POSIX_C_SOURCE
5036 make an error
5037 #endif
5038   ;
5039   return 0;
5040 }
5041 _ACEOF
5042 rm -f "conftest.$ac_objext"
5043 if { (eval echo "$as_me:5043: \"$ac_compile\"") >&5
5044   (eval $ac_compile) 2>&5
5045   ac_status=$?
5046   echo "$as_me:5046: \$? = $ac_status" >&5
5047   (exit "$ac_status"); } &&
5048          { ac_try='test -s "conftest.$ac_objext"'
5049   { (eval echo "$as_me:5049: \"$ac_try\"") >&5
5050   (eval $ac_try) 2>&5
5051   ac_status=$?
5052   echo "$as_me:5052: \$? = $ac_status" >&5
5053   (exit "$ac_status"); }; }; then
5054   :
5055 else
5056   echo "$as_me: failed program was:" >&5
5057 cat "conftest.$ac_ext" >&5
5058 cf_cv_posix_c_source=no
5059 fi
5060 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5061          CFLAGS="$cf_save_CFLAGS"
5062          CPPFLAGS="$cf_save_CPPFLAGS"
5063
5064 fi
5065 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5066
5067 fi
5068 echo "$as_me:5068: result: $cf_cv_posix_c_source" >&5
5069 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5070
5071 if test "$cf_cv_posix_c_source" != no ; then
5072         CFLAGS="$cf_trim_CFLAGS"
5073         CPPFLAGS="$cf_trim_CPPFLAGS"
5074
5075 cf_fix_cppflags=no
5076 cf_new_cflags=
5077 cf_new_cppflags=
5078 cf_new_extra_cppflags=
5079
5080 for cf_add_cflags in $cf_cv_posix_c_source
5081 do
5082 case "$cf_fix_cppflags" in
5083 (no)
5084         case "$cf_add_cflags" in
5085         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5086                 case "$cf_add_cflags" in
5087                 (-D*)
5088                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5089
5090                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5091                                 && test -z "${cf_tst_cflags}" \
5092                                 && cf_fix_cppflags=yes
5093
5094                         if test "$cf_fix_cppflags" = yes ; then
5095
5096         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5097         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5098
5099                                 continue
5100                         elif test "${cf_tst_cflags}" = "\"'" ; then
5101
5102         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5103         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5104
5105                                 continue
5106                         fi
5107                         ;;
5108                 esac
5109                 case "$CPPFLAGS" in
5110                 (*$cf_add_cflags)
5111                         ;;
5112                 (*)
5113                         case "$cf_add_cflags" in
5114                         (-D*)
5115                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5116
5117 CPPFLAGS=`echo "$CPPFLAGS" | \
5118         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5119                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5120
5121                                 ;;
5122                         esac
5123
5124         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5125         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5126
5127                         ;;
5128                 esac
5129                 ;;
5130         (*)
5131
5132         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5133         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5134
5135                 ;;
5136         esac
5137         ;;
5138 (yes)
5139
5140         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5141         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5142
5143         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5144
5145         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5146                 && test -z "${cf_tst_cflags}" \
5147                 && cf_fix_cppflags=no
5148         ;;
5149 esac
5150 done
5151
5152 if test -n "$cf_new_cflags" ; then
5153
5154         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5155         CFLAGS="${CFLAGS}$cf_new_cflags"
5156
5157 fi
5158
5159 if test -n "$cf_new_cppflags" ; then
5160
5161         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5162         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5163
5164 fi
5165
5166 if test -n "$cf_new_extra_cppflags" ; then
5167
5168         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5169         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5170
5171 fi
5172
5173 fi
5174
5175 fi # cf_cv_posix_visible
5176
5177         ;;
5178 esac
5179
5180 if test -n "$cf_xopen_source" ; then
5181
5182 cf_fix_cppflags=no
5183 cf_new_cflags=
5184 cf_new_cppflags=
5185 cf_new_extra_cppflags=
5186
5187 for cf_add_cflags in $cf_xopen_source
5188 do
5189 case "$cf_fix_cppflags" in
5190 (no)
5191         case "$cf_add_cflags" in
5192         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5193                 case "$cf_add_cflags" in
5194                 (-D*)
5195                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5196
5197                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5198                                 && test -z "${cf_tst_cflags}" \
5199                                 && cf_fix_cppflags=yes
5200
5201                         if test "$cf_fix_cppflags" = yes ; then
5202
5203         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5204         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5205
5206                                 continue
5207                         elif test "${cf_tst_cflags}" = "\"'" ; then
5208
5209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5211
5212                                 continue
5213                         fi
5214                         ;;
5215                 esac
5216                 case "$CPPFLAGS" in
5217                 (*$cf_add_cflags)
5218                         ;;
5219                 (*)
5220                         case "$cf_add_cflags" in
5221                         (-D*)
5222                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5223
5224 CPPFLAGS=`echo "$CPPFLAGS" | \
5225         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5226                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5227
5228                                 ;;
5229                         esac
5230
5231         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5232         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5233
5234                         ;;
5235                 esac
5236                 ;;
5237         (*)
5238
5239         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5240         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5241
5242                 ;;
5243         esac
5244         ;;
5245 (yes)
5246
5247         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5248         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5249
5250         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5251
5252         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5253                 && test -z "${cf_tst_cflags}" \
5254                 && cf_fix_cppflags=no
5255         ;;
5256 esac
5257 done
5258
5259 if test -n "$cf_new_cflags" ; then
5260         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5261
5262 echo "${as_me:-configure}:5262: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5263
5264         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5265         CFLAGS="${CFLAGS}$cf_new_cflags"
5266
5267 fi
5268
5269 if test -n "$cf_new_cppflags" ; then
5270         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5271
5272 echo "${as_me:-configure}:5272: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5273
5274         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5275         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5276
5277 fi
5278
5279 if test -n "$cf_new_extra_cppflags" ; then
5280         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5281
5282 echo "${as_me:-configure}:5282: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5283
5284         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5285         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5286
5287 fi
5288
5289 fi
5290
5291 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5292         echo "$as_me:5292: checking if _XOPEN_SOURCE really is set" >&5
5293 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5294         cat >"conftest.$ac_ext" <<_ACEOF
5295 #line 5295 "configure"
5296 #include "confdefs.h"
5297 #include <stdlib.h>
5298 int
5299 main (void)
5300 {
5301
5302 #ifndef _XOPEN_SOURCE
5303 make an error
5304 #endif
5305   ;
5306   return 0;
5307 }
5308 _ACEOF
5309 rm -f "conftest.$ac_objext"
5310 if { (eval echo "$as_me:5310: \"$ac_compile\"") >&5
5311   (eval $ac_compile) 2>&5
5312   ac_status=$?
5313   echo "$as_me:5313: \$? = $ac_status" >&5
5314   (exit "$ac_status"); } &&
5315          { ac_try='test -s "conftest.$ac_objext"'
5316   { (eval echo "$as_me:5316: \"$ac_try\"") >&5
5317   (eval $ac_try) 2>&5
5318   ac_status=$?
5319   echo "$as_me:5319: \$? = $ac_status" >&5
5320   (exit "$ac_status"); }; }; then
5321   cf_XOPEN_SOURCE_set=yes
5322 else
5323   echo "$as_me: failed program was:" >&5
5324 cat "conftest.$ac_ext" >&5
5325 cf_XOPEN_SOURCE_set=no
5326 fi
5327 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5328         echo "$as_me:5328: result: $cf_XOPEN_SOURCE_set" >&5
5329 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5330         if test "$cf_XOPEN_SOURCE_set" = yes
5331         then
5332                 cat >"conftest.$ac_ext" <<_ACEOF
5333 #line 5333 "configure"
5334 #include "confdefs.h"
5335 #include <stdlib.h>
5336 int
5337 main (void)
5338 {
5339
5340 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5341 make an error
5342 #endif
5343   ;
5344   return 0;
5345 }
5346 _ACEOF
5347 rm -f "conftest.$ac_objext"
5348 if { (eval echo "$as_me:5348: \"$ac_compile\"") >&5
5349   (eval $ac_compile) 2>&5
5350   ac_status=$?
5351   echo "$as_me:5351: \$? = $ac_status" >&5
5352   (exit "$ac_status"); } &&
5353          { ac_try='test -s "conftest.$ac_objext"'
5354   { (eval echo "$as_me:5354: \"$ac_try\"") >&5
5355   (eval $ac_try) 2>&5
5356   ac_status=$?
5357   echo "$as_me:5357: \$? = $ac_status" >&5
5358   (exit "$ac_status"); }; }; then
5359   cf_XOPEN_SOURCE_set_ok=yes
5360 else
5361   echo "$as_me: failed program was:" >&5
5362 cat "conftest.$ac_ext" >&5
5363 cf_XOPEN_SOURCE_set_ok=no
5364 fi
5365 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5366                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5367                 then
5368                         { echo "$as_me:5368: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5369 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5370                 fi
5371         else
5372
5373 echo "$as_me:5373: checking if we should define _XOPEN_SOURCE" >&5
5374 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5375 if test "${cf_cv_xopen_source+set}" = set; then
5376   echo $ECHO_N "(cached) $ECHO_C" >&6
5377 else
5378
5379         cat >"conftest.$ac_ext" <<_ACEOF
5380 #line 5380 "configure"
5381 #include "confdefs.h"
5382
5383 #include <stdlib.h>
5384 #include <string.h>
5385 #include <sys/types.h>
5386
5387 int
5388 main (void)
5389 {
5390
5391 #ifndef _XOPEN_SOURCE
5392 make an error
5393 #endif
5394   ;
5395   return 0;
5396 }
5397 _ACEOF
5398 rm -f "conftest.$ac_objext"
5399 if { (eval echo "$as_me:5399: \"$ac_compile\"") >&5
5400   (eval $ac_compile) 2>&5
5401   ac_status=$?
5402   echo "$as_me:5402: \$? = $ac_status" >&5
5403   (exit "$ac_status"); } &&
5404          { ac_try='test -s "conftest.$ac_objext"'
5405   { (eval echo "$as_me:5405: \"$ac_try\"") >&5
5406   (eval $ac_try) 2>&5
5407   ac_status=$?
5408   echo "$as_me:5408: \$? = $ac_status" >&5
5409   (exit "$ac_status"); }; }; then
5410   cf_cv_xopen_source=no
5411 else
5412   echo "$as_me: failed program was:" >&5
5413 cat "conftest.$ac_ext" >&5
5414 cf_save="$CPPFLAGS"
5415
5416         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5417         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5418
5419          cat >"conftest.$ac_ext" <<_ACEOF
5420 #line 5420 "configure"
5421 #include "confdefs.h"
5422
5423 #include <stdlib.h>
5424 #include <string.h>
5425 #include <sys/types.h>
5426
5427 int
5428 main (void)
5429 {
5430
5431 #ifdef _XOPEN_SOURCE
5432 make an error
5433 #endif
5434   ;
5435   return 0;
5436 }
5437 _ACEOF
5438 rm -f "conftest.$ac_objext"
5439 if { (eval echo "$as_me:5439: \"$ac_compile\"") >&5
5440   (eval $ac_compile) 2>&5
5441   ac_status=$?
5442   echo "$as_me:5442: \$? = $ac_status" >&5
5443   (exit "$ac_status"); } &&
5444          { ac_try='test -s "conftest.$ac_objext"'
5445   { (eval echo "$as_me:5445: \"$ac_try\"") >&5
5446   (eval $ac_try) 2>&5
5447   ac_status=$?
5448   echo "$as_me:5448: \$? = $ac_status" >&5
5449   (exit "$ac_status"); }; }; then
5450   cf_cv_xopen_source=no
5451 else
5452   echo "$as_me: failed program was:" >&5
5453 cat "conftest.$ac_ext" >&5
5454 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5455 fi
5456 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5457         CPPFLAGS="$cf_save"
5458
5459 fi
5460 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5461
5462 fi
5463 echo "$as_me:5463: result: $cf_cv_xopen_source" >&5
5464 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5465
5466 if test "$cf_cv_xopen_source" != no ; then
5467
5468 CFLAGS=`echo "$CFLAGS" | \
5469         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5470                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5471
5472 CPPFLAGS=`echo "$CPPFLAGS" | \
5473         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5474                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5475
5476         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5477
5478 cf_fix_cppflags=no
5479 cf_new_cflags=
5480 cf_new_cppflags=
5481 cf_new_extra_cppflags=
5482
5483 for cf_add_cflags in $cf_temp_xopen_source
5484 do
5485 case "$cf_fix_cppflags" in
5486 (no)
5487         case "$cf_add_cflags" in
5488         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5489                 case "$cf_add_cflags" in
5490                 (-D*)
5491                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5492
5493                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5494                                 && test -z "${cf_tst_cflags}" \
5495                                 && cf_fix_cppflags=yes
5496
5497                         if test "$cf_fix_cppflags" = yes ; then
5498
5499         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5500         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5501
5502                                 continue
5503                         elif test "${cf_tst_cflags}" = "\"'" ; then
5504
5505         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5506         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5507
5508                                 continue
5509                         fi
5510                         ;;
5511                 esac
5512                 case "$CPPFLAGS" in
5513                 (*$cf_add_cflags)
5514                         ;;
5515                 (*)
5516                         case "$cf_add_cflags" in
5517                         (-D*)
5518                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5519
5520 CPPFLAGS=`echo "$CPPFLAGS" | \
5521         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5522                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5523
5524                                 ;;
5525                         esac
5526
5527         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5528         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5529
5530                         ;;
5531                 esac
5532                 ;;
5533         (*)
5534
5535         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5536         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5537
5538                 ;;
5539         esac
5540         ;;
5541 (yes)
5542
5543         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5544         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5545
5546         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5547
5548         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5549                 && test -z "${cf_tst_cflags}" \
5550                 && cf_fix_cppflags=no
5551         ;;
5552 esac
5553 done
5554
5555 if test -n "$cf_new_cflags" ; then
5556
5557         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5558         CFLAGS="${CFLAGS}$cf_new_cflags"
5559
5560 fi
5561
5562 if test -n "$cf_new_cppflags" ; then
5563
5564         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5565         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5566
5567 fi
5568
5569 if test -n "$cf_new_extra_cppflags" ; then
5570
5571         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5572         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5573
5574 fi
5575
5576 fi
5577
5578         fi
5579 fi
5580 fi # cf_cv_posix_visible
5581
5582 echo "$as_me:5582: checking for signal global datatype" >&5
5583 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5584 if test "${cf_cv_sig_atomic_t+set}" = set; then
5585   echo $ECHO_N "(cached) $ECHO_C" >&6
5586 else
5587
5588         for cf_type in \
5589                 "volatile sig_atomic_t" \
5590                 "sig_atomic_t" \
5591                 "int"
5592         do
5593         cat >"conftest.$ac_ext" <<_ACEOF
5594 #line 5594 "configure"
5595 #include "confdefs.h"
5596
5597 #include <sys/types.h>
5598 #include <signal.h>
5599 #include <stdio.h>
5600
5601 extern $cf_type x;
5602 $cf_type x;
5603 static void handler(int sig)
5604 {
5605         (void)sig;
5606         x = 5;
5607 }
5608 int
5609 main (void)
5610 {
5611 signal(SIGINT, handler);
5612                  x = 1
5613   ;
5614   return 0;
5615 }
5616 _ACEOF
5617 rm -f "conftest.$ac_objext"
5618 if { (eval echo "$as_me:5618: \"$ac_compile\"") >&5
5619   (eval $ac_compile) 2>&5
5620   ac_status=$?
5621   echo "$as_me:5621: \$? = $ac_status" >&5
5622   (exit "$ac_status"); } &&
5623          { ac_try='test -s "conftest.$ac_objext"'
5624   { (eval echo "$as_me:5624: \"$ac_try\"") >&5
5625   (eval $ac_try) 2>&5
5626   ac_status=$?
5627   echo "$as_me:5627: \$? = $ac_status" >&5
5628   (exit "$ac_status"); }; }; then
5629   cf_cv_sig_atomic_t=$cf_type
5630 else
5631   echo "$as_me: failed program was:" >&5
5632 cat "conftest.$ac_ext" >&5
5633 cf_cv_sig_atomic_t=no
5634 fi
5635 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5636                 test "$cf_cv_sig_atomic_t" != no && break
5637         done
5638
5639 fi
5640
5641 echo "$as_me:5641: result: $cf_cv_sig_atomic_t" >&5
5642 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5643 test "$cf_cv_sig_atomic_t" != no &&
5644 cat >>confdefs.h <<EOF
5645 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5646 EOF
5647
5648 # Work around breakage on OS X
5649
5650 echo "$as_me:5650: checking if SIGWINCH is defined" >&5
5651 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5652 if test "${cf_cv_define_sigwinch+set}" = set; then
5653   echo $ECHO_N "(cached) $ECHO_C" >&6
5654 else
5655
5656         cat >"conftest.$ac_ext" <<_ACEOF
5657 #line 5657 "configure"
5658 #include "confdefs.h"
5659
5660 #include <sys/types.h>
5661 #include <sys/signal.h>
5662
5663 int
5664 main (void)
5665 {
5666 int x = SIGWINCH; (void)x
5667   ;
5668   return 0;
5669 }
5670 _ACEOF
5671 rm -f "conftest.$ac_objext"
5672 if { (eval echo "$as_me:5672: \"$ac_compile\"") >&5
5673   (eval $ac_compile) 2>&5
5674   ac_status=$?
5675   echo "$as_me:5675: \$? = $ac_status" >&5
5676   (exit "$ac_status"); } &&
5677          { ac_try='test -s "conftest.$ac_objext"'
5678   { (eval echo "$as_me:5678: \"$ac_try\"") >&5
5679   (eval $ac_try) 2>&5
5680   ac_status=$?
5681   echo "$as_me:5681: \$? = $ac_status" >&5
5682   (exit "$ac_status"); }; }; then
5683   cf_cv_define_sigwinch=yes
5684 else
5685   echo "$as_me: failed program was:" >&5
5686 cat "conftest.$ac_ext" >&5
5687 cat >"conftest.$ac_ext" <<_ACEOF
5688 #line 5688 "configure"
5689 #include "confdefs.h"
5690
5691 #undef _XOPEN_SOURCE
5692 #undef _POSIX_SOURCE
5693 #undef _POSIX_C_SOURCE
5694 #include <sys/types.h>
5695 #include <sys/signal.h>
5696
5697 int
5698 main (void)
5699 {
5700 int x = SIGWINCH; (void)x
5701   ;
5702   return 0;
5703 }
5704 _ACEOF
5705 rm -f "conftest.$ac_objext"
5706 if { (eval echo "$as_me:5706: \"$ac_compile\"") >&5
5707   (eval $ac_compile) 2>&5
5708   ac_status=$?
5709   echo "$as_me:5709: \$? = $ac_status" >&5
5710   (exit "$ac_status"); } &&
5711          { ac_try='test -s "conftest.$ac_objext"'
5712   { (eval echo "$as_me:5712: \"$ac_try\"") >&5
5713   (eval $ac_try) 2>&5
5714   ac_status=$?
5715   echo "$as_me:5715: \$? = $ac_status" >&5
5716   (exit "$ac_status"); }; }; then
5717   cf_cv_define_sigwinch=maybe
5718 else
5719   echo "$as_me: failed program was:" >&5
5720 cat "conftest.$ac_ext" >&5
5721 cf_cv_define_sigwinch=no
5722 fi
5723 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5724
5725 fi
5726 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5727
5728 fi
5729 echo "$as_me:5729: result: $cf_cv_define_sigwinch" >&5
5730 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5731
5732 if test "$cf_cv_define_sigwinch" = maybe ; then
5733 echo "$as_me:5733: checking for actual SIGWINCH definition" >&5
5734 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5735 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5736   echo $ECHO_N "(cached) $ECHO_C" >&6
5737 else
5738
5739 cf_cv_fixup_sigwinch=unknown
5740 cf_sigwinch=32
5741 while test "$cf_sigwinch" != 1
5742 do
5743         cat >"conftest.$ac_ext" <<_ACEOF
5744 #line 5744 "configure"
5745 #include "confdefs.h"
5746
5747 #undef _XOPEN_SOURCE
5748 #undef _POSIX_SOURCE
5749 #undef _POSIX_C_SOURCE
5750 #include <sys/types.h>
5751 #include <sys/signal.h>
5752
5753 int
5754 main (void)
5755 {
5756
5757 #if SIGWINCH != $cf_sigwinch
5758 make an error
5759 #endif
5760 int x = SIGWINCH; (void)x
5761   ;
5762   return 0;
5763 }
5764 _ACEOF
5765 rm -f "conftest.$ac_objext"
5766 if { (eval echo "$as_me:5766: \"$ac_compile\"") >&5
5767   (eval $ac_compile) 2>&5
5768   ac_status=$?
5769   echo "$as_me:5769: \$? = $ac_status" >&5
5770   (exit "$ac_status"); } &&
5771          { ac_try='test -s "conftest.$ac_objext"'
5772   { (eval echo "$as_me:5772: \"$ac_try\"") >&5
5773   (eval $ac_try) 2>&5
5774   ac_status=$?
5775   echo "$as_me:5775: \$? = $ac_status" >&5
5776   (exit "$ac_status"); }; }; then
5777   cf_cv_fixup_sigwinch=$cf_sigwinch
5778          break
5779 else
5780   echo "$as_me: failed program was:" >&5
5781 cat "conftest.$ac_ext" >&5
5782 fi
5783 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5784
5785 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
5786 done
5787
5788 fi
5789 echo "$as_me:5789: result: $cf_cv_fixup_sigwinch" >&5
5790 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5791
5792         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5793                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5794         fi
5795 fi
5796
5797 # Checks for CODESET support.
5798
5799 echo "$as_me:5799: checking for nl_langinfo and CODESET" >&5
5800 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5801 if test "${am_cv_langinfo_codeset+set}" = set; then
5802   echo $ECHO_N "(cached) $ECHO_C" >&6
5803 else
5804   cat >"conftest.$ac_ext" <<_ACEOF
5805 #line 5805 "configure"
5806 #include "confdefs.h"
5807 #include <langinfo.h>
5808 int
5809 main (void)
5810 {
5811 char* cs = nl_langinfo(CODESET); (void)cs
5812   ;
5813   return 0;
5814 }
5815 _ACEOF
5816 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5817 if { (eval echo "$as_me:5817: \"$ac_link\"") >&5
5818   (eval $ac_link) 2>&5
5819   ac_status=$?
5820   echo "$as_me:5820: \$? = $ac_status" >&5
5821   (exit "$ac_status"); } &&
5822          { ac_try='test -s "conftest$ac_exeext"'
5823   { (eval echo "$as_me:5823: \"$ac_try\"") >&5
5824   (eval $ac_try) 2>&5
5825   ac_status=$?
5826   echo "$as_me:5826: \$? = $ac_status" >&5
5827   (exit "$ac_status"); }; }; then
5828   am_cv_langinfo_codeset=yes
5829 else
5830   echo "$as_me: failed program was:" >&5
5831 cat "conftest.$ac_ext" >&5
5832 am_cv_langinfo_codeset=no
5833 fi
5834 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5835
5836 fi
5837 echo "$as_me:5837: result: $am_cv_langinfo_codeset" >&5
5838 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5839         if test "$am_cv_langinfo_codeset" = yes; then
5840
5841 cat >>confdefs.h <<\EOF
5842 #define HAVE_LANGINFO_CODESET 1
5843 EOF
5844
5845         fi
5846
5847 echo "$as_me:5847: checking if you want to use pkg-config" >&5
5848 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5849
5850 # Check whether --with-pkg-config or --without-pkg-config was given.
5851 if test "${with_pkg_config+set}" = set; then
5852   withval="$with_pkg_config"
5853   cf_pkg_config=$withval
5854 else
5855   cf_pkg_config=yes
5856 fi;
5857 echo "$as_me:5857: result: $cf_pkg_config" >&5
5858 echo "${ECHO_T}$cf_pkg_config" >&6
5859
5860 case "$cf_pkg_config" in
5861 (no)
5862         PKG_CONFIG=none
5863         ;;
5864 (yes)
5865
5866 if test -n "$ac_tool_prefix"; then
5867   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5868 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5869 echo "$as_me:5869: checking for $ac_word" >&5
5870 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5871 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5872   echo $ECHO_N "(cached) $ECHO_C" >&6
5873 else
5874   case $PKG_CONFIG in
5875   [\\/]* | ?:[\\/]*)
5876   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5877   ;;
5878   *)
5879   ac_save_IFS=$IFS; IFS=$ac_path_separator
5880 ac_dummy="$PATH"
5881 for ac_dir in $ac_dummy; do
5882   IFS=$ac_save_IFS
5883   test -z "$ac_dir" && ac_dir=.
5884   if $as_executable_p "$ac_dir/$ac_word"; then
5885    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5886    echo "$as_me:5886: found $ac_dir/$ac_word" >&5
5887    break
5888 fi
5889 done
5890
5891   ;;
5892 esac
5893 fi
5894 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5895
5896 if test -n "$PKG_CONFIG"; then
5897   echo "$as_me:5897: result: $PKG_CONFIG" >&5
5898 echo "${ECHO_T}$PKG_CONFIG" >&6
5899 else
5900   echo "$as_me:5900: result: no" >&5
5901 echo "${ECHO_T}no" >&6
5902 fi
5903
5904 fi
5905 if test -z "$ac_cv_path_PKG_CONFIG"; then
5906   ac_pt_PKG_CONFIG=$PKG_CONFIG
5907   # Extract the first word of "pkg-config", so it can be a program name with args.
5908 set dummy pkg-config; ac_word=$2
5909 echo "$as_me:5909: checking for $ac_word" >&5
5910 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5911 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5912   echo $ECHO_N "(cached) $ECHO_C" >&6
5913 else
5914   case $ac_pt_PKG_CONFIG in
5915   [\\/]* | ?:[\\/]*)
5916   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5917   ;;
5918   *)
5919   ac_save_IFS=$IFS; IFS=$ac_path_separator
5920 ac_dummy="$PATH"
5921 for ac_dir in $ac_dummy; do
5922   IFS=$ac_save_IFS
5923   test -z "$ac_dir" && ac_dir=.
5924   if $as_executable_p "$ac_dir/$ac_word"; then
5925    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5926    echo "$as_me:5926: found $ac_dir/$ac_word" >&5
5927    break
5928 fi
5929 done
5930
5931   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5932   ;;
5933 esac
5934 fi
5935 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5936
5937 if test -n "$ac_pt_PKG_CONFIG"; then
5938   echo "$as_me:5938: result: $ac_pt_PKG_CONFIG" >&5
5939 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5940 else
5941   echo "$as_me:5941: result: no" >&5
5942 echo "${ECHO_T}no" >&6
5943 fi
5944
5945   PKG_CONFIG=$ac_pt_PKG_CONFIG
5946 else
5947   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5948 fi
5949
5950         ;;
5951 (*)
5952         PKG_CONFIG=$withval
5953         ;;
5954 esac
5955
5956 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5957 if test "$PKG_CONFIG" != none ; then
5958
5959 if test "x$prefix" != xNONE; then
5960         cf_path_syntax="$prefix"
5961 else
5962         cf_path_syntax="$ac_default_prefix"
5963 fi
5964
5965 case ".$PKG_CONFIG" in
5966 (.\$\(*\)*|.\'*\'*)
5967         ;;
5968 (..|./*|.\\*)
5969         ;;
5970 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5971         ;;
5972 (.\$\{*prefix\}*|.\$\{*dir\}*)
5973         eval PKG_CONFIG="$PKG_CONFIG"
5974         case ".$PKG_CONFIG" in
5975         (.NONE/*)
5976                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
5977                 ;;
5978         esac
5979         ;;
5980 (.no|.NONE/*)
5981         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
5982         ;;
5983 (*)
5984         { { echo "$as_me:5984: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5985 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5986    { (exit 1); exit 1; }; }
5987         ;;
5988 esac
5989
5990 elif test "x$cf_pkg_config" != xno ; then
5991         { echo "$as_me:5991: WARNING: pkg-config is not installed" >&5
5992 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5993 fi
5994
5995 echo "$as_me:5995: checking if you want to see long compiling messages" >&5
5996 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5997
5998 # Check whether --enable-echo or --disable-echo was given.
5999 if test "${enable_echo+set}" = set; then
6000   enableval="$enable_echo"
6001   test "$enableval" != no && enableval=yes
6002         if test "$enableval" != "yes" ; then
6003
6004         ECHO_LT='--silent'
6005         ECHO_LD='@echo linking $@;'
6006         RULE_CC='@echo compiling $<'
6007         SHOW_CC='@echo compiling $@'
6008         ECHO_CC='@'
6009
6010         else
6011
6012         ECHO_LT=''
6013         ECHO_LD=''
6014         RULE_CC=''
6015         SHOW_CC=''
6016         ECHO_CC=''
6017
6018         fi
6019 else
6020   enableval=yes
6021
6022         ECHO_LT=''
6023         ECHO_LD=''
6024         RULE_CC=''
6025         SHOW_CC=''
6026         ECHO_CC=''
6027
6028 fi;
6029 echo "$as_me:6029: result: $enableval" >&5
6030 echo "${ECHO_T}$enableval" >&6
6031
6032 echo "$as_me:6032: checking for ncurses wrap-prefix" >&5
6033 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6034
6035 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6036 if test "${with_ncurses_wrap_prefix+set}" = set; then
6037   withval="$with_ncurses_wrap_prefix"
6038   NCURSES_WRAP_PREFIX=$withval
6039 else
6040   NCURSES_WRAP_PREFIX=_nc_
6041 fi;
6042 echo "$as_me:6042: result: $NCURSES_WRAP_PREFIX" >&5
6043 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6044
6045 echo "$as_me:6045: checking if you want to check for wide-character functions" >&5
6046 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6047
6048 # Check whether --enable-widec or --disable-widec was given.
6049 if test "${enable_widec+set}" = set; then
6050   enableval="$enable_widec"
6051   test "$enableval" != no && enableval=yes
6052         if test "$enableval" != "yes" ; then
6053     cf_enable_widec=no
6054         else
6055                 cf_enable_widec=yes
6056         fi
6057 else
6058   enableval=yes
6059         cf_enable_widec=yes
6060
6061 fi;
6062 echo "$as_me:6062: result: $cf_enable_widec" >&5
6063 echo "${ECHO_T}$cf_enable_widec" >&6
6064
6065 echo "$as_me:6065: checking for specific curses-directory" >&5
6066 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6067
6068 # Check whether --with-curses-dir or --without-curses-dir was given.
6069 if test "${with_curses_dir+set}" = set; then
6070   withval="$with_curses_dir"
6071   cf_cv_curses_dir=$withval
6072 else
6073   cf_cv_curses_dir=no
6074 fi;
6075 echo "$as_me:6075: result: $cf_cv_curses_dir" >&5
6076 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6077
6078 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6079 then
6080
6081 if test "x$prefix" != xNONE; then
6082         cf_path_syntax="$prefix"
6083 else
6084         cf_path_syntax="$ac_default_prefix"
6085 fi
6086
6087 case ".$withval" in
6088 (.\$\(*\)*|.\'*\'*)
6089         ;;
6090 (..|./*|.\\*)
6091         ;;
6092 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6093         ;;
6094 (.\$\{*prefix\}*|.\$\{*dir\}*)
6095         eval withval="$withval"
6096         case ".$withval" in
6097         (.NONE/*)
6098                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6099                 ;;
6100         esac
6101         ;;
6102 (.no|.NONE/*)
6103         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6104         ;;
6105 (*)
6106         { { echo "$as_me:6106: error: expected a pathname, not \"$withval\"" >&5
6107 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6108    { (exit 1); exit 1; }; }
6109         ;;
6110 esac
6111
6112         if test -d "$cf_cv_curses_dir"
6113         then
6114
6115 if test -n "$cf_cv_curses_dir/include" ; then
6116   for cf_add_incdir in $cf_cv_curses_dir/include
6117   do
6118         while test "$cf_add_incdir" != /usr/include
6119         do
6120           if test -d "$cf_add_incdir"
6121           then
6122                 cf_have_incdir=no
6123                 if test -n "$CFLAGS$CPPFLAGS" ; then
6124                   # a loop is needed to ensure we can add subdirs of existing dirs
6125                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6126                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6127                           cf_have_incdir=yes; break
6128                         fi
6129                   done
6130                 fi
6131
6132                 if test "$cf_have_incdir" = no ; then
6133                   if test "$cf_add_incdir" = /usr/local/include ; then
6134                         if test "$GCC" = yes
6135                         then
6136                           cf_save_CPPFLAGS=$CPPFLAGS
6137
6138         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6139         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6140
6141                           cat >"conftest.$ac_ext" <<_ACEOF
6142 #line 6142 "configure"
6143 #include "confdefs.h"
6144 #include <stdio.h>
6145 int
6146 main (void)
6147 {
6148 printf("Hello")
6149   ;
6150   return 0;
6151 }
6152 _ACEOF
6153 rm -f "conftest.$ac_objext"
6154 if { (eval echo "$as_me:6154: \"$ac_compile\"") >&5
6155   (eval $ac_compile) 2>&5
6156   ac_status=$?
6157   echo "$as_me:6157: \$? = $ac_status" >&5
6158   (exit "$ac_status"); } &&
6159          { ac_try='test -s "conftest.$ac_objext"'
6160   { (eval echo "$as_me:6160: \"$ac_try\"") >&5
6161   (eval $ac_try) 2>&5
6162   ac_status=$?
6163   echo "$as_me:6163: \$? = $ac_status" >&5
6164   (exit "$ac_status"); }; }; then
6165   :
6166 else
6167   echo "$as_me: failed program was:" >&5
6168 cat "conftest.$ac_ext" >&5
6169 cf_have_incdir=yes
6170 fi
6171 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6172                           CPPFLAGS=$cf_save_CPPFLAGS
6173                         fi
6174                   fi
6175                 fi
6176
6177                 if test "$cf_have_incdir" = no ; then
6178                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6179
6180 echo "${as_me:-configure}:6180: testing adding $cf_add_incdir to include-path ..." 1>&5
6181
6182                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6183
6184                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6185                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6186                   cf_add_incdir="$cf_top_incdir"
6187                 else
6188                   break
6189                 fi
6190           else
6191                 break
6192           fi
6193         done
6194   done
6195 fi
6196
6197 if test -n "$cf_cv_curses_dir/lib" ; then
6198         for cf_add_libdir in $cf_cv_curses_dir/lib
6199         do
6200                 if test "$cf_add_libdir" = /usr/lib ; then
6201                         :
6202                 elif test -d "$cf_add_libdir"
6203                 then
6204                         cf_have_libdir=no
6205                         if test -n "$LDFLAGS$LIBS" ; then
6206                                 # a loop is needed to ensure we can add subdirs of existing dirs
6207                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6208                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6209                                                 cf_have_libdir=yes; break
6210                                         fi
6211                                 done
6212                         fi
6213                         if test "$cf_have_libdir" = no ; then
6214                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6215
6216 echo "${as_me:-configure}:6216: testing adding $cf_add_libdir to library-path ..." 1>&5
6217
6218                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6219                         fi
6220                 fi
6221         done
6222 fi
6223
6224         fi
6225 fi
6226
6227 cf_cv_screen=curses
6228
6229 echo "$as_me:6229: checking for specified curses library type" >&5
6230 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6231
6232 # Check whether --with-screen or --without-screen was given.
6233 if test "${with_screen+set}" = set; then
6234   withval="$with_screen"
6235   cf_cv_screen=$withval
6236 else
6237
6238 # Check whether --with-ncursesw or --without-ncursesw was given.
6239 if test "${with_ncursesw+set}" = set; then
6240   withval="$with_ncursesw"
6241   cf_cv_screen=ncursesw
6242 else
6243
6244 # Check whether --with-ncurses or --without-ncurses was given.
6245 if test "${with_ncurses+set}" = set; then
6246   withval="$with_ncurses"
6247   cf_cv_screen=ncurses
6248 else
6249
6250 # Check whether --with-pdcurses or --without-pdcurses was given.
6251 if test "${with_pdcurses+set}" = set; then
6252   withval="$with_pdcurses"
6253   cf_cv_screen=pdcurses
6254 else
6255
6256 # Check whether --with-curses-colr or --without-curses-colr was given.
6257 if test "${with_curses_colr+set}" = set; then
6258   withval="$with_curses_colr"
6259   cf_cv_screen=curses_colr
6260 else
6261
6262 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6263 if test "${with_curses_5lib+set}" = set; then
6264   withval="$with_curses_5lib"
6265   cf_cv_screen=curses_5lib
6266 fi;
6267 fi;
6268 fi;
6269 fi;
6270 fi;
6271 fi;
6272
6273 echo "$as_me:6273: result: $cf_cv_screen" >&5
6274 echo "${ECHO_T}$cf_cv_screen" >&6
6275
6276 case $cf_cv_screen in
6277 (curses|curses_*)
6278
6279 echo "$as_me:6279: checking for extra include directories" >&5
6280 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6281 if test "${cf_cv_curses_incdir+set}" = set; then
6282   echo $ECHO_N "(cached) $ECHO_C" >&6
6283 else
6284
6285 cf_cv_curses_incdir=no
6286 case "$host_os" in
6287 (hpux10.*)
6288         if test "x$cf_cv_screen" = "xcurses_colr"
6289         then
6290                 test -d /usr/include/curses_colr && \
6291                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6292         fi
6293         ;;
6294 (sunos3*|sunos4*)
6295         if test "x$cf_cv_screen" = "xcurses_5lib"
6296         then
6297                 test -d /usr/5lib && \
6298                 test -d /usr/5include && \
6299                 cf_cv_curses_incdir="-I/usr/5include"
6300         fi
6301         ;;
6302 esac
6303
6304 fi
6305 echo "$as_me:6305: result: $cf_cv_curses_incdir" >&5
6306 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6307 if test "$cf_cv_curses_incdir" != no
6308 then
6309
6310         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6311         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6312
6313 fi
6314
6315 echo "$as_me:6315: checking if we have identified curses headers" >&5
6316 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6317 if test "${cf_cv_ncurses_header+set}" = set; then
6318   echo $ECHO_N "(cached) $ECHO_C" >&6
6319 else
6320
6321 cf_cv_ncurses_header=none
6322 for cf_header in \
6323         ncurses.h  \
6324         curses.h  ncurses/ncurses.h ncurses/curses.h
6325 do
6326 cat >"conftest.$ac_ext" <<_ACEOF
6327 #line 6327 "configure"
6328 #include "confdefs.h"
6329 #include <${cf_header}>
6330 int
6331 main (void)
6332 {
6333 initscr(); tgoto("?", 0,0)
6334   ;
6335   return 0;
6336 }
6337 _ACEOF
6338 rm -f "conftest.$ac_objext"
6339 if { (eval echo "$as_me:6339: \"$ac_compile\"") >&5
6340   (eval $ac_compile) 2>&5
6341   ac_status=$?
6342   echo "$as_me:6342: \$? = $ac_status" >&5
6343   (exit "$ac_status"); } &&
6344          { ac_try='test -s "conftest.$ac_objext"'
6345   { (eval echo "$as_me:6345: \"$ac_try\"") >&5
6346   (eval $ac_try) 2>&5
6347   ac_status=$?
6348   echo "$as_me:6348: \$? = $ac_status" >&5
6349   (exit "$ac_status"); }; }; then
6350   cf_cv_ncurses_header=$cf_header; break
6351 else
6352   echo "$as_me: failed program was:" >&5
6353 cat "conftest.$ac_ext" >&5
6354 fi
6355 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6356 done
6357
6358 fi
6359 echo "$as_me:6359: result: $cf_cv_ncurses_header" >&5
6360 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6361
6362 if test "$cf_cv_ncurses_header" = none ; then
6363         { { echo "$as_me:6363: error: No curses header-files found" >&5
6364 echo "$as_me: error: No curses header-files found" >&2;}
6365    { (exit 1); exit 1; }; }
6366 fi
6367
6368 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6369
6370 for ac_header in $cf_cv_ncurses_header
6371 do
6372 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6373 echo "$as_me:6373: checking for $ac_header" >&5
6374 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6375 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6376   echo $ECHO_N "(cached) $ECHO_C" >&6
6377 else
6378   cat >"conftest.$ac_ext" <<_ACEOF
6379 #line 6379 "configure"
6380 #include "confdefs.h"
6381 #include <$ac_header>
6382 _ACEOF
6383 if { (eval echo "$as_me:6383: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6384   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6385   ac_status=$?
6386   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6387   rm -f conftest.er1
6388   cat conftest.err >&5
6389   echo "$as_me:6389: \$? = $ac_status" >&5
6390   (exit "$ac_status"); } >/dev/null; then
6391   if test -s conftest.err; then
6392     ac_cpp_err=$ac_c_preproc_warn_flag
6393   else
6394     ac_cpp_err=
6395   fi
6396 else
6397   ac_cpp_err=yes
6398 fi
6399 if test -z "$ac_cpp_err"; then
6400   eval "$as_ac_Header=yes"
6401 else
6402   echo "$as_me: failed program was:" >&5
6403   cat "conftest.$ac_ext" >&5
6404   eval "$as_ac_Header=no"
6405 fi
6406 rm -f conftest.err "conftest.$ac_ext"
6407 fi
6408 echo "$as_me:6408: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6409 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6410 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6411   cat >>confdefs.h <<EOF
6412 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6413 EOF
6414
6415 fi
6416 done
6417
6418 echo "$as_me:6418: checking for terminfo header" >&5
6419 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6420 if test "${cf_cv_term_header+set}" = set; then
6421   echo $ECHO_N "(cached) $ECHO_C" >&6
6422 else
6423
6424 case "${cf_cv_ncurses_header}" in
6425 (*/ncurses.h|*/ncursesw.h)
6426         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6427         ;;
6428 (*)
6429         cf_term_header=term.h
6430         ;;
6431 esac
6432
6433 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6434 do
6435 cat >"conftest.$ac_ext" <<_ACEOF
6436 #line 6436 "configure"
6437 #include "confdefs.h"
6438 #include <stdio.h>
6439 #include <${cf_cv_ncurses_header:-curses.h}>
6440 #include <$cf_test>
6441
6442 int
6443 main (void)
6444 {
6445 int x = auto_left_margin; (void)x
6446   ;
6447   return 0;
6448 }
6449 _ACEOF
6450 rm -f "conftest.$ac_objext"
6451 if { (eval echo "$as_me:6451: \"$ac_compile\"") >&5
6452   (eval $ac_compile) 2>&5
6453   ac_status=$?
6454   echo "$as_me:6454: \$? = $ac_status" >&5
6455   (exit "$ac_status"); } &&
6456          { ac_try='test -s "conftest.$ac_objext"'
6457   { (eval echo "$as_me:6457: \"$ac_try\"") >&5
6458   (eval $ac_try) 2>&5
6459   ac_status=$?
6460   echo "$as_me:6460: \$? = $ac_status" >&5
6461   (exit "$ac_status"); }; }; then
6462
6463         cf_cv_term_header="$cf_test"
6464 else
6465   echo "$as_me: failed program was:" >&5
6466 cat "conftest.$ac_ext" >&5
6467
6468         cf_cv_term_header=unknown
6469
6470 fi
6471 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6472         test "$cf_cv_term_header" != unknown && break
6473 done
6474
6475 fi
6476 echo "$as_me:6476: result: $cf_cv_term_header" >&5
6477 echo "${ECHO_T}$cf_cv_term_header" >&6
6478
6479 # Set definitions to allow ifdef'ing to accommodate subdirectories
6480
6481 case "$cf_cv_term_header" in
6482 (*term.h)
6483
6484 cat >>confdefs.h <<\EOF
6485 #define HAVE_TERM_H 1
6486 EOF
6487
6488         ;;
6489 esac
6490
6491 case "$cf_cv_term_header" in
6492 (ncurses/term.h)
6493
6494 cat >>confdefs.h <<\EOF
6495 #define HAVE_NCURSES_TERM_H 1
6496 EOF
6497
6498         ;;
6499 (ncursesw/term.h)
6500
6501 cat >>confdefs.h <<\EOF
6502 #define HAVE_NCURSESW_TERM_H 1
6503 EOF
6504
6505         ;;
6506 esac
6507
6508 echo "$as_me:6508: checking for ncurses version" >&5
6509 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6510 if test "${cf_cv_ncurses_version+set}" = set; then
6511   echo $ECHO_N "(cached) $ECHO_C" >&6
6512 else
6513
6514         cf_cv_ncurses_version=no
6515         cf_tempfile=out$$
6516         rm -f "$cf_tempfile"
6517         if test "$cross_compiling" = yes; then
6518
6519         # This will not work if the preprocessor splits the line after the
6520         # Autoconf token.  The 'unproto' program does that.
6521         cat > "conftest.$ac_ext" <<EOF
6522 #include <${cf_cv_ncurses_header:-curses.h}>
6523 #undef Autoconf
6524 #ifdef NCURSES_VERSION
6525 Autoconf NCURSES_VERSION
6526 #else
6527 #ifdef __NCURSES_H
6528 Autoconf "old"
6529 #endif
6530 ;
6531 #endif
6532 EOF
6533         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6534         { (eval echo "$as_me:6534: \"$cf_try\"") >&5
6535   (eval $cf_try) 2>&5
6536   ac_status=$?
6537   echo "$as_me:6537: \$? = $ac_status" >&5
6538   (exit "$ac_status"); }
6539         if test -f conftest.out ; then
6540                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6541                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6542                 rm -f conftest.out
6543         fi
6544
6545 else
6546   cat >"conftest.$ac_ext" <<_ACEOF
6547 #line 6547 "configure"
6548 #include "confdefs.h"
6549
6550 #include <${cf_cv_ncurses_header:-curses.h}>
6551 #include <stdio.h>
6552 int main(void)
6553 {
6554         FILE *fp = fopen("$cf_tempfile", "w");
6555 #ifdef NCURSES_VERSION
6556 # ifdef NCURSES_VERSION_PATCH
6557         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6558 # else
6559         fprintf(fp, "%s\\n", NCURSES_VERSION);
6560 # endif
6561 #else
6562 # ifdef __NCURSES_H
6563         fprintf(fp, "old\\n");
6564 # else
6565         make an error
6566 # endif
6567 #endif
6568         ${cf_cv_main_return:-return}(0);
6569 }
6570 _ACEOF
6571 rm -f "conftest$ac_exeext"
6572 if { (eval echo "$as_me:6572: \"$ac_link\"") >&5
6573   (eval $ac_link) 2>&5
6574   ac_status=$?
6575   echo "$as_me:6575: \$? = $ac_status" >&5
6576   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6577   { (eval echo "$as_me:6577: \"$ac_try\"") >&5
6578   (eval $ac_try) 2>&5
6579   ac_status=$?
6580   echo "$as_me:6580: \$? = $ac_status" >&5
6581   (exit "$ac_status"); }; }; then
6582
6583         cf_cv_ncurses_version=`cat $cf_tempfile`
6584 else
6585   echo "$as_me: program exited with status $ac_status" >&5
6586 echo "$as_me: failed program was:" >&5
6587 cat "conftest.$ac_ext" >&5
6588 fi
6589 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6590 fi
6591         rm -f "$cf_tempfile"
6592
6593 fi
6594 echo "$as_me:6594: result: $cf_cv_ncurses_version" >&5
6595 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6596 test "$cf_cv_ncurses_version" = no ||
6597 cat >>confdefs.h <<\EOF
6598 #define NCURSES 1
6599 EOF
6600
6601 echo "$as_me:6601: checking if we have identified curses libraries" >&5
6602 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6603 cat >"conftest.$ac_ext" <<_ACEOF
6604 #line 6604 "configure"
6605 #include "confdefs.h"
6606 #include <${cf_cv_ncurses_header:-curses.h}>
6607 int
6608 main (void)
6609 {
6610 initscr(); tgoto("?", 0,0)
6611   ;
6612   return 0;
6613 }
6614 _ACEOF
6615 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6616 if { (eval echo "$as_me:6616: \"$ac_link\"") >&5
6617   (eval $ac_link) 2>&5
6618   ac_status=$?
6619   echo "$as_me:6619: \$? = $ac_status" >&5
6620   (exit "$ac_status"); } &&
6621          { ac_try='test -s "conftest$ac_exeext"'
6622   { (eval echo "$as_me:6622: \"$ac_try\"") >&5
6623   (eval $ac_try) 2>&5
6624   ac_status=$?
6625   echo "$as_me:6625: \$? = $ac_status" >&5
6626   (exit "$ac_status"); }; }; then
6627   cf_result=yes
6628 else
6629   echo "$as_me: failed program was:" >&5
6630 cat "conftest.$ac_ext" >&5
6631 cf_result=no
6632 fi
6633 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6634 echo "$as_me:6634: result: $cf_result" >&5
6635 echo "${ECHO_T}$cf_result" >&6
6636
6637 if test "$cf_result" = no ; then
6638 case "$host_os" in
6639 (freebsd*)
6640         echo "$as_me:6640: checking for tgoto in -lmytinfo" >&5
6641 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6642 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6643   echo $ECHO_N "(cached) $ECHO_C" >&6
6644 else
6645   ac_check_lib_save_LIBS=$LIBS
6646 LIBS="-lmytinfo  $LIBS"
6647 cat >"conftest.$ac_ext" <<_ACEOF
6648 #line 6648 "configure"
6649 #include "confdefs.h"
6650
6651 /* Override any gcc2 internal prototype to avoid an error.  */
6652 #ifdef __cplusplus
6653 extern "C"
6654 #endif
6655 /* We use char because int might match the return type of a gcc2
6656    builtin and then its argument prototype would still apply.  */
6657 char tgoto ();
6658 int
6659 main (void)
6660 {
6661 tgoto ();
6662   ;
6663   return 0;
6664 }
6665 _ACEOF
6666 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6667 if { (eval echo "$as_me:6667: \"$ac_link\"") >&5
6668   (eval $ac_link) 2>&5
6669   ac_status=$?
6670   echo "$as_me:6670: \$? = $ac_status" >&5
6671   (exit "$ac_status"); } &&
6672          { ac_try='test -s "conftest$ac_exeext"'
6673   { (eval echo "$as_me:6673: \"$ac_try\"") >&5
6674   (eval $ac_try) 2>&5
6675   ac_status=$?
6676   echo "$as_me:6676: \$? = $ac_status" >&5
6677   (exit "$ac_status"); }; }; then
6678   ac_cv_lib_mytinfo_tgoto=yes
6679 else
6680   echo "$as_me: failed program was:" >&5
6681 cat "conftest.$ac_ext" >&5
6682 ac_cv_lib_mytinfo_tgoto=no
6683 fi
6684 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6685 LIBS=$ac_check_lib_save_LIBS
6686 fi
6687 echo "$as_me:6687: result: $ac_cv_lib_mytinfo_tgoto" >&5
6688 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6689 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6690
6691 cf_add_libs="$LIBS"
6692 # reverse order
6693 cf_add_0lib=
6694 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6695 # filter duplicates
6696 for cf_add_1lib in $cf_add_0lib; do
6697         for cf_add_2lib in $cf_add_libs; do
6698                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6699                         cf_add_1lib=
6700                         break
6701                 fi
6702         done
6703         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6704 done
6705 LIBS="$cf_add_libs"
6706
6707 fi
6708
6709         ;;
6710 (hpux10.*)
6711         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6712         # next (1998), and xcurses "newer" (2000).  There is no header file for
6713         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6714         # term.h) for cur_colr
6715         if test "x$cf_cv_screen" = "xcurses_colr"
6716         then
6717                 echo "$as_me:6717: checking for initscr in -lcur_colr" >&5
6718 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6719 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6720   echo $ECHO_N "(cached) $ECHO_C" >&6
6721 else
6722   ac_check_lib_save_LIBS=$LIBS
6723 LIBS="-lcur_colr  $LIBS"
6724 cat >"conftest.$ac_ext" <<_ACEOF
6725 #line 6725 "configure"
6726 #include "confdefs.h"
6727
6728 /* Override any gcc2 internal prototype to avoid an error.  */
6729 #ifdef __cplusplus
6730 extern "C"
6731 #endif
6732 /* We use char because int might match the return type of a gcc2
6733    builtin and then its argument prototype would still apply.  */
6734 char initscr ();
6735 int
6736 main (void)
6737 {
6738 initscr ();
6739   ;
6740   return 0;
6741 }
6742 _ACEOF
6743 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6744 if { (eval echo "$as_me:6744: \"$ac_link\"") >&5
6745   (eval $ac_link) 2>&5
6746   ac_status=$?
6747   echo "$as_me:6747: \$? = $ac_status" >&5
6748   (exit "$ac_status"); } &&
6749          { ac_try='test -s "conftest$ac_exeext"'
6750   { (eval echo "$as_me:6750: \"$ac_try\"") >&5
6751   (eval $ac_try) 2>&5
6752   ac_status=$?
6753   echo "$as_me:6753: \$? = $ac_status" >&5
6754   (exit "$ac_status"); }; }; then
6755   ac_cv_lib_cur_colr_initscr=yes
6756 else
6757   echo "$as_me: failed program was:" >&5
6758 cat "conftest.$ac_ext" >&5
6759 ac_cv_lib_cur_colr_initscr=no
6760 fi
6761 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6762 LIBS=$ac_check_lib_save_LIBS
6763 fi
6764 echo "$as_me:6764: result: $ac_cv_lib_cur_colr_initscr" >&5
6765 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6766 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
6767
6768 cf_add_libs="$LIBS"
6769 # reverse order
6770 cf_add_0lib=
6771 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6772 # filter duplicates
6773 for cf_add_1lib in $cf_add_0lib; do
6774         for cf_add_2lib in $cf_add_libs; do
6775                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6776                         cf_add_1lib=
6777                         break
6778                 fi
6779         done
6780         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6781 done
6782 LIBS="$cf_add_libs"
6783
6784                         ac_cv_func_initscr=yes
6785
6786 else
6787
6788                 echo "$as_me:6788: checking for initscr in -lHcurses" >&5
6789 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6790 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6791   echo $ECHO_N "(cached) $ECHO_C" >&6
6792 else
6793   ac_check_lib_save_LIBS=$LIBS
6794 LIBS="-lHcurses  $LIBS"
6795 cat >"conftest.$ac_ext" <<_ACEOF
6796 #line 6796 "configure"
6797 #include "confdefs.h"
6798
6799 /* Override any gcc2 internal prototype to avoid an error.  */
6800 #ifdef __cplusplus
6801 extern "C"
6802 #endif
6803 /* We use char because int might match the return type of a gcc2
6804    builtin and then its argument prototype would still apply.  */
6805 char initscr ();
6806 int
6807 main (void)
6808 {
6809 initscr ();
6810   ;
6811   return 0;
6812 }
6813 _ACEOF
6814 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6815 if { (eval echo "$as_me:6815: \"$ac_link\"") >&5
6816   (eval $ac_link) 2>&5
6817   ac_status=$?
6818   echo "$as_me:6818: \$? = $ac_status" >&5
6819   (exit "$ac_status"); } &&
6820          { ac_try='test -s "conftest$ac_exeext"'
6821   { (eval echo "$as_me:6821: \"$ac_try\"") >&5
6822   (eval $ac_try) 2>&5
6823   ac_status=$?
6824   echo "$as_me:6824: \$? = $ac_status" >&5
6825   (exit "$ac_status"); }; }; then
6826   ac_cv_lib_Hcurses_initscr=yes
6827 else
6828   echo "$as_me: failed program was:" >&5
6829 cat "conftest.$ac_ext" >&5
6830 ac_cv_lib_Hcurses_initscr=no
6831 fi
6832 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6833 LIBS=$ac_check_lib_save_LIBS
6834 fi
6835 echo "$as_me:6835: result: $ac_cv_lib_Hcurses_initscr" >&5
6836 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6837 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
6838
6839                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6840
6841 cf_add_libs="$LIBS"
6842 # reverse order
6843 cf_add_0lib=
6844 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6845 # filter duplicates
6846 for cf_add_1lib in $cf_add_0lib; do
6847         for cf_add_2lib in $cf_add_libs; do
6848                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6849                         cf_add_1lib=
6850                         break
6851                 fi
6852         done
6853         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6854 done
6855 LIBS="$cf_add_libs"
6856
6857         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6858         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6859
6860                         ac_cv_func_initscr=yes
6861
6862 fi
6863
6864 fi
6865
6866         fi
6867         ;;
6868 (linux*)
6869         case `arch 2>/dev/null` in
6870         (x86_64)
6871                 if test -d /lib64
6872                 then
6873
6874 if test -n "/lib64" ; then
6875         for cf_add_libdir in /lib64
6876         do
6877                 if test "$cf_add_libdir" = /usr/lib ; then
6878                         :
6879                 elif test -d "$cf_add_libdir"
6880                 then
6881                         cf_have_libdir=no
6882                         if test -n "$LDFLAGS$LIBS" ; then
6883                                 # a loop is needed to ensure we can add subdirs of existing dirs
6884                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6885                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6886                                                 cf_have_libdir=yes; break
6887                                         fi
6888                                 done
6889                         fi
6890                         if test "$cf_have_libdir" = no ; then
6891                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6892
6893 echo "${as_me:-configure}:6893: testing adding $cf_add_libdir to library-path ..." 1>&5
6894
6895                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6896                         fi
6897                 fi
6898         done
6899 fi
6900
6901                 else
6902
6903 if test -n "/lib" ; then
6904         for cf_add_libdir in /lib
6905         do
6906                 if test "$cf_add_libdir" = /usr/lib ; then
6907                         :
6908                 elif test -d "$cf_add_libdir"
6909                 then
6910                         cf_have_libdir=no
6911                         if test -n "$LDFLAGS$LIBS" ; then
6912                                 # a loop is needed to ensure we can add subdirs of existing dirs
6913                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6914                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6915                                                 cf_have_libdir=yes; break
6916                                         fi
6917                                 done
6918                         fi
6919                         if test "$cf_have_libdir" = no ; then
6920                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6921
6922 echo "${as_me:-configure}:6922: testing adding $cf_add_libdir to library-path ..." 1>&5
6923
6924                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6925                         fi
6926                 fi
6927         done
6928 fi
6929
6930                 fi
6931                 ;;
6932         (*)
6933
6934 if test -n "/lib" ; then
6935         for cf_add_libdir in /lib
6936         do
6937                 if test "$cf_add_libdir" = /usr/lib ; then
6938                         :
6939                 elif test -d "$cf_add_libdir"
6940                 then
6941                         cf_have_libdir=no
6942                         if test -n "$LDFLAGS$LIBS" ; then
6943                                 # a loop is needed to ensure we can add subdirs of existing dirs
6944                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6945                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6946                                                 cf_have_libdir=yes; break
6947                                         fi
6948                                 done
6949                         fi
6950                         if test "$cf_have_libdir" = no ; then
6951                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6952
6953 echo "${as_me:-configure}:6953: testing adding $cf_add_libdir to library-path ..." 1>&5
6954
6955                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6956                         fi
6957                 fi
6958         done
6959 fi
6960
6961                 ;;
6962         esac
6963         ;;
6964 (sunos3*|sunos4*)
6965         if test "x$cf_cv_screen" = "xcurses_5lib"
6966         then
6967                 if test -d /usr/5lib ; then
6968
6969 if test -n "/usr/5lib" ; then
6970         for cf_add_libdir in /usr/5lib
6971         do
6972                 if test "$cf_add_libdir" = /usr/lib ; then
6973                         :
6974                 elif test -d "$cf_add_libdir"
6975                 then
6976                         cf_have_libdir=no
6977                         if test -n "$LDFLAGS$LIBS" ; then
6978                                 # a loop is needed to ensure we can add subdirs of existing dirs
6979                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6980                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6981                                                 cf_have_libdir=yes; break
6982                                         fi
6983                                 done
6984                         fi
6985                         if test "$cf_have_libdir" = no ; then
6986                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6987
6988 echo "${as_me:-configure}:6988: testing adding $cf_add_libdir to library-path ..." 1>&5
6989
6990                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6991                         fi
6992                 fi
6993         done
6994 fi
6995
6996 cf_add_libs="$LIBS"
6997 # reverse order
6998 cf_add_0lib=
6999 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7000 # filter duplicates
7001 for cf_add_1lib in $cf_add_0lib; do
7002         for cf_add_2lib in $cf_add_libs; do
7003                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7004                         cf_add_1lib=
7005                         break
7006                 fi
7007         done
7008         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7009 done
7010 LIBS="$cf_add_libs"
7011
7012                 fi
7013         fi
7014         ac_cv_func_initscr=yes
7015         ;;
7016 esac
7017
7018 if test ".$ac_cv_func_initscr" != .yes ; then
7019         cf_save_LIBS="$LIBS"
7020
7021         if test ".${cf_cv_ncurses_version:-no}" != .no
7022         then
7023                 cf_check_list="ncurses curses cursesX"
7024         else
7025                 cf_check_list="cursesX curses ncurses"
7026         fi
7027
7028         # Check for library containing tgoto.  Do this before curses library
7029         # because it may be needed to link the test-case for initscr.
7030         if test "x$cf_term_lib" = x
7031         then
7032                 echo "$as_me:7032: checking for tgoto" >&5
7033 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7034 if test "${ac_cv_func_tgoto+set}" = set; then
7035   echo $ECHO_N "(cached) $ECHO_C" >&6
7036 else
7037   cat >"conftest.$ac_ext" <<_ACEOF
7038 #line 7038 "configure"
7039 #include "confdefs.h"
7040 #define tgoto autoconf_temporary
7041 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7042 #undef tgoto
7043
7044 #ifdef __cplusplus
7045 extern "C"
7046 #endif
7047
7048 /* We use char because int might match the return type of a gcc2
7049    builtin and then its argument prototype would still apply.  */
7050 char tgoto (void);
7051
7052 int
7053 main (void)
7054 {
7055
7056 /* The GNU C library defines stubs for functions which it implements
7057     to always fail with ENOSYS.  Some functions are actually named
7058     something starting with __ and the normal name is an alias.  */
7059 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7060 #error found stub for tgoto
7061 #endif
7062
7063         return tgoto ();
7064   ;
7065   return 0;
7066 }
7067 _ACEOF
7068 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7069 if { (eval echo "$as_me:7069: \"$ac_link\"") >&5
7070   (eval $ac_link) 2>&5
7071   ac_status=$?
7072   echo "$as_me:7072: \$? = $ac_status" >&5
7073   (exit "$ac_status"); } &&
7074          { ac_try='test -s "conftest$ac_exeext"'
7075   { (eval echo "$as_me:7075: \"$ac_try\"") >&5
7076   (eval $ac_try) 2>&5
7077   ac_status=$?
7078   echo "$as_me:7078: \$? = $ac_status" >&5
7079   (exit "$ac_status"); }; }; then
7080   ac_cv_func_tgoto=yes
7081 else
7082   echo "$as_me: failed program was:" >&5
7083 cat "conftest.$ac_ext" >&5
7084 ac_cv_func_tgoto=no
7085 fi
7086 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7087 fi
7088 echo "$as_me:7088: result: $ac_cv_func_tgoto" >&5
7089 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7090 if test "$ac_cv_func_tgoto" = yes; then
7091   cf_term_lib=predefined
7092 else
7093
7094                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7095                         do
7096                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7097 echo "$as_me:7097: checking for tgoto in -l$cf_term_lib" >&5
7098 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7099 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7100   echo $ECHO_N "(cached) $ECHO_C" >&6
7101 else
7102   ac_check_lib_save_LIBS=$LIBS
7103 LIBS="-l$cf_term_lib  $LIBS"
7104 cat >"conftest.$ac_ext" <<_ACEOF
7105 #line 7105 "configure"
7106 #include "confdefs.h"
7107
7108 /* Override any gcc2 internal prototype to avoid an error.  */
7109 #ifdef __cplusplus
7110 extern "C"
7111 #endif
7112 /* We use char because int might match the return type of a gcc2
7113    builtin and then its argument prototype would still apply.  */
7114 char tgoto ();
7115 int
7116 main (void)
7117 {
7118 tgoto ();
7119   ;
7120   return 0;
7121 }
7122 _ACEOF
7123 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7124 if { (eval echo "$as_me:7124: \"$ac_link\"") >&5
7125   (eval $ac_link) 2>&5
7126   ac_status=$?
7127   echo "$as_me:7127: \$? = $ac_status" >&5
7128   (exit "$ac_status"); } &&
7129          { ac_try='test -s "conftest$ac_exeext"'
7130   { (eval echo "$as_me:7130: \"$ac_try\"") >&5
7131   (eval $ac_try) 2>&5
7132   ac_status=$?
7133   echo "$as_me:7133: \$? = $ac_status" >&5
7134   (exit "$ac_status"); }; }; then
7135   eval "$as_ac_Lib=yes"
7136 else
7137   echo "$as_me: failed program was:" >&5
7138 cat "conftest.$ac_ext" >&5
7139 eval "$as_ac_Lib=no"
7140 fi
7141 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7142 LIBS=$ac_check_lib_save_LIBS
7143 fi
7144 echo "$as_me:7144: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7145 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7146 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7147
7148                                         : "${cf_nculib_root:=$cf_term_lib}"
7149                                         break
7150
7151 fi
7152
7153                         done
7154
7155 fi
7156
7157         fi
7158
7159         # Check for library containing initscr
7160         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7161         if test "x$cf_curs_lib" = x
7162         then
7163                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7164                 do
7165                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7166                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7167                                 echo "$as_me:7167: checking if we can link with $cf_curs_lib library" >&5
7168 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7169                                 cat >"conftest.$ac_ext" <<_ACEOF
7170 #line 7170 "configure"
7171 #include "confdefs.h"
7172 #include <${cf_cv_ncurses_header:-curses.h}>
7173 int
7174 main (void)
7175 {
7176 initscr()
7177   ;
7178   return 0;
7179 }
7180 _ACEOF
7181 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7182 if { (eval echo "$as_me:7182: \"$ac_link\"") >&5
7183   (eval $ac_link) 2>&5
7184   ac_status=$?
7185   echo "$as_me:7185: \$? = $ac_status" >&5
7186   (exit "$ac_status"); } &&
7187          { ac_try='test -s "conftest$ac_exeext"'
7188   { (eval echo "$as_me:7188: \"$ac_try\"") >&5
7189   (eval $ac_try) 2>&5
7190   ac_status=$?
7191   echo "$as_me:7191: \$? = $ac_status" >&5
7192   (exit "$ac_status"); }; }; then
7193   cf_result=yes
7194 else
7195   echo "$as_me: failed program was:" >&5
7196 cat "conftest.$ac_ext" >&5
7197 cf_result=no
7198 fi
7199 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7200                                 echo "$as_me:7200: result: $cf_result" >&5
7201 echo "${ECHO_T}$cf_result" >&6
7202                                 test "$cf_result" = yes && break
7203                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7204                                 cf_result=no
7205                         elif test "$cf_term_lib" != predefined ; then
7206                                 echo "$as_me:7206: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7207 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7208                                 cat >"conftest.$ac_ext" <<_ACEOF
7209 #line 7209 "configure"
7210 #include "confdefs.h"
7211 #include <${cf_cv_ncurses_header:-curses.h}>
7212 int
7213 main (void)
7214 {
7215 initscr(); tgoto((char *)0, 0, 0);
7216   ;
7217   return 0;
7218 }
7219 _ACEOF
7220 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7221 if { (eval echo "$as_me:7221: \"$ac_link\"") >&5
7222   (eval $ac_link) 2>&5
7223   ac_status=$?
7224   echo "$as_me:7224: \$? = $ac_status" >&5
7225   (exit "$ac_status"); } &&
7226          { ac_try='test -s "conftest$ac_exeext"'
7227   { (eval echo "$as_me:7227: \"$ac_try\"") >&5
7228   (eval $ac_try) 2>&5
7229   ac_status=$?
7230   echo "$as_me:7230: \$? = $ac_status" >&5
7231   (exit "$ac_status"); }; }; then
7232   cf_result=no
7233 else
7234   echo "$as_me: failed program was:" >&5
7235 cat "conftest.$ac_ext" >&5
7236
7237                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7238                                         cat >"conftest.$ac_ext" <<_ACEOF
7239 #line 7239 "configure"
7240 #include "confdefs.h"
7241 #include <${cf_cv_ncurses_header:-curses.h}>
7242 int
7243 main (void)
7244 {
7245 initscr()
7246   ;
7247   return 0;
7248 }
7249 _ACEOF
7250 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7251 if { (eval echo "$as_me:7251: \"$ac_link\"") >&5
7252   (eval $ac_link) 2>&5
7253   ac_status=$?
7254   echo "$as_me:7254: \$? = $ac_status" >&5
7255   (exit "$ac_status"); } &&
7256          { ac_try='test -s "conftest$ac_exeext"'
7257   { (eval echo "$as_me:7257: \"$ac_try\"") >&5
7258   (eval $ac_try) 2>&5
7259   ac_status=$?
7260   echo "$as_me:7260: \$? = $ac_status" >&5
7261   (exit "$ac_status"); }; }; then
7262   cf_result=yes
7263 else
7264   echo "$as_me: failed program was:" >&5
7265 cat "conftest.$ac_ext" >&5
7266 cf_result=error
7267 fi
7268 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7269
7270 fi
7271 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7272                                 echo "$as_me:7272: result: $cf_result" >&5
7273 echo "${ECHO_T}$cf_result" >&6
7274                                 test "$cf_result" != error && break
7275                         fi
7276                 done
7277         fi
7278         test "$cf_curs_lib" = unknown && { { echo "$as_me:7278: error: no curses library found" >&5
7279 echo "$as_me: error: no curses library found" >&2;}
7280    { (exit 1); exit 1; }; }
7281 fi
7282 fi
7283
7284         ;;
7285 (ncursesw*)
7286
7287 echo "$as_me:7287: checking for multibyte character support" >&5
7288 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7289 if test "${cf_cv_utf8_lib+set}" = set; then
7290   echo $ECHO_N "(cached) $ECHO_C" >&6
7291 else
7292
7293         cf_save_LIBS="$LIBS"
7294         cat >"conftest.$ac_ext" <<_ACEOF
7295 #line 7295 "configure"
7296 #include "confdefs.h"
7297
7298 #include <stdlib.h>
7299 int
7300 main (void)
7301 {
7302 putwc(0,0);
7303   ;
7304   return 0;
7305 }
7306 _ACEOF
7307 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7308 if { (eval echo "$as_me:7308: \"$ac_link\"") >&5
7309   (eval $ac_link) 2>&5
7310   ac_status=$?
7311   echo "$as_me:7311: \$? = $ac_status" >&5
7312   (exit "$ac_status"); } &&
7313          { ac_try='test -s "conftest$ac_exeext"'
7314   { (eval echo "$as_me:7314: \"$ac_try\"") >&5
7315   (eval $ac_try) 2>&5
7316   ac_status=$?
7317   echo "$as_me:7317: \$? = $ac_status" >&5
7318   (exit "$ac_status"); }; }; then
7319   cf_cv_utf8_lib=yes
7320 else
7321   echo "$as_me: failed program was:" >&5
7322 cat "conftest.$ac_ext" >&5
7323
7324 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7325 # will be set on completion of the AC_TRY_LINK below.
7326 cf_cv_header_path_utf8=
7327 cf_cv_library_path_utf8=
7328
7329 echo "${as_me:-configure}:7329: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7330
7331 cf_save_LIBS="$LIBS"
7332
7333 cat >"conftest.$ac_ext" <<_ACEOF
7334 #line 7334 "configure"
7335 #include "confdefs.h"
7336
7337 #include <libutf8.h>
7338 int
7339 main (void)
7340 {
7341 putwc(0,0);
7342   ;
7343   return 0;
7344 }
7345 _ACEOF
7346 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7347 if { (eval echo "$as_me:7347: \"$ac_link\"") >&5
7348   (eval $ac_link) 2>&5
7349   ac_status=$?
7350   echo "$as_me:7350: \$? = $ac_status" >&5
7351   (exit "$ac_status"); } &&
7352          { ac_try='test -s "conftest$ac_exeext"'
7353   { (eval echo "$as_me:7353: \"$ac_try\"") >&5
7354   (eval $ac_try) 2>&5
7355   ac_status=$?
7356   echo "$as_me:7356: \$? = $ac_status" >&5
7357   (exit "$ac_status"); }; }; then
7358
7359         cf_cv_find_linkage_utf8=yes
7360         cf_cv_header_path_utf8=/usr/include
7361         cf_cv_library_path_utf8=/usr/lib
7362
7363 else
7364   echo "$as_me: failed program was:" >&5
7365 cat "conftest.$ac_ext" >&5
7366
7367 LIBS="-lutf8  $cf_save_LIBS"
7368
7369 cat >"conftest.$ac_ext" <<_ACEOF
7370 #line 7370 "configure"
7371 #include "confdefs.h"
7372
7373 #include <libutf8.h>
7374 int
7375 main (void)
7376 {
7377 putwc(0,0);
7378   ;
7379   return 0;
7380 }
7381 _ACEOF
7382 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7383 if { (eval echo "$as_me:7383: \"$ac_link\"") >&5
7384   (eval $ac_link) 2>&5
7385   ac_status=$?
7386   echo "$as_me:7386: \$? = $ac_status" >&5
7387   (exit "$ac_status"); } &&
7388          { ac_try='test -s "conftest$ac_exeext"'
7389   { (eval echo "$as_me:7389: \"$ac_try\"") >&5
7390   (eval $ac_try) 2>&5
7391   ac_status=$?
7392   echo "$as_me:7392: \$? = $ac_status" >&5
7393   (exit "$ac_status"); }; }; then
7394
7395         cf_cv_find_linkage_utf8=yes
7396         cf_cv_header_path_utf8=/usr/include
7397         cf_cv_library_path_utf8=/usr/lib
7398         cf_cv_library_file_utf8="-lutf8"
7399
7400 else
7401   echo "$as_me: failed program was:" >&5
7402 cat "conftest.$ac_ext" >&5
7403
7404         cf_cv_find_linkage_utf8=no
7405         LIBS="$cf_save_LIBS"
7406
7407         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7408
7409 echo "${as_me:-configure}:7409: testing find linkage for utf8 library ..." 1>&5
7410
7411 echo "${as_me:-configure}:7411: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7412
7413         cf_save_CPPFLAGS="$CPPFLAGS"
7414         cf_test_CPPFLAGS="$CPPFLAGS"
7415
7416 cf_search=
7417
7418 # collect the current set of include-directories from compiler flags
7419 cf_header_path_list=""
7420 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7421         for cf_header_path in $CPPFLAGS $CFLAGS
7422         do
7423                 case "$cf_header_path" in
7424                 (-I*)
7425                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7426
7427 test "x$cf_header_path" != "xNONE" && \
7428 test -d "$cf_header_path" && \
7429  {
7430         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7431         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7432         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7433         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7434         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7435         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7436 }
7437
7438                         cf_header_path_list="$cf_header_path_list $cf_search"
7439                         ;;
7440                 esac
7441         done
7442 fi
7443
7444 # add the variations for the package we are looking for
7445
7446 cf_search=
7447
7448 test "x$prefix" != "xNONE" && \
7449 test -d "$prefix" && \
7450  {
7451         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7452         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7453         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7454         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7455         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7456         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7457 }
7458
7459 for cf_subdir_prefix in \
7460         /usr \
7461         /usr/local \
7462         /usr/pkg \
7463         /opt \
7464         /opt/local \
7465         $HOME
7466 do
7467
7468 test "x$cf_subdir_prefix" != "x$prefix" && \
7469 test -d "$cf_subdir_prefix" && \
7470 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7471         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7472         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7473         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7474         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7475         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7476         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7477 }
7478
7479 done
7480
7481 test "$includedir" != NONE && \
7482 test "$includedir" != "/usr/include" && \
7483 test -d "$includedir" && {
7484         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7485         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7486 }
7487
7488 test "$oldincludedir" != NONE && \
7489 test "$oldincludedir" != "/usr/include" && \
7490 test -d "$oldincludedir" && {
7491         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7492         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7493 }
7494
7495 cf_search="$cf_search $cf_header_path_list"
7496
7497         for cf_cv_header_path_utf8 in $cf_search
7498         do
7499                 if test -d "$cf_cv_header_path_utf8" ; then
7500                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7501
7502 echo "${as_me:-configure}:7502: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7503
7504                         CPPFLAGS="$cf_save_CPPFLAGS"
7505
7506         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7507         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7508
7509                         cat >"conftest.$ac_ext" <<_ACEOF
7510 #line 7510 "configure"
7511 #include "confdefs.h"
7512
7513 #include <libutf8.h>
7514 int
7515 main (void)
7516 {
7517 putwc(0,0);
7518   ;
7519   return 0;
7520 }
7521 _ACEOF
7522 rm -f "conftest.$ac_objext"
7523 if { (eval echo "$as_me:7523: \"$ac_compile\"") >&5
7524   (eval $ac_compile) 2>&5
7525   ac_status=$?
7526   echo "$as_me:7526: \$? = $ac_status" >&5
7527   (exit "$ac_status"); } &&
7528          { ac_try='test -s "conftest.$ac_objext"'
7529   { (eval echo "$as_me:7529: \"$ac_try\"") >&5
7530   (eval $ac_try) 2>&5
7531   ac_status=$?
7532   echo "$as_me:7532: \$? = $ac_status" >&5
7533   (exit "$ac_status"); }; }; then
7534
7535                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7536
7537 echo "${as_me:-configure}:7537: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7538
7539                                 cf_cv_find_linkage_utf8=maybe
7540                                 cf_test_CPPFLAGS="$CPPFLAGS"
7541                                 break
7542 else
7543   echo "$as_me: failed program was:" >&5
7544 cat "conftest.$ac_ext" >&5
7545
7546                                 CPPFLAGS="$cf_save_CPPFLAGS"
7547
7548 fi
7549 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7550                 fi
7551         done
7552
7553         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7554
7555 echo "${as_me:-configure}:7555: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7556
7557                 cf_save_LIBS="$LIBS"
7558                 cf_save_LDFLAGS="$LDFLAGS"
7559
7560                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7561
7562 cf_search=
7563 cf_library_path_list=""
7564 if test -n "${LDFLAGS}${LIBS}" ; then
7565         for cf_library_path in $LDFLAGS $LIBS
7566         do
7567                 case "$cf_library_path" in
7568                 (-L*)
7569                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7570
7571 test "x$cf_library_path" != "xNONE" && \
7572 test -d "$cf_library_path" && \
7573  {
7574         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7575         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7576         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7577         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7578         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7579         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7580 }
7581
7582                         cf_library_path_list="$cf_library_path_list $cf_search"
7583                         ;;
7584                 esac
7585         done
7586 fi
7587
7588 cf_search=
7589
7590 test "x$prefix" != "xNONE" && \
7591 test -d "$prefix" && \
7592  {
7593         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7594         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7595         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7596         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7597         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7598         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7599 }
7600
7601 for cf_subdir_prefix in \
7602         /usr \
7603         /usr/local \
7604         /usr/pkg \
7605         /opt \
7606         /opt/local \
7607         $HOME
7608 do
7609
7610 test "x$cf_subdir_prefix" != "x$prefix" && \
7611 test -d "$cf_subdir_prefix" && \
7612 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7613         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7614         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7615         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7616         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7617         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7618         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7619 }
7620
7621 done
7622
7623 cf_search="$cf_library_path_list $cf_search"
7624
7625                         for cf_cv_library_path_utf8 in $cf_search
7626                         do
7627                                 if test -d "$cf_cv_library_path_utf8" ; then
7628                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7629
7630 echo "${as_me:-configure}:7630: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7631
7632                                         CPPFLAGS="$cf_test_CPPFLAGS"
7633                                         LIBS="-lutf8  $cf_save_LIBS"
7634                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7635                                         cat >"conftest.$ac_ext" <<_ACEOF
7636 #line 7636 "configure"
7637 #include "confdefs.h"
7638
7639 #include <libutf8.h>
7640 int
7641 main (void)
7642 {
7643 putwc(0,0);
7644   ;
7645   return 0;
7646 }
7647 _ACEOF
7648 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7649 if { (eval echo "$as_me:7649: \"$ac_link\"") >&5
7650   (eval $ac_link) 2>&5
7651   ac_status=$?
7652   echo "$as_me:7652: \$? = $ac_status" >&5
7653   (exit "$ac_status"); } &&
7654          { ac_try='test -s "conftest$ac_exeext"'
7655   { (eval echo "$as_me:7655: \"$ac_try\"") >&5
7656   (eval $ac_try) 2>&5
7657   ac_status=$?
7658   echo "$as_me:7658: \$? = $ac_status" >&5
7659   (exit "$ac_status"); }; }; then
7660
7661                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7662
7663 echo "${as_me:-configure}:7663: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7664
7665                                         cf_cv_find_linkage_utf8=yes
7666                                         cf_cv_library_file_utf8="-lutf8"
7667                                         break
7668 else
7669   echo "$as_me: failed program was:" >&5
7670 cat "conftest.$ac_ext" >&5
7671
7672                                         CPPFLAGS="$cf_save_CPPFLAGS"
7673                                         LIBS="$cf_save_LIBS"
7674                                         LDFLAGS="$cf_save_LDFLAGS"
7675
7676 fi
7677 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7678                                 fi
7679                         done
7680                         CPPFLAGS="$cf_save_CPPFLAGS"
7681                         LDFLAGS="$cf_save_LDFLAGS"
7682                 fi
7683
7684         else
7685                 cf_cv_find_linkage_utf8=no
7686         fi
7687
7688 fi
7689 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7690
7691 fi
7692 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7693
7694 LIBS="$cf_save_LIBS"
7695
7696 if test "$cf_cv_find_linkage_utf8" = yes ; then
7697 cf_cv_utf8_lib=add-on
7698 else
7699 cf_cv_utf8_lib=no
7700 fi
7701
7702 fi
7703 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7704 fi
7705 echo "$as_me:7705: result: $cf_cv_utf8_lib" >&5
7706 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7707
7708 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7709 # ncurses/ncursesw:
7710 if test "$cf_cv_utf8_lib" = "add-on" ; then
7711
7712 cat >>confdefs.h <<\EOF
7713 #define HAVE_LIBUTF8_H 1
7714 EOF
7715
7716 if test -n "$cf_cv_header_path_utf8" ; then
7717   for cf_add_incdir in $cf_cv_header_path_utf8
7718   do
7719         while test "$cf_add_incdir" != /usr/include
7720         do
7721           if test -d "$cf_add_incdir"
7722           then
7723                 cf_have_incdir=no
7724                 if test -n "$CFLAGS$CPPFLAGS" ; then
7725                   # a loop is needed to ensure we can add subdirs of existing dirs
7726                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7727                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7728                           cf_have_incdir=yes; break
7729                         fi
7730                   done
7731                 fi
7732
7733                 if test "$cf_have_incdir" = no ; then
7734                   if test "$cf_add_incdir" = /usr/local/include ; then
7735                         if test "$GCC" = yes
7736                         then
7737                           cf_save_CPPFLAGS=$CPPFLAGS
7738
7739         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7740         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7741
7742                           cat >"conftest.$ac_ext" <<_ACEOF
7743 #line 7743 "configure"
7744 #include "confdefs.h"
7745 #include <stdio.h>
7746 int
7747 main (void)
7748 {
7749 printf("Hello")
7750   ;
7751   return 0;
7752 }
7753 _ACEOF
7754 rm -f "conftest.$ac_objext"
7755 if { (eval echo "$as_me:7755: \"$ac_compile\"") >&5
7756   (eval $ac_compile) 2>&5
7757   ac_status=$?
7758   echo "$as_me:7758: \$? = $ac_status" >&5
7759   (exit "$ac_status"); } &&
7760          { ac_try='test -s "conftest.$ac_objext"'
7761   { (eval echo "$as_me:7761: \"$ac_try\"") >&5
7762   (eval $ac_try) 2>&5
7763   ac_status=$?
7764   echo "$as_me:7764: \$? = $ac_status" >&5
7765   (exit "$ac_status"); }; }; then
7766   :
7767 else
7768   echo "$as_me: failed program was:" >&5
7769 cat "conftest.$ac_ext" >&5
7770 cf_have_incdir=yes
7771 fi
7772 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7773                           CPPFLAGS=$cf_save_CPPFLAGS
7774                         fi
7775                   fi
7776                 fi
7777
7778                 if test "$cf_have_incdir" = no ; then
7779                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7780
7781 echo "${as_me:-configure}:7781: testing adding $cf_add_incdir to include-path ..." 1>&5
7782
7783                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7784
7785                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7786                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7787                   cf_add_incdir="$cf_top_incdir"
7788                 else
7789                   break
7790                 fi
7791           else
7792                 break
7793           fi
7794         done
7795   done
7796 fi
7797
7798 if test -n "$cf_cv_library_path_utf8" ; then
7799         for cf_add_libdir in $cf_cv_library_path_utf8
7800         do
7801                 if test "$cf_add_libdir" = /usr/lib ; then
7802                         :
7803                 elif test -d "$cf_add_libdir"
7804                 then
7805                         cf_have_libdir=no
7806                         if test -n "$LDFLAGS$LIBS" ; then
7807                                 # a loop is needed to ensure we can add subdirs of existing dirs
7808                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7809                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7810                                                 cf_have_libdir=yes; break
7811                                         fi
7812                                 done
7813                         fi
7814                         if test "$cf_have_libdir" = no ; then
7815                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7816
7817 echo "${as_me:-configure}:7817: testing adding $cf_add_libdir to library-path ..." 1>&5
7818
7819                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7820                         fi
7821                 fi
7822         done
7823 fi
7824
7825 cf_add_libs="$LIBS"
7826 # reverse order
7827 cf_add_0lib=
7828 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7829 # filter duplicates
7830 for cf_add_1lib in $cf_add_0lib; do
7831         for cf_add_2lib in $cf_add_libs; do
7832                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7833                         cf_add_1lib=
7834                         break
7835                 fi
7836         done
7837         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7838 done
7839 LIBS="$cf_add_libs"
7840
7841 fi
7842
7843 cf_ncuconfig_root=$cf_cv_screen
7844 cf_have_ncuconfig=no
7845
7846 if test "x${PKG_CONFIG:=none}" != xnone; then
7847         echo "$as_me:7847: checking pkg-config for $cf_ncuconfig_root" >&5
7848 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7849         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7850                 echo "$as_me:7850: result: yes" >&5
7851 echo "${ECHO_T}yes" >&6
7852
7853                 echo "$as_me:7853: checking if the $cf_ncuconfig_root package files work" >&5
7854 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7855                 cf_have_ncuconfig=unknown
7856
7857                 cf_save_CFLAGS="$CFLAGS"
7858                 cf_save_CPPFLAGS="$CPPFLAGS"
7859                 cf_save_LIBS="$LIBS"
7860
7861                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7862                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7863
7864                 # while -W for passing linker flags is prevalent, it is not "standard".
7865                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7866                 # incompatible _and_ non-standard -W option which gives an error.  Work
7867                 # around that pitfall.
7868                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7869                 (x*c[89]9@@*-W*)
7870
7871 cf_fix_cppflags=no
7872 cf_new_cflags=
7873 cf_new_cppflags=
7874 cf_new_extra_cppflags=
7875
7876 for cf_add_cflags in $cf_pkg_cflags
7877 do
7878 case "$cf_fix_cppflags" in
7879 (no)
7880         case "$cf_add_cflags" in
7881         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7882                 case "$cf_add_cflags" in
7883                 (-D*)
7884                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7885
7886                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7887                                 && test -z "${cf_tst_cflags}" \
7888                                 && cf_fix_cppflags=yes
7889
7890                         if test "$cf_fix_cppflags" = yes ; then
7891
7892         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7893         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7894
7895                                 continue
7896                         elif test "${cf_tst_cflags}" = "\"'" ; then
7897
7898         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7899         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7900
7901                                 continue
7902                         fi
7903                         ;;
7904                 esac
7905                 case "$CPPFLAGS" in
7906                 (*$cf_add_cflags)
7907                         ;;
7908                 (*)
7909                         case "$cf_add_cflags" in
7910                         (-D*)
7911                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7912
7913 CPPFLAGS=`echo "$CPPFLAGS" | \
7914         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7915                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7916
7917                                 ;;
7918                         esac
7919
7920         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7921         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7922
7923                         ;;
7924                 esac
7925                 ;;
7926         (*)
7927
7928         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7929         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7930
7931                 ;;
7932         esac
7933         ;;
7934 (yes)
7935
7936         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7937         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7938
7939         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7940
7941         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7942                 && test -z "${cf_tst_cflags}" \
7943                 && cf_fix_cppflags=no
7944         ;;
7945 esac
7946 done
7947
7948 if test -n "$cf_new_cflags" ; then
7949
7950         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7951         CFLAGS="${CFLAGS}$cf_new_cflags"
7952
7953 fi
7954
7955 if test -n "$cf_new_cppflags" ; then
7956
7957         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7958         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7959
7960 fi
7961
7962 if test -n "$cf_new_extra_cppflags" ; then
7963
7964         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7965         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7966
7967 fi
7968
7969 cf_add_libs="$LIBS"
7970 # reverse order
7971 cf_add_0lib=
7972 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7973 # filter duplicates
7974 for cf_add_1lib in $cf_add_0lib; do
7975         for cf_add_2lib in $cf_add_libs; do
7976                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7977                         cf_add_1lib=
7978                         break
7979                 fi
7980         done
7981         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7982 done
7983 LIBS="$cf_add_libs"
7984
7985                         cat >"conftest.$ac_ext" <<_ACEOF
7986 #line 7986 "configure"
7987 #include "confdefs.h"
7988 #include <${cf_cv_ncurses_header:-curses.h}>
7989 int
7990 main (void)
7991 {
7992 initscr(); mousemask(0,0); tigetstr((char *)0);
7993   ;
7994   return 0;
7995 }
7996 _ACEOF
7997 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7998 if { (eval echo "$as_me:7998: \"$ac_link\"") >&5
7999   (eval $ac_link) 2>&5
8000   ac_status=$?
8001   echo "$as_me:8001: \$? = $ac_status" >&5
8002   (exit "$ac_status"); } &&
8003          { ac_try='test -s "conftest$ac_exeext"'
8004   { (eval echo "$as_me:8004: \"$ac_try\"") >&5
8005   (eval $ac_try) 2>&5
8006   ac_status=$?
8007   echo "$as_me:8007: \$? = $ac_status" >&5
8008   (exit "$ac_status"); }; }; then
8009   if test "$cross_compiling" = yes; then
8010   cf_test_ncuconfig=maybe
8011 else
8012   cat >"conftest.$ac_ext" <<_ACEOF
8013 #line 8013 "configure"
8014 #include "confdefs.h"
8015 #include <${cf_cv_ncurses_header:-curses.h}>
8016                                         int main(void)
8017                                         { char *xx = curses_version(); return (xx == 0); }
8018 _ACEOF
8019 rm -f "conftest$ac_exeext"
8020 if { (eval echo "$as_me:8020: \"$ac_link\"") >&5
8021   (eval $ac_link) 2>&5
8022   ac_status=$?
8023   echo "$as_me:8023: \$? = $ac_status" >&5
8024   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8025   { (eval echo "$as_me:8025: \"$ac_try\"") >&5
8026   (eval $ac_try) 2>&5
8027   ac_status=$?
8028   echo "$as_me:8028: \$? = $ac_status" >&5
8029   (exit "$ac_status"); }; }; then
8030   cf_test_ncuconfig=yes
8031 else
8032   echo "$as_me: program exited with status $ac_status" >&5
8033 echo "$as_me: failed program was:" >&5
8034 cat "conftest.$ac_ext" >&5
8035 cf_test_ncuconfig=no
8036 fi
8037 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8038 fi
8039 else
8040   echo "$as_me: failed program was:" >&5
8041 cat "conftest.$ac_ext" >&5
8042 cf_test_ncuconfig=no
8043 fi
8044 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8045
8046                         CFLAGS="$cf_save_CFLAGS"
8047                         CPPFLAGS="$cf_save_CPPFLAGS"
8048                         LIBS="$cf_save_LIBS"
8049
8050                         if test "x$cf_test_ncuconfig" != xyes; then
8051                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8052                                 cf_pkg_cflags="$cf_temp"
8053                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8054                                 cf_pkg_libs="$cf_temp"
8055                         fi
8056                         ;;
8057                 esac
8058
8059 cf_fix_cppflags=no
8060 cf_new_cflags=
8061 cf_new_cppflags=
8062 cf_new_extra_cppflags=
8063
8064 for cf_add_cflags in $cf_pkg_cflags
8065 do
8066 case "$cf_fix_cppflags" in
8067 (no)
8068         case "$cf_add_cflags" in
8069         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8070                 case "$cf_add_cflags" in
8071                 (-D*)
8072                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8073
8074                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8075                                 && test -z "${cf_tst_cflags}" \
8076                                 && cf_fix_cppflags=yes
8077
8078                         if test "$cf_fix_cppflags" = yes ; then
8079
8080         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8081         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8082
8083                                 continue
8084                         elif test "${cf_tst_cflags}" = "\"'" ; then
8085
8086         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8087         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8088
8089                                 continue
8090                         fi
8091                         ;;
8092                 esac
8093                 case "$CPPFLAGS" in
8094                 (*$cf_add_cflags)
8095                         ;;
8096                 (*)
8097                         case "$cf_add_cflags" in
8098                         (-D*)
8099                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8100
8101 CPPFLAGS=`echo "$CPPFLAGS" | \
8102         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8103                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8104
8105                                 ;;
8106                         esac
8107
8108         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8109         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8110
8111                         ;;
8112                 esac
8113                 ;;
8114         (*)
8115
8116         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8117         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8118
8119                 ;;
8120         esac
8121         ;;
8122 (yes)
8123
8124         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8125         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8126
8127         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8128
8129         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8130                 && test -z "${cf_tst_cflags}" \
8131                 && cf_fix_cppflags=no
8132         ;;
8133 esac
8134 done
8135
8136 if test -n "$cf_new_cflags" ; then
8137
8138         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8139         CFLAGS="${CFLAGS}$cf_new_cflags"
8140
8141 fi
8142
8143 if test -n "$cf_new_cppflags" ; then
8144
8145         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8146         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8147
8148 fi
8149
8150 if test -n "$cf_new_extra_cppflags" ; then
8151
8152         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8153         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8154
8155 fi
8156
8157 cf_add_libs="$LIBS"
8158 # reverse order
8159 cf_add_0lib=
8160 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8161 # filter duplicates
8162 for cf_add_1lib in $cf_add_0lib; do
8163         for cf_add_2lib in $cf_add_libs; do
8164                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8165                         cf_add_1lib=
8166                         break
8167                 fi
8168         done
8169         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8170 done
8171 LIBS="$cf_add_libs"
8172
8173                 cat >"conftest.$ac_ext" <<_ACEOF
8174 #line 8174 "configure"
8175 #include "confdefs.h"
8176 #include <${cf_cv_ncurses_header:-curses.h}>
8177 int
8178 main (void)
8179 {
8180 initscr(); mousemask(0,0); tigetstr((char *)0);
8181   ;
8182   return 0;
8183 }
8184 _ACEOF
8185 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8186 if { (eval echo "$as_me:8186: \"$ac_link\"") >&5
8187   (eval $ac_link) 2>&5
8188   ac_status=$?
8189   echo "$as_me:8189: \$? = $ac_status" >&5
8190   (exit "$ac_status"); } &&
8191          { ac_try='test -s "conftest$ac_exeext"'
8192   { (eval echo "$as_me:8192: \"$ac_try\"") >&5
8193   (eval $ac_try) 2>&5
8194   ac_status=$?
8195   echo "$as_me:8195: \$? = $ac_status" >&5
8196   (exit "$ac_status"); }; }; then
8197   if test "$cross_compiling" = yes; then
8198   cf_have_ncuconfig=maybe
8199 else
8200   cat >"conftest.$ac_ext" <<_ACEOF
8201 #line 8201 "configure"
8202 #include "confdefs.h"
8203 #include <${cf_cv_ncurses_header:-curses.h}>
8204                                 int main(void)
8205                                 { char *xx = curses_version(); return (xx == 0); }
8206 _ACEOF
8207 rm -f "conftest$ac_exeext"
8208 if { (eval echo "$as_me:8208: \"$ac_link\"") >&5
8209   (eval $ac_link) 2>&5
8210   ac_status=$?
8211   echo "$as_me:8211: \$? = $ac_status" >&5
8212   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8213   { (eval echo "$as_me:8213: \"$ac_try\"") >&5
8214   (eval $ac_try) 2>&5
8215   ac_status=$?
8216   echo "$as_me:8216: \$? = $ac_status" >&5
8217   (exit "$ac_status"); }; }; then
8218   cf_have_ncuconfig=yes
8219 else
8220   echo "$as_me: program exited with status $ac_status" >&5
8221 echo "$as_me: failed program was:" >&5
8222 cat "conftest.$ac_ext" >&5
8223 cf_have_ncuconfig=no
8224 fi
8225 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8226 fi
8227 else
8228   echo "$as_me: failed program was:" >&5
8229 cat "conftest.$ac_ext" >&5
8230 cf_have_ncuconfig=no
8231 fi
8232 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8233                 echo "$as_me:8233: result: $cf_have_ncuconfig" >&5
8234 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8235                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8236                 if test "$cf_have_ncuconfig" != "yes"
8237                 then
8238                         CPPFLAGS="$cf_save_CPPFLAGS"
8239                         LIBS="$cf_save_LIBS"
8240                         NCURSES_CONFIG_PKG=none
8241                 else
8242
8243 cat >>confdefs.h <<\EOF
8244 #define NCURSES 1
8245 EOF
8246
8247                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8248
8249 echo "$as_me:8249: checking for terminfo header" >&5
8250 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8251 if test "${cf_cv_term_header+set}" = set; then
8252   echo $ECHO_N "(cached) $ECHO_C" >&6
8253 else
8254
8255 case "${cf_cv_ncurses_header}" in
8256 (*/ncurses.h|*/ncursesw.h)
8257         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8258         ;;
8259 (*)
8260         cf_term_header=term.h
8261         ;;
8262 esac
8263
8264 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8265 do
8266 cat >"conftest.$ac_ext" <<_ACEOF
8267 #line 8267 "configure"
8268 #include "confdefs.h"
8269 #include <stdio.h>
8270 #include <${cf_cv_ncurses_header:-curses.h}>
8271 #include <$cf_test>
8272
8273 int
8274 main (void)
8275 {
8276 int x = auto_left_margin; (void)x
8277   ;
8278   return 0;
8279 }
8280 _ACEOF
8281 rm -f "conftest.$ac_objext"
8282 if { (eval echo "$as_me:8282: \"$ac_compile\"") >&5
8283   (eval $ac_compile) 2>&5
8284   ac_status=$?
8285   echo "$as_me:8285: \$? = $ac_status" >&5
8286   (exit "$ac_status"); } &&
8287          { ac_try='test -s "conftest.$ac_objext"'
8288   { (eval echo "$as_me:8288: \"$ac_try\"") >&5
8289   (eval $ac_try) 2>&5
8290   ac_status=$?
8291   echo "$as_me:8291: \$? = $ac_status" >&5
8292   (exit "$ac_status"); }; }; then
8293
8294         cf_cv_term_header="$cf_test"
8295 else
8296   echo "$as_me: failed program was:" >&5
8297 cat "conftest.$ac_ext" >&5
8298
8299         cf_cv_term_header=unknown
8300
8301 fi
8302 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8303         test "$cf_cv_term_header" != unknown && break
8304 done
8305
8306 fi
8307 echo "$as_me:8307: result: $cf_cv_term_header" >&5
8308 echo "${ECHO_T}$cf_cv_term_header" >&6
8309
8310 # Set definitions to allow ifdef'ing to accommodate subdirectories
8311
8312 case "$cf_cv_term_header" in
8313 (*term.h)
8314
8315 cat >>confdefs.h <<\EOF
8316 #define HAVE_TERM_H 1
8317 EOF
8318
8319         ;;
8320 esac
8321
8322 case "$cf_cv_term_header" in
8323 (ncurses/term.h)
8324
8325 cat >>confdefs.h <<\EOF
8326 #define HAVE_NCURSES_TERM_H 1
8327 EOF
8328
8329         ;;
8330 (ncursesw/term.h)
8331
8332 cat >>confdefs.h <<\EOF
8333 #define HAVE_NCURSESW_TERM_H 1
8334 EOF
8335
8336         ;;
8337 esac
8338
8339                 fi
8340
8341         else
8342                 echo "$as_me:8342: result: no" >&5
8343 echo "${ECHO_T}no" >&6
8344                 NCURSES_CONFIG_PKG=none
8345         fi
8346 else
8347         NCURSES_CONFIG_PKG=none
8348 fi
8349
8350 if test "x$cf_have_ncuconfig" = "xno"; then
8351         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8352
8353 if test -n "$ac_tool_prefix"; then
8354   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8355   do
8356     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8357 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8358 echo "$as_me:8358: checking for $ac_word" >&5
8359 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8360 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8361   echo $ECHO_N "(cached) $ECHO_C" >&6
8362 else
8363   if test -n "$NCURSES_CONFIG"; then
8364   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8365 else
8366   ac_save_IFS=$IFS; IFS=$ac_path_separator
8367 ac_dummy="$PATH"
8368 for ac_dir in $ac_dummy; do
8369   IFS=$ac_save_IFS
8370   test -z "$ac_dir" && ac_dir=.
8371   $as_executable_p "$ac_dir/$ac_word" || continue
8372 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8373 echo "$as_me:8373: found $ac_dir/$ac_word" >&5
8374 break
8375 done
8376
8377 fi
8378 fi
8379 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8380 if test -n "$NCURSES_CONFIG"; then
8381   echo "$as_me:8381: result: $NCURSES_CONFIG" >&5
8382 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8383 else
8384   echo "$as_me:8384: result: no" >&5
8385 echo "${ECHO_T}no" >&6
8386 fi
8387
8388     test -n "$NCURSES_CONFIG" && break
8389   done
8390 fi
8391 if test -z "$NCURSES_CONFIG"; then
8392   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8393   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8394 do
8395   # Extract the first word of "$ac_prog", so it can be a program name with args.
8396 set dummy $ac_prog; ac_word=$2
8397 echo "$as_me:8397: checking for $ac_word" >&5
8398 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8399 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8400   echo $ECHO_N "(cached) $ECHO_C" >&6
8401 else
8402   if test -n "$ac_ct_NCURSES_CONFIG"; then
8403   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8404 else
8405   ac_save_IFS=$IFS; IFS=$ac_path_separator
8406 ac_dummy="$PATH"
8407 for ac_dir in $ac_dummy; do
8408   IFS=$ac_save_IFS
8409   test -z "$ac_dir" && ac_dir=.
8410   $as_executable_p "$ac_dir/$ac_word" || continue
8411 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8412 echo "$as_me:8412: found $ac_dir/$ac_word" >&5
8413 break
8414 done
8415
8416 fi
8417 fi
8418 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8419 if test -n "$ac_ct_NCURSES_CONFIG"; then
8420   echo "$as_me:8420: result: $ac_ct_NCURSES_CONFIG" >&5
8421 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8422 else
8423   echo "$as_me:8423: result: no" >&5
8424 echo "${ECHO_T}no" >&6
8425 fi
8426
8427   test -n "$ac_ct_NCURSES_CONFIG" && break
8428 done
8429 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8430
8431   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8432 fi
8433
8434         if test "$NCURSES_CONFIG" != none ; then
8435
8436 cf_fix_cppflags=no
8437 cf_new_cflags=
8438 cf_new_cppflags=
8439 cf_new_extra_cppflags=
8440
8441 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8442 do
8443 case "$cf_fix_cppflags" in
8444 (no)
8445         case "$cf_add_cflags" in
8446         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8447                 case "$cf_add_cflags" in
8448                 (-D*)
8449                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8450
8451                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8452                                 && test -z "${cf_tst_cflags}" \
8453                                 && cf_fix_cppflags=yes
8454
8455                         if test "$cf_fix_cppflags" = yes ; then
8456
8457         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8458         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8459
8460                                 continue
8461                         elif test "${cf_tst_cflags}" = "\"'" ; then
8462
8463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8465
8466                                 continue
8467                         fi
8468                         ;;
8469                 esac
8470                 case "$CPPFLAGS" in
8471                 (*$cf_add_cflags)
8472                         ;;
8473                 (*)
8474                         case "$cf_add_cflags" in
8475                         (-D*)
8476                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8477
8478 CPPFLAGS=`echo "$CPPFLAGS" | \
8479         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8480                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8481
8482                                 ;;
8483                         esac
8484
8485         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8486         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8487
8488                         ;;
8489                 esac
8490                 ;;
8491         (*)
8492
8493         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8494         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8495
8496                 ;;
8497         esac
8498         ;;
8499 (yes)
8500
8501         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8502         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8503
8504         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8505
8506         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8507                 && test -z "${cf_tst_cflags}" \
8508                 && cf_fix_cppflags=no
8509         ;;
8510 esac
8511 done
8512
8513 if test -n "$cf_new_cflags" ; then
8514
8515         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8516         CFLAGS="${CFLAGS}$cf_new_cflags"
8517
8518 fi
8519
8520 if test -n "$cf_new_cppflags" ; then
8521
8522         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8523         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8524
8525 fi
8526
8527 if test -n "$cf_new_extra_cppflags" ; then
8528
8529         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8530         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8531
8532 fi
8533
8534 cf_add_libs="$LIBS"
8535 # reverse order
8536 cf_add_0lib=
8537 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8538 # filter duplicates
8539 for cf_add_1lib in $cf_add_0lib; do
8540         for cf_add_2lib in $cf_add_libs; do
8541                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8542                         cf_add_1lib=
8543                         break
8544                 fi
8545         done
8546         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8547 done
8548 LIBS="$cf_add_libs"
8549
8550                 # even with config script, some packages use no-override for curses.h
8551
8552 echo "$as_me:8552: checking if we have identified curses headers" >&5
8553 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8554 if test "${cf_cv_ncurses_header+set}" = set; then
8555   echo $ECHO_N "(cached) $ECHO_C" >&6
8556 else
8557
8558 cf_cv_ncurses_header=none
8559 for cf_header in \
8560         ncurses.h $cf_cv_screen/ncurses.h \
8561         curses.h $cf_cv_screen/curses.h
8562 do
8563 cat >"conftest.$ac_ext" <<_ACEOF
8564 #line 8564 "configure"
8565 #include "confdefs.h"
8566 #include <${cf_header}>
8567 int
8568 main (void)
8569 {
8570 initscr(); tgoto("?", 0,0)
8571   ;
8572   return 0;
8573 }
8574 _ACEOF
8575 rm -f "conftest.$ac_objext"
8576 if { (eval echo "$as_me:8576: \"$ac_compile\"") >&5
8577   (eval $ac_compile) 2>&5
8578   ac_status=$?
8579   echo "$as_me:8579: \$? = $ac_status" >&5
8580   (exit "$ac_status"); } &&
8581          { ac_try='test -s "conftest.$ac_objext"'
8582   { (eval echo "$as_me:8582: \"$ac_try\"") >&5
8583   (eval $ac_try) 2>&5
8584   ac_status=$?
8585   echo "$as_me:8585: \$? = $ac_status" >&5
8586   (exit "$ac_status"); }; }; then
8587   cf_cv_ncurses_header=$cf_header; break
8588 else
8589   echo "$as_me: failed program was:" >&5
8590 cat "conftest.$ac_ext" >&5
8591 fi
8592 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8593 done
8594
8595 fi
8596 echo "$as_me:8596: result: $cf_cv_ncurses_header" >&5
8597 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8598
8599 if test "$cf_cv_ncurses_header" = none ; then
8600         { { echo "$as_me:8600: error: No curses header-files found" >&5
8601 echo "$as_me: error: No curses header-files found" >&2;}
8602    { (exit 1); exit 1; }; }
8603 fi
8604
8605 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8606
8607 for ac_header in $cf_cv_ncurses_header
8608 do
8609 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8610 echo "$as_me:8610: checking for $ac_header" >&5
8611 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8612 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8613   echo $ECHO_N "(cached) $ECHO_C" >&6
8614 else
8615   cat >"conftest.$ac_ext" <<_ACEOF
8616 #line 8616 "configure"
8617 #include "confdefs.h"
8618 #include <$ac_header>
8619 _ACEOF
8620 if { (eval echo "$as_me:8620: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8621   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8622   ac_status=$?
8623   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8624   rm -f conftest.er1
8625   cat conftest.err >&5
8626   echo "$as_me:8626: \$? = $ac_status" >&5
8627   (exit "$ac_status"); } >/dev/null; then
8628   if test -s conftest.err; then
8629     ac_cpp_err=$ac_c_preproc_warn_flag
8630   else
8631     ac_cpp_err=
8632   fi
8633 else
8634   ac_cpp_err=yes
8635 fi
8636 if test -z "$ac_cpp_err"; then
8637   eval "$as_ac_Header=yes"
8638 else
8639   echo "$as_me: failed program was:" >&5
8640   cat "conftest.$ac_ext" >&5
8641   eval "$as_ac_Header=no"
8642 fi
8643 rm -f conftest.err "conftest.$ac_ext"
8644 fi
8645 echo "$as_me:8645: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8646 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8647 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8648   cat >>confdefs.h <<EOF
8649 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8650 EOF
8651
8652 fi
8653 done
8654
8655 cat >>confdefs.h <<\EOF
8656 #define NCURSES 1
8657 EOF
8658
8659 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8660
8661                 cat >>confdefs.h <<EOF
8662 #define $cf_nculib_ROOT 1
8663 EOF
8664
8665                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8666
8667         else
8668
8669 cf_ncuhdr_root=$cf_cv_screen
8670
8671 test -n "$cf_cv_curses_dir" && \
8672 test "$cf_cv_curses_dir" != "no" && { \
8673
8674 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8675   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8676   do
8677         while test "$cf_add_incdir" != /usr/include
8678         do
8679           if test -d "$cf_add_incdir"
8680           then
8681                 cf_have_incdir=no
8682                 if test -n "$CFLAGS$CPPFLAGS" ; then
8683                   # a loop is needed to ensure we can add subdirs of existing dirs
8684                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8685                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8686                           cf_have_incdir=yes; break
8687                         fi
8688                   done
8689                 fi
8690
8691                 if test "$cf_have_incdir" = no ; then
8692                   if test "$cf_add_incdir" = /usr/local/include ; then
8693                         if test "$GCC" = yes
8694                         then
8695                           cf_save_CPPFLAGS=$CPPFLAGS
8696
8697         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8698         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8699
8700                           cat >"conftest.$ac_ext" <<_ACEOF
8701 #line 8701 "configure"
8702 #include "confdefs.h"
8703 #include <stdio.h>
8704 int
8705 main (void)
8706 {
8707 printf("Hello")
8708   ;
8709   return 0;
8710 }
8711 _ACEOF
8712 rm -f "conftest.$ac_objext"
8713 if { (eval echo "$as_me:8713: \"$ac_compile\"") >&5
8714   (eval $ac_compile) 2>&5
8715   ac_status=$?
8716   echo "$as_me:8716: \$? = $ac_status" >&5
8717   (exit "$ac_status"); } &&
8718          { ac_try='test -s "conftest.$ac_objext"'
8719   { (eval echo "$as_me:8719: \"$ac_try\"") >&5
8720   (eval $ac_try) 2>&5
8721   ac_status=$?
8722   echo "$as_me:8722: \$? = $ac_status" >&5
8723   (exit "$ac_status"); }; }; then
8724   :
8725 else
8726   echo "$as_me: failed program was:" >&5
8727 cat "conftest.$ac_ext" >&5
8728 cf_have_incdir=yes
8729 fi
8730 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8731                           CPPFLAGS=$cf_save_CPPFLAGS
8732                         fi
8733                   fi
8734                 fi
8735
8736                 if test "$cf_have_incdir" = no ; then
8737                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8738
8739 echo "${as_me:-configure}:8739: testing adding $cf_add_incdir to include-path ..." 1>&5
8740
8741                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8742
8743                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8744                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8745                   cf_add_incdir="$cf_top_incdir"
8746                 else
8747                   break
8748                 fi
8749           else
8750                 break
8751           fi
8752         done
8753   done
8754 fi
8755
8756 }
8757
8758 echo "$as_me:8758: checking for $cf_ncuhdr_root header in include-path" >&5
8759 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8760 if test "${cf_cv_ncurses_h+set}" = set; then
8761   echo $ECHO_N "(cached) $ECHO_C" >&6
8762 else
8763
8764         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8765         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8766         for cf_header in $cf_header_list
8767         do
8768
8769         cat >"conftest.$ac_ext" <<_ACEOF
8770 #line 8770 "configure"
8771 #include "confdefs.h"
8772
8773 #include <$cf_header>
8774 int
8775 main (void)
8776 {
8777
8778 #ifdef NCURSES_VERSION
8779
8780 printf("%s\\n", NCURSES_VERSION);
8781 #else
8782 #ifdef __NCURSES_H
8783 printf("old\\n");
8784 #else
8785         make an error
8786 #endif
8787 #endif
8788
8789   ;
8790   return 0;
8791 }
8792 _ACEOF
8793 rm -f "conftest.$ac_objext"
8794 if { (eval echo "$as_me:8794: \"$ac_compile\"") >&5
8795   (eval $ac_compile) 2>&5
8796   ac_status=$?
8797   echo "$as_me:8797: \$? = $ac_status" >&5
8798   (exit "$ac_status"); } &&
8799          { ac_try='test -s "conftest.$ac_objext"'
8800   { (eval echo "$as_me:8800: \"$ac_try\"") >&5
8801   (eval $ac_try) 2>&5
8802   ac_status=$?
8803   echo "$as_me:8803: \$? = $ac_status" >&5
8804   (exit "$ac_status"); }; }; then
8805   cf_cv_ncurses_h=$cf_header
8806
8807 else
8808   echo "$as_me: failed program was:" >&5
8809 cat "conftest.$ac_ext" >&5
8810 cf_cv_ncurses_h=no
8811 fi
8812 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8813
8814                 test "$cf_cv_ncurses_h" != no && break
8815         done
8816
8817 fi
8818 echo "$as_me:8818: result: $cf_cv_ncurses_h" >&5
8819 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8820
8821 if test "$cf_cv_ncurses_h" != no ; then
8822         cf_cv_ncurses_header=$cf_cv_ncurses_h
8823 else
8824
8825 echo "$as_me:8825: checking for $cf_ncuhdr_root include-path" >&5
8826 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8827 if test "${cf_cv_ncurses_h2+set}" = set; then
8828   echo $ECHO_N "(cached) $ECHO_C" >&6
8829 else
8830
8831         test -n "$verbose" && echo
8832
8833 cf_search=
8834
8835 # collect the current set of include-directories from compiler flags
8836 cf_header_path_list=""
8837 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8838         for cf_header_path in $CPPFLAGS $CFLAGS
8839         do
8840                 case "$cf_header_path" in
8841                 (-I*)
8842                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8843
8844 test "x$cf_header_path" != "xNONE" && \
8845 test -d "$cf_header_path" && \
8846  {
8847         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8848         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8849         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8850         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8851         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8852         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"
8853 }
8854
8855                         cf_header_path_list="$cf_header_path_list $cf_search"
8856                         ;;
8857                 esac
8858         done
8859 fi
8860
8861 # add the variations for the package we are looking for
8862
8863 cf_search=
8864
8865 test "x$prefix" != "xNONE" && \
8866 test -d "$prefix" && \
8867  {
8868         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8869         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8870         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8871         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8872         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8873         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8874 }
8875
8876 for cf_subdir_prefix in \
8877         /usr \
8878         /usr/local \
8879         /usr/pkg \
8880         /opt \
8881         /opt/local \
8882         $HOME
8883 do
8884
8885 test "x$cf_subdir_prefix" != "x$prefix" && \
8886 test -d "$cf_subdir_prefix" && \
8887 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8888         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8889         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8890         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8891         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8892         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8893         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"
8894 }
8895
8896 done
8897
8898 test "$includedir" != NONE && \
8899 test "$includedir" != "/usr/include" && \
8900 test -d "$includedir" && {
8901         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8902         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8903 }
8904
8905 test "$oldincludedir" != NONE && \
8906 test "$oldincludedir" != "/usr/include" && \
8907 test -d "$oldincludedir" && {
8908         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8909         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8910 }
8911
8912 cf_search="$cf_search $cf_header_path_list"
8913
8914         test -n "$verbose" && echo "search path $cf_search"
8915         cf_save2_CPPFLAGS="$CPPFLAGS"
8916         for cf_incdir in $cf_search
8917         do
8918
8919 if test -n "$cf_incdir" ; then
8920   for cf_add_incdir in $cf_incdir
8921   do
8922         while test "$cf_add_incdir" != /usr/include
8923         do
8924           if test -d "$cf_add_incdir"
8925           then
8926                 cf_have_incdir=no
8927                 if test -n "$CFLAGS$CPPFLAGS" ; then
8928                   # a loop is needed to ensure we can add subdirs of existing dirs
8929                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8930                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8931                           cf_have_incdir=yes; break
8932                         fi
8933                   done
8934                 fi
8935
8936                 if test "$cf_have_incdir" = no ; then
8937                   if test "$cf_add_incdir" = /usr/local/include ; then
8938                         if test "$GCC" = yes
8939                         then
8940                           cf_save_CPPFLAGS=$CPPFLAGS
8941
8942         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8943         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8944
8945                           cat >"conftest.$ac_ext" <<_ACEOF
8946 #line 8946 "configure"
8947 #include "confdefs.h"
8948 #include <stdio.h>
8949 int
8950 main (void)
8951 {
8952 printf("Hello")
8953   ;
8954   return 0;
8955 }
8956 _ACEOF
8957 rm -f "conftest.$ac_objext"
8958 if { (eval echo "$as_me:8958: \"$ac_compile\"") >&5
8959   (eval $ac_compile) 2>&5
8960   ac_status=$?
8961   echo "$as_me:8961: \$? = $ac_status" >&5
8962   (exit "$ac_status"); } &&
8963          { ac_try='test -s "conftest.$ac_objext"'
8964   { (eval echo "$as_me:8964: \"$ac_try\"") >&5
8965   (eval $ac_try) 2>&5
8966   ac_status=$?
8967   echo "$as_me:8967: \$? = $ac_status" >&5
8968   (exit "$ac_status"); }; }; then
8969   :
8970 else
8971   echo "$as_me: failed program was:" >&5
8972 cat "conftest.$ac_ext" >&5
8973 cf_have_incdir=yes
8974 fi
8975 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8976                           CPPFLAGS=$cf_save_CPPFLAGS
8977                         fi
8978                   fi
8979                 fi
8980
8981                 if test "$cf_have_incdir" = no ; then
8982                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8983
8984 echo "${as_me:-configure}:8984: testing adding $cf_add_incdir to include-path ..." 1>&5
8985
8986                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8987
8988                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8989                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8990                   cf_add_incdir="$cf_top_incdir"
8991                 else
8992                   break
8993                 fi
8994           else
8995                 break
8996           fi
8997         done
8998   done
8999 fi
9000
9001                 for cf_header in \
9002                         ncurses.h \
9003                         curses.h
9004                 do
9005
9006         cat >"conftest.$ac_ext" <<_ACEOF
9007 #line 9007 "configure"
9008 #include "confdefs.h"
9009
9010 #include <$cf_header>
9011 int
9012 main (void)
9013 {
9014
9015 #ifdef NCURSES_VERSION
9016
9017 printf("%s\\n", NCURSES_VERSION);
9018 #else
9019 #ifdef __NCURSES_H
9020 printf("old\\n");
9021 #else
9022         make an error
9023 #endif
9024 #endif
9025
9026   ;
9027   return 0;
9028 }
9029 _ACEOF
9030 rm -f "conftest.$ac_objext"
9031 if { (eval echo "$as_me:9031: \"$ac_compile\"") >&5
9032   (eval $ac_compile) 2>&5
9033   ac_status=$?
9034   echo "$as_me:9034: \$? = $ac_status" >&5
9035   (exit "$ac_status"); } &&
9036          { ac_try='test -s "conftest.$ac_objext"'
9037   { (eval echo "$as_me:9037: \"$ac_try\"") >&5
9038   (eval $ac_try) 2>&5
9039   ac_status=$?
9040   echo "$as_me:9040: \$? = $ac_status" >&5
9041   (exit "$ac_status"); }; }; then
9042   cf_cv_ncurses_h2=$cf_header
9043
9044 else
9045   echo "$as_me: failed program was:" >&5
9046 cat "conftest.$ac_ext" >&5
9047 cf_cv_ncurses_h2=no
9048 fi
9049 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9050
9051                         if test "$cf_cv_ncurses_h2" != no ; then
9052                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9053                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9054                                 break
9055                         fi
9056                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9057                 done
9058                 CPPFLAGS="$cf_save2_CPPFLAGS"
9059                 test "$cf_cv_ncurses_h2" != no && break
9060         done
9061         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9061: error: not found" >&5
9062 echo "$as_me: error: not found" >&2;}
9063    { (exit 1); exit 1; }; }
9064
9065 fi
9066 echo "$as_me:9066: result: $cf_cv_ncurses_h2" >&5
9067 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9068
9069         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9070         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9071         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9072                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9073         fi
9074
9075 if test -n "$cf_1st_incdir" ; then
9076   for cf_add_incdir in $cf_1st_incdir
9077   do
9078         while test "$cf_add_incdir" != /usr/include
9079         do
9080           if test -d "$cf_add_incdir"
9081           then
9082                 cf_have_incdir=no
9083                 if test -n "$CFLAGS$CPPFLAGS" ; then
9084                   # a loop is needed to ensure we can add subdirs of existing dirs
9085                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9086                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9087                           cf_have_incdir=yes; break
9088                         fi
9089                   done
9090                 fi
9091
9092                 if test "$cf_have_incdir" = no ; then
9093                   if test "$cf_add_incdir" = /usr/local/include ; then
9094                         if test "$GCC" = yes
9095                         then
9096                           cf_save_CPPFLAGS=$CPPFLAGS
9097
9098         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9099         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9100
9101                           cat >"conftest.$ac_ext" <<_ACEOF
9102 #line 9102 "configure"
9103 #include "confdefs.h"
9104 #include <stdio.h>
9105 int
9106 main (void)
9107 {
9108 printf("Hello")
9109   ;
9110   return 0;
9111 }
9112 _ACEOF
9113 rm -f "conftest.$ac_objext"
9114 if { (eval echo "$as_me:9114: \"$ac_compile\"") >&5
9115   (eval $ac_compile) 2>&5
9116   ac_status=$?
9117   echo "$as_me:9117: \$? = $ac_status" >&5
9118   (exit "$ac_status"); } &&
9119          { ac_try='test -s "conftest.$ac_objext"'
9120   { (eval echo "$as_me:9120: \"$ac_try\"") >&5
9121   (eval $ac_try) 2>&5
9122   ac_status=$?
9123   echo "$as_me:9123: \$? = $ac_status" >&5
9124   (exit "$ac_status"); }; }; then
9125   :
9126 else
9127   echo "$as_me: failed program was:" >&5
9128 cat "conftest.$ac_ext" >&5
9129 cf_have_incdir=yes
9130 fi
9131 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9132                           CPPFLAGS=$cf_save_CPPFLAGS
9133                         fi
9134                   fi
9135                 fi
9136
9137                 if test "$cf_have_incdir" = no ; then
9138                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9139
9140 echo "${as_me:-configure}:9140: testing adding $cf_add_incdir to include-path ..." 1>&5
9141
9142                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9143
9144                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9145                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9146                   cf_add_incdir="$cf_top_incdir"
9147                 else
9148                   break
9149                 fi
9150           else
9151                 break
9152           fi
9153         done
9154   done
9155 fi
9156
9157 fi
9158
9159 # Set definitions to allow ifdef'ing for ncurses.h
9160
9161 case "$cf_cv_ncurses_header" in
9162 (*ncurses.h)
9163
9164 cat >>confdefs.h <<\EOF
9165 #define HAVE_NCURSES_H 1
9166 EOF
9167
9168         ;;
9169 esac
9170
9171 case "$cf_cv_ncurses_header" in
9172 (ncurses/curses.h|ncurses/ncurses.h)
9173
9174 cat >>confdefs.h <<\EOF
9175 #define HAVE_NCURSES_NCURSES_H 1
9176 EOF
9177
9178         ;;
9179 (ncursesw/curses.h|ncursesw/ncurses.h)
9180
9181 cat >>confdefs.h <<\EOF
9182 #define HAVE_NCURSESW_NCURSES_H 1
9183 EOF
9184
9185         ;;
9186 esac
9187
9188 echo "$as_me:9188: checking for terminfo header" >&5
9189 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9190 if test "${cf_cv_term_header+set}" = set; then
9191   echo $ECHO_N "(cached) $ECHO_C" >&6
9192 else
9193
9194 case "${cf_cv_ncurses_header}" in
9195 (*/ncurses.h|*/ncursesw.h)
9196         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9197         ;;
9198 (*)
9199         cf_term_header=term.h
9200         ;;
9201 esac
9202
9203 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9204 do
9205 cat >"conftest.$ac_ext" <<_ACEOF
9206 #line 9206 "configure"
9207 #include "confdefs.h"
9208 #include <stdio.h>
9209 #include <${cf_cv_ncurses_header:-curses.h}>
9210 #include <$cf_test>
9211
9212 int
9213 main (void)
9214 {
9215 int x = auto_left_margin; (void)x
9216   ;
9217   return 0;
9218 }
9219 _ACEOF
9220 rm -f "conftest.$ac_objext"
9221 if { (eval echo "$as_me:9221: \"$ac_compile\"") >&5
9222   (eval $ac_compile) 2>&5
9223   ac_status=$?
9224   echo "$as_me:9224: \$? = $ac_status" >&5
9225   (exit "$ac_status"); } &&
9226          { ac_try='test -s "conftest.$ac_objext"'
9227   { (eval echo "$as_me:9227: \"$ac_try\"") >&5
9228   (eval $ac_try) 2>&5
9229   ac_status=$?
9230   echo "$as_me:9230: \$? = $ac_status" >&5
9231   (exit "$ac_status"); }; }; then
9232
9233         cf_cv_term_header="$cf_test"
9234 else
9235   echo "$as_me: failed program was:" >&5
9236 cat "conftest.$ac_ext" >&5
9237
9238         cf_cv_term_header=unknown
9239
9240 fi
9241 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9242         test "$cf_cv_term_header" != unknown && break
9243 done
9244
9245 fi
9246 echo "$as_me:9246: result: $cf_cv_term_header" >&5
9247 echo "${ECHO_T}$cf_cv_term_header" >&6
9248
9249 # Set definitions to allow ifdef'ing to accommodate subdirectories
9250
9251 case "$cf_cv_term_header" in
9252 (*term.h)
9253
9254 cat >>confdefs.h <<\EOF
9255 #define HAVE_TERM_H 1
9256 EOF
9257
9258         ;;
9259 esac
9260
9261 case "$cf_cv_term_header" in
9262 (ncurses/term.h)
9263
9264 cat >>confdefs.h <<\EOF
9265 #define HAVE_NCURSES_TERM_H 1
9266 EOF
9267
9268         ;;
9269 (ncursesw/term.h)
9270
9271 cat >>confdefs.h <<\EOF
9272 #define HAVE_NCURSESW_TERM_H 1
9273 EOF
9274
9275         ;;
9276 esac
9277
9278 # some applications need this, but should check for NCURSES_VERSION
9279
9280 cat >>confdefs.h <<\EOF
9281 #define NCURSES 1
9282 EOF
9283
9284 echo "$as_me:9284: checking for ncurses version" >&5
9285 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9286 if test "${cf_cv_ncurses_version+set}" = set; then
9287   echo $ECHO_N "(cached) $ECHO_C" >&6
9288 else
9289
9290         cf_cv_ncurses_version=no
9291         cf_tempfile=out$$
9292         rm -f "$cf_tempfile"
9293         if test "$cross_compiling" = yes; then
9294
9295         # This will not work if the preprocessor splits the line after the
9296         # Autoconf token.  The 'unproto' program does that.
9297         cat > "conftest.$ac_ext" <<EOF
9298 #include <${cf_cv_ncurses_header:-curses.h}>
9299 #undef Autoconf
9300 #ifdef NCURSES_VERSION
9301 Autoconf NCURSES_VERSION
9302 #else
9303 #ifdef __NCURSES_H
9304 Autoconf "old"
9305 #endif
9306 ;
9307 #endif
9308 EOF
9309         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9310         { (eval echo "$as_me:9310: \"$cf_try\"") >&5
9311   (eval $cf_try) 2>&5
9312   ac_status=$?
9313   echo "$as_me:9313: \$? = $ac_status" >&5
9314   (exit "$ac_status"); }
9315         if test -f conftest.out ; then
9316                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9317                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9318                 rm -f conftest.out
9319         fi
9320
9321 else
9322   cat >"conftest.$ac_ext" <<_ACEOF
9323 #line 9323 "configure"
9324 #include "confdefs.h"
9325
9326 #include <${cf_cv_ncurses_header:-curses.h}>
9327 #include <stdio.h>
9328 int main(void)
9329 {
9330         FILE *fp = fopen("$cf_tempfile", "w");
9331 #ifdef NCURSES_VERSION
9332 # ifdef NCURSES_VERSION_PATCH
9333         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9334 # else
9335         fprintf(fp, "%s\\n", NCURSES_VERSION);
9336 # endif
9337 #else
9338 # ifdef __NCURSES_H
9339         fprintf(fp, "old\\n");
9340 # else
9341         make an error
9342 # endif
9343 #endif
9344         ${cf_cv_main_return:-return}(0);
9345 }
9346 _ACEOF
9347 rm -f "conftest$ac_exeext"
9348 if { (eval echo "$as_me:9348: \"$ac_link\"") >&5
9349   (eval $ac_link) 2>&5
9350   ac_status=$?
9351   echo "$as_me:9351: \$? = $ac_status" >&5
9352   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9353   { (eval echo "$as_me:9353: \"$ac_try\"") >&5
9354   (eval $ac_try) 2>&5
9355   ac_status=$?
9356   echo "$as_me:9356: \$? = $ac_status" >&5
9357   (exit "$ac_status"); }; }; then
9358
9359         cf_cv_ncurses_version=`cat $cf_tempfile`
9360 else
9361   echo "$as_me: program exited with status $ac_status" >&5
9362 echo "$as_me: failed program was:" >&5
9363 cat "conftest.$ac_ext" >&5
9364 fi
9365 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9366 fi
9367         rm -f "$cf_tempfile"
9368
9369 fi
9370 echo "$as_me:9370: result: $cf_cv_ncurses_version" >&5
9371 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9372 test "$cf_cv_ncurses_version" = no ||
9373 cat >>confdefs.h <<\EOF
9374 #define NCURSES 1
9375 EOF
9376
9377 cf_nculib_root=$cf_cv_screen
9378         # This works, except for the special case where we find gpm, but
9379         # ncurses is in a nonstandard location via $LIBS, and we really want
9380         # to link gpm.
9381 cf_ncurses_LIBS=""
9382 cf_ncurses_SAVE="$LIBS"
9383 echo "$as_me:9383: checking for Gpm_Open in -lgpm" >&5
9384 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9385 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9386   echo $ECHO_N "(cached) $ECHO_C" >&6
9387 else
9388   ac_check_lib_save_LIBS=$LIBS
9389 LIBS="-lgpm  $LIBS"
9390 cat >"conftest.$ac_ext" <<_ACEOF
9391 #line 9391 "configure"
9392 #include "confdefs.h"
9393
9394 /* Override any gcc2 internal prototype to avoid an error.  */
9395 #ifdef __cplusplus
9396 extern "C"
9397 #endif
9398 /* We use char because int might match the return type of a gcc2
9399    builtin and then its argument prototype would still apply.  */
9400 char Gpm_Open ();
9401 int
9402 main (void)
9403 {
9404 Gpm_Open ();
9405   ;
9406   return 0;
9407 }
9408 _ACEOF
9409 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9410 if { (eval echo "$as_me:9410: \"$ac_link\"") >&5
9411   (eval $ac_link) 2>&5
9412   ac_status=$?
9413   echo "$as_me:9413: \$? = $ac_status" >&5
9414   (exit "$ac_status"); } &&
9415          { ac_try='test -s "conftest$ac_exeext"'
9416   { (eval echo "$as_me:9416: \"$ac_try\"") >&5
9417   (eval $ac_try) 2>&5
9418   ac_status=$?
9419   echo "$as_me:9419: \$? = $ac_status" >&5
9420   (exit "$ac_status"); }; }; then
9421   ac_cv_lib_gpm_Gpm_Open=yes
9422 else
9423   echo "$as_me: failed program was:" >&5
9424 cat "conftest.$ac_ext" >&5
9425 ac_cv_lib_gpm_Gpm_Open=no
9426 fi
9427 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9428 LIBS=$ac_check_lib_save_LIBS
9429 fi
9430 echo "$as_me:9430: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9431 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9432 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9433   echo "$as_me:9433: checking for initscr in -lgpm" >&5
9434 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9435 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9436   echo $ECHO_N "(cached) $ECHO_C" >&6
9437 else
9438   ac_check_lib_save_LIBS=$LIBS
9439 LIBS="-lgpm  $LIBS"
9440 cat >"conftest.$ac_ext" <<_ACEOF
9441 #line 9441 "configure"
9442 #include "confdefs.h"
9443
9444 /* Override any gcc2 internal prototype to avoid an error.  */
9445 #ifdef __cplusplus
9446 extern "C"
9447 #endif
9448 /* We use char because int might match the return type of a gcc2
9449    builtin and then its argument prototype would still apply.  */
9450 char initscr ();
9451 int
9452 main (void)
9453 {
9454 initscr ();
9455   ;
9456   return 0;
9457 }
9458 _ACEOF
9459 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9460 if { (eval echo "$as_me:9460: \"$ac_link\"") >&5
9461   (eval $ac_link) 2>&5
9462   ac_status=$?
9463   echo "$as_me:9463: \$? = $ac_status" >&5
9464   (exit "$ac_status"); } &&
9465          { ac_try='test -s "conftest$ac_exeext"'
9466   { (eval echo "$as_me:9466: \"$ac_try\"") >&5
9467   (eval $ac_try) 2>&5
9468   ac_status=$?
9469   echo "$as_me:9469: \$? = $ac_status" >&5
9470   (exit "$ac_status"); }; }; then
9471   ac_cv_lib_gpm_initscr=yes
9472 else
9473   echo "$as_me: failed program was:" >&5
9474 cat "conftest.$ac_ext" >&5
9475 ac_cv_lib_gpm_initscr=no
9476 fi
9477 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9478 LIBS=$ac_check_lib_save_LIBS
9479 fi
9480 echo "$as_me:9480: result: $ac_cv_lib_gpm_initscr" >&5
9481 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9482 if test "$ac_cv_lib_gpm_initscr" = yes; then
9483   LIBS="$cf_ncurses_SAVE"
9484 else
9485   cf_ncurses_LIBS="-lgpm"
9486 fi
9487
9488 fi
9489
9490 case "$host_os" in
9491 (freebsd*)
9492         # This is only necessary if you are linking against an obsolete
9493         # version of ncurses (but it should do no harm, since it's static).
9494         if test "$cf_nculib_root" = ncurses ; then
9495                 echo "$as_me:9495: checking for tgoto in -lmytinfo" >&5
9496 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9497 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9498   echo $ECHO_N "(cached) $ECHO_C" >&6
9499 else
9500   ac_check_lib_save_LIBS=$LIBS
9501 LIBS="-lmytinfo  $LIBS"
9502 cat >"conftest.$ac_ext" <<_ACEOF
9503 #line 9503 "configure"
9504 #include "confdefs.h"
9505
9506 /* Override any gcc2 internal prototype to avoid an error.  */
9507 #ifdef __cplusplus
9508 extern "C"
9509 #endif
9510 /* We use char because int might match the return type of a gcc2
9511    builtin and then its argument prototype would still apply.  */
9512 char tgoto ();
9513 int
9514 main (void)
9515 {
9516 tgoto ();
9517   ;
9518   return 0;
9519 }
9520 _ACEOF
9521 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9522 if { (eval echo "$as_me:9522: \"$ac_link\"") >&5
9523   (eval $ac_link) 2>&5
9524   ac_status=$?
9525   echo "$as_me:9525: \$? = $ac_status" >&5
9526   (exit "$ac_status"); } &&
9527          { ac_try='test -s "conftest$ac_exeext"'
9528   { (eval echo "$as_me:9528: \"$ac_try\"") >&5
9529   (eval $ac_try) 2>&5
9530   ac_status=$?
9531   echo "$as_me:9531: \$? = $ac_status" >&5
9532   (exit "$ac_status"); }; }; then
9533   ac_cv_lib_mytinfo_tgoto=yes
9534 else
9535   echo "$as_me: failed program was:" >&5
9536 cat "conftest.$ac_ext" >&5
9537 ac_cv_lib_mytinfo_tgoto=no
9538 fi
9539 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9540 LIBS=$ac_check_lib_save_LIBS
9541 fi
9542 echo "$as_me:9542: result: $ac_cv_lib_mytinfo_tgoto" >&5
9543 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9544 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9545   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9546 fi
9547
9548         fi
9549         ;;
9550 esac
9551
9552 cf_add_libs="$LIBS"
9553 # reverse order
9554 cf_add_0lib=
9555 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9556 # filter duplicates
9557 for cf_add_1lib in $cf_add_0lib; do
9558         for cf_add_2lib in $cf_add_libs; do
9559                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9560                         cf_add_1lib=
9561                         break
9562                 fi
9563         done
9564         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9565 done
9566 LIBS="$cf_add_libs"
9567
9568 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9569 then
9570
9571 cf_add_libs="$LIBS"
9572 # reverse order
9573 cf_add_0lib=
9574 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9575 # filter duplicates
9576 for cf_add_1lib in $cf_add_0lib; do
9577         for cf_add_2lib in $cf_add_libs; do
9578                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9579                         cf_add_1lib=
9580                         break
9581                 fi
9582         done
9583         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9584 done
9585 LIBS="$cf_add_libs"
9586
9587 else
9588
9589         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9590         cf_libdir=""
9591         echo "$as_me:9591: checking for initscr" >&5
9592 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9593 if test "${ac_cv_func_initscr+set}" = set; then
9594   echo $ECHO_N "(cached) $ECHO_C" >&6
9595 else
9596   cat >"conftest.$ac_ext" <<_ACEOF
9597 #line 9597 "configure"
9598 #include "confdefs.h"
9599 #define initscr autoconf_temporary
9600 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9601 #undef initscr
9602
9603 #ifdef __cplusplus
9604 extern "C"
9605 #endif
9606
9607 /* We use char because int might match the return type of a gcc2
9608    builtin and then its argument prototype would still apply.  */
9609 char initscr (void);
9610
9611 int
9612 main (void)
9613 {
9614
9615 /* The GNU C library defines stubs for functions which it implements
9616     to always fail with ENOSYS.  Some functions are actually named
9617     something starting with __ and the normal name is an alias.  */
9618 #if defined (__stub_initscr) || defined (__stub___initscr)
9619 #error found stub for initscr
9620 #endif
9621
9622         return initscr ();
9623   ;
9624   return 0;
9625 }
9626 _ACEOF
9627 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9628 if { (eval echo "$as_me:9628: \"$ac_link\"") >&5
9629   (eval $ac_link) 2>&5
9630   ac_status=$?
9631   echo "$as_me:9631: \$? = $ac_status" >&5
9632   (exit "$ac_status"); } &&
9633          { ac_try='test -s "conftest$ac_exeext"'
9634   { (eval echo "$as_me:9634: \"$ac_try\"") >&5
9635   (eval $ac_try) 2>&5
9636   ac_status=$?
9637   echo "$as_me:9637: \$? = $ac_status" >&5
9638   (exit "$ac_status"); }; }; then
9639   ac_cv_func_initscr=yes
9640 else
9641   echo "$as_me: failed program was:" >&5
9642 cat "conftest.$ac_ext" >&5
9643 ac_cv_func_initscr=no
9644 fi
9645 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9646 fi
9647 echo "$as_me:9647: result: $ac_cv_func_initscr" >&5
9648 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9649 if test "$ac_cv_func_initscr" = yes; then
9650   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9651 else
9652
9653                 cf_save_LIBS="$LIBS"
9654                 echo "$as_me:9654: checking for initscr in -l$cf_nculib_root" >&5
9655 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9656                 LIBS="-l$cf_nculib_root $LIBS"
9657                 cat >"conftest.$ac_ext" <<_ACEOF
9658 #line 9658 "configure"
9659 #include "confdefs.h"
9660 #include <${cf_cv_ncurses_header:-curses.h}>
9661 int
9662 main (void)
9663 {
9664 initscr()
9665   ;
9666   return 0;
9667 }
9668 _ACEOF
9669 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9670 if { (eval echo "$as_me:9670: \"$ac_link\"") >&5
9671   (eval $ac_link) 2>&5
9672   ac_status=$?
9673   echo "$as_me:9673: \$? = $ac_status" >&5
9674   (exit "$ac_status"); } &&
9675          { ac_try='test -s "conftest$ac_exeext"'
9676   { (eval echo "$as_me:9676: \"$ac_try\"") >&5
9677   (eval $ac_try) 2>&5
9678   ac_status=$?
9679   echo "$as_me:9679: \$? = $ac_status" >&5
9680   (exit "$ac_status"); }; }; then
9681   echo "$as_me:9681: result: yes" >&5
9682 echo "${ECHO_T}yes" >&6
9683                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9684
9685 else
9686   echo "$as_me: failed program was:" >&5
9687 cat "conftest.$ac_ext" >&5
9688 echo "$as_me:9688: result: no" >&5
9689 echo "${ECHO_T}no" >&6
9690
9691 cf_search=
9692 cf_library_path_list=""
9693 if test -n "${LDFLAGS}${LIBS}" ; then
9694         for cf_library_path in $LDFLAGS $LIBS
9695         do
9696                 case "$cf_library_path" in
9697                 (-L*)
9698                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9699
9700 test "x$cf_library_path" != "xNONE" && \
9701 test -d "$cf_library_path" && \
9702  {
9703         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9704         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9705         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9706         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9707         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9708         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"
9709 }
9710
9711                         cf_library_path_list="$cf_library_path_list $cf_search"
9712                         ;;
9713                 esac
9714         done
9715 fi
9716
9717 cf_search=
9718
9719 test "x$prefix" != "xNONE" && \
9720 test -d "$prefix" && \
9721  {
9722         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9723         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9724         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9725         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9726         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9727         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9728 }
9729
9730 for cf_subdir_prefix in \
9731         /usr \
9732         /usr/local \
9733         /usr/pkg \
9734         /opt \
9735         /opt/local \
9736         $HOME
9737 do
9738
9739 test "x$cf_subdir_prefix" != "x$prefix" && \
9740 test -d "$cf_subdir_prefix" && \
9741 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9742         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9743         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9744         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9745         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9746         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9747         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"
9748 }
9749
9750 done
9751
9752 cf_search="$cf_library_path_list $cf_search"
9753
9754                         for cf_libdir in $cf_search
9755                         do
9756                                 echo "$as_me:9756: checking for -l$cf_nculib_root in $cf_libdir" >&5
9757 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9758                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9759                                 cat >"conftest.$ac_ext" <<_ACEOF
9760 #line 9760 "configure"
9761 #include "confdefs.h"
9762 #include <${cf_cv_ncurses_header:-curses.h}>
9763 int
9764 main (void)
9765 {
9766 initscr()
9767   ;
9768   return 0;
9769 }
9770 _ACEOF
9771 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9772 if { (eval echo "$as_me:9772: \"$ac_link\"") >&5
9773   (eval $ac_link) 2>&5
9774   ac_status=$?
9775   echo "$as_me:9775: \$? = $ac_status" >&5
9776   (exit "$ac_status"); } &&
9777          { ac_try='test -s "conftest$ac_exeext"'
9778   { (eval echo "$as_me:9778: \"$ac_try\"") >&5
9779   (eval $ac_try) 2>&5
9780   ac_status=$?
9781   echo "$as_me:9781: \$? = $ac_status" >&5
9782   (exit "$ac_status"); }; }; then
9783   echo "$as_me:9783: result: yes" >&5
9784 echo "${ECHO_T}yes" >&6
9785                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9786                                          break
9787 else
9788   echo "$as_me: failed program was:" >&5
9789 cat "conftest.$ac_ext" >&5
9790 echo "$as_me:9790: result: no" >&5
9791 echo "${ECHO_T}no" >&6
9792                                          LIBS="$cf_save_LIBS"
9793 fi
9794 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9795                         done
9796
9797 fi
9798 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9799
9800 fi
9801
9802 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9803
9804 if test "$cf_found_library" = no ; then
9805         { { echo "$as_me:9805: error: Cannot link $cf_nculib_root library" >&5
9806 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9807    { (exit 1); exit 1; }; }
9808 fi
9809
9810 fi
9811
9812 if test -n "$cf_ncurses_LIBS" ; then
9813         echo "$as_me:9813: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9814 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9815         cf_ncurses_SAVE="$LIBS"
9816         for p in $cf_ncurses_LIBS ; do
9817                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9818                 if test "$q" != "$LIBS" ; then
9819                         LIBS="$q"
9820                 fi
9821         done
9822         cat >"conftest.$ac_ext" <<_ACEOF
9823 #line 9823 "configure"
9824 #include "confdefs.h"
9825 #include <${cf_cv_ncurses_header:-curses.h}>
9826 int
9827 main (void)
9828 {
9829 initscr(); mousemask(0,0); tigetstr((char *)0);
9830   ;
9831   return 0;
9832 }
9833 _ACEOF
9834 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9835 if { (eval echo "$as_me:9835: \"$ac_link\"") >&5
9836   (eval $ac_link) 2>&5
9837   ac_status=$?
9838   echo "$as_me:9838: \$? = $ac_status" >&5
9839   (exit "$ac_status"); } &&
9840          { ac_try='test -s "conftest$ac_exeext"'
9841   { (eval echo "$as_me:9841: \"$ac_try\"") >&5
9842   (eval $ac_try) 2>&5
9843   ac_status=$?
9844   echo "$as_me:9844: \$? = $ac_status" >&5
9845   (exit "$ac_status"); }; }; then
9846   echo "$as_me:9846: result: yes" >&5
9847 echo "${ECHO_T}yes" >&6
9848 else
9849   echo "$as_me: failed program was:" >&5
9850 cat "conftest.$ac_ext" >&5
9851 echo "$as_me:9851: result: no" >&5
9852 echo "${ECHO_T}no" >&6
9853                  LIBS="$cf_ncurses_SAVE"
9854 fi
9855 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9856 fi
9857
9858 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9859
9860 cat >>confdefs.h <<EOF
9861 #define $cf_nculib_ROOT 1
9862 EOF
9863
9864         fi
9865 else
9866         NCURSES_CONFIG=none
9867 fi
9868
9869         ;;
9870 (ncurses*)
9871
9872 cf_ncuconfig_root=$cf_cv_screen
9873 cf_have_ncuconfig=no
9874
9875 if test "x${PKG_CONFIG:=none}" != xnone; then
9876         echo "$as_me:9876: checking pkg-config for $cf_ncuconfig_root" >&5
9877 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9878         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9879                 echo "$as_me:9879: result: yes" >&5
9880 echo "${ECHO_T}yes" >&6
9881
9882                 echo "$as_me:9882: checking if the $cf_ncuconfig_root package files work" >&5
9883 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9884                 cf_have_ncuconfig=unknown
9885
9886                 cf_save_CFLAGS="$CFLAGS"
9887                 cf_save_CPPFLAGS="$CPPFLAGS"
9888                 cf_save_LIBS="$LIBS"
9889
9890                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9891                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9892
9893                 # while -W for passing linker flags is prevalent, it is not "standard".
9894                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9895                 # incompatible _and_ non-standard -W option which gives an error.  Work
9896                 # around that pitfall.
9897                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9898                 (x*c[89]9@@*-W*)
9899
9900 cf_fix_cppflags=no
9901 cf_new_cflags=
9902 cf_new_cppflags=
9903 cf_new_extra_cppflags=
9904
9905 for cf_add_cflags in $cf_pkg_cflags
9906 do
9907 case "$cf_fix_cppflags" in
9908 (no)
9909         case "$cf_add_cflags" in
9910         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9911                 case "$cf_add_cflags" in
9912                 (-D*)
9913                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9914
9915                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9916                                 && test -z "${cf_tst_cflags}" \
9917                                 && cf_fix_cppflags=yes
9918
9919                         if test "$cf_fix_cppflags" = yes ; then
9920
9921         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9922         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9923
9924                                 continue
9925                         elif test "${cf_tst_cflags}" = "\"'" ; then
9926
9927         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9928         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9929
9930                                 continue
9931                         fi
9932                         ;;
9933                 esac
9934                 case "$CPPFLAGS" in
9935                 (*$cf_add_cflags)
9936                         ;;
9937                 (*)
9938                         case "$cf_add_cflags" in
9939                         (-D*)
9940                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9941
9942 CPPFLAGS=`echo "$CPPFLAGS" | \
9943         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9944                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9945
9946                                 ;;
9947                         esac
9948
9949         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9950         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9951
9952                         ;;
9953                 esac
9954                 ;;
9955         (*)
9956
9957         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9958         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9959
9960                 ;;
9961         esac
9962         ;;
9963 (yes)
9964
9965         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9966         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9967
9968         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9969
9970         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9971                 && test -z "${cf_tst_cflags}" \
9972                 && cf_fix_cppflags=no
9973         ;;
9974 esac
9975 done
9976
9977 if test -n "$cf_new_cflags" ; then
9978
9979         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9980         CFLAGS="${CFLAGS}$cf_new_cflags"
9981
9982 fi
9983
9984 if test -n "$cf_new_cppflags" ; then
9985
9986         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9987         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9988
9989 fi
9990
9991 if test -n "$cf_new_extra_cppflags" ; then
9992
9993         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9994         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9995
9996 fi
9997
9998 cf_add_libs="$LIBS"
9999 # reverse order
10000 cf_add_0lib=
10001 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10002 # filter duplicates
10003 for cf_add_1lib in $cf_add_0lib; do
10004         for cf_add_2lib in $cf_add_libs; do
10005                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10006                         cf_add_1lib=
10007                         break
10008                 fi
10009         done
10010         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10011 done
10012 LIBS="$cf_add_libs"
10013
10014                         cat >"conftest.$ac_ext" <<_ACEOF
10015 #line 10015 "configure"
10016 #include "confdefs.h"
10017 #include <${cf_cv_ncurses_header:-curses.h}>
10018 int
10019 main (void)
10020 {
10021 initscr(); mousemask(0,0); tigetstr((char *)0);
10022   ;
10023   return 0;
10024 }
10025 _ACEOF
10026 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10027 if { (eval echo "$as_me:10027: \"$ac_link\"") >&5
10028   (eval $ac_link) 2>&5
10029   ac_status=$?
10030   echo "$as_me:10030: \$? = $ac_status" >&5
10031   (exit "$ac_status"); } &&
10032          { ac_try='test -s "conftest$ac_exeext"'
10033   { (eval echo "$as_me:10033: \"$ac_try\"") >&5
10034   (eval $ac_try) 2>&5
10035   ac_status=$?
10036   echo "$as_me:10036: \$? = $ac_status" >&5
10037   (exit "$ac_status"); }; }; then
10038   if test "$cross_compiling" = yes; then
10039   cf_test_ncuconfig=maybe
10040 else
10041   cat >"conftest.$ac_ext" <<_ACEOF
10042 #line 10042 "configure"
10043 #include "confdefs.h"
10044 #include <${cf_cv_ncurses_header:-curses.h}>
10045                                         int main(void)
10046                                         { char *xx = curses_version(); return (xx == 0); }
10047 _ACEOF
10048 rm -f "conftest$ac_exeext"
10049 if { (eval echo "$as_me:10049: \"$ac_link\"") >&5
10050   (eval $ac_link) 2>&5
10051   ac_status=$?
10052   echo "$as_me:10052: \$? = $ac_status" >&5
10053   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10054   { (eval echo "$as_me:10054: \"$ac_try\"") >&5
10055   (eval $ac_try) 2>&5
10056   ac_status=$?
10057   echo "$as_me:10057: \$? = $ac_status" >&5
10058   (exit "$ac_status"); }; }; then
10059   cf_test_ncuconfig=yes
10060 else
10061   echo "$as_me: program exited with status $ac_status" >&5
10062 echo "$as_me: failed program was:" >&5
10063 cat "conftest.$ac_ext" >&5
10064 cf_test_ncuconfig=no
10065 fi
10066 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10067 fi
10068 else
10069   echo "$as_me: failed program was:" >&5
10070 cat "conftest.$ac_ext" >&5
10071 cf_test_ncuconfig=no
10072 fi
10073 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10074
10075                         CFLAGS="$cf_save_CFLAGS"
10076                         CPPFLAGS="$cf_save_CPPFLAGS"
10077                         LIBS="$cf_save_LIBS"
10078
10079                         if test "x$cf_test_ncuconfig" != xyes; then
10080                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10081                                 cf_pkg_cflags="$cf_temp"
10082                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10083                                 cf_pkg_libs="$cf_temp"
10084                         fi
10085                         ;;
10086                 esac
10087
10088 cf_fix_cppflags=no
10089 cf_new_cflags=
10090 cf_new_cppflags=
10091 cf_new_extra_cppflags=
10092
10093 for cf_add_cflags in $cf_pkg_cflags
10094 do
10095 case "$cf_fix_cppflags" in
10096 (no)
10097         case "$cf_add_cflags" in
10098         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10099                 case "$cf_add_cflags" in
10100                 (-D*)
10101                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10102
10103                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10104                                 && test -z "${cf_tst_cflags}" \
10105                                 && cf_fix_cppflags=yes
10106
10107                         if test "$cf_fix_cppflags" = yes ; then
10108
10109         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10110         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10111
10112                                 continue
10113                         elif test "${cf_tst_cflags}" = "\"'" ; then
10114
10115         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10116         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10117
10118                                 continue
10119                         fi
10120                         ;;
10121                 esac
10122                 case "$CPPFLAGS" in
10123                 (*$cf_add_cflags)
10124                         ;;
10125                 (*)
10126                         case "$cf_add_cflags" in
10127                         (-D*)
10128                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10129
10130 CPPFLAGS=`echo "$CPPFLAGS" | \
10131         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10132                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10133
10134                                 ;;
10135                         esac
10136
10137         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10138         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10139
10140                         ;;
10141                 esac
10142                 ;;
10143         (*)
10144
10145         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10146         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10147
10148                 ;;
10149         esac
10150         ;;
10151 (yes)
10152
10153         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10154         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10155
10156         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10157
10158         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10159                 && test -z "${cf_tst_cflags}" \
10160                 && cf_fix_cppflags=no
10161         ;;
10162 esac
10163 done
10164
10165 if test -n "$cf_new_cflags" ; then
10166
10167         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10168         CFLAGS="${CFLAGS}$cf_new_cflags"
10169
10170 fi
10171
10172 if test -n "$cf_new_cppflags" ; then
10173
10174         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10175         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10176
10177 fi
10178
10179 if test -n "$cf_new_extra_cppflags" ; then
10180
10181         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10182         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10183
10184 fi
10185
10186 cf_add_libs="$LIBS"
10187 # reverse order
10188 cf_add_0lib=
10189 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10190 # filter duplicates
10191 for cf_add_1lib in $cf_add_0lib; do
10192         for cf_add_2lib in $cf_add_libs; do
10193                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10194                         cf_add_1lib=
10195                         break
10196                 fi
10197         done
10198         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10199 done
10200 LIBS="$cf_add_libs"
10201
10202                 cat >"conftest.$ac_ext" <<_ACEOF
10203 #line 10203 "configure"
10204 #include "confdefs.h"
10205 #include <${cf_cv_ncurses_header:-curses.h}>
10206 int
10207 main (void)
10208 {
10209 initscr(); mousemask(0,0); tigetstr((char *)0);
10210   ;
10211   return 0;
10212 }
10213 _ACEOF
10214 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10215 if { (eval echo "$as_me:10215: \"$ac_link\"") >&5
10216   (eval $ac_link) 2>&5
10217   ac_status=$?
10218   echo "$as_me:10218: \$? = $ac_status" >&5
10219   (exit "$ac_status"); } &&
10220          { ac_try='test -s "conftest$ac_exeext"'
10221   { (eval echo "$as_me:10221: \"$ac_try\"") >&5
10222   (eval $ac_try) 2>&5
10223   ac_status=$?
10224   echo "$as_me:10224: \$? = $ac_status" >&5
10225   (exit "$ac_status"); }; }; then
10226   if test "$cross_compiling" = yes; then
10227   cf_have_ncuconfig=maybe
10228 else
10229   cat >"conftest.$ac_ext" <<_ACEOF
10230 #line 10230 "configure"
10231 #include "confdefs.h"
10232 #include <${cf_cv_ncurses_header:-curses.h}>
10233                                 int main(void)
10234                                 { char *xx = curses_version(); return (xx == 0); }
10235 _ACEOF
10236 rm -f "conftest$ac_exeext"
10237 if { (eval echo "$as_me:10237: \"$ac_link\"") >&5
10238   (eval $ac_link) 2>&5
10239   ac_status=$?
10240   echo "$as_me:10240: \$? = $ac_status" >&5
10241   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10242   { (eval echo "$as_me:10242: \"$ac_try\"") >&5
10243   (eval $ac_try) 2>&5
10244   ac_status=$?
10245   echo "$as_me:10245: \$? = $ac_status" >&5
10246   (exit "$ac_status"); }; }; then
10247   cf_have_ncuconfig=yes
10248 else
10249   echo "$as_me: program exited with status $ac_status" >&5
10250 echo "$as_me: failed program was:" >&5
10251 cat "conftest.$ac_ext" >&5
10252 cf_have_ncuconfig=no
10253 fi
10254 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10255 fi
10256 else
10257   echo "$as_me: failed program was:" >&5
10258 cat "conftest.$ac_ext" >&5
10259 cf_have_ncuconfig=no
10260 fi
10261 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10262                 echo "$as_me:10262: result: $cf_have_ncuconfig" >&5
10263 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10264                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10265                 if test "$cf_have_ncuconfig" != "yes"
10266                 then
10267                         CPPFLAGS="$cf_save_CPPFLAGS"
10268                         LIBS="$cf_save_LIBS"
10269                         NCURSES_CONFIG_PKG=none
10270                 else
10271
10272 cat >>confdefs.h <<\EOF
10273 #define NCURSES 1
10274 EOF
10275
10276                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10277
10278 echo "$as_me:10278: checking for terminfo header" >&5
10279 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10280 if test "${cf_cv_term_header+set}" = set; then
10281   echo $ECHO_N "(cached) $ECHO_C" >&6
10282 else
10283
10284 case "${cf_cv_ncurses_header}" in
10285 (*/ncurses.h|*/ncursesw.h)
10286         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10287         ;;
10288 (*)
10289         cf_term_header=term.h
10290         ;;
10291 esac
10292
10293 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10294 do
10295 cat >"conftest.$ac_ext" <<_ACEOF
10296 #line 10296 "configure"
10297 #include "confdefs.h"
10298 #include <stdio.h>
10299 #include <${cf_cv_ncurses_header:-curses.h}>
10300 #include <$cf_test>
10301
10302 int
10303 main (void)
10304 {
10305 int x = auto_left_margin; (void)x
10306   ;
10307   return 0;
10308 }
10309 _ACEOF
10310 rm -f "conftest.$ac_objext"
10311 if { (eval echo "$as_me:10311: \"$ac_compile\"") >&5
10312   (eval $ac_compile) 2>&5
10313   ac_status=$?
10314   echo "$as_me:10314: \$? = $ac_status" >&5
10315   (exit "$ac_status"); } &&
10316          { ac_try='test -s "conftest.$ac_objext"'
10317   { (eval echo "$as_me:10317: \"$ac_try\"") >&5
10318   (eval $ac_try) 2>&5
10319   ac_status=$?
10320   echo "$as_me:10320: \$? = $ac_status" >&5
10321   (exit "$ac_status"); }; }; then
10322
10323         cf_cv_term_header="$cf_test"
10324 else
10325   echo "$as_me: failed program was:" >&5
10326 cat "conftest.$ac_ext" >&5
10327
10328         cf_cv_term_header=unknown
10329
10330 fi
10331 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10332         test "$cf_cv_term_header" != unknown && break
10333 done
10334
10335 fi
10336 echo "$as_me:10336: result: $cf_cv_term_header" >&5
10337 echo "${ECHO_T}$cf_cv_term_header" >&6
10338
10339 # Set definitions to allow ifdef'ing to accommodate subdirectories
10340
10341 case "$cf_cv_term_header" in
10342 (*term.h)
10343
10344 cat >>confdefs.h <<\EOF
10345 #define HAVE_TERM_H 1
10346 EOF
10347
10348         ;;
10349 esac
10350
10351 case "$cf_cv_term_header" in
10352 (ncurses/term.h)
10353
10354 cat >>confdefs.h <<\EOF
10355 #define HAVE_NCURSES_TERM_H 1
10356 EOF
10357
10358         ;;
10359 (ncursesw/term.h)
10360
10361 cat >>confdefs.h <<\EOF
10362 #define HAVE_NCURSESW_TERM_H 1
10363 EOF
10364
10365         ;;
10366 esac
10367
10368                 fi
10369
10370         else
10371                 echo "$as_me:10371: result: no" >&5
10372 echo "${ECHO_T}no" >&6
10373                 NCURSES_CONFIG_PKG=none
10374         fi
10375 else
10376         NCURSES_CONFIG_PKG=none
10377 fi
10378
10379 if test "x$cf_have_ncuconfig" = "xno"; then
10380         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10381
10382 if test -n "$ac_tool_prefix"; then
10383   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10384   do
10385     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10386 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10387 echo "$as_me:10387: checking for $ac_word" >&5
10388 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10389 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10390   echo $ECHO_N "(cached) $ECHO_C" >&6
10391 else
10392   if test -n "$NCURSES_CONFIG"; then
10393   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10394 else
10395   ac_save_IFS=$IFS; IFS=$ac_path_separator
10396 ac_dummy="$PATH"
10397 for ac_dir in $ac_dummy; do
10398   IFS=$ac_save_IFS
10399   test -z "$ac_dir" && ac_dir=.
10400   $as_executable_p "$ac_dir/$ac_word" || continue
10401 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10402 echo "$as_me:10402: found $ac_dir/$ac_word" >&5
10403 break
10404 done
10405
10406 fi
10407 fi
10408 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10409 if test -n "$NCURSES_CONFIG"; then
10410   echo "$as_me:10410: result: $NCURSES_CONFIG" >&5
10411 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10412 else
10413   echo "$as_me:10413: result: no" >&5
10414 echo "${ECHO_T}no" >&6
10415 fi
10416
10417     test -n "$NCURSES_CONFIG" && break
10418   done
10419 fi
10420 if test -z "$NCURSES_CONFIG"; then
10421   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10422   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10423 do
10424   # Extract the first word of "$ac_prog", so it can be a program name with args.
10425 set dummy $ac_prog; ac_word=$2
10426 echo "$as_me:10426: checking for $ac_word" >&5
10427 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10428 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10429   echo $ECHO_N "(cached) $ECHO_C" >&6
10430 else
10431   if test -n "$ac_ct_NCURSES_CONFIG"; then
10432   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10433 else
10434   ac_save_IFS=$IFS; IFS=$ac_path_separator
10435 ac_dummy="$PATH"
10436 for ac_dir in $ac_dummy; do
10437   IFS=$ac_save_IFS
10438   test -z "$ac_dir" && ac_dir=.
10439   $as_executable_p "$ac_dir/$ac_word" || continue
10440 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10441 echo "$as_me:10441: found $ac_dir/$ac_word" >&5
10442 break
10443 done
10444
10445 fi
10446 fi
10447 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10448 if test -n "$ac_ct_NCURSES_CONFIG"; then
10449   echo "$as_me:10449: result: $ac_ct_NCURSES_CONFIG" >&5
10450 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10451 else
10452   echo "$as_me:10452: result: no" >&5
10453 echo "${ECHO_T}no" >&6
10454 fi
10455
10456   test -n "$ac_ct_NCURSES_CONFIG" && break
10457 done
10458 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10459
10460   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10461 fi
10462
10463         if test "$NCURSES_CONFIG" != none ; then
10464
10465 cf_fix_cppflags=no
10466 cf_new_cflags=
10467 cf_new_cppflags=
10468 cf_new_extra_cppflags=
10469
10470 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10471 do
10472 case "$cf_fix_cppflags" in
10473 (no)
10474         case "$cf_add_cflags" in
10475         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10476                 case "$cf_add_cflags" in
10477                 (-D*)
10478                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10479
10480                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10481                                 && test -z "${cf_tst_cflags}" \
10482                                 && cf_fix_cppflags=yes
10483
10484                         if test "$cf_fix_cppflags" = yes ; then
10485
10486         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10487         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10488
10489                                 continue
10490                         elif test "${cf_tst_cflags}" = "\"'" ; then
10491
10492         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10493         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10494
10495                                 continue
10496                         fi
10497                         ;;
10498                 esac
10499                 case "$CPPFLAGS" in
10500                 (*$cf_add_cflags)
10501                         ;;
10502                 (*)
10503                         case "$cf_add_cflags" in
10504                         (-D*)
10505                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10506
10507 CPPFLAGS=`echo "$CPPFLAGS" | \
10508         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10509                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10510
10511                                 ;;
10512                         esac
10513
10514         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10515         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10516
10517                         ;;
10518                 esac
10519                 ;;
10520         (*)
10521
10522         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10523         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10524
10525                 ;;
10526         esac
10527         ;;
10528 (yes)
10529
10530         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10531         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10532
10533         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10534
10535         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10536                 && test -z "${cf_tst_cflags}" \
10537                 && cf_fix_cppflags=no
10538         ;;
10539 esac
10540 done
10541
10542 if test -n "$cf_new_cflags" ; then
10543
10544         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10545         CFLAGS="${CFLAGS}$cf_new_cflags"
10546
10547 fi
10548
10549 if test -n "$cf_new_cppflags" ; then
10550
10551         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10552         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10553
10554 fi
10555
10556 if test -n "$cf_new_extra_cppflags" ; then
10557
10558         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10559         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10560
10561 fi
10562
10563 cf_add_libs="$LIBS"
10564 # reverse order
10565 cf_add_0lib=
10566 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10567 # filter duplicates
10568 for cf_add_1lib in $cf_add_0lib; do
10569         for cf_add_2lib in $cf_add_libs; do
10570                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10571                         cf_add_1lib=
10572                         break
10573                 fi
10574         done
10575         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10576 done
10577 LIBS="$cf_add_libs"
10578
10579                 # even with config script, some packages use no-override for curses.h
10580
10581 echo "$as_me:10581: checking if we have identified curses headers" >&5
10582 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10583 if test "${cf_cv_ncurses_header+set}" = set; then
10584   echo $ECHO_N "(cached) $ECHO_C" >&6
10585 else
10586
10587 cf_cv_ncurses_header=none
10588 for cf_header in \
10589         ncurses.h $cf_cv_screen/ncurses.h \
10590         curses.h $cf_cv_screen/curses.h
10591 do
10592 cat >"conftest.$ac_ext" <<_ACEOF
10593 #line 10593 "configure"
10594 #include "confdefs.h"
10595 #include <${cf_header}>
10596 int
10597 main (void)
10598 {
10599 initscr(); tgoto("?", 0,0)
10600   ;
10601   return 0;
10602 }
10603 _ACEOF
10604 rm -f "conftest.$ac_objext"
10605 if { (eval echo "$as_me:10605: \"$ac_compile\"") >&5
10606   (eval $ac_compile) 2>&5
10607   ac_status=$?
10608   echo "$as_me:10608: \$? = $ac_status" >&5
10609   (exit "$ac_status"); } &&
10610          { ac_try='test -s "conftest.$ac_objext"'
10611   { (eval echo "$as_me:10611: \"$ac_try\"") >&5
10612   (eval $ac_try) 2>&5
10613   ac_status=$?
10614   echo "$as_me:10614: \$? = $ac_status" >&5
10615   (exit "$ac_status"); }; }; then
10616   cf_cv_ncurses_header=$cf_header; break
10617 else
10618   echo "$as_me: failed program was:" >&5
10619 cat "conftest.$ac_ext" >&5
10620 fi
10621 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10622 done
10623
10624 fi
10625 echo "$as_me:10625: result: $cf_cv_ncurses_header" >&5
10626 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10627
10628 if test "$cf_cv_ncurses_header" = none ; then
10629         { { echo "$as_me:10629: error: No curses header-files found" >&5
10630 echo "$as_me: error: No curses header-files found" >&2;}
10631    { (exit 1); exit 1; }; }
10632 fi
10633
10634 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10635
10636 for ac_header in $cf_cv_ncurses_header
10637 do
10638 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10639 echo "$as_me:10639: checking for $ac_header" >&5
10640 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10641 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10642   echo $ECHO_N "(cached) $ECHO_C" >&6
10643 else
10644   cat >"conftest.$ac_ext" <<_ACEOF
10645 #line 10645 "configure"
10646 #include "confdefs.h"
10647 #include <$ac_header>
10648 _ACEOF
10649 if { (eval echo "$as_me:10649: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10650   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10651   ac_status=$?
10652   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10653   rm -f conftest.er1
10654   cat conftest.err >&5
10655   echo "$as_me:10655: \$? = $ac_status" >&5
10656   (exit "$ac_status"); } >/dev/null; then
10657   if test -s conftest.err; then
10658     ac_cpp_err=$ac_c_preproc_warn_flag
10659   else
10660     ac_cpp_err=
10661   fi
10662 else
10663   ac_cpp_err=yes
10664 fi
10665 if test -z "$ac_cpp_err"; then
10666   eval "$as_ac_Header=yes"
10667 else
10668   echo "$as_me: failed program was:" >&5
10669   cat "conftest.$ac_ext" >&5
10670   eval "$as_ac_Header=no"
10671 fi
10672 rm -f conftest.err "conftest.$ac_ext"
10673 fi
10674 echo "$as_me:10674: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10675 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10676 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10677   cat >>confdefs.h <<EOF
10678 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10679 EOF
10680
10681 fi
10682 done
10683
10684 cat >>confdefs.h <<\EOF
10685 #define NCURSES 1
10686 EOF
10687
10688 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10689
10690                 cat >>confdefs.h <<EOF
10691 #define $cf_nculib_ROOT 1
10692 EOF
10693
10694                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10695
10696         else
10697
10698 cf_ncuhdr_root=$cf_cv_screen
10699
10700 test -n "$cf_cv_curses_dir" && \
10701 test "$cf_cv_curses_dir" != "no" && { \
10702
10703 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10704   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10705   do
10706         while test "$cf_add_incdir" != /usr/include
10707         do
10708           if test -d "$cf_add_incdir"
10709           then
10710                 cf_have_incdir=no
10711                 if test -n "$CFLAGS$CPPFLAGS" ; then
10712                   # a loop is needed to ensure we can add subdirs of existing dirs
10713                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10714                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10715                           cf_have_incdir=yes; break
10716                         fi
10717                   done
10718                 fi
10719
10720                 if test "$cf_have_incdir" = no ; then
10721                   if test "$cf_add_incdir" = /usr/local/include ; then
10722                         if test "$GCC" = yes
10723                         then
10724                           cf_save_CPPFLAGS=$CPPFLAGS
10725
10726         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10727         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10728
10729                           cat >"conftest.$ac_ext" <<_ACEOF
10730 #line 10730 "configure"
10731 #include "confdefs.h"
10732 #include <stdio.h>
10733 int
10734 main (void)
10735 {
10736 printf("Hello")
10737   ;
10738   return 0;
10739 }
10740 _ACEOF
10741 rm -f "conftest.$ac_objext"
10742 if { (eval echo "$as_me:10742: \"$ac_compile\"") >&5
10743   (eval $ac_compile) 2>&5
10744   ac_status=$?
10745   echo "$as_me:10745: \$? = $ac_status" >&5
10746   (exit "$ac_status"); } &&
10747          { ac_try='test -s "conftest.$ac_objext"'
10748   { (eval echo "$as_me:10748: \"$ac_try\"") >&5
10749   (eval $ac_try) 2>&5
10750   ac_status=$?
10751   echo "$as_me:10751: \$? = $ac_status" >&5
10752   (exit "$ac_status"); }; }; then
10753   :
10754 else
10755   echo "$as_me: failed program was:" >&5
10756 cat "conftest.$ac_ext" >&5
10757 cf_have_incdir=yes
10758 fi
10759 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10760                           CPPFLAGS=$cf_save_CPPFLAGS
10761                         fi
10762                   fi
10763                 fi
10764
10765                 if test "$cf_have_incdir" = no ; then
10766                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10767
10768 echo "${as_me:-configure}:10768: testing adding $cf_add_incdir to include-path ..." 1>&5
10769
10770                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10771
10772                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10773                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10774                   cf_add_incdir="$cf_top_incdir"
10775                 else
10776                   break
10777                 fi
10778           else
10779                 break
10780           fi
10781         done
10782   done
10783 fi
10784
10785 }
10786
10787 echo "$as_me:10787: checking for $cf_ncuhdr_root header in include-path" >&5
10788 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10789 if test "${cf_cv_ncurses_h+set}" = set; then
10790   echo $ECHO_N "(cached) $ECHO_C" >&6
10791 else
10792
10793         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10794         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10795         for cf_header in $cf_header_list
10796         do
10797
10798         cat >"conftest.$ac_ext" <<_ACEOF
10799 #line 10799 "configure"
10800 #include "confdefs.h"
10801
10802 #include <$cf_header>
10803 int
10804 main (void)
10805 {
10806
10807 #ifdef NCURSES_VERSION
10808
10809 printf("%s\\n", NCURSES_VERSION);
10810 #else
10811 #ifdef __NCURSES_H
10812 printf("old\\n");
10813 #else
10814         make an error
10815 #endif
10816 #endif
10817
10818   ;
10819   return 0;
10820 }
10821 _ACEOF
10822 rm -f "conftest.$ac_objext"
10823 if { (eval echo "$as_me:10823: \"$ac_compile\"") >&5
10824   (eval $ac_compile) 2>&5
10825   ac_status=$?
10826   echo "$as_me:10826: \$? = $ac_status" >&5
10827   (exit "$ac_status"); } &&
10828          { ac_try='test -s "conftest.$ac_objext"'
10829   { (eval echo "$as_me:10829: \"$ac_try\"") >&5
10830   (eval $ac_try) 2>&5
10831   ac_status=$?
10832   echo "$as_me:10832: \$? = $ac_status" >&5
10833   (exit "$ac_status"); }; }; then
10834   cf_cv_ncurses_h=$cf_header
10835
10836 else
10837   echo "$as_me: failed program was:" >&5
10838 cat "conftest.$ac_ext" >&5
10839 cf_cv_ncurses_h=no
10840 fi
10841 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10842
10843                 test "$cf_cv_ncurses_h" != no && break
10844         done
10845
10846 fi
10847 echo "$as_me:10847: result: $cf_cv_ncurses_h" >&5
10848 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10849
10850 if test "$cf_cv_ncurses_h" != no ; then
10851         cf_cv_ncurses_header=$cf_cv_ncurses_h
10852 else
10853
10854 echo "$as_me:10854: checking for $cf_ncuhdr_root include-path" >&5
10855 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10856 if test "${cf_cv_ncurses_h2+set}" = set; then
10857   echo $ECHO_N "(cached) $ECHO_C" >&6
10858 else
10859
10860         test -n "$verbose" && echo
10861
10862 cf_search=
10863
10864 # collect the current set of include-directories from compiler flags
10865 cf_header_path_list=""
10866 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10867         for cf_header_path in $CPPFLAGS $CFLAGS
10868         do
10869                 case "$cf_header_path" in
10870                 (-I*)
10871                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10872
10873 test "x$cf_header_path" != "xNONE" && \
10874 test -d "$cf_header_path" && \
10875  {
10876         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10877         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10878         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10879         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10880         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10881         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"
10882 }
10883
10884                         cf_header_path_list="$cf_header_path_list $cf_search"
10885                         ;;
10886                 esac
10887         done
10888 fi
10889
10890 # add the variations for the package we are looking for
10891
10892 cf_search=
10893
10894 test "x$prefix" != "xNONE" && \
10895 test -d "$prefix" && \
10896  {
10897         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10898         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10899         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10900         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10901         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10902         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10903 }
10904
10905 for cf_subdir_prefix in \
10906         /usr \
10907         /usr/local \
10908         /usr/pkg \
10909         /opt \
10910         /opt/local \
10911         $HOME
10912 do
10913
10914 test "x$cf_subdir_prefix" != "x$prefix" && \
10915 test -d "$cf_subdir_prefix" && \
10916 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10917         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10918         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10919         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10920         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10921         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10922         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"
10923 }
10924
10925 done
10926
10927 test "$includedir" != NONE && \
10928 test "$includedir" != "/usr/include" && \
10929 test -d "$includedir" && {
10930         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10931         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10932 }
10933
10934 test "$oldincludedir" != NONE && \
10935 test "$oldincludedir" != "/usr/include" && \
10936 test -d "$oldincludedir" && {
10937         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10938         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10939 }
10940
10941 cf_search="$cf_search $cf_header_path_list"
10942
10943         test -n "$verbose" && echo "search path $cf_search"
10944         cf_save2_CPPFLAGS="$CPPFLAGS"
10945         for cf_incdir in $cf_search
10946         do
10947
10948 if test -n "$cf_incdir" ; then
10949   for cf_add_incdir in $cf_incdir
10950   do
10951         while test "$cf_add_incdir" != /usr/include
10952         do
10953           if test -d "$cf_add_incdir"
10954           then
10955                 cf_have_incdir=no
10956                 if test -n "$CFLAGS$CPPFLAGS" ; then
10957                   # a loop is needed to ensure we can add subdirs of existing dirs
10958                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10959                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10960                           cf_have_incdir=yes; break
10961                         fi
10962                   done
10963                 fi
10964
10965                 if test "$cf_have_incdir" = no ; then
10966                   if test "$cf_add_incdir" = /usr/local/include ; then
10967                         if test "$GCC" = yes
10968                         then
10969                           cf_save_CPPFLAGS=$CPPFLAGS
10970
10971         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10972         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10973
10974                           cat >"conftest.$ac_ext" <<_ACEOF
10975 #line 10975 "configure"
10976 #include "confdefs.h"
10977 #include <stdio.h>
10978 int
10979 main (void)
10980 {
10981 printf("Hello")
10982   ;
10983   return 0;
10984 }
10985 _ACEOF
10986 rm -f "conftest.$ac_objext"
10987 if { (eval echo "$as_me:10987: \"$ac_compile\"") >&5
10988   (eval $ac_compile) 2>&5
10989   ac_status=$?
10990   echo "$as_me:10990: \$? = $ac_status" >&5
10991   (exit "$ac_status"); } &&
10992          { ac_try='test -s "conftest.$ac_objext"'
10993   { (eval echo "$as_me:10993: \"$ac_try\"") >&5
10994   (eval $ac_try) 2>&5
10995   ac_status=$?
10996   echo "$as_me:10996: \$? = $ac_status" >&5
10997   (exit "$ac_status"); }; }; then
10998   :
10999 else
11000   echo "$as_me: failed program was:" >&5
11001 cat "conftest.$ac_ext" >&5
11002 cf_have_incdir=yes
11003 fi
11004 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11005                           CPPFLAGS=$cf_save_CPPFLAGS
11006                         fi
11007                   fi
11008                 fi
11009
11010                 if test "$cf_have_incdir" = no ; then
11011                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11012
11013 echo "${as_me:-configure}:11013: testing adding $cf_add_incdir to include-path ..." 1>&5
11014
11015                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11016
11017                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11018                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11019                   cf_add_incdir="$cf_top_incdir"
11020                 else
11021                   break
11022                 fi
11023           else
11024                 break
11025           fi
11026         done
11027   done
11028 fi
11029
11030                 for cf_header in \
11031                         ncurses.h \
11032                         curses.h
11033                 do
11034
11035         cat >"conftest.$ac_ext" <<_ACEOF
11036 #line 11036 "configure"
11037 #include "confdefs.h"
11038
11039 #include <$cf_header>
11040 int
11041 main (void)
11042 {
11043
11044 #ifdef NCURSES_VERSION
11045
11046 printf("%s\\n", NCURSES_VERSION);
11047 #else
11048 #ifdef __NCURSES_H
11049 printf("old\\n");
11050 #else
11051         make an error
11052 #endif
11053 #endif
11054
11055   ;
11056   return 0;
11057 }
11058 _ACEOF
11059 rm -f "conftest.$ac_objext"
11060 if { (eval echo "$as_me:11060: \"$ac_compile\"") >&5
11061   (eval $ac_compile) 2>&5
11062   ac_status=$?
11063   echo "$as_me:11063: \$? = $ac_status" >&5
11064   (exit "$ac_status"); } &&
11065          { ac_try='test -s "conftest.$ac_objext"'
11066   { (eval echo "$as_me:11066: \"$ac_try\"") >&5
11067   (eval $ac_try) 2>&5
11068   ac_status=$?
11069   echo "$as_me:11069: \$? = $ac_status" >&5
11070   (exit "$ac_status"); }; }; then
11071   cf_cv_ncurses_h2=$cf_header
11072
11073 else
11074   echo "$as_me: failed program was:" >&5
11075 cat "conftest.$ac_ext" >&5
11076 cf_cv_ncurses_h2=no
11077 fi
11078 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11079
11080                         if test "$cf_cv_ncurses_h2" != no ; then
11081                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11082                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11083                                 break
11084                         fi
11085                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11086                 done
11087                 CPPFLAGS="$cf_save2_CPPFLAGS"
11088                 test "$cf_cv_ncurses_h2" != no && break
11089         done
11090         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11090: error: not found" >&5
11091 echo "$as_me: error: not found" >&2;}
11092    { (exit 1); exit 1; }; }
11093
11094 fi
11095 echo "$as_me:11095: result: $cf_cv_ncurses_h2" >&5
11096 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11097
11098         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11099         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11100         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11101                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11102         fi
11103
11104 if test -n "$cf_1st_incdir" ; then
11105   for cf_add_incdir in $cf_1st_incdir
11106   do
11107         while test "$cf_add_incdir" != /usr/include
11108         do
11109           if test -d "$cf_add_incdir"
11110           then
11111                 cf_have_incdir=no
11112                 if test -n "$CFLAGS$CPPFLAGS" ; then
11113                   # a loop is needed to ensure we can add subdirs of existing dirs
11114                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11115                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11116                           cf_have_incdir=yes; break
11117                         fi
11118                   done
11119                 fi
11120
11121                 if test "$cf_have_incdir" = no ; then
11122                   if test "$cf_add_incdir" = /usr/local/include ; then
11123                         if test "$GCC" = yes
11124                         then
11125                           cf_save_CPPFLAGS=$CPPFLAGS
11126
11127         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11128         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11129
11130                           cat >"conftest.$ac_ext" <<_ACEOF
11131 #line 11131 "configure"
11132 #include "confdefs.h"
11133 #include <stdio.h>
11134 int
11135 main (void)
11136 {
11137 printf("Hello")
11138   ;
11139   return 0;
11140 }
11141 _ACEOF
11142 rm -f "conftest.$ac_objext"
11143 if { (eval echo "$as_me:11143: \"$ac_compile\"") >&5
11144   (eval $ac_compile) 2>&5
11145   ac_status=$?
11146   echo "$as_me:11146: \$? = $ac_status" >&5
11147   (exit "$ac_status"); } &&
11148          { ac_try='test -s "conftest.$ac_objext"'
11149   { (eval echo "$as_me:11149: \"$ac_try\"") >&5
11150   (eval $ac_try) 2>&5
11151   ac_status=$?
11152   echo "$as_me:11152: \$? = $ac_status" >&5
11153   (exit "$ac_status"); }; }; then
11154   :
11155 else
11156   echo "$as_me: failed program was:" >&5
11157 cat "conftest.$ac_ext" >&5
11158 cf_have_incdir=yes
11159 fi
11160 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11161                           CPPFLAGS=$cf_save_CPPFLAGS
11162                         fi
11163                   fi
11164                 fi
11165
11166                 if test "$cf_have_incdir" = no ; then
11167                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11168
11169 echo "${as_me:-configure}:11169: testing adding $cf_add_incdir to include-path ..." 1>&5
11170
11171                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11172
11173                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11174                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11175                   cf_add_incdir="$cf_top_incdir"
11176                 else
11177                   break
11178                 fi
11179           else
11180                 break
11181           fi
11182         done
11183   done
11184 fi
11185
11186 fi
11187
11188 # Set definitions to allow ifdef'ing for ncurses.h
11189
11190 case "$cf_cv_ncurses_header" in
11191 (*ncurses.h)
11192
11193 cat >>confdefs.h <<\EOF
11194 #define HAVE_NCURSES_H 1
11195 EOF
11196
11197         ;;
11198 esac
11199
11200 case "$cf_cv_ncurses_header" in
11201 (ncurses/curses.h|ncurses/ncurses.h)
11202
11203 cat >>confdefs.h <<\EOF
11204 #define HAVE_NCURSES_NCURSES_H 1
11205 EOF
11206
11207         ;;
11208 (ncursesw/curses.h|ncursesw/ncurses.h)
11209
11210 cat >>confdefs.h <<\EOF
11211 #define HAVE_NCURSESW_NCURSES_H 1
11212 EOF
11213
11214         ;;
11215 esac
11216
11217 echo "$as_me:11217: checking for terminfo header" >&5
11218 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11219 if test "${cf_cv_term_header+set}" = set; then
11220   echo $ECHO_N "(cached) $ECHO_C" >&6
11221 else
11222
11223 case "${cf_cv_ncurses_header}" in
11224 (*/ncurses.h|*/ncursesw.h)
11225         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11226         ;;
11227 (*)
11228         cf_term_header=term.h
11229         ;;
11230 esac
11231
11232 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11233 do
11234 cat >"conftest.$ac_ext" <<_ACEOF
11235 #line 11235 "configure"
11236 #include "confdefs.h"
11237 #include <stdio.h>
11238 #include <${cf_cv_ncurses_header:-curses.h}>
11239 #include <$cf_test>
11240
11241 int
11242 main (void)
11243 {
11244 int x = auto_left_margin; (void)x
11245   ;
11246   return 0;
11247 }
11248 _ACEOF
11249 rm -f "conftest.$ac_objext"
11250 if { (eval echo "$as_me:11250: \"$ac_compile\"") >&5
11251   (eval $ac_compile) 2>&5
11252   ac_status=$?
11253   echo "$as_me:11253: \$? = $ac_status" >&5
11254   (exit "$ac_status"); } &&
11255          { ac_try='test -s "conftest.$ac_objext"'
11256   { (eval echo "$as_me:11256: \"$ac_try\"") >&5
11257   (eval $ac_try) 2>&5
11258   ac_status=$?
11259   echo "$as_me:11259: \$? = $ac_status" >&5
11260   (exit "$ac_status"); }; }; then
11261
11262         cf_cv_term_header="$cf_test"
11263 else
11264   echo "$as_me: failed program was:" >&5
11265 cat "conftest.$ac_ext" >&5
11266
11267         cf_cv_term_header=unknown
11268
11269 fi
11270 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11271         test "$cf_cv_term_header" != unknown && break
11272 done
11273
11274 fi
11275 echo "$as_me:11275: result: $cf_cv_term_header" >&5
11276 echo "${ECHO_T}$cf_cv_term_header" >&6
11277
11278 # Set definitions to allow ifdef'ing to accommodate subdirectories
11279
11280 case "$cf_cv_term_header" in
11281 (*term.h)
11282
11283 cat >>confdefs.h <<\EOF
11284 #define HAVE_TERM_H 1
11285 EOF
11286
11287         ;;
11288 esac
11289
11290 case "$cf_cv_term_header" in
11291 (ncurses/term.h)
11292
11293 cat >>confdefs.h <<\EOF
11294 #define HAVE_NCURSES_TERM_H 1
11295 EOF
11296
11297         ;;
11298 (ncursesw/term.h)
11299
11300 cat >>confdefs.h <<\EOF
11301 #define HAVE_NCURSESW_TERM_H 1
11302 EOF
11303
11304         ;;
11305 esac
11306
11307 # some applications need this, but should check for NCURSES_VERSION
11308
11309 cat >>confdefs.h <<\EOF
11310 #define NCURSES 1
11311 EOF
11312
11313 echo "$as_me:11313: checking for ncurses version" >&5
11314 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11315 if test "${cf_cv_ncurses_version+set}" = set; then
11316   echo $ECHO_N "(cached) $ECHO_C" >&6
11317 else
11318
11319         cf_cv_ncurses_version=no
11320         cf_tempfile=out$$
11321         rm -f "$cf_tempfile"
11322         if test "$cross_compiling" = yes; then
11323
11324         # This will not work if the preprocessor splits the line after the
11325         # Autoconf token.  The 'unproto' program does that.
11326         cat > "conftest.$ac_ext" <<EOF
11327 #include <${cf_cv_ncurses_header:-curses.h}>
11328 #undef Autoconf
11329 #ifdef NCURSES_VERSION
11330 Autoconf NCURSES_VERSION
11331 #else
11332 #ifdef __NCURSES_H
11333 Autoconf "old"
11334 #endif
11335 ;
11336 #endif
11337 EOF
11338         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11339         { (eval echo "$as_me:11339: \"$cf_try\"") >&5
11340   (eval $cf_try) 2>&5
11341   ac_status=$?
11342   echo "$as_me:11342: \$? = $ac_status" >&5
11343   (exit "$ac_status"); }
11344         if test -f conftest.out ; then
11345                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11346                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11347                 rm -f conftest.out
11348         fi
11349
11350 else
11351   cat >"conftest.$ac_ext" <<_ACEOF
11352 #line 11352 "configure"
11353 #include "confdefs.h"
11354
11355 #include <${cf_cv_ncurses_header:-curses.h}>
11356 #include <stdio.h>
11357 int main(void)
11358 {
11359         FILE *fp = fopen("$cf_tempfile", "w");
11360 #ifdef NCURSES_VERSION
11361 # ifdef NCURSES_VERSION_PATCH
11362         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11363 # else
11364         fprintf(fp, "%s\\n", NCURSES_VERSION);
11365 # endif
11366 #else
11367 # ifdef __NCURSES_H
11368         fprintf(fp, "old\\n");
11369 # else
11370         make an error
11371 # endif
11372 #endif
11373         ${cf_cv_main_return:-return}(0);
11374 }
11375 _ACEOF
11376 rm -f "conftest$ac_exeext"
11377 if { (eval echo "$as_me:11377: \"$ac_link\"") >&5
11378   (eval $ac_link) 2>&5
11379   ac_status=$?
11380   echo "$as_me:11380: \$? = $ac_status" >&5
11381   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11382   { (eval echo "$as_me:11382: \"$ac_try\"") >&5
11383   (eval $ac_try) 2>&5
11384   ac_status=$?
11385   echo "$as_me:11385: \$? = $ac_status" >&5
11386   (exit "$ac_status"); }; }; then
11387
11388         cf_cv_ncurses_version=`cat $cf_tempfile`
11389 else
11390   echo "$as_me: program exited with status $ac_status" >&5
11391 echo "$as_me: failed program was:" >&5
11392 cat "conftest.$ac_ext" >&5
11393 fi
11394 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11395 fi
11396         rm -f "$cf_tempfile"
11397
11398 fi
11399 echo "$as_me:11399: result: $cf_cv_ncurses_version" >&5
11400 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11401 test "$cf_cv_ncurses_version" = no ||
11402 cat >>confdefs.h <<\EOF
11403 #define NCURSES 1
11404 EOF
11405
11406 cf_nculib_root=$cf_cv_screen
11407         # This works, except for the special case where we find gpm, but
11408         # ncurses is in a nonstandard location via $LIBS, and we really want
11409         # to link gpm.
11410 cf_ncurses_LIBS=""
11411 cf_ncurses_SAVE="$LIBS"
11412 echo "$as_me:11412: checking for Gpm_Open in -lgpm" >&5
11413 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11414 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11415   echo $ECHO_N "(cached) $ECHO_C" >&6
11416 else
11417   ac_check_lib_save_LIBS=$LIBS
11418 LIBS="-lgpm  $LIBS"
11419 cat >"conftest.$ac_ext" <<_ACEOF
11420 #line 11420 "configure"
11421 #include "confdefs.h"
11422
11423 /* Override any gcc2 internal prototype to avoid an error.  */
11424 #ifdef __cplusplus
11425 extern "C"
11426 #endif
11427 /* We use char because int might match the return type of a gcc2
11428    builtin and then its argument prototype would still apply.  */
11429 char Gpm_Open ();
11430 int
11431 main (void)
11432 {
11433 Gpm_Open ();
11434   ;
11435   return 0;
11436 }
11437 _ACEOF
11438 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11439 if { (eval echo "$as_me:11439: \"$ac_link\"") >&5
11440   (eval $ac_link) 2>&5
11441   ac_status=$?
11442   echo "$as_me:11442: \$? = $ac_status" >&5
11443   (exit "$ac_status"); } &&
11444          { ac_try='test -s "conftest$ac_exeext"'
11445   { (eval echo "$as_me:11445: \"$ac_try\"") >&5
11446   (eval $ac_try) 2>&5
11447   ac_status=$?
11448   echo "$as_me:11448: \$? = $ac_status" >&5
11449   (exit "$ac_status"); }; }; then
11450   ac_cv_lib_gpm_Gpm_Open=yes
11451 else
11452   echo "$as_me: failed program was:" >&5
11453 cat "conftest.$ac_ext" >&5
11454 ac_cv_lib_gpm_Gpm_Open=no
11455 fi
11456 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11457 LIBS=$ac_check_lib_save_LIBS
11458 fi
11459 echo "$as_me:11459: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11460 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11461 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11462   echo "$as_me:11462: checking for initscr in -lgpm" >&5
11463 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11464 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11465   echo $ECHO_N "(cached) $ECHO_C" >&6
11466 else
11467   ac_check_lib_save_LIBS=$LIBS
11468 LIBS="-lgpm  $LIBS"
11469 cat >"conftest.$ac_ext" <<_ACEOF
11470 #line 11470 "configure"
11471 #include "confdefs.h"
11472
11473 /* Override any gcc2 internal prototype to avoid an error.  */
11474 #ifdef __cplusplus
11475 extern "C"
11476 #endif
11477 /* We use char because int might match the return type of a gcc2
11478    builtin and then its argument prototype would still apply.  */
11479 char initscr ();
11480 int
11481 main (void)
11482 {
11483 initscr ();
11484   ;
11485   return 0;
11486 }
11487 _ACEOF
11488 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11489 if { (eval echo "$as_me:11489: \"$ac_link\"") >&5
11490   (eval $ac_link) 2>&5
11491   ac_status=$?
11492   echo "$as_me:11492: \$? = $ac_status" >&5
11493   (exit "$ac_status"); } &&
11494          { ac_try='test -s "conftest$ac_exeext"'
11495   { (eval echo "$as_me:11495: \"$ac_try\"") >&5
11496   (eval $ac_try) 2>&5
11497   ac_status=$?
11498   echo "$as_me:11498: \$? = $ac_status" >&5
11499   (exit "$ac_status"); }; }; then
11500   ac_cv_lib_gpm_initscr=yes
11501 else
11502   echo "$as_me: failed program was:" >&5
11503 cat "conftest.$ac_ext" >&5
11504 ac_cv_lib_gpm_initscr=no
11505 fi
11506 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11507 LIBS=$ac_check_lib_save_LIBS
11508 fi
11509 echo "$as_me:11509: result: $ac_cv_lib_gpm_initscr" >&5
11510 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11511 if test "$ac_cv_lib_gpm_initscr" = yes; then
11512   LIBS="$cf_ncurses_SAVE"
11513 else
11514   cf_ncurses_LIBS="-lgpm"
11515 fi
11516
11517 fi
11518
11519 case "$host_os" in
11520 (freebsd*)
11521         # This is only necessary if you are linking against an obsolete
11522         # version of ncurses (but it should do no harm, since it's static).
11523         if test "$cf_nculib_root" = ncurses ; then
11524                 echo "$as_me:11524: checking for tgoto in -lmytinfo" >&5
11525 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11526 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11527   echo $ECHO_N "(cached) $ECHO_C" >&6
11528 else
11529   ac_check_lib_save_LIBS=$LIBS
11530 LIBS="-lmytinfo  $LIBS"
11531 cat >"conftest.$ac_ext" <<_ACEOF
11532 #line 11532 "configure"
11533 #include "confdefs.h"
11534
11535 /* Override any gcc2 internal prototype to avoid an error.  */
11536 #ifdef __cplusplus
11537 extern "C"
11538 #endif
11539 /* We use char because int might match the return type of a gcc2
11540    builtin and then its argument prototype would still apply.  */
11541 char tgoto ();
11542 int
11543 main (void)
11544 {
11545 tgoto ();
11546   ;
11547   return 0;
11548 }
11549 _ACEOF
11550 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11551 if { (eval echo "$as_me:11551: \"$ac_link\"") >&5
11552   (eval $ac_link) 2>&5
11553   ac_status=$?
11554   echo "$as_me:11554: \$? = $ac_status" >&5
11555   (exit "$ac_status"); } &&
11556          { ac_try='test -s "conftest$ac_exeext"'
11557   { (eval echo "$as_me:11557: \"$ac_try\"") >&5
11558   (eval $ac_try) 2>&5
11559   ac_status=$?
11560   echo "$as_me:11560: \$? = $ac_status" >&5
11561   (exit "$ac_status"); }; }; then
11562   ac_cv_lib_mytinfo_tgoto=yes
11563 else
11564   echo "$as_me: failed program was:" >&5
11565 cat "conftest.$ac_ext" >&5
11566 ac_cv_lib_mytinfo_tgoto=no
11567 fi
11568 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11569 LIBS=$ac_check_lib_save_LIBS
11570 fi
11571 echo "$as_me:11571: result: $ac_cv_lib_mytinfo_tgoto" >&5
11572 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11573 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11574   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11575 fi
11576
11577         fi
11578         ;;
11579 esac
11580
11581 cf_add_libs="$LIBS"
11582 # reverse order
11583 cf_add_0lib=
11584 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11585 # filter duplicates
11586 for cf_add_1lib in $cf_add_0lib; do
11587         for cf_add_2lib in $cf_add_libs; do
11588                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11589                         cf_add_1lib=
11590                         break
11591                 fi
11592         done
11593         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11594 done
11595 LIBS="$cf_add_libs"
11596
11597 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11598 then
11599
11600 cf_add_libs="$LIBS"
11601 # reverse order
11602 cf_add_0lib=
11603 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11604 # filter duplicates
11605 for cf_add_1lib in $cf_add_0lib; do
11606         for cf_add_2lib in $cf_add_libs; do
11607                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11608                         cf_add_1lib=
11609                         break
11610                 fi
11611         done
11612         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11613 done
11614 LIBS="$cf_add_libs"
11615
11616 else
11617
11618         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11619         cf_libdir=""
11620         echo "$as_me:11620: checking for initscr" >&5
11621 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11622 if test "${ac_cv_func_initscr+set}" = set; then
11623   echo $ECHO_N "(cached) $ECHO_C" >&6
11624 else
11625   cat >"conftest.$ac_ext" <<_ACEOF
11626 #line 11626 "configure"
11627 #include "confdefs.h"
11628 #define initscr autoconf_temporary
11629 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11630 #undef initscr
11631
11632 #ifdef __cplusplus
11633 extern "C"
11634 #endif
11635
11636 /* We use char because int might match the return type of a gcc2
11637    builtin and then its argument prototype would still apply.  */
11638 char initscr (void);
11639
11640 int
11641 main (void)
11642 {
11643
11644 /* The GNU C library defines stubs for functions which it implements
11645     to always fail with ENOSYS.  Some functions are actually named
11646     something starting with __ and the normal name is an alias.  */
11647 #if defined (__stub_initscr) || defined (__stub___initscr)
11648 #error found stub for initscr
11649 #endif
11650
11651         return initscr ();
11652   ;
11653   return 0;
11654 }
11655 _ACEOF
11656 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11657 if { (eval echo "$as_me:11657: \"$ac_link\"") >&5
11658   (eval $ac_link) 2>&5
11659   ac_status=$?
11660   echo "$as_me:11660: \$? = $ac_status" >&5
11661   (exit "$ac_status"); } &&
11662          { ac_try='test -s "conftest$ac_exeext"'
11663   { (eval echo "$as_me:11663: \"$ac_try\"") >&5
11664   (eval $ac_try) 2>&5
11665   ac_status=$?
11666   echo "$as_me:11666: \$? = $ac_status" >&5
11667   (exit "$ac_status"); }; }; then
11668   ac_cv_func_initscr=yes
11669 else
11670   echo "$as_me: failed program was:" >&5
11671 cat "conftest.$ac_ext" >&5
11672 ac_cv_func_initscr=no
11673 fi
11674 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11675 fi
11676 echo "$as_me:11676: result: $ac_cv_func_initscr" >&5
11677 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11678 if test "$ac_cv_func_initscr" = yes; then
11679   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11680 else
11681
11682                 cf_save_LIBS="$LIBS"
11683                 echo "$as_me:11683: checking for initscr in -l$cf_nculib_root" >&5
11684 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11685                 LIBS="-l$cf_nculib_root $LIBS"
11686                 cat >"conftest.$ac_ext" <<_ACEOF
11687 #line 11687 "configure"
11688 #include "confdefs.h"
11689 #include <${cf_cv_ncurses_header:-curses.h}>
11690 int
11691 main (void)
11692 {
11693 initscr()
11694   ;
11695   return 0;
11696 }
11697 _ACEOF
11698 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11699 if { (eval echo "$as_me:11699: \"$ac_link\"") >&5
11700   (eval $ac_link) 2>&5
11701   ac_status=$?
11702   echo "$as_me:11702: \$? = $ac_status" >&5
11703   (exit "$ac_status"); } &&
11704          { ac_try='test -s "conftest$ac_exeext"'
11705   { (eval echo "$as_me:11705: \"$ac_try\"") >&5
11706   (eval $ac_try) 2>&5
11707   ac_status=$?
11708   echo "$as_me:11708: \$? = $ac_status" >&5
11709   (exit "$ac_status"); }; }; then
11710   echo "$as_me:11710: result: yes" >&5
11711 echo "${ECHO_T}yes" >&6
11712                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11713
11714 else
11715   echo "$as_me: failed program was:" >&5
11716 cat "conftest.$ac_ext" >&5
11717 echo "$as_me:11717: result: no" >&5
11718 echo "${ECHO_T}no" >&6
11719
11720 cf_search=
11721 cf_library_path_list=""
11722 if test -n "${LDFLAGS}${LIBS}" ; then
11723         for cf_library_path in $LDFLAGS $LIBS
11724         do
11725                 case "$cf_library_path" in
11726                 (-L*)
11727                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11728
11729 test "x$cf_library_path" != "xNONE" && \
11730 test -d "$cf_library_path" && \
11731  {
11732         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11733         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11734         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11735         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11736         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11737         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"
11738 }
11739
11740                         cf_library_path_list="$cf_library_path_list $cf_search"
11741                         ;;
11742                 esac
11743         done
11744 fi
11745
11746 cf_search=
11747
11748 test "x$prefix" != "xNONE" && \
11749 test -d "$prefix" && \
11750  {
11751         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11752         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11753         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11754         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11755         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11756         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11757 }
11758
11759 for cf_subdir_prefix in \
11760         /usr \
11761         /usr/local \
11762         /usr/pkg \
11763         /opt \
11764         /opt/local \
11765         $HOME
11766 do
11767
11768 test "x$cf_subdir_prefix" != "x$prefix" && \
11769 test -d "$cf_subdir_prefix" && \
11770 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11771         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11772         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11773         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11774         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11775         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11776         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"
11777 }
11778
11779 done
11780
11781 cf_search="$cf_library_path_list $cf_search"
11782
11783                         for cf_libdir in $cf_search
11784                         do
11785                                 echo "$as_me:11785: checking for -l$cf_nculib_root in $cf_libdir" >&5
11786 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11787                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11788                                 cat >"conftest.$ac_ext" <<_ACEOF
11789 #line 11789 "configure"
11790 #include "confdefs.h"
11791 #include <${cf_cv_ncurses_header:-curses.h}>
11792 int
11793 main (void)
11794 {
11795 initscr()
11796   ;
11797   return 0;
11798 }
11799 _ACEOF
11800 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11801 if { (eval echo "$as_me:11801: \"$ac_link\"") >&5
11802   (eval $ac_link) 2>&5
11803   ac_status=$?
11804   echo "$as_me:11804: \$? = $ac_status" >&5
11805   (exit "$ac_status"); } &&
11806          { ac_try='test -s "conftest$ac_exeext"'
11807   { (eval echo "$as_me:11807: \"$ac_try\"") >&5
11808   (eval $ac_try) 2>&5
11809   ac_status=$?
11810   echo "$as_me:11810: \$? = $ac_status" >&5
11811   (exit "$ac_status"); }; }; then
11812   echo "$as_me:11812: result: yes" >&5
11813 echo "${ECHO_T}yes" >&6
11814                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11815                                          break
11816 else
11817   echo "$as_me: failed program was:" >&5
11818 cat "conftest.$ac_ext" >&5
11819 echo "$as_me:11819: result: no" >&5
11820 echo "${ECHO_T}no" >&6
11821                                          LIBS="$cf_save_LIBS"
11822 fi
11823 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11824                         done
11825
11826 fi
11827 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11828
11829 fi
11830
11831 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11832
11833 if test "$cf_found_library" = no ; then
11834         { { echo "$as_me:11834: error: Cannot link $cf_nculib_root library" >&5
11835 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11836    { (exit 1); exit 1; }; }
11837 fi
11838
11839 fi
11840
11841 if test -n "$cf_ncurses_LIBS" ; then
11842         echo "$as_me:11842: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11843 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11844         cf_ncurses_SAVE="$LIBS"
11845         for p in $cf_ncurses_LIBS ; do
11846                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11847                 if test "$q" != "$LIBS" ; then
11848                         LIBS="$q"
11849                 fi
11850         done
11851         cat >"conftest.$ac_ext" <<_ACEOF
11852 #line 11852 "configure"
11853 #include "confdefs.h"
11854 #include <${cf_cv_ncurses_header:-curses.h}>
11855 int
11856 main (void)
11857 {
11858 initscr(); mousemask(0,0); tigetstr((char *)0);
11859   ;
11860   return 0;
11861 }
11862 _ACEOF
11863 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11864 if { (eval echo "$as_me:11864: \"$ac_link\"") >&5
11865   (eval $ac_link) 2>&5
11866   ac_status=$?
11867   echo "$as_me:11867: \$? = $ac_status" >&5
11868   (exit "$ac_status"); } &&
11869          { ac_try='test -s "conftest$ac_exeext"'
11870   { (eval echo "$as_me:11870: \"$ac_try\"") >&5
11871   (eval $ac_try) 2>&5
11872   ac_status=$?
11873   echo "$as_me:11873: \$? = $ac_status" >&5
11874   (exit "$ac_status"); }; }; then
11875   echo "$as_me:11875: result: yes" >&5
11876 echo "${ECHO_T}yes" >&6
11877 else
11878   echo "$as_me: failed program was:" >&5
11879 cat "conftest.$ac_ext" >&5
11880 echo "$as_me:11880: result: no" >&5
11881 echo "${ECHO_T}no" >&6
11882                  LIBS="$cf_ncurses_SAVE"
11883 fi
11884 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11885 fi
11886
11887 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11888
11889 cat >>confdefs.h <<EOF
11890 #define $cf_nculib_ROOT 1
11891 EOF
11892
11893         fi
11894 else
11895         NCURSES_CONFIG=none
11896 fi
11897
11898         ;;
11899 (pdcurses)
11900         echo "$as_me:11900: checking for X" >&5
11901 echo $ECHO_N "checking for X... $ECHO_C" >&6
11902
11903 # Check whether --with-x or --without-x was given.
11904 if test "${with_x+set}" = set; then
11905   withval="$with_x"
11906
11907 fi;
11908 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11909 if test "x$with_x" = xno; then
11910   # The user explicitly disabled X.
11911   have_x=disabled
11912 else
11913   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11914     # Both variables are already set.
11915     have_x=yes
11916   else
11917     if test "${ac_cv_have_x+set}" = set; then
11918   echo $ECHO_N "(cached) $ECHO_C" >&6
11919 else
11920   # One or both of the vars are not set, and there is no cached value.
11921 ac_x_includes=no ac_x_libraries=no
11922 rm -fr conftest.dir
11923 if mkdir conftest.dir; then
11924   cd conftest.dir
11925   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11926   cat >Imakefile <<'EOF'
11927 acfindx:
11928         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11929 EOF
11930   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11931     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11932     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
11933     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11934     for ac_extension in a so sl dylib dll; do
11935       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
11936          test -f "$ac_im_libdir/libX11.$ac_extension"; then
11937         ac_im_usrlibdir=$ac_im_libdir; break
11938       fi
11939     done
11940     # Screen out bogus values from the imake configuration.  They are
11941     # bogus both because they are the default anyway, and because
11942     # using them would break gcc on systems where it needs fixed includes.
11943     case $ac_im_incroot in
11944         /usr/include) ;;
11945         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11946     esac
11947     case $ac_im_usrlibdir in
11948         /usr/lib | /lib) ;;
11949         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11950     esac
11951   fi
11952   cd ..
11953   rm -fr conftest.dir
11954 fi
11955
11956 # Standard set of common directories for X headers.
11957 # Check X11 before X11Rn because it is often a symlink to the current release.
11958 ac_x_header_dirs='
11959 /usr/X11/include
11960 /usr/X11R7/include
11961 /usr/X11R6/include
11962 /usr/X11R5/include
11963 /usr/X11R4/include
11964
11965 /opt/local/include
11966 /opt/X11/include
11967
11968 /usr/include/X11
11969 /usr/include/X11R7
11970 /usr/include/X11R6
11971 /usr/include/X11R5
11972 /usr/include/X11R4
11973
11974 /usr/local/X11/include
11975 /usr/local/X11R7/include
11976 /usr/local/X11R6/include
11977 /usr/local/X11R5/include
11978 /usr/local/X11R4/include
11979
11980 /usr/local/include/X11
11981 /usr/local/include/X11R7
11982 /usr/local/include/X11R6
11983 /usr/local/include/X11R5
11984 /usr/local/include/X11R4
11985
11986 /usr/X386/include
11987 /usr/x386/include
11988 /usr/XFree86/include/X11
11989
11990 /usr/include
11991 /usr/local/include
11992 /usr/unsupported/include
11993 /usr/athena/include
11994 /usr/local/x11r5/include
11995 /usr/lpp/Xamples/include
11996
11997 /usr/openwin/include
11998 /usr/openwin/share/include'
11999
12000 if test "$ac_x_includes" = no; then
12001   # Guess where to find include files, by looking for Intrinsic.h.
12002   # First, try using that file with no special directory specified.
12003   cat >"conftest.$ac_ext" <<_ACEOF
12004 #line 12004 "configure"
12005 #include "confdefs.h"
12006 #include <X11/Intrinsic.h>
12007 _ACEOF
12008 if { (eval echo "$as_me:12008: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12009   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12010   ac_status=$?
12011   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12012   rm -f conftest.er1
12013   cat conftest.err >&5
12014   echo "$as_me:12014: \$? = $ac_status" >&5
12015   (exit "$ac_status"); } >/dev/null; then
12016   if test -s conftest.err; then
12017     ac_cpp_err=$ac_c_preproc_warn_flag
12018   else
12019     ac_cpp_err=
12020   fi
12021 else
12022   ac_cpp_err=yes
12023 fi
12024 if test -z "$ac_cpp_err"; then
12025   # We can compile using X headers with no special include directory.
12026 ac_x_includes=
12027 else
12028   echo "$as_me: failed program was:" >&5
12029   cat "conftest.$ac_ext" >&5
12030   for ac_dir in $ac_x_header_dirs; do
12031   if test -r "$ac_dir/X11/Intrinsic.h"; then
12032     ac_x_includes=$ac_dir
12033     break
12034   fi
12035 done
12036 fi
12037 rm -f conftest.err "conftest.$ac_ext"
12038 fi # $ac_x_includes = no
12039
12040 if test "$ac_x_libraries" = no; then
12041   # Check for the libraries.
12042   # See if we find them without any special options.
12043   # Don't add to $LIBS permanently.
12044   ac_save_LIBS=$LIBS
12045   LIBS="-lXt $LIBS"
12046   cat >"conftest.$ac_ext" <<_ACEOF
12047 #line 12047 "configure"
12048 #include "confdefs.h"
12049 #include <X11/Intrinsic.h>
12050 int
12051 main (void)
12052 {
12053 XtMalloc (0)
12054   ;
12055   return 0;
12056 }
12057 _ACEOF
12058 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12059 if { (eval echo "$as_me:12059: \"$ac_link\"") >&5
12060   (eval $ac_link) 2>&5
12061   ac_status=$?
12062   echo "$as_me:12062: \$? = $ac_status" >&5
12063   (exit "$ac_status"); } &&
12064          { ac_try='test -s "conftest$ac_exeext"'
12065   { (eval echo "$as_me:12065: \"$ac_try\"") >&5
12066   (eval $ac_try) 2>&5
12067   ac_status=$?
12068   echo "$as_me:12068: \$? = $ac_status" >&5
12069   (exit "$ac_status"); }; }; then
12070   LIBS=$ac_save_LIBS
12071 # We can link X programs with no special library path.
12072 ac_x_libraries=
12073 else
12074   echo "$as_me: failed program was:" >&5
12075 cat "conftest.$ac_ext" >&5
12076 LIBS=$ac_save_LIBS
12077 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12078 do
12079   # Don't even attempt the hair of trying to link an X program!
12080   for ac_extension in a so sl dylib dll; do
12081     if test -r "$ac_dir/libXt.$ac_extension"; then
12082       ac_x_libraries=$ac_dir
12083       break 2
12084     fi
12085   done
12086 done
12087 fi
12088 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12089 fi # $ac_x_libraries = no
12090
12091 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12092   # Didn't find X anywhere.  Cache the known absence of X.
12093   ac_cv_have_x="have_x=no"
12094 else
12095   # Record where we found X for the cache.
12096   ac_cv_have_x="have_x=yes \
12097                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12098 fi
12099 fi
12100
12101   fi
12102   eval "$ac_cv_have_x"
12103 fi # $with_x != no
12104
12105 if test "$have_x" != yes; then
12106   echo "$as_me:12106: result: $have_x" >&5
12107 echo "${ECHO_T}$have_x" >&6
12108   no_x=yes
12109 else
12110   # If each of the values was on the command line, it overrides each guess.
12111   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12112   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12113   # Update the cache value to reflect the command line values.
12114   ac_cv_have_x="have_x=yes \
12115                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12116   echo "$as_me:12116: result: libraries $x_libraries, headers $x_includes" >&5
12117 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12118 fi
12119
12120 if test "$no_x" = yes; then
12121   # Not all programs may use this symbol, but it does not hurt to define it.
12122
12123 cat >>confdefs.h <<\EOF
12124 #define X_DISPLAY_MISSING 1
12125 EOF
12126
12127   X_CFLAGS=
12128   X_PRE_LIBS=
12129   X_LIBS=
12130   X_EXTRA_LIBS=
12131 else
12132   if test -n "$x_includes"; then
12133     X_CFLAGS="$X_CFLAGS -I$x_includes"
12134   fi
12135
12136   # It would also be nice to do this for all -L options, not just this one.
12137   if test -n "$x_libraries"; then
12138     X_LIBS="$X_LIBS -L$x_libraries"
12139     # For Solaris; some versions of Sun CC require a space after -R and
12140     # others require no space.  Words are not sufficient . . . .
12141     case `(uname -sr) 2>/dev/null` in
12142     "SunOS 5"*)
12143       echo "$as_me:12143: checking whether -R must be followed by a space" >&5
12144 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12145       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12146       cat >"conftest.$ac_ext" <<_ACEOF
12147 #line 12147 "configure"
12148 #include "confdefs.h"
12149
12150 int
12151 main (void)
12152 {
12153
12154   ;
12155   return 0;
12156 }
12157 _ACEOF
12158 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12159 if { (eval echo "$as_me:12159: \"$ac_link\"") >&5
12160   (eval $ac_link) 2>&5
12161   ac_status=$?
12162   echo "$as_me:12162: \$? = $ac_status" >&5
12163   (exit "$ac_status"); } &&
12164          { ac_try='test -s "conftest$ac_exeext"'
12165   { (eval echo "$as_me:12165: \"$ac_try\"") >&5
12166   (eval $ac_try) 2>&5
12167   ac_status=$?
12168   echo "$as_me:12168: \$? = $ac_status" >&5
12169   (exit "$ac_status"); }; }; then
12170   ac_R_nospace=yes
12171 else
12172   echo "$as_me: failed program was:" >&5
12173 cat "conftest.$ac_ext" >&5
12174 ac_R_nospace=no
12175 fi
12176 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12177       if test $ac_R_nospace = yes; then
12178         echo "$as_me:12178: result: no" >&5
12179 echo "${ECHO_T}no" >&6
12180         X_LIBS="$X_LIBS -R$x_libraries"
12181       else
12182         LIBS="$ac_xsave_LIBS -R $x_libraries"
12183         cat >"conftest.$ac_ext" <<_ACEOF
12184 #line 12184 "configure"
12185 #include "confdefs.h"
12186
12187 int
12188 main (void)
12189 {
12190
12191   ;
12192   return 0;
12193 }
12194 _ACEOF
12195 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12196 if { (eval echo "$as_me:12196: \"$ac_link\"") >&5
12197   (eval $ac_link) 2>&5
12198   ac_status=$?
12199   echo "$as_me:12199: \$? = $ac_status" >&5
12200   (exit "$ac_status"); } &&
12201          { ac_try='test -s "conftest$ac_exeext"'
12202   { (eval echo "$as_me:12202: \"$ac_try\"") >&5
12203   (eval $ac_try) 2>&5
12204   ac_status=$?
12205   echo "$as_me:12205: \$? = $ac_status" >&5
12206   (exit "$ac_status"); }; }; then
12207   ac_R_space=yes
12208 else
12209   echo "$as_me: failed program was:" >&5
12210 cat "conftest.$ac_ext" >&5
12211 ac_R_space=no
12212 fi
12213 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12214         if test $ac_R_space = yes; then
12215           echo "$as_me:12215: result: yes" >&5
12216 echo "${ECHO_T}yes" >&6
12217           X_LIBS="$X_LIBS -R $x_libraries"
12218         else
12219           echo "$as_me:12219: result: neither works" >&5
12220 echo "${ECHO_T}neither works" >&6
12221         fi
12222       fi
12223       LIBS=$ac_xsave_LIBS
12224     esac
12225   fi
12226
12227   # Check for system-dependent libraries X programs must link with.
12228   # Do this before checking for the system-independent R6 libraries
12229   # (-lICE), since we may need -lsocket or whatever for X linking.
12230
12231   if test "$ISC" = yes; then
12232     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12233   else
12234     # Martyn Johnson says this is needed for Ultrix, if the X
12235     # libraries were built with DECnet support.  And Karl Berry says
12236     # the Alpha needs dnet_stub (dnet does not exist).
12237     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12238     cat >"conftest.$ac_ext" <<_ACEOF
12239 #line 12239 "configure"
12240 #include "confdefs.h"
12241
12242 /* Override any gcc2 internal prototype to avoid an error.  */
12243 #ifdef __cplusplus
12244 extern "C"
12245 #endif
12246 /* We use char because int might match the return type of a gcc2
12247    builtin and then its argument prototype would still apply.  */
12248 char XOpenDisplay ();
12249 int
12250 main (void)
12251 {
12252 XOpenDisplay ();
12253   ;
12254   return 0;
12255 }
12256 _ACEOF
12257 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12258 if { (eval echo "$as_me:12258: \"$ac_link\"") >&5
12259   (eval $ac_link) 2>&5
12260   ac_status=$?
12261   echo "$as_me:12261: \$? = $ac_status" >&5
12262   (exit "$ac_status"); } &&
12263          { ac_try='test -s "conftest$ac_exeext"'
12264   { (eval echo "$as_me:12264: \"$ac_try\"") >&5
12265   (eval $ac_try) 2>&5
12266   ac_status=$?
12267   echo "$as_me:12267: \$? = $ac_status" >&5
12268   (exit "$ac_status"); }; }; then
12269   :
12270 else
12271   echo "$as_me: failed program was:" >&5
12272 cat "conftest.$ac_ext" >&5
12273 echo "$as_me:12273: checking for dnet_ntoa in -ldnet" >&5
12274 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12275 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12276   echo $ECHO_N "(cached) $ECHO_C" >&6
12277 else
12278   ac_check_lib_save_LIBS=$LIBS
12279 LIBS="-ldnet  $LIBS"
12280 cat >"conftest.$ac_ext" <<_ACEOF
12281 #line 12281 "configure"
12282 #include "confdefs.h"
12283
12284 /* Override any gcc2 internal prototype to avoid an error.  */
12285 #ifdef __cplusplus
12286 extern "C"
12287 #endif
12288 /* We use char because int might match the return type of a gcc2
12289    builtin and then its argument prototype would still apply.  */
12290 char dnet_ntoa ();
12291 int
12292 main (void)
12293 {
12294 dnet_ntoa ();
12295   ;
12296   return 0;
12297 }
12298 _ACEOF
12299 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12300 if { (eval echo "$as_me:12300: \"$ac_link\"") >&5
12301   (eval $ac_link) 2>&5
12302   ac_status=$?
12303   echo "$as_me:12303: \$? = $ac_status" >&5
12304   (exit "$ac_status"); } &&
12305          { ac_try='test -s "conftest$ac_exeext"'
12306   { (eval echo "$as_me:12306: \"$ac_try\"") >&5
12307   (eval $ac_try) 2>&5
12308   ac_status=$?
12309   echo "$as_me:12309: \$? = $ac_status" >&5
12310   (exit "$ac_status"); }; }; then
12311   ac_cv_lib_dnet_dnet_ntoa=yes
12312 else
12313   echo "$as_me: failed program was:" >&5
12314 cat "conftest.$ac_ext" >&5
12315 ac_cv_lib_dnet_dnet_ntoa=no
12316 fi
12317 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12318 LIBS=$ac_check_lib_save_LIBS
12319 fi
12320 echo "$as_me:12320: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12321 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12322 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12323   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12324 fi
12325
12326     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12327       echo "$as_me:12327: checking for dnet_ntoa in -ldnet_stub" >&5
12328 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12329 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12330   echo $ECHO_N "(cached) $ECHO_C" >&6
12331 else
12332   ac_check_lib_save_LIBS=$LIBS
12333 LIBS="-ldnet_stub  $LIBS"
12334 cat >"conftest.$ac_ext" <<_ACEOF
12335 #line 12335 "configure"
12336 #include "confdefs.h"
12337
12338 /* Override any gcc2 internal prototype to avoid an error.  */
12339 #ifdef __cplusplus
12340 extern "C"
12341 #endif
12342 /* We use char because int might match the return type of a gcc2
12343    builtin and then its argument prototype would still apply.  */
12344 char dnet_ntoa ();
12345 int
12346 main (void)
12347 {
12348 dnet_ntoa ();
12349   ;
12350   return 0;
12351 }
12352 _ACEOF
12353 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12354 if { (eval echo "$as_me:12354: \"$ac_link\"") >&5
12355   (eval $ac_link) 2>&5
12356   ac_status=$?
12357   echo "$as_me:12357: \$? = $ac_status" >&5
12358   (exit "$ac_status"); } &&
12359          { ac_try='test -s "conftest$ac_exeext"'
12360   { (eval echo "$as_me:12360: \"$ac_try\"") >&5
12361   (eval $ac_try) 2>&5
12362   ac_status=$?
12363   echo "$as_me:12363: \$? = $ac_status" >&5
12364   (exit "$ac_status"); }; }; then
12365   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12366 else
12367   echo "$as_me: failed program was:" >&5
12368 cat "conftest.$ac_ext" >&5
12369 ac_cv_lib_dnet_stub_dnet_ntoa=no
12370 fi
12371 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12372 LIBS=$ac_check_lib_save_LIBS
12373 fi
12374 echo "$as_me:12374: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12375 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12376 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12377   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12378 fi
12379
12380     fi
12381 fi
12382 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12383     LIBS="$ac_xsave_LIBS"
12384
12385     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12386     # to get the SysV transport functions.
12387     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12388     # needs -lnsl.
12389     # The nsl library prevents programs from opening the X display
12390     # on Irix 5.2, according to T.E. Dickey.
12391     # The functions gethostbyname, getservbyname, and inet_addr are
12392     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12393     echo "$as_me:12393: checking for gethostbyname" >&5
12394 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12395 if test "${ac_cv_func_gethostbyname+set}" = set; then
12396   echo $ECHO_N "(cached) $ECHO_C" >&6
12397 else
12398   cat >"conftest.$ac_ext" <<_ACEOF
12399 #line 12399 "configure"
12400 #include "confdefs.h"
12401 #define gethostbyname autoconf_temporary
12402 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12403 #undef gethostbyname
12404
12405 #ifdef __cplusplus
12406 extern "C"
12407 #endif
12408
12409 /* We use char because int might match the return type of a gcc2
12410    builtin and then its argument prototype would still apply.  */
12411 char gethostbyname (void);
12412
12413 int
12414 main (void)
12415 {
12416
12417 /* The GNU C library defines stubs for functions which it implements
12418     to always fail with ENOSYS.  Some functions are actually named
12419     something starting with __ and the normal name is an alias.  */
12420 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12421 #error found stub for gethostbyname
12422 #endif
12423
12424         return gethostbyname ();
12425   ;
12426   return 0;
12427 }
12428 _ACEOF
12429 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12430 if { (eval echo "$as_me:12430: \"$ac_link\"") >&5
12431   (eval $ac_link) 2>&5
12432   ac_status=$?
12433   echo "$as_me:12433: \$? = $ac_status" >&5
12434   (exit "$ac_status"); } &&
12435          { ac_try='test -s "conftest$ac_exeext"'
12436   { (eval echo "$as_me:12436: \"$ac_try\"") >&5
12437   (eval $ac_try) 2>&5
12438   ac_status=$?
12439   echo "$as_me:12439: \$? = $ac_status" >&5
12440   (exit "$ac_status"); }; }; then
12441   ac_cv_func_gethostbyname=yes
12442 else
12443   echo "$as_me: failed program was:" >&5
12444 cat "conftest.$ac_ext" >&5
12445 ac_cv_func_gethostbyname=no
12446 fi
12447 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12448 fi
12449 echo "$as_me:12449: result: $ac_cv_func_gethostbyname" >&5
12450 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12451
12452     if test $ac_cv_func_gethostbyname = no; then
12453       echo "$as_me:12453: checking for gethostbyname in -lnsl" >&5
12454 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12455 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12456   echo $ECHO_N "(cached) $ECHO_C" >&6
12457 else
12458   ac_check_lib_save_LIBS=$LIBS
12459 LIBS="-lnsl  $LIBS"
12460 cat >"conftest.$ac_ext" <<_ACEOF
12461 #line 12461 "configure"
12462 #include "confdefs.h"
12463
12464 /* Override any gcc2 internal prototype to avoid an error.  */
12465 #ifdef __cplusplus
12466 extern "C"
12467 #endif
12468 /* We use char because int might match the return type of a gcc2
12469    builtin and then its argument prototype would still apply.  */
12470 char gethostbyname ();
12471 int
12472 main (void)
12473 {
12474 gethostbyname ();
12475   ;
12476   return 0;
12477 }
12478 _ACEOF
12479 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12480 if { (eval echo "$as_me:12480: \"$ac_link\"") >&5
12481   (eval $ac_link) 2>&5
12482   ac_status=$?
12483   echo "$as_me:12483: \$? = $ac_status" >&5
12484   (exit "$ac_status"); } &&
12485          { ac_try='test -s "conftest$ac_exeext"'
12486   { (eval echo "$as_me:12486: \"$ac_try\"") >&5
12487   (eval $ac_try) 2>&5
12488   ac_status=$?
12489   echo "$as_me:12489: \$? = $ac_status" >&5
12490   (exit "$ac_status"); }; }; then
12491   ac_cv_lib_nsl_gethostbyname=yes
12492 else
12493   echo "$as_me: failed program was:" >&5
12494 cat "conftest.$ac_ext" >&5
12495 ac_cv_lib_nsl_gethostbyname=no
12496 fi
12497 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12498 LIBS=$ac_check_lib_save_LIBS
12499 fi
12500 echo "$as_me:12500: result: $ac_cv_lib_nsl_gethostbyname" >&5
12501 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12502 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12503   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12504 fi
12505
12506       if test $ac_cv_lib_nsl_gethostbyname = no; then
12507         echo "$as_me:12507: checking for gethostbyname in -lbsd" >&5
12508 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12509 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12510   echo $ECHO_N "(cached) $ECHO_C" >&6
12511 else
12512   ac_check_lib_save_LIBS=$LIBS
12513 LIBS="-lbsd  $LIBS"
12514 cat >"conftest.$ac_ext" <<_ACEOF
12515 #line 12515 "configure"
12516 #include "confdefs.h"
12517
12518 /* Override any gcc2 internal prototype to avoid an error.  */
12519 #ifdef __cplusplus
12520 extern "C"
12521 #endif
12522 /* We use char because int might match the return type of a gcc2
12523    builtin and then its argument prototype would still apply.  */
12524 char gethostbyname ();
12525 int
12526 main (void)
12527 {
12528 gethostbyname ();
12529   ;
12530   return 0;
12531 }
12532 _ACEOF
12533 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12534 if { (eval echo "$as_me:12534: \"$ac_link\"") >&5
12535   (eval $ac_link) 2>&5
12536   ac_status=$?
12537   echo "$as_me:12537: \$? = $ac_status" >&5
12538   (exit "$ac_status"); } &&
12539          { ac_try='test -s "conftest$ac_exeext"'
12540   { (eval echo "$as_me:12540: \"$ac_try\"") >&5
12541   (eval $ac_try) 2>&5
12542   ac_status=$?
12543   echo "$as_me:12543: \$? = $ac_status" >&5
12544   (exit "$ac_status"); }; }; then
12545   ac_cv_lib_bsd_gethostbyname=yes
12546 else
12547   echo "$as_me: failed program was:" >&5
12548 cat "conftest.$ac_ext" >&5
12549 ac_cv_lib_bsd_gethostbyname=no
12550 fi
12551 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12552 LIBS=$ac_check_lib_save_LIBS
12553 fi
12554 echo "$as_me:12554: result: $ac_cv_lib_bsd_gethostbyname" >&5
12555 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12556 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
12557   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12558 fi
12559
12560       fi
12561     fi
12562
12563     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12564     # socket/setsockopt and other routines are undefined under SCO ODT
12565     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12566     # on later versions), says Simon Leinen: it contains gethostby*
12567     # variants that don't use the nameserver (or something).  -lsocket
12568     # must be given before -lnsl if both are needed.  We assume that
12569     # if connect needs -lnsl, so does gethostbyname.
12570     echo "$as_me:12570: checking for connect" >&5
12571 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12572 if test "${ac_cv_func_connect+set}" = set; then
12573   echo $ECHO_N "(cached) $ECHO_C" >&6
12574 else
12575   cat >"conftest.$ac_ext" <<_ACEOF
12576 #line 12576 "configure"
12577 #include "confdefs.h"
12578 #define connect autoconf_temporary
12579 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12580 #undef connect
12581
12582 #ifdef __cplusplus
12583 extern "C"
12584 #endif
12585
12586 /* We use char because int might match the return type of a gcc2
12587    builtin and then its argument prototype would still apply.  */
12588 char connect (void);
12589
12590 int
12591 main (void)
12592 {
12593
12594 /* The GNU C library defines stubs for functions which it implements
12595     to always fail with ENOSYS.  Some functions are actually named
12596     something starting with __ and the normal name is an alias.  */
12597 #if defined (__stub_connect) || defined (__stub___connect)
12598 #error found stub for connect
12599 #endif
12600
12601         return connect ();
12602   ;
12603   return 0;
12604 }
12605 _ACEOF
12606 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12607 if { (eval echo "$as_me:12607: \"$ac_link\"") >&5
12608   (eval $ac_link) 2>&5
12609   ac_status=$?
12610   echo "$as_me:12610: \$? = $ac_status" >&5
12611   (exit "$ac_status"); } &&
12612          { ac_try='test -s "conftest$ac_exeext"'
12613   { (eval echo "$as_me:12613: \"$ac_try\"") >&5
12614   (eval $ac_try) 2>&5
12615   ac_status=$?
12616   echo "$as_me:12616: \$? = $ac_status" >&5
12617   (exit "$ac_status"); }; }; then
12618   ac_cv_func_connect=yes
12619 else
12620   echo "$as_me: failed program was:" >&5
12621 cat "conftest.$ac_ext" >&5
12622 ac_cv_func_connect=no
12623 fi
12624 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12625 fi
12626 echo "$as_me:12626: result: $ac_cv_func_connect" >&5
12627 echo "${ECHO_T}$ac_cv_func_connect" >&6
12628
12629     if test $ac_cv_func_connect = no; then
12630       echo "$as_me:12630: checking for connect in -lsocket" >&5
12631 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12632 if test "${ac_cv_lib_socket_connect+set}" = set; then
12633   echo $ECHO_N "(cached) $ECHO_C" >&6
12634 else
12635   ac_check_lib_save_LIBS=$LIBS
12636 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12637 cat >"conftest.$ac_ext" <<_ACEOF
12638 #line 12638 "configure"
12639 #include "confdefs.h"
12640
12641 /* Override any gcc2 internal prototype to avoid an error.  */
12642 #ifdef __cplusplus
12643 extern "C"
12644 #endif
12645 /* We use char because int might match the return type of a gcc2
12646    builtin and then its argument prototype would still apply.  */
12647 char connect ();
12648 int
12649 main (void)
12650 {
12651 connect ();
12652   ;
12653   return 0;
12654 }
12655 _ACEOF
12656 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12657 if { (eval echo "$as_me:12657: \"$ac_link\"") >&5
12658   (eval $ac_link) 2>&5
12659   ac_status=$?
12660   echo "$as_me:12660: \$? = $ac_status" >&5
12661   (exit "$ac_status"); } &&
12662          { ac_try='test -s "conftest$ac_exeext"'
12663   { (eval echo "$as_me:12663: \"$ac_try\"") >&5
12664   (eval $ac_try) 2>&5
12665   ac_status=$?
12666   echo "$as_me:12666: \$? = $ac_status" >&5
12667   (exit "$ac_status"); }; }; then
12668   ac_cv_lib_socket_connect=yes
12669 else
12670   echo "$as_me: failed program was:" >&5
12671 cat "conftest.$ac_ext" >&5
12672 ac_cv_lib_socket_connect=no
12673 fi
12674 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12675 LIBS=$ac_check_lib_save_LIBS
12676 fi
12677 echo "$as_me:12677: result: $ac_cv_lib_socket_connect" >&5
12678 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12679 if test "$ac_cv_lib_socket_connect" = yes; then
12680   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12681 fi
12682
12683     fi
12684
12685     # Guillermo Gomez says -lposix is necessary on A/UX.
12686     echo "$as_me:12686: checking for remove" >&5
12687 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12688 if test "${ac_cv_func_remove+set}" = set; then
12689   echo $ECHO_N "(cached) $ECHO_C" >&6
12690 else
12691   cat >"conftest.$ac_ext" <<_ACEOF
12692 #line 12692 "configure"
12693 #include "confdefs.h"
12694 #define remove autoconf_temporary
12695 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12696 #undef remove
12697
12698 #ifdef __cplusplus
12699 extern "C"
12700 #endif
12701
12702 /* We use char because int might match the return type of a gcc2
12703    builtin and then its argument prototype would still apply.  */
12704 char remove (void);
12705
12706 int
12707 main (void)
12708 {
12709
12710 /* The GNU C library defines stubs for functions which it implements
12711     to always fail with ENOSYS.  Some functions are actually named
12712     something starting with __ and the normal name is an alias.  */
12713 #if defined (__stub_remove) || defined (__stub___remove)
12714 #error found stub for remove
12715 #endif
12716
12717         return remove ();
12718   ;
12719   return 0;
12720 }
12721 _ACEOF
12722 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12723 if { (eval echo "$as_me:12723: \"$ac_link\"") >&5
12724   (eval $ac_link) 2>&5
12725   ac_status=$?
12726   echo "$as_me:12726: \$? = $ac_status" >&5
12727   (exit "$ac_status"); } &&
12728          { ac_try='test -s "conftest$ac_exeext"'
12729   { (eval echo "$as_me:12729: \"$ac_try\"") >&5
12730   (eval $ac_try) 2>&5
12731   ac_status=$?
12732   echo "$as_me:12732: \$? = $ac_status" >&5
12733   (exit "$ac_status"); }; }; then
12734   ac_cv_func_remove=yes
12735 else
12736   echo "$as_me: failed program was:" >&5
12737 cat "conftest.$ac_ext" >&5
12738 ac_cv_func_remove=no
12739 fi
12740 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12741 fi
12742 echo "$as_me:12742: result: $ac_cv_func_remove" >&5
12743 echo "${ECHO_T}$ac_cv_func_remove" >&6
12744
12745     if test $ac_cv_func_remove = no; then
12746       echo "$as_me:12746: checking for remove in -lposix" >&5
12747 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12748 if test "${ac_cv_lib_posix_remove+set}" = set; then
12749   echo $ECHO_N "(cached) $ECHO_C" >&6
12750 else
12751   ac_check_lib_save_LIBS=$LIBS
12752 LIBS="-lposix  $LIBS"
12753 cat >"conftest.$ac_ext" <<_ACEOF
12754 #line 12754 "configure"
12755 #include "confdefs.h"
12756
12757 /* Override any gcc2 internal prototype to avoid an error.  */
12758 #ifdef __cplusplus
12759 extern "C"
12760 #endif
12761 /* We use char because int might match the return type of a gcc2
12762    builtin and then its argument prototype would still apply.  */
12763 char remove ();
12764 int
12765 main (void)
12766 {
12767 remove ();
12768   ;
12769   return 0;
12770 }
12771 _ACEOF
12772 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12773 if { (eval echo "$as_me:12773: \"$ac_link\"") >&5
12774   (eval $ac_link) 2>&5
12775   ac_status=$?
12776   echo "$as_me:12776: \$? = $ac_status" >&5
12777   (exit "$ac_status"); } &&
12778          { ac_try='test -s "conftest$ac_exeext"'
12779   { (eval echo "$as_me:12779: \"$ac_try\"") >&5
12780   (eval $ac_try) 2>&5
12781   ac_status=$?
12782   echo "$as_me:12782: \$? = $ac_status" >&5
12783   (exit "$ac_status"); }; }; then
12784   ac_cv_lib_posix_remove=yes
12785 else
12786   echo "$as_me: failed program was:" >&5
12787 cat "conftest.$ac_ext" >&5
12788 ac_cv_lib_posix_remove=no
12789 fi
12790 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12791 LIBS=$ac_check_lib_save_LIBS
12792 fi
12793 echo "$as_me:12793: result: $ac_cv_lib_posix_remove" >&5
12794 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12795 if test "$ac_cv_lib_posix_remove" = yes; then
12796   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12797 fi
12798
12799     fi
12800
12801     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12802     echo "$as_me:12802: checking for shmat" >&5
12803 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12804 if test "${ac_cv_func_shmat+set}" = set; then
12805   echo $ECHO_N "(cached) $ECHO_C" >&6
12806 else
12807   cat >"conftest.$ac_ext" <<_ACEOF
12808 #line 12808 "configure"
12809 #include "confdefs.h"
12810 #define shmat autoconf_temporary
12811 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12812 #undef shmat
12813
12814 #ifdef __cplusplus
12815 extern "C"
12816 #endif
12817
12818 /* We use char because int might match the return type of a gcc2
12819    builtin and then its argument prototype would still apply.  */
12820 char shmat (void);
12821
12822 int
12823 main (void)
12824 {
12825
12826 /* The GNU C library defines stubs for functions which it implements
12827     to always fail with ENOSYS.  Some functions are actually named
12828     something starting with __ and the normal name is an alias.  */
12829 #if defined (__stub_shmat) || defined (__stub___shmat)
12830 #error found stub for shmat
12831 #endif
12832
12833         return shmat ();
12834   ;
12835   return 0;
12836 }
12837 _ACEOF
12838 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12839 if { (eval echo "$as_me:12839: \"$ac_link\"") >&5
12840   (eval $ac_link) 2>&5
12841   ac_status=$?
12842   echo "$as_me:12842: \$? = $ac_status" >&5
12843   (exit "$ac_status"); } &&
12844          { ac_try='test -s "conftest$ac_exeext"'
12845   { (eval echo "$as_me:12845: \"$ac_try\"") >&5
12846   (eval $ac_try) 2>&5
12847   ac_status=$?
12848   echo "$as_me:12848: \$? = $ac_status" >&5
12849   (exit "$ac_status"); }; }; then
12850   ac_cv_func_shmat=yes
12851 else
12852   echo "$as_me: failed program was:" >&5
12853 cat "conftest.$ac_ext" >&5
12854 ac_cv_func_shmat=no
12855 fi
12856 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12857 fi
12858 echo "$as_me:12858: result: $ac_cv_func_shmat" >&5
12859 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12860
12861     if test $ac_cv_func_shmat = no; then
12862       echo "$as_me:12862: checking for shmat in -lipc" >&5
12863 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12864 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12865   echo $ECHO_N "(cached) $ECHO_C" >&6
12866 else
12867   ac_check_lib_save_LIBS=$LIBS
12868 LIBS="-lipc  $LIBS"
12869 cat >"conftest.$ac_ext" <<_ACEOF
12870 #line 12870 "configure"
12871 #include "confdefs.h"
12872
12873 /* Override any gcc2 internal prototype to avoid an error.  */
12874 #ifdef __cplusplus
12875 extern "C"
12876 #endif
12877 /* We use char because int might match the return type of a gcc2
12878    builtin and then its argument prototype would still apply.  */
12879 char shmat ();
12880 int
12881 main (void)
12882 {
12883 shmat ();
12884   ;
12885   return 0;
12886 }
12887 _ACEOF
12888 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12889 if { (eval echo "$as_me:12889: \"$ac_link\"") >&5
12890   (eval $ac_link) 2>&5
12891   ac_status=$?
12892   echo "$as_me:12892: \$? = $ac_status" >&5
12893   (exit "$ac_status"); } &&
12894          { ac_try='test -s "conftest$ac_exeext"'
12895   { (eval echo "$as_me:12895: \"$ac_try\"") >&5
12896   (eval $ac_try) 2>&5
12897   ac_status=$?
12898   echo "$as_me:12898: \$? = $ac_status" >&5
12899   (exit "$ac_status"); }; }; then
12900   ac_cv_lib_ipc_shmat=yes
12901 else
12902   echo "$as_me: failed program was:" >&5
12903 cat "conftest.$ac_ext" >&5
12904 ac_cv_lib_ipc_shmat=no
12905 fi
12906 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12907 LIBS=$ac_check_lib_save_LIBS
12908 fi
12909 echo "$as_me:12909: result: $ac_cv_lib_ipc_shmat" >&5
12910 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12911 if test "$ac_cv_lib_ipc_shmat" = yes; then
12912   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12913 fi
12914
12915     fi
12916   fi
12917
12918   # Check for libraries that X11R6 Xt/Xaw programs need.
12919   ac_save_LDFLAGS=$LDFLAGS
12920   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12921   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12922   # check for ICE first), but we must link in the order -lSM -lICE or
12923   # we get undefined symbols.  So assume we have SM if we have ICE.
12924   # These have to be linked with before -lX11, unlike the other
12925   # libraries we check for below, so use a different variable.
12926   # John Interrante, Karl Berry
12927   echo "$as_me:12927: checking for IceConnectionNumber in -lICE" >&5
12928 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12929 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12930   echo $ECHO_N "(cached) $ECHO_C" >&6
12931 else
12932   ac_check_lib_save_LIBS=$LIBS
12933 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12934 cat >"conftest.$ac_ext" <<_ACEOF
12935 #line 12935 "configure"
12936 #include "confdefs.h"
12937
12938 /* Override any gcc2 internal prototype to avoid an error.  */
12939 #ifdef __cplusplus
12940 extern "C"
12941 #endif
12942 /* We use char because int might match the return type of a gcc2
12943    builtin and then its argument prototype would still apply.  */
12944 char IceConnectionNumber ();
12945 int
12946 main (void)
12947 {
12948 IceConnectionNumber ();
12949   ;
12950   return 0;
12951 }
12952 _ACEOF
12953 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12954 if { (eval echo "$as_me:12954: \"$ac_link\"") >&5
12955   (eval $ac_link) 2>&5
12956   ac_status=$?
12957   echo "$as_me:12957: \$? = $ac_status" >&5
12958   (exit "$ac_status"); } &&
12959          { ac_try='test -s "conftest$ac_exeext"'
12960   { (eval echo "$as_me:12960: \"$ac_try\"") >&5
12961   (eval $ac_try) 2>&5
12962   ac_status=$?
12963   echo "$as_me:12963: \$? = $ac_status" >&5
12964   (exit "$ac_status"); }; }; then
12965   ac_cv_lib_ICE_IceConnectionNumber=yes
12966 else
12967   echo "$as_me: failed program was:" >&5
12968 cat "conftest.$ac_ext" >&5
12969 ac_cv_lib_ICE_IceConnectionNumber=no
12970 fi
12971 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12972 LIBS=$ac_check_lib_save_LIBS
12973 fi
12974 echo "$as_me:12974: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12975 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12976 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
12977   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12978 fi
12979
12980   LDFLAGS=$ac_save_LDFLAGS
12981
12982 fi
12983
12984 cf_x_athena=${cf_x_athena:-Xaw}
12985
12986 echo "$as_me:12986: checking if you want to link with Xaw 3d library" >&5
12987 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12988 withval=
12989
12990 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12991 if test "${with_Xaw3d+set}" = set; then
12992   withval="$with_Xaw3d"
12993
12994 fi;
12995 if test "$withval" = yes ; then
12996         cf_x_athena=Xaw3d
12997         echo "$as_me:12997: result: yes" >&5
12998 echo "${ECHO_T}yes" >&6
12999 else
13000         echo "$as_me:13000: result: no" >&5
13001 echo "${ECHO_T}no" >&6
13002 fi
13003
13004 echo "$as_me:13004: checking if you want to link with Xaw 3d xft library" >&5
13005 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13006 withval=
13007
13008 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13009 if test "${with_Xaw3dxft+set}" = set; then
13010   withval="$with_Xaw3dxft"
13011
13012 fi;
13013 if test "$withval" = yes ; then
13014         cf_x_athena=Xaw3dxft
13015         echo "$as_me:13015: result: yes" >&5
13016 echo "${ECHO_T}yes" >&6
13017 else
13018         echo "$as_me:13018: result: no" >&5
13019 echo "${ECHO_T}no" >&6
13020 fi
13021
13022 echo "$as_me:13022: checking if you want to link with neXT Athena library" >&5
13023 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13024 withval=
13025
13026 # Check whether --with-neXtaw or --without-neXtaw was given.
13027 if test "${with_neXtaw+set}" = set; then
13028   withval="$with_neXtaw"
13029
13030 fi;
13031 if test "$withval" = yes ; then
13032         cf_x_athena=neXtaw
13033         echo "$as_me:13033: result: yes" >&5
13034 echo "${ECHO_T}yes" >&6
13035 else
13036         echo "$as_me:13036: result: no" >&5
13037 echo "${ECHO_T}no" >&6
13038 fi
13039
13040 echo "$as_me:13040: checking if you want to link with Athena-Plus library" >&5
13041 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13042 withval=
13043
13044 # Check whether --with-XawPlus or --without-XawPlus was given.
13045 if test "${with_XawPlus+set}" = set; then
13046   withval="$with_XawPlus"
13047
13048 fi;
13049 if test "$withval" = yes ; then
13050         cf_x_athena=XawPlus
13051         echo "$as_me:13051: result: yes" >&5
13052 echo "${ECHO_T}yes" >&6
13053 else
13054         echo "$as_me:13054: result: no" >&5
13055 echo "${ECHO_T}no" >&6
13056 fi
13057
13058 cf_x_athena_lib=""
13059
13060 if test "$PKG_CONFIG" != none ; then
13061         cf_athena_list=
13062         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13063         for cf_athena_pkg in \
13064                 $cf_athena_list \
13065                 ${cf_x_athena} \
13066                 ${cf_x_athena}-devel \
13067                 lib${cf_x_athena} \
13068                 lib${cf_x_athena}-devel
13069         do
13070
13071 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13072         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13073
13074 echo "${as_me:-configure}:13074: testing found package $cf_athena_pkg ..." 1>&5
13075
13076         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13077         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13078         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13079
13080 echo "${as_me:-configure}:13080: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13081
13082         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13083
13084 echo "${as_me:-configure}:13084: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13085
13086 cf_fix_cppflags=no
13087 cf_new_cflags=
13088 cf_new_cppflags=
13089 cf_new_extra_cppflags=
13090
13091 for cf_add_cflags in $cf_pkgconfig_incs
13092 do
13093 case "$cf_fix_cppflags" in
13094 (no)
13095         case "$cf_add_cflags" in
13096         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13097                 case "$cf_add_cflags" in
13098                 (-D*)
13099                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13100
13101                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13102                                 && test -z "${cf_tst_cflags}" \
13103                                 && cf_fix_cppflags=yes
13104
13105                         if test "$cf_fix_cppflags" = yes ; then
13106
13107         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13108         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13109
13110                                 continue
13111                         elif test "${cf_tst_cflags}" = "\"'" ; then
13112
13113         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13114         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13115
13116                                 continue
13117                         fi
13118                         ;;
13119                 esac
13120                 case "$CPPFLAGS" in
13121                 (*$cf_add_cflags)
13122                         ;;
13123                 (*)
13124                         case "$cf_add_cflags" in
13125                         (-D*)
13126                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13127
13128 CPPFLAGS=`echo "$CPPFLAGS" | \
13129         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13130                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13131
13132                                 ;;
13133                         esac
13134
13135         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13136         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13137
13138                         ;;
13139                 esac
13140                 ;;
13141         (*)
13142
13143         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13144         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13145
13146                 ;;
13147         esac
13148         ;;
13149 (yes)
13150
13151         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13152         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13153
13154         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13155
13156         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13157                 && test -z "${cf_tst_cflags}" \
13158                 && cf_fix_cppflags=no
13159         ;;
13160 esac
13161 done
13162
13163 if test -n "$cf_new_cflags" ; then
13164
13165         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13166         CFLAGS="${CFLAGS}$cf_new_cflags"
13167
13168 fi
13169
13170 if test -n "$cf_new_cppflags" ; then
13171
13172         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13173         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13174
13175 fi
13176
13177 if test -n "$cf_new_extra_cppflags" ; then
13178
13179         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13180         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13181
13182 fi
13183
13184 cf_add_libs="$LIBS"
13185 # reverse order
13186 cf_add_0lib=
13187 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13188 # filter duplicates
13189 for cf_add_1lib in $cf_add_0lib; do
13190         for cf_add_2lib in $cf_add_libs; do
13191                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13192                         cf_add_1lib=
13193                         break
13194                 fi
13195         done
13196         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13197 done
13198 LIBS="$cf_add_libs"
13199
13200                         cf_x_athena_lib="$cf_pkgconfig_libs"
13201
13202 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13203
13204                         cat >>confdefs.h <<EOF
13205 #define $cf_x_athena_LIBS 1
13206 EOF
13207
13208         for cf_trim_lib in Xmu Xt X11
13209         do
13210                 case "$LIBS" in
13211                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13212                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13213                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13214
13215 echo "${as_me:-configure}:13215: testing ..trimmed $LIBS ..." 1>&5
13216
13217                         ;;
13218                 esac
13219         done
13220
13221 echo "$as_me:13221: checking for usable $cf_x_athena/Xmu package" >&5
13222 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13223 if test "${cf_cv_xaw_compat+set}" = set; then
13224   echo $ECHO_N "(cached) $ECHO_C" >&6
13225 else
13226
13227 cat >"conftest.$ac_ext" <<_ACEOF
13228 #line 13228 "configure"
13229 #include "confdefs.h"
13230
13231 #include <X11/Xmu/CharSet.h>
13232
13233 int
13234 main (void)
13235 {
13236
13237 int check = XmuCompareISOLatin1("big", "small");
13238 (void)check;
13239
13240   ;
13241   return 0;
13242 }
13243 _ACEOF
13244 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13245 if { (eval echo "$as_me:13245: \"$ac_link\"") >&5
13246   (eval $ac_link) 2>&5
13247   ac_status=$?
13248   echo "$as_me:13248: \$? = $ac_status" >&5
13249   (exit "$ac_status"); } &&
13250          { ac_try='test -s "conftest$ac_exeext"'
13251   { (eval echo "$as_me:13251: \"$ac_try\"") >&5
13252   (eval $ac_try) 2>&5
13253   ac_status=$?
13254   echo "$as_me:13254: \$? = $ac_status" >&5
13255   (exit "$ac_status"); }; }; then
13256   cf_cv_xaw_compat=yes
13257 else
13258   echo "$as_me: failed program was:" >&5
13259 cat "conftest.$ac_ext" >&5
13260 cf_cv_xaw_compat=no
13261 fi
13262 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13263 fi
13264 echo "$as_me:13264: result: $cf_cv_xaw_compat" >&5
13265 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13266
13267                         if test "$cf_cv_xaw_compat" = no
13268                         then
13269                                 # workaround for broken ".pc" files...
13270                                 case "$cf_x_athena_lib" in
13271                                 (*-lXmu*)
13272                                         ;;
13273                                 (*)
13274                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13275
13276 echo "${as_me:-configure}:13276: testing work around broken package ..." 1>&5
13277
13278                                         cf_save_xmu="$LIBS"
13279                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13280
13281 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13282         test -n "$verbose" && echo "    found package xmu" 1>&6
13283
13284 echo "${as_me:-configure}:13284: testing found package xmu ..." 1>&5
13285
13286         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13287         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13288         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13289
13290 echo "${as_me:-configure}:13290: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13291
13292         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13293
13294 echo "${as_me:-configure}:13294: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13295
13296 cf_fix_cppflags=no
13297 cf_new_cflags=
13298 cf_new_cppflags=
13299 cf_new_extra_cppflags=
13300
13301 for cf_add_cflags in $cf_pkgconfig_incs
13302 do
13303 case "$cf_fix_cppflags" in
13304 (no)
13305         case "$cf_add_cflags" in
13306         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13307                 case "$cf_add_cflags" in
13308                 (-D*)
13309                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13310
13311                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13312                                 && test -z "${cf_tst_cflags}" \
13313                                 && cf_fix_cppflags=yes
13314
13315                         if test "$cf_fix_cppflags" = yes ; then
13316
13317         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13318         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13319
13320                                 continue
13321                         elif test "${cf_tst_cflags}" = "\"'" ; then
13322
13323         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13324         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13325
13326                                 continue
13327                         fi
13328                         ;;
13329                 esac
13330                 case "$CPPFLAGS" in
13331                 (*$cf_add_cflags)
13332                         ;;
13333                 (*)
13334                         case "$cf_add_cflags" in
13335                         (-D*)
13336                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13337
13338 CPPFLAGS=`echo "$CPPFLAGS" | \
13339         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13340                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13341
13342                                 ;;
13343                         esac
13344
13345         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13346         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13347
13348                         ;;
13349                 esac
13350                 ;;
13351         (*)
13352
13353         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13354         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13355
13356                 ;;
13357         esac
13358         ;;
13359 (yes)
13360
13361         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13362         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13363
13364         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13365
13366         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13367                 && test -z "${cf_tst_cflags}" \
13368                 && cf_fix_cppflags=no
13369         ;;
13370 esac
13371 done
13372
13373 if test -n "$cf_new_cflags" ; then
13374
13375         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13376         CFLAGS="${CFLAGS}$cf_new_cflags"
13377
13378 fi
13379
13380 if test -n "$cf_new_cppflags" ; then
13381
13382         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13383         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13384
13385 fi
13386
13387 if test -n "$cf_new_extra_cppflags" ; then
13388
13389         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13390         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13391
13392 fi
13393
13394 cf_add_libs="$LIBS"
13395 # reverse order
13396 cf_add_0lib=
13397 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13398 # filter duplicates
13399 for cf_add_1lib in $cf_add_0lib; do
13400         for cf_add_2lib in $cf_add_libs; do
13401                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13402                         cf_add_1lib=
13403                         break
13404                 fi
13405         done
13406         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13407 done
13408 LIBS="$cf_add_libs"
13409
13410                                                         LIBS="$cf_save_xmu"
13411
13412 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13413
13414 echo "${as_me:-configure}:13414: testing ...before $LIBS ..." 1>&5
13415
13416 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13417 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13418
13419 echo "${as_me:-configure}:13419: testing ...after  $LIBS ..." 1>&5
13420
13421 else
13422         cf_pkgconfig_incs=
13423         cf_pkgconfig_libs=
13424
13425 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13426
13427 echo "${as_me:-configure}:13427: testing ...before $LIBS ..." 1>&5
13428
13429 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13430 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13431
13432 echo "${as_me:-configure}:13432: testing ...after  $LIBS ..." 1>&5
13433
13434 fi
13435
13436         for cf_trim_lib in Xmu Xt X11
13437         do
13438                 case "$LIBS" in
13439                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13440                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13441                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13442
13443 echo "${as_me:-configure}:13443: testing ..trimmed $LIBS ..." 1>&5
13444
13445                         ;;
13446                 esac
13447         done
13448
13449                                         ;;
13450                                 esac
13451                         fi
13452
13453                         break
13454 else
13455         cf_pkgconfig_incs=
13456         cf_pkgconfig_libs=
13457         :
13458 fi
13459
13460         done
13461 fi
13462
13463 if test -z "$cf_x_athena_lib" ; then
13464
13465 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13466         test -n "$verbose" && echo "    found package Xext" 1>&6
13467
13468 echo "${as_me:-configure}:13468: testing found package Xext ..." 1>&5
13469
13470         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13471         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13472         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13473
13474 echo "${as_me:-configure}:13474: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13475
13476         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13477
13478 echo "${as_me:-configure}:13478: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13479
13480 cf_fix_cppflags=no
13481 cf_new_cflags=
13482 cf_new_cppflags=
13483 cf_new_extra_cppflags=
13484
13485 for cf_add_cflags in $cf_pkgconfig_incs
13486 do
13487 case "$cf_fix_cppflags" in
13488 (no)
13489         case "$cf_add_cflags" in
13490         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13491                 case "$cf_add_cflags" in
13492                 (-D*)
13493                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13494
13495                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13496                                 && test -z "${cf_tst_cflags}" \
13497                                 && cf_fix_cppflags=yes
13498
13499                         if test "$cf_fix_cppflags" = yes ; then
13500
13501         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13502         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13503
13504                                 continue
13505                         elif test "${cf_tst_cflags}" = "\"'" ; then
13506
13507         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13508         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13509
13510                                 continue
13511                         fi
13512                         ;;
13513                 esac
13514                 case "$CPPFLAGS" in
13515                 (*$cf_add_cflags)
13516                         ;;
13517                 (*)
13518                         case "$cf_add_cflags" in
13519                         (-D*)
13520                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13521
13522 CPPFLAGS=`echo "$CPPFLAGS" | \
13523         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13524                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13525
13526                                 ;;
13527                         esac
13528
13529         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13530         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13531
13532                         ;;
13533                 esac
13534                 ;;
13535         (*)
13536
13537         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13538         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13539
13540                 ;;
13541         esac
13542         ;;
13543 (yes)
13544
13545         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13546         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13547
13548         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13549
13550         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13551                 && test -z "${cf_tst_cflags}" \
13552                 && cf_fix_cppflags=no
13553         ;;
13554 esac
13555 done
13556
13557 if test -n "$cf_new_cflags" ; then
13558
13559         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13560         CFLAGS="${CFLAGS}$cf_new_cflags"
13561
13562 fi
13563
13564 if test -n "$cf_new_cppflags" ; then
13565
13566         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13567         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13568
13569 fi
13570
13571 if test -n "$cf_new_extra_cppflags" ; then
13572
13573         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13574         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13575
13576 fi
13577
13578 cf_add_libs="$LIBS"
13579 # reverse order
13580 cf_add_0lib=
13581 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13582 # filter duplicates
13583 for cf_add_1lib in $cf_add_0lib; do
13584         for cf_add_2lib in $cf_add_libs; do
13585                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13586                         cf_add_1lib=
13587                         break
13588                 fi
13589         done
13590         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13591 done
13592 LIBS="$cf_add_libs"
13593
13594         :
13595 else
13596         cf_pkgconfig_incs=
13597         cf_pkgconfig_libs=
13598
13599         echo "$as_me:13599: checking for XextCreateExtension in -lXext" >&5
13600 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13601 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13602   echo $ECHO_N "(cached) $ECHO_C" >&6
13603 else
13604   ac_check_lib_save_LIBS=$LIBS
13605 LIBS="-lXext  $LIBS"
13606 cat >"conftest.$ac_ext" <<_ACEOF
13607 #line 13607 "configure"
13608 #include "confdefs.h"
13609
13610 /* Override any gcc2 internal prototype to avoid an error.  */
13611 #ifdef __cplusplus
13612 extern "C"
13613 #endif
13614 /* We use char because int might match the return type of a gcc2
13615    builtin and then its argument prototype would still apply.  */
13616 char XextCreateExtension ();
13617 int
13618 main (void)
13619 {
13620 XextCreateExtension ();
13621   ;
13622   return 0;
13623 }
13624 _ACEOF
13625 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13626 if { (eval echo "$as_me:13626: \"$ac_link\"") >&5
13627   (eval $ac_link) 2>&5
13628   ac_status=$?
13629   echo "$as_me:13629: \$? = $ac_status" >&5
13630   (exit "$ac_status"); } &&
13631          { ac_try='test -s "conftest$ac_exeext"'
13632   { (eval echo "$as_me:13632: \"$ac_try\"") >&5
13633   (eval $ac_try) 2>&5
13634   ac_status=$?
13635   echo "$as_me:13635: \$? = $ac_status" >&5
13636   (exit "$ac_status"); }; }; then
13637   ac_cv_lib_Xext_XextCreateExtension=yes
13638 else
13639   echo "$as_me: failed program was:" >&5
13640 cat "conftest.$ac_ext" >&5
13641 ac_cv_lib_Xext_XextCreateExtension=no
13642 fi
13643 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13644 LIBS=$ac_check_lib_save_LIBS
13645 fi
13646 echo "$as_me:13646: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13647 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13648 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
13649
13650 cf_add_libs="$LIBS"
13651 # reverse order
13652 cf_add_0lib=
13653 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13654 # filter duplicates
13655 for cf_add_1lib in $cf_add_0lib; do
13656         for cf_add_2lib in $cf_add_libs; do
13657                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13658                         cf_add_1lib=
13659                         break
13660                 fi
13661         done
13662         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13663 done
13664 LIBS="$cf_add_libs"
13665
13666 fi
13667
13668 fi
13669
13670 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13671 # in some cases has installed dummy files in the former, other cases replaced
13672 # it with a link to the new location).  This complicates the configure script.
13673 # Check for that pitfall, and recover using pkg-config
13674 #
13675 # If none of these are set, the configuration is almost certainly broken.
13676 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13677 then
13678
13679 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
13680         test -n "$verbose" && echo "    found package x11" 1>&6
13681
13682 echo "${as_me:-configure}:13682: testing found package x11 ..." 1>&5
13683
13684         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
13685         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
13686         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13687
13688 echo "${as_me:-configure}:13688: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13689
13690         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13691
13692 echo "${as_me:-configure}:13692: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13693
13694 cf_fix_cppflags=no
13695 cf_new_cflags=
13696 cf_new_cppflags=
13697 cf_new_extra_cppflags=
13698
13699 for cf_add_cflags in $cf_pkgconfig_incs
13700 do
13701 case "$cf_fix_cppflags" in
13702 (no)
13703         case "$cf_add_cflags" in
13704         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13705                 case "$cf_add_cflags" in
13706                 (-D*)
13707                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13708
13709                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13710                                 && test -z "${cf_tst_cflags}" \
13711                                 && cf_fix_cppflags=yes
13712
13713                         if test "$cf_fix_cppflags" = yes ; then
13714
13715         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13716         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13717
13718                                 continue
13719                         elif test "${cf_tst_cflags}" = "\"'" ; then
13720
13721         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13722         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13723
13724                                 continue
13725                         fi
13726                         ;;
13727                 esac
13728                 case "$CPPFLAGS" in
13729                 (*$cf_add_cflags)
13730                         ;;
13731                 (*)
13732                         case "$cf_add_cflags" in
13733                         (-D*)
13734                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13735
13736 CPPFLAGS=`echo "$CPPFLAGS" | \
13737         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13738                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13739
13740                                 ;;
13741                         esac
13742
13743         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13744         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13745
13746                         ;;
13747                 esac
13748                 ;;
13749         (*)
13750
13751         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13752         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13753
13754                 ;;
13755         esac
13756         ;;
13757 (yes)
13758
13759         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13760         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13761
13762         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13763
13764         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13765                 && test -z "${cf_tst_cflags}" \
13766                 && cf_fix_cppflags=no
13767         ;;
13768 esac
13769 done
13770
13771 if test -n "$cf_new_cflags" ; then
13772
13773         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13774         CFLAGS="${CFLAGS}$cf_new_cflags"
13775
13776 fi
13777
13778 if test -n "$cf_new_cppflags" ; then
13779
13780         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13781         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13782
13783 fi
13784
13785 if test -n "$cf_new_extra_cppflags" ; then
13786
13787         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13788         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13789
13790 fi
13791
13792 cf_add_libs="$LIBS"
13793 # reverse order
13794 cf_add_0lib=
13795 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13796 # filter duplicates
13797 for cf_add_1lib in $cf_add_0lib; do
13798         for cf_add_2lib in $cf_add_libs; do
13799                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13800                         cf_add_1lib=
13801                         break
13802                 fi
13803         done
13804         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13805 done
13806 LIBS="$cf_add_libs"
13807
13808         :
13809 else
13810         cf_pkgconfig_incs=
13811         cf_pkgconfig_libs=
13812         { echo "$as_me:13812: WARNING: unable to find X11 library" >&5
13813 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13814 fi
13815
13816 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
13817         test -n "$verbose" && echo "    found package ice" 1>&6
13818
13819 echo "${as_me:-configure}:13819: testing found package ice ..." 1>&5
13820
13821         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
13822         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
13823         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13824
13825 echo "${as_me:-configure}:13825: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13826
13827         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13828
13829 echo "${as_me:-configure}:13829: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13830
13831 cf_fix_cppflags=no
13832 cf_new_cflags=
13833 cf_new_cppflags=
13834 cf_new_extra_cppflags=
13835
13836 for cf_add_cflags in $cf_pkgconfig_incs
13837 do
13838 case "$cf_fix_cppflags" in
13839 (no)
13840         case "$cf_add_cflags" in
13841         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13842                 case "$cf_add_cflags" in
13843                 (-D*)
13844                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13845
13846                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13847                                 && test -z "${cf_tst_cflags}" \
13848                                 && cf_fix_cppflags=yes
13849
13850                         if test "$cf_fix_cppflags" = yes ; then
13851
13852         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13853         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13854
13855                                 continue
13856                         elif test "${cf_tst_cflags}" = "\"'" ; then
13857
13858         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13859         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13860
13861                                 continue
13862                         fi
13863                         ;;
13864                 esac
13865                 case "$CPPFLAGS" in
13866                 (*$cf_add_cflags)
13867                         ;;
13868                 (*)
13869                         case "$cf_add_cflags" in
13870                         (-D*)
13871                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13872
13873 CPPFLAGS=`echo "$CPPFLAGS" | \
13874         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13875                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13876
13877                                 ;;
13878                         esac
13879
13880         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13881         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13882
13883                         ;;
13884                 esac
13885                 ;;
13886         (*)
13887
13888         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13889         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13890
13891                 ;;
13892         esac
13893         ;;
13894 (yes)
13895
13896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13898
13899         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13900
13901         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13902                 && test -z "${cf_tst_cflags}" \
13903                 && cf_fix_cppflags=no
13904         ;;
13905 esac
13906 done
13907
13908 if test -n "$cf_new_cflags" ; then
13909
13910         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13911         CFLAGS="${CFLAGS}$cf_new_cflags"
13912
13913 fi
13914
13915 if test -n "$cf_new_cppflags" ; then
13916
13917         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13918         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13919
13920 fi
13921
13922 if test -n "$cf_new_extra_cppflags" ; then
13923
13924         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13925         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13926
13927 fi
13928
13929 cf_add_libs="$LIBS"
13930 # reverse order
13931 cf_add_0lib=
13932 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13933 # filter duplicates
13934 for cf_add_1lib in $cf_add_0lib; do
13935         for cf_add_2lib in $cf_add_libs; do
13936                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13937                         cf_add_1lib=
13938                         break
13939                 fi
13940         done
13941         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13942 done
13943 LIBS="$cf_add_libs"
13944
13945         :
13946 else
13947         cf_pkgconfig_incs=
13948         cf_pkgconfig_libs=
13949         { echo "$as_me:13949: WARNING: unable to find ICE library" >&5
13950 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13951 fi
13952
13953 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
13954         test -n "$verbose" && echo "    found package sm" 1>&6
13955
13956 echo "${as_me:-configure}:13956: testing found package sm ..." 1>&5
13957
13958         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
13959         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
13960         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13961
13962 echo "${as_me:-configure}:13962: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13963
13964         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13965
13966 echo "${as_me:-configure}:13966: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13967
13968 cf_fix_cppflags=no
13969 cf_new_cflags=
13970 cf_new_cppflags=
13971 cf_new_extra_cppflags=
13972
13973 for cf_add_cflags in $cf_pkgconfig_incs
13974 do
13975 case "$cf_fix_cppflags" in
13976 (no)
13977         case "$cf_add_cflags" in
13978         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13979                 case "$cf_add_cflags" in
13980                 (-D*)
13981                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13982
13983                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13984                                 && test -z "${cf_tst_cflags}" \
13985                                 && cf_fix_cppflags=yes
13986
13987                         if test "$cf_fix_cppflags" = yes ; then
13988
13989         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13990         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13991
13992                                 continue
13993                         elif test "${cf_tst_cflags}" = "\"'" ; then
13994
13995         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13996         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13997
13998                                 continue
13999                         fi
14000                         ;;
14001                 esac
14002                 case "$CPPFLAGS" in
14003                 (*$cf_add_cflags)
14004                         ;;
14005                 (*)
14006                         case "$cf_add_cflags" in
14007                         (-D*)
14008                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14009
14010 CPPFLAGS=`echo "$CPPFLAGS" | \
14011         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14012                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14013
14014                                 ;;
14015                         esac
14016
14017         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14018         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14019
14020                         ;;
14021                 esac
14022                 ;;
14023         (*)
14024
14025         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14026         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14027
14028                 ;;
14029         esac
14030         ;;
14031 (yes)
14032
14033         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14034         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14035
14036         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14037
14038         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14039                 && test -z "${cf_tst_cflags}" \
14040                 && cf_fix_cppflags=no
14041         ;;
14042 esac
14043 done
14044
14045 if test -n "$cf_new_cflags" ; then
14046
14047         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14048         CFLAGS="${CFLAGS}$cf_new_cflags"
14049
14050 fi
14051
14052 if test -n "$cf_new_cppflags" ; then
14053
14054         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14055         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14056
14057 fi
14058
14059 if test -n "$cf_new_extra_cppflags" ; then
14060
14061         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14062         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14063
14064 fi
14065
14066 cf_add_libs="$LIBS"
14067 # reverse order
14068 cf_add_0lib=
14069 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14070 # filter duplicates
14071 for cf_add_1lib in $cf_add_0lib; do
14072         for cf_add_2lib in $cf_add_libs; do
14073                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14074                         cf_add_1lib=
14075                         break
14076                 fi
14077         done
14078         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14079 done
14080 LIBS="$cf_add_libs"
14081
14082         :
14083 else
14084         cf_pkgconfig_incs=
14085         cf_pkgconfig_libs=
14086         { echo "$as_me:14086: WARNING: unable to find SM library" >&5
14087 echo "$as_me: WARNING: unable to find SM library" >&2;}
14088 fi
14089
14090 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14091         test -n "$verbose" && echo "    found package xt" 1>&6
14092
14093 echo "${as_me:-configure}:14093: testing found package xt ..." 1>&5
14094
14095         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14096         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14097         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14098
14099 echo "${as_me:-configure}:14099: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14100
14101         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14102
14103 echo "${as_me:-configure}:14103: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14104
14105 cf_fix_cppflags=no
14106 cf_new_cflags=
14107 cf_new_cppflags=
14108 cf_new_extra_cppflags=
14109
14110 for cf_add_cflags in $cf_pkgconfig_incs
14111 do
14112 case "$cf_fix_cppflags" in
14113 (no)
14114         case "$cf_add_cflags" in
14115         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14116                 case "$cf_add_cflags" in
14117                 (-D*)
14118                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14119
14120                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14121                                 && test -z "${cf_tst_cflags}" \
14122                                 && cf_fix_cppflags=yes
14123
14124                         if test "$cf_fix_cppflags" = yes ; then
14125
14126         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14127         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14128
14129                                 continue
14130                         elif test "${cf_tst_cflags}" = "\"'" ; then
14131
14132         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14133         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14134
14135                                 continue
14136                         fi
14137                         ;;
14138                 esac
14139                 case "$CPPFLAGS" in
14140                 (*$cf_add_cflags)
14141                         ;;
14142                 (*)
14143                         case "$cf_add_cflags" in
14144                         (-D*)
14145                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14146
14147 CPPFLAGS=`echo "$CPPFLAGS" | \
14148         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14149                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14150
14151                                 ;;
14152                         esac
14153
14154         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14155         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14156
14157                         ;;
14158                 esac
14159                 ;;
14160         (*)
14161
14162         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14163         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14164
14165                 ;;
14166         esac
14167         ;;
14168 (yes)
14169
14170         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14171         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14172
14173         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14174
14175         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14176                 && test -z "${cf_tst_cflags}" \
14177                 && cf_fix_cppflags=no
14178         ;;
14179 esac
14180 done
14181
14182 if test -n "$cf_new_cflags" ; then
14183
14184         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14185         CFLAGS="${CFLAGS}$cf_new_cflags"
14186
14187 fi
14188
14189 if test -n "$cf_new_cppflags" ; then
14190
14191         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14192         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14193
14194 fi
14195
14196 if test -n "$cf_new_extra_cppflags" ; then
14197
14198         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14199         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14200
14201 fi
14202
14203 cf_add_libs="$LIBS"
14204 # reverse order
14205 cf_add_0lib=
14206 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14207 # filter duplicates
14208 for cf_add_1lib in $cf_add_0lib; do
14209         for cf_add_2lib in $cf_add_libs; do
14210                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14211                         cf_add_1lib=
14212                         break
14213                 fi
14214         done
14215         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14216 done
14217 LIBS="$cf_add_libs"
14218
14219         :
14220 else
14221         cf_pkgconfig_incs=
14222         cf_pkgconfig_libs=
14223         { echo "$as_me:14223: WARNING: unable to find Xt library" >&5
14224 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14225 fi
14226
14227 else
14228         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14229 fi
14230
14231 cf_have_X_LIBS=no
14232
14233 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14234         test -n "$verbose" && echo "    found package xt" 1>&6
14235
14236 echo "${as_me:-configure}:14236: testing found package xt ..." 1>&5
14237
14238         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14239         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14240         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14241
14242 echo "${as_me:-configure}:14242: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14243
14244         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14245
14246 echo "${as_me:-configure}:14246: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14247
14248 cf_fix_cppflags=no
14249 cf_new_cflags=
14250 cf_new_cppflags=
14251 cf_new_extra_cppflags=
14252
14253 for cf_add_cflags in $cf_pkgconfig_incs
14254 do
14255 case "$cf_fix_cppflags" in
14256 (no)
14257         case "$cf_add_cflags" in
14258         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14259                 case "$cf_add_cflags" in
14260                 (-D*)
14261                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14262
14263                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14264                                 && test -z "${cf_tst_cflags}" \
14265                                 && cf_fix_cppflags=yes
14266
14267                         if test "$cf_fix_cppflags" = yes ; then
14268
14269         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14270         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14271
14272                                 continue
14273                         elif test "${cf_tst_cflags}" = "\"'" ; then
14274
14275         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14276         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14277
14278                                 continue
14279                         fi
14280                         ;;
14281                 esac
14282                 case "$CPPFLAGS" in
14283                 (*$cf_add_cflags)
14284                         ;;
14285                 (*)
14286                         case "$cf_add_cflags" in
14287                         (-D*)
14288                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14289
14290 CPPFLAGS=`echo "$CPPFLAGS" | \
14291         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14292                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14293
14294                                 ;;
14295                         esac
14296
14297         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14298         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14299
14300                         ;;
14301                 esac
14302                 ;;
14303         (*)
14304
14305         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14306         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14307
14308                 ;;
14309         esac
14310         ;;
14311 (yes)
14312
14313         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14314         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14315
14316         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14317
14318         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14319                 && test -z "${cf_tst_cflags}" \
14320                 && cf_fix_cppflags=no
14321         ;;
14322 esac
14323 done
14324
14325 if test -n "$cf_new_cflags" ; then
14326
14327         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14328         CFLAGS="${CFLAGS}$cf_new_cflags"
14329
14330 fi
14331
14332 if test -n "$cf_new_cppflags" ; then
14333
14334         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14335         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14336
14337 fi
14338
14339 if test -n "$cf_new_extra_cppflags" ; then
14340
14341         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14342         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14343
14344 fi
14345
14346 cf_add_libs="$LIBS"
14347 # reverse order
14348 cf_add_0lib=
14349 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14350 # filter duplicates
14351 for cf_add_1lib in $cf_add_0lib; do
14352         for cf_add_2lib in $cf_add_libs; do
14353                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14354                         cf_add_1lib=
14355                         break
14356                 fi
14357         done
14358         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14359 done
14360 LIBS="$cf_add_libs"
14361
14362         case "x$LIBS" in
14363         (*-lX11*)
14364                 ;;
14365         (*)
14366 # we have an "xt" package, but it may omit Xt's dependency on X11
14367 echo "$as_me:14367: checking for usable X dependency" >&5
14368 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14369 if test "${cf_cv_xt_x11_compat+set}" = set; then
14370   echo $ECHO_N "(cached) $ECHO_C" >&6
14371 else
14372
14373 cat >"conftest.$ac_ext" <<_ACEOF
14374 #line 14374 "configure"
14375 #include "confdefs.h"
14376
14377 #include <X11/Xlib.h>
14378
14379 int
14380 main (void)
14381 {
14382
14383         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14384         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14385         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14386         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14387
14388   ;
14389   return 0;
14390 }
14391 _ACEOF
14392 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14393 if { (eval echo "$as_me:14393: \"$ac_link\"") >&5
14394   (eval $ac_link) 2>&5
14395   ac_status=$?
14396   echo "$as_me:14396: \$? = $ac_status" >&5
14397   (exit "$ac_status"); } &&
14398          { ac_try='test -s "conftest$ac_exeext"'
14399   { (eval echo "$as_me:14399: \"$ac_try\"") >&5
14400   (eval $ac_try) 2>&5
14401   ac_status=$?
14402   echo "$as_me:14402: \$? = $ac_status" >&5
14403   (exit "$ac_status"); }; }; then
14404   cf_cv_xt_x11_compat=yes
14405 else
14406   echo "$as_me: failed program was:" >&5
14407 cat "conftest.$ac_ext" >&5
14408 cf_cv_xt_x11_compat=no
14409 fi
14410 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14411 fi
14412 echo "$as_me:14412: result: $cf_cv_xt_x11_compat" >&5
14413 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14414                 if test "$cf_cv_xt_x11_compat" = no
14415                 then
14416                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14417
14418 echo "${as_me:-configure}:14418: testing work around broken X11 dependency ..." 1>&5
14419
14420                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14421
14422 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14423         test -n "$verbose" && echo "    found package x11" 1>&6
14424
14425 echo "${as_me:-configure}:14425: testing found package x11 ..." 1>&5
14426
14427         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14428         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14429         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14430
14431 echo "${as_me:-configure}:14431: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14432
14433         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14434
14435 echo "${as_me:-configure}:14435: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14436
14437 cf_fix_cppflags=no
14438 cf_new_cflags=
14439 cf_new_cppflags=
14440 cf_new_extra_cppflags=
14441
14442 for cf_add_cflags in $cf_pkgconfig_incs
14443 do
14444 case "$cf_fix_cppflags" in
14445 (no)
14446         case "$cf_add_cflags" in
14447         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14448                 case "$cf_add_cflags" in
14449                 (-D*)
14450                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14451
14452                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14453                                 && test -z "${cf_tst_cflags}" \
14454                                 && cf_fix_cppflags=yes
14455
14456                         if test "$cf_fix_cppflags" = yes ; then
14457
14458         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14459         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14460
14461                                 continue
14462                         elif test "${cf_tst_cflags}" = "\"'" ; then
14463
14464         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14465         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14466
14467                                 continue
14468                         fi
14469                         ;;
14470                 esac
14471                 case "$CPPFLAGS" in
14472                 (*$cf_add_cflags)
14473                         ;;
14474                 (*)
14475                         case "$cf_add_cflags" in
14476                         (-D*)
14477                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14478
14479 CPPFLAGS=`echo "$CPPFLAGS" | \
14480         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14481                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14482
14483                                 ;;
14484                         esac
14485
14486         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14487         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14488
14489                         ;;
14490                 esac
14491                 ;;
14492         (*)
14493
14494         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14495         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14496
14497                 ;;
14498         esac
14499         ;;
14500 (yes)
14501
14502         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14503         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14504
14505         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14506
14507         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14508                 && test -z "${cf_tst_cflags}" \
14509                 && cf_fix_cppflags=no
14510         ;;
14511 esac
14512 done
14513
14514 if test -n "$cf_new_cflags" ; then
14515
14516         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14517         CFLAGS="${CFLAGS}$cf_new_cflags"
14518
14519 fi
14520
14521 if test -n "$cf_new_cppflags" ; then
14522
14523         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14524         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14525
14526 fi
14527
14528 if test -n "$cf_new_extra_cppflags" ; then
14529
14530         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14531         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14532
14533 fi
14534
14535 cf_add_libs="$LIBS"
14536 # reverse order
14537 cf_add_0lib=
14538 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14539 # filter duplicates
14540 for cf_add_1lib in $cf_add_0lib; do
14541         for cf_add_2lib in $cf_add_libs; do
14542                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14543                         cf_add_1lib=
14544                         break
14545                 fi
14546         done
14547         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14548 done
14549 LIBS="$cf_add_libs"
14550
14551         :
14552 else
14553         cf_pkgconfig_incs=
14554         cf_pkgconfig_libs=
14555
14556 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14557
14558 echo "${as_me:-configure}:14558: testing ...before $LIBS ..." 1>&5
14559
14560 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14561 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14562
14563 echo "${as_me:-configure}:14563: testing ...after  $LIBS ..." 1>&5
14564
14565 fi
14566
14567                 fi
14568                 ;;
14569         esac
14570
14571 echo "$as_me:14571: checking for usable X Toolkit package" >&5
14572 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14573 if test "${cf_cv_xt_ice_compat+set}" = set; then
14574   echo $ECHO_N "(cached) $ECHO_C" >&6
14575 else
14576
14577 cat >"conftest.$ac_ext" <<_ACEOF
14578 #line 14578 "configure"
14579 #include "confdefs.h"
14580
14581 #include <X11/Shell.h>
14582
14583 int
14584 main (void)
14585 {
14586 int num = IceConnectionNumber(0); (void) num
14587
14588   ;
14589   return 0;
14590 }
14591 _ACEOF
14592 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14593 if { (eval echo "$as_me:14593: \"$ac_link\"") >&5
14594   (eval $ac_link) 2>&5
14595   ac_status=$?
14596   echo "$as_me:14596: \$? = $ac_status" >&5
14597   (exit "$ac_status"); } &&
14598          { ac_try='test -s "conftest$ac_exeext"'
14599   { (eval echo "$as_me:14599: \"$ac_try\"") >&5
14600   (eval $ac_try) 2>&5
14601   ac_status=$?
14602   echo "$as_me:14602: \$? = $ac_status" >&5
14603   (exit "$ac_status"); }; }; then
14604   cf_cv_xt_ice_compat=yes
14605 else
14606   echo "$as_me: failed program was:" >&5
14607 cat "conftest.$ac_ext" >&5
14608 cf_cv_xt_ice_compat=no
14609 fi
14610 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14611 fi
14612 echo "$as_me:14612: result: $cf_cv_xt_ice_compat" >&5
14613 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14614
14615         if test "$cf_cv_xt_ice_compat" = no
14616         then
14617                 # workaround for broken ".pc" files used for X Toolkit.
14618                 case "x$X_PRE_LIBS" in
14619                 (*-lICE*)
14620                         case "x$LIBS" in
14621                         (*-lICE*)
14622                                 ;;
14623                         (*)
14624                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14625
14626 echo "${as_me:-configure}:14626: testing work around broken ICE dependency ..." 1>&5
14627
14628 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14629         test -n "$verbose" && echo "    found package ice" 1>&6
14630
14631 echo "${as_me:-configure}:14631: testing found package ice ..." 1>&5
14632
14633         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14634         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14635         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14636
14637 echo "${as_me:-configure}:14637: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14638
14639         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14640
14641 echo "${as_me:-configure}:14641: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14642
14643 cf_fix_cppflags=no
14644 cf_new_cflags=
14645 cf_new_cppflags=
14646 cf_new_extra_cppflags=
14647
14648 for cf_add_cflags in $cf_pkgconfig_incs
14649 do
14650 case "$cf_fix_cppflags" in
14651 (no)
14652         case "$cf_add_cflags" in
14653         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14654                 case "$cf_add_cflags" in
14655                 (-D*)
14656                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14657
14658                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14659                                 && test -z "${cf_tst_cflags}" \
14660                                 && cf_fix_cppflags=yes
14661
14662                         if test "$cf_fix_cppflags" = yes ; then
14663
14664         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14665         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14666
14667                                 continue
14668                         elif test "${cf_tst_cflags}" = "\"'" ; then
14669
14670         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14671         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14672
14673                                 continue
14674                         fi
14675                         ;;
14676                 esac
14677                 case "$CPPFLAGS" in
14678                 (*$cf_add_cflags)
14679                         ;;
14680                 (*)
14681                         case "$cf_add_cflags" in
14682                         (-D*)
14683                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14684
14685 CPPFLAGS=`echo "$CPPFLAGS" | \
14686         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14687                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14688
14689                                 ;;
14690                         esac
14691
14692         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14693         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14694
14695                         ;;
14696                 esac
14697                 ;;
14698         (*)
14699
14700         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14701         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14702
14703                 ;;
14704         esac
14705         ;;
14706 (yes)
14707
14708         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14709         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14710
14711         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14712
14713         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14714                 && test -z "${cf_tst_cflags}" \
14715                 && cf_fix_cppflags=no
14716         ;;
14717 esac
14718 done
14719
14720 if test -n "$cf_new_cflags" ; then
14721
14722         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14723         CFLAGS="${CFLAGS}$cf_new_cflags"
14724
14725 fi
14726
14727 if test -n "$cf_new_cppflags" ; then
14728
14729         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14730         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14731
14732 fi
14733
14734 if test -n "$cf_new_extra_cppflags" ; then
14735
14736         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14737         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14738
14739 fi
14740
14741 cf_add_libs="$LIBS"
14742 # reverse order
14743 cf_add_0lib=
14744 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14745 # filter duplicates
14746 for cf_add_1lib in $cf_add_0lib; do
14747         for cf_add_2lib in $cf_add_libs; do
14748                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14749                         cf_add_1lib=
14750                         break
14751                 fi
14752         done
14753         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14754 done
14755 LIBS="$cf_add_libs"
14756
14757 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14758         test -n "$verbose" && echo "    found package sm" 1>&6
14759
14760 echo "${as_me:-configure}:14760: testing found package sm ..." 1>&5
14761
14762         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14763         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14764         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14765
14766 echo "${as_me:-configure}:14766: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14767
14768         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14769
14770 echo "${as_me:-configure}:14770: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14771
14772 cf_fix_cppflags=no
14773 cf_new_cflags=
14774 cf_new_cppflags=
14775 cf_new_extra_cppflags=
14776
14777 for cf_add_cflags in $cf_pkgconfig_incs
14778 do
14779 case "$cf_fix_cppflags" in
14780 (no)
14781         case "$cf_add_cflags" in
14782         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14783                 case "$cf_add_cflags" in
14784                 (-D*)
14785                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14786
14787                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14788                                 && test -z "${cf_tst_cflags}" \
14789                                 && cf_fix_cppflags=yes
14790
14791                         if test "$cf_fix_cppflags" = yes ; then
14792
14793         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14794         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14795
14796                                 continue
14797                         elif test "${cf_tst_cflags}" = "\"'" ; then
14798
14799         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14800         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14801
14802                                 continue
14803                         fi
14804                         ;;
14805                 esac
14806                 case "$CPPFLAGS" in
14807                 (*$cf_add_cflags)
14808                         ;;
14809                 (*)
14810                         case "$cf_add_cflags" in
14811                         (-D*)
14812                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14813
14814 CPPFLAGS=`echo "$CPPFLAGS" | \
14815         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14816                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14817
14818                                 ;;
14819                         esac
14820
14821         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14822         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14823
14824                         ;;
14825                 esac
14826                 ;;
14827         (*)
14828
14829         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14830         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14831
14832                 ;;
14833         esac
14834         ;;
14835 (yes)
14836
14837         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14838         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14839
14840         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14841
14842         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14843                 && test -z "${cf_tst_cflags}" \
14844                 && cf_fix_cppflags=no
14845         ;;
14846 esac
14847 done
14848
14849 if test -n "$cf_new_cflags" ; then
14850
14851         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14852         CFLAGS="${CFLAGS}$cf_new_cflags"
14853
14854 fi
14855
14856 if test -n "$cf_new_cppflags" ; then
14857
14858         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14859         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14860
14861 fi
14862
14863 if test -n "$cf_new_extra_cppflags" ; then
14864
14865         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14866         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14867
14868 fi
14869
14870 cf_add_libs="$LIBS"
14871 # reverse order
14872 cf_add_0lib=
14873 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14874 # filter duplicates
14875 for cf_add_1lib in $cf_add_0lib; do
14876         for cf_add_2lib in $cf_add_libs; do
14877                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14878                         cf_add_1lib=
14879                         break
14880                 fi
14881         done
14882         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14883 done
14884 LIBS="$cf_add_libs"
14885
14886         :
14887 else
14888         cf_pkgconfig_incs=
14889         cf_pkgconfig_libs=
14890         :
14891 fi
14892
14893 else
14894         cf_pkgconfig_incs=
14895         cf_pkgconfig_libs=
14896
14897 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14898
14899 echo "${as_me:-configure}:14899: testing ...before $LIBS ..." 1>&5
14900
14901 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14902 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14903
14904 echo "${as_me:-configure}:14904: testing ...after  $LIBS ..." 1>&5
14905
14906 fi
14907
14908                                 ;;
14909                         esac
14910                         ;;
14911                 esac
14912         fi
14913
14914         cf_have_X_LIBS=yes
14915
14916 else
14917         cf_pkgconfig_incs=
14918         cf_pkgconfig_libs=
14919
14920         LDFLAGS="$X_LIBS $LDFLAGS"
14921
14922 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14923
14924 echo "${as_me:-configure}:14924: testing checking additions to CFLAGS ..." 1>&5
14925
14926 cf_check_cflags="$CFLAGS"
14927 cf_check_cppflags="$CPPFLAGS"
14928
14929 cf_fix_cppflags=no
14930 cf_new_cflags=
14931 cf_new_cppflags=
14932 cf_new_extra_cppflags=
14933
14934 for cf_add_cflags in $X_CFLAGS
14935 do
14936 case "$cf_fix_cppflags" in
14937 (no)
14938         case "$cf_add_cflags" in
14939         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14940                 case "$cf_add_cflags" in
14941                 (-D*)
14942                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14943
14944                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14945                                 && test -z "${cf_tst_cflags}" \
14946                                 && cf_fix_cppflags=yes
14947
14948                         if test "$cf_fix_cppflags" = yes ; then
14949
14950         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14951         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14952
14953                                 continue
14954                         elif test "${cf_tst_cflags}" = "\"'" ; then
14955
14956         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14957         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14958
14959                                 continue
14960                         fi
14961                         ;;
14962                 esac
14963                 case "$CPPFLAGS" in
14964                 (*$cf_add_cflags)
14965                         ;;
14966                 (*)
14967                         case "$cf_add_cflags" in
14968                         (-D*)
14969                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14970
14971 CPPFLAGS=`echo "$CPPFLAGS" | \
14972         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14973                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14974
14975                                 ;;
14976                         esac
14977
14978         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14979         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14980
14981                         ;;
14982                 esac
14983                 ;;
14984         (*)
14985
14986         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14987         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14988
14989                 ;;
14990         esac
14991         ;;
14992 (yes)
14993
14994         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14995         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14996
14997         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14998
14999         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15000                 && test -z "${cf_tst_cflags}" \
15001                 && cf_fix_cppflags=no
15002         ;;
15003 esac
15004 done
15005
15006 if test -n "$cf_new_cflags" ; then
15007         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15008
15009 echo "${as_me:-configure}:15009: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15010
15011         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15012         CFLAGS="${CFLAGS}$cf_new_cflags"
15013
15014 fi
15015
15016 if test -n "$cf_new_cppflags" ; then
15017         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15018
15019 echo "${as_me:-configure}:15019: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15020
15021         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15022         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15023
15024 fi
15025
15026 if test -n "$cf_new_extra_cppflags" ; then
15027         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15028
15029 echo "${as_me:-configure}:15029: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15030
15031         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15032         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15033
15034 fi
15035
15036 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15037 cat >"conftest.$ac_ext" <<_ACEOF
15038 #line 15038 "configure"
15039 #include "confdefs.h"
15040 #include <stdio.h>
15041 int
15042 main (void)
15043 {
15044 printf("Hello world");
15045   ;
15046   return 0;
15047 }
15048 _ACEOF
15049 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15050 if { (eval echo "$as_me:15050: \"$ac_link\"") >&5
15051   (eval $ac_link) 2>&5
15052   ac_status=$?
15053   echo "$as_me:15053: \$? = $ac_status" >&5
15054   (exit "$ac_status"); } &&
15055          { ac_try='test -s "conftest$ac_exeext"'
15056   { (eval echo "$as_me:15056: \"$ac_try\"") >&5
15057   (eval $ac_try) 2>&5
15058   ac_status=$?
15059   echo "$as_me:15059: \$? = $ac_status" >&5
15060   (exit "$ac_status"); }; }; then
15061   :
15062 else
15063   echo "$as_me: failed program was:" >&5
15064 cat "conftest.$ac_ext" >&5
15065 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15066
15067 echo "${as_me:-configure}:15067: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15068
15069          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15070                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15071
15072 echo "${as_me:-configure}:15072: testing but keeping change to \$CPPFLAGS ..." 1>&5
15073
15074          fi
15075          CFLAGS="$cf_check_cflags"
15076 fi
15077 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15078 fi
15079
15080         echo "$as_me:15080: checking for XOpenDisplay" >&5
15081 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15082 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15083   echo $ECHO_N "(cached) $ECHO_C" >&6
15084 else
15085   cat >"conftest.$ac_ext" <<_ACEOF
15086 #line 15086 "configure"
15087 #include "confdefs.h"
15088 #define XOpenDisplay autoconf_temporary
15089 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15090 #undef XOpenDisplay
15091
15092 #ifdef __cplusplus
15093 extern "C"
15094 #endif
15095
15096 /* We use char because int might match the return type of a gcc2
15097    builtin and then its argument prototype would still apply.  */
15098 char XOpenDisplay (void);
15099
15100 int
15101 main (void)
15102 {
15103
15104 /* The GNU C library defines stubs for functions which it implements
15105     to always fail with ENOSYS.  Some functions are actually named
15106     something starting with __ and the normal name is an alias.  */
15107 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15108 #error found stub for XOpenDisplay
15109 #endif
15110
15111         return XOpenDisplay ();
15112   ;
15113   return 0;
15114 }
15115 _ACEOF
15116 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15117 if { (eval echo "$as_me:15117: \"$ac_link\"") >&5
15118   (eval $ac_link) 2>&5
15119   ac_status=$?
15120   echo "$as_me:15120: \$? = $ac_status" >&5
15121   (exit "$ac_status"); } &&
15122          { ac_try='test -s "conftest$ac_exeext"'
15123   { (eval echo "$as_me:15123: \"$ac_try\"") >&5
15124   (eval $ac_try) 2>&5
15125   ac_status=$?
15126   echo "$as_me:15126: \$? = $ac_status" >&5
15127   (exit "$ac_status"); }; }; then
15128   ac_cv_func_XOpenDisplay=yes
15129 else
15130   echo "$as_me: failed program was:" >&5
15131 cat "conftest.$ac_ext" >&5
15132 ac_cv_func_XOpenDisplay=no
15133 fi
15134 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15135 fi
15136 echo "$as_me:15136: result: $ac_cv_func_XOpenDisplay" >&5
15137 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15138 if test "$ac_cv_func_XOpenDisplay" = yes; then
15139   :
15140 else
15141
15142         echo "$as_me:15142: checking for XOpenDisplay in -lX11" >&5
15143 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15144 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15145   echo $ECHO_N "(cached) $ECHO_C" >&6
15146 else
15147   ac_check_lib_save_LIBS=$LIBS
15148 LIBS="-lX11  $LIBS"
15149 cat >"conftest.$ac_ext" <<_ACEOF
15150 #line 15150 "configure"
15151 #include "confdefs.h"
15152
15153 /* Override any gcc2 internal prototype to avoid an error.  */
15154 #ifdef __cplusplus
15155 extern "C"
15156 #endif
15157 /* We use char because int might match the return type of a gcc2
15158    builtin and then its argument prototype would still apply.  */
15159 char XOpenDisplay ();
15160 int
15161 main (void)
15162 {
15163 XOpenDisplay ();
15164   ;
15165   return 0;
15166 }
15167 _ACEOF
15168 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15169 if { (eval echo "$as_me:15169: \"$ac_link\"") >&5
15170   (eval $ac_link) 2>&5
15171   ac_status=$?
15172   echo "$as_me:15172: \$? = $ac_status" >&5
15173   (exit "$ac_status"); } &&
15174          { ac_try='test -s "conftest$ac_exeext"'
15175   { (eval echo "$as_me:15175: \"$ac_try\"") >&5
15176   (eval $ac_try) 2>&5
15177   ac_status=$?
15178   echo "$as_me:15178: \$? = $ac_status" >&5
15179   (exit "$ac_status"); }; }; then
15180   ac_cv_lib_X11_XOpenDisplay=yes
15181 else
15182   echo "$as_me: failed program was:" >&5
15183 cat "conftest.$ac_ext" >&5
15184 ac_cv_lib_X11_XOpenDisplay=no
15185 fi
15186 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15187 LIBS=$ac_check_lib_save_LIBS
15188 fi
15189 echo "$as_me:15189: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15190 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15191 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15192
15193 cf_add_libs="$LIBS"
15194 # reverse order
15195 cf_add_0lib=
15196 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15197 # filter duplicates
15198 for cf_add_1lib in $cf_add_0lib; do
15199         for cf_add_2lib in $cf_add_libs; do
15200                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15201                         cf_add_1lib=
15202                         break
15203                 fi
15204         done
15205         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15206 done
15207 LIBS="$cf_add_libs"
15208
15209 fi
15210
15211 fi
15212
15213         echo "$as_me:15213: checking for XtAppInitialize" >&5
15214 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15215 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15216   echo $ECHO_N "(cached) $ECHO_C" >&6
15217 else
15218   cat >"conftest.$ac_ext" <<_ACEOF
15219 #line 15219 "configure"
15220 #include "confdefs.h"
15221 #define XtAppInitialize autoconf_temporary
15222 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15223 #undef XtAppInitialize
15224
15225 #ifdef __cplusplus
15226 extern "C"
15227 #endif
15228
15229 /* We use char because int might match the return type of a gcc2
15230    builtin and then its argument prototype would still apply.  */
15231 char XtAppInitialize (void);
15232
15233 int
15234 main (void)
15235 {
15236
15237 /* The GNU C library defines stubs for functions which it implements
15238     to always fail with ENOSYS.  Some functions are actually named
15239     something starting with __ and the normal name is an alias.  */
15240 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15241 #error found stub for XtAppInitialize
15242 #endif
15243
15244         return XtAppInitialize ();
15245   ;
15246   return 0;
15247 }
15248 _ACEOF
15249 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15250 if { (eval echo "$as_me:15250: \"$ac_link\"") >&5
15251   (eval $ac_link) 2>&5
15252   ac_status=$?
15253   echo "$as_me:15253: \$? = $ac_status" >&5
15254   (exit "$ac_status"); } &&
15255          { ac_try='test -s "conftest$ac_exeext"'
15256   { (eval echo "$as_me:15256: \"$ac_try\"") >&5
15257   (eval $ac_try) 2>&5
15258   ac_status=$?
15259   echo "$as_me:15259: \$? = $ac_status" >&5
15260   (exit "$ac_status"); }; }; then
15261   ac_cv_func_XtAppInitialize=yes
15262 else
15263   echo "$as_me: failed program was:" >&5
15264 cat "conftest.$ac_ext" >&5
15265 ac_cv_func_XtAppInitialize=no
15266 fi
15267 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15268 fi
15269 echo "$as_me:15269: result: $ac_cv_func_XtAppInitialize" >&5
15270 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15271 if test "$ac_cv_func_XtAppInitialize" = yes; then
15272   :
15273 else
15274
15275         echo "$as_me:15275: checking for XtAppInitialize in -lXt" >&5
15276 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15277 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15278   echo $ECHO_N "(cached) $ECHO_C" >&6
15279 else
15280   ac_check_lib_save_LIBS=$LIBS
15281 LIBS="-lXt  $LIBS"
15282 cat >"conftest.$ac_ext" <<_ACEOF
15283 #line 15283 "configure"
15284 #include "confdefs.h"
15285
15286 /* Override any gcc2 internal prototype to avoid an error.  */
15287 #ifdef __cplusplus
15288 extern "C"
15289 #endif
15290 /* We use char because int might match the return type of a gcc2
15291    builtin and then its argument prototype would still apply.  */
15292 char XtAppInitialize ();
15293 int
15294 main (void)
15295 {
15296 XtAppInitialize ();
15297   ;
15298   return 0;
15299 }
15300 _ACEOF
15301 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15302 if { (eval echo "$as_me:15302: \"$ac_link\"") >&5
15303   (eval $ac_link) 2>&5
15304   ac_status=$?
15305   echo "$as_me:15305: \$? = $ac_status" >&5
15306   (exit "$ac_status"); } &&
15307          { ac_try='test -s "conftest$ac_exeext"'
15308   { (eval echo "$as_me:15308: \"$ac_try\"") >&5
15309   (eval $ac_try) 2>&5
15310   ac_status=$?
15311   echo "$as_me:15311: \$? = $ac_status" >&5
15312   (exit "$ac_status"); }; }; then
15313   ac_cv_lib_Xt_XtAppInitialize=yes
15314 else
15315   echo "$as_me: failed program was:" >&5
15316 cat "conftest.$ac_ext" >&5
15317 ac_cv_lib_Xt_XtAppInitialize=no
15318 fi
15319 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15320 LIBS=$ac_check_lib_save_LIBS
15321 fi
15322 echo "$as_me:15322: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15323 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15324 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15325
15326 cat >>confdefs.h <<\EOF
15327 #define HAVE_LIBXT 1
15328 EOF
15329
15330                  cf_have_X_LIBS=Xt
15331                  LIBS="-lXt $LIBS"
15332 fi
15333
15334 fi
15335
15336 fi
15337
15338 if test "$cf_have_X_LIBS" = no ; then
15339         { echo "$as_me:15339: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15340 test program.  You will have to check and add the proper libraries by hand
15341 to makefile." >&5
15342 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15343 test program.  You will have to check and add the proper libraries by hand
15344 to makefile." >&2;}
15345 fi
15346
15347 cf_x_athena_root=$cf_x_athena
15348 cf_x_athena_inc=""
15349
15350 for cf_path in default \
15351         /usr/contrib/X11R6 \
15352         /usr/contrib/X11R5 \
15353         /usr/lib/X11R5 \
15354         /usr/local
15355 do
15356         if test -z "$cf_x_athena_inc" ; then
15357
15358 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15359 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15360 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15361 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15362 for cf_X_CFLAGS in $X_CFLAGS
15363 do
15364         case "x$cf_X_CFLAGS" in
15365         x-[IUD]*)
15366                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15367                 ;;
15368         *)
15369                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15370                 ;;
15371         esac
15372 done
15373
15374                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15375                 if test "$cf_path" != default ; then
15376
15377         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15378         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15379
15380                         echo "$as_me:15380: checking for $cf_test in $cf_path" >&5
15381 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15382                 else
15383                         echo "$as_me:15383: checking for $cf_test" >&5
15384 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15385                 fi
15386                 cat >"conftest.$ac_ext" <<_ACEOF
15387 #line 15387 "configure"
15388 #include "confdefs.h"
15389
15390 #include <X11/Intrinsic.h>
15391 #include <$cf_test>
15392 int
15393 main (void)
15394 {
15395
15396   ;
15397   return 0;
15398 }
15399 _ACEOF
15400 rm -f "conftest.$ac_objext"
15401 if { (eval echo "$as_me:15401: \"$ac_compile\"") >&5
15402   (eval $ac_compile) 2>&5
15403   ac_status=$?
15404   echo "$as_me:15404: \$? = $ac_status" >&5
15405   (exit "$ac_status"); } &&
15406          { ac_try='test -s "conftest.$ac_objext"'
15407   { (eval echo "$as_me:15407: \"$ac_try\"") >&5
15408   (eval $ac_try) 2>&5
15409   ac_status=$?
15410   echo "$as_me:15410: \$? = $ac_status" >&5
15411   (exit "$ac_status"); }; }; then
15412   cf_result=yes
15413 else
15414   echo "$as_me: failed program was:" >&5
15415 cat "conftest.$ac_ext" >&5
15416 cf_result=no
15417 fi
15418 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15419                 echo "$as_me:15419: result: $cf_result" >&5
15420 echo "${ECHO_T}$cf_result" >&6
15421
15422 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15423 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15424 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15425
15426                 if test "$cf_result" = yes ; then
15427                         test "$cf_path"  = default && cf_x_athena_inc=default
15428                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15429                         break
15430                 fi
15431         fi
15432 done
15433
15434 if test -z "$cf_x_athena_inc" ; then
15435         { echo "$as_me:15435: WARNING: Unable to find Athena header files" >&5
15436 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15437 elif test "$cf_x_athena_inc" != default ; then
15438
15439         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15440         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15441
15442 fi
15443
15444 cf_x_athena_root=$cf_x_athena
15445 cf_x_athena_lib=""
15446
15447 for cf_path in default \
15448         /usr/contrib/X11R6 \
15449         /usr/contrib/X11R5 \
15450         /usr/lib/X11R5 \
15451         /usr/local
15452 do
15453         for cf_lib in \
15454                 ${cf_x_athena_root} \
15455                 ${cf_x_athena_root}7 \
15456                 ${cf_x_athena_root}6
15457         do
15458         for cf_libs in \
15459                 "-l$cf_lib -lXmu" \
15460                 "-l$cf_lib -lXpm -lXmu" \
15461                 "-l${cf_lib}_s -lXmu_s"
15462         do
15463                 test -n "$cf_x_athena_lib" && break
15464
15465 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15466 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15467 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15468 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15469 for cf_X_CFLAGS in $X_CFLAGS
15470 do
15471         case "x$cf_X_CFLAGS" in
15472         x-[IUD]*)
15473                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15474                 ;;
15475         *)
15476                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15477                 ;;
15478         esac
15479 done
15480
15481                 cf_test=XawSimpleMenuAddGlobalActions
15482                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15483
15484 cf_add_libs="$LIBS"
15485 # reverse order
15486 cf_add_0lib=
15487 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15488 # filter duplicates
15489 for cf_add_1lib in $cf_add_0lib; do
15490         for cf_add_2lib in $cf_add_libs; do
15491                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15492                         cf_add_1lib=
15493                         break
15494                 fi
15495         done
15496         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15497 done
15498 LIBS="$cf_add_libs"
15499
15500                 echo "$as_me:15500: checking for $cf_test in $cf_libs" >&5
15501 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15502                 cat >"conftest.$ac_ext" <<_ACEOF
15503 #line 15503 "configure"
15504 #include "confdefs.h"
15505
15506 #include <X11/Intrinsic.h>
15507 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15508
15509 int
15510 main (void)
15511 {
15512
15513 $cf_test((XtAppContext) 0)
15514   ;
15515   return 0;
15516 }
15517 _ACEOF
15518 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15519 if { (eval echo "$as_me:15519: \"$ac_link\"") >&5
15520   (eval $ac_link) 2>&5
15521   ac_status=$?
15522   echo "$as_me:15522: \$? = $ac_status" >&5
15523   (exit "$ac_status"); } &&
15524          { ac_try='test -s "conftest$ac_exeext"'
15525   { (eval echo "$as_me:15525: \"$ac_try\"") >&5
15526   (eval $ac_try) 2>&5
15527   ac_status=$?
15528   echo "$as_me:15528: \$? = $ac_status" >&5
15529   (exit "$ac_status"); }; }; then
15530   cf_result=yes
15531 else
15532   echo "$as_me: failed program was:" >&5
15533 cat "conftest.$ac_ext" >&5
15534 cf_result=no
15535 fi
15536 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15537                 echo "$as_me:15537: result: $cf_result" >&5
15538 echo "${ECHO_T}$cf_result" >&6
15539
15540 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15541 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15542 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15543
15544                 if test "$cf_result" = yes ; then
15545                         cf_x_athena_lib="$cf_libs"
15546                         break
15547                 fi
15548         done # cf_libs
15549                 test -n "$cf_x_athena_lib" && break
15550         done # cf_lib
15551 done
15552
15553 if test -z "$cf_x_athena_lib" ; then
15554         { { echo "$as_me:15554: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15555 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15556    { (exit 1); exit 1; }; }
15557 fi
15558
15559 cf_add_libs="$LIBS"
15560 # reverse order
15561 cf_add_0lib=
15562 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15563 # filter duplicates
15564 for cf_add_1lib in $cf_add_0lib; do
15565         for cf_add_2lib in $cf_add_libs; do
15566                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15567                         cf_add_1lib=
15568                         break
15569                 fi
15570         done
15571         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15572 done
15573 LIBS="$cf_add_libs"
15574
15575 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15576
15577 cat >>confdefs.h <<EOF
15578 #define $cf_x_athena_LIBS 1
15579 EOF
15580
15581 fi
15582
15583 if test -n "$ac_tool_prefix"; then
15584   for ac_prog in xcurses-config
15585   do
15586     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15587 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15588 echo "$as_me:15588: checking for $ac_word" >&5
15589 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15590 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15591   echo $ECHO_N "(cached) $ECHO_C" >&6
15592 else
15593   if test -n "$XCURSES_CONFIG"; then
15594   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15595 else
15596   ac_save_IFS=$IFS; IFS=$ac_path_separator
15597 ac_dummy="$PATH"
15598 for ac_dir in $ac_dummy; do
15599   IFS=$ac_save_IFS
15600   test -z "$ac_dir" && ac_dir=.
15601   $as_executable_p "$ac_dir/$ac_word" || continue
15602 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15603 echo "$as_me:15603: found $ac_dir/$ac_word" >&5
15604 break
15605 done
15606
15607 fi
15608 fi
15609 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15610 if test -n "$XCURSES_CONFIG"; then
15611   echo "$as_me:15611: result: $XCURSES_CONFIG" >&5
15612 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15613 else
15614   echo "$as_me:15614: result: no" >&5
15615 echo "${ECHO_T}no" >&6
15616 fi
15617
15618     test -n "$XCURSES_CONFIG" && break
15619   done
15620 fi
15621 if test -z "$XCURSES_CONFIG"; then
15622   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15623   for ac_prog in xcurses-config
15624 do
15625   # Extract the first word of "$ac_prog", so it can be a program name with args.
15626 set dummy $ac_prog; ac_word=$2
15627 echo "$as_me:15627: checking for $ac_word" >&5
15628 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15629 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15630   echo $ECHO_N "(cached) $ECHO_C" >&6
15631 else
15632   if test -n "$ac_ct_XCURSES_CONFIG"; then
15633   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15634 else
15635   ac_save_IFS=$IFS; IFS=$ac_path_separator
15636 ac_dummy="$PATH"
15637 for ac_dir in $ac_dummy; do
15638   IFS=$ac_save_IFS
15639   test -z "$ac_dir" && ac_dir=.
15640   $as_executable_p "$ac_dir/$ac_word" || continue
15641 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15642 echo "$as_me:15642: found $ac_dir/$ac_word" >&5
15643 break
15644 done
15645
15646 fi
15647 fi
15648 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15649 if test -n "$ac_ct_XCURSES_CONFIG"; then
15650   echo "$as_me:15650: result: $ac_ct_XCURSES_CONFIG" >&5
15651 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15652 else
15653   echo "$as_me:15653: result: no" >&5
15654 echo "${ECHO_T}no" >&6
15655 fi
15656
15657   test -n "$ac_ct_XCURSES_CONFIG" && break
15658 done
15659 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15660
15661   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15662 fi
15663
15664 if test "$XCURSES_CONFIG" != none ; then
15665
15666 cf_fix_cppflags=no
15667 cf_new_cflags=
15668 cf_new_cppflags=
15669 cf_new_extra_cppflags=
15670
15671 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15672 do
15673 case "$cf_fix_cppflags" in
15674 (no)
15675         case "$cf_add_cflags" in
15676         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15677                 case "$cf_add_cflags" in
15678                 (-D*)
15679                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15680
15681                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15682                                 && test -z "${cf_tst_cflags}" \
15683                                 && cf_fix_cppflags=yes
15684
15685                         if test "$cf_fix_cppflags" = yes ; then
15686
15687         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15688         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15689
15690                                 continue
15691                         elif test "${cf_tst_cflags}" = "\"'" ; then
15692
15693         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15694         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15695
15696                                 continue
15697                         fi
15698                         ;;
15699                 esac
15700                 case "$CPPFLAGS" in
15701                 (*$cf_add_cflags)
15702                         ;;
15703                 (*)
15704                         case "$cf_add_cflags" in
15705                         (-D*)
15706                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15707
15708 CPPFLAGS=`echo "$CPPFLAGS" | \
15709         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15710                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15711
15712                                 ;;
15713                         esac
15714
15715         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15716         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15717
15718                         ;;
15719                 esac
15720                 ;;
15721         (*)
15722
15723         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15724         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15725
15726                 ;;
15727         esac
15728         ;;
15729 (yes)
15730
15731         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15732         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15733
15734         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15735
15736         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15737                 && test -z "${cf_tst_cflags}" \
15738                 && cf_fix_cppflags=no
15739         ;;
15740 esac
15741 done
15742
15743 if test -n "$cf_new_cflags" ; then
15744
15745         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15746         CFLAGS="${CFLAGS}$cf_new_cflags"
15747
15748 fi
15749
15750 if test -n "$cf_new_cppflags" ; then
15751
15752         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15753         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15754
15755 fi
15756
15757 if test -n "$cf_new_extra_cppflags" ; then
15758
15759         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15760         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15761
15762 fi
15763
15764 cf_add_libs="$LIBS"
15765 # reverse order
15766 cf_add_0lib=
15767 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15768 # filter duplicates
15769 for cf_add_1lib in $cf_add_0lib; do
15770         for cf_add_2lib in $cf_add_libs; do
15771                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15772                         cf_add_1lib=
15773                         break
15774                 fi
15775         done
15776         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15777 done
15778 LIBS="$cf_add_libs"
15779
15780 cf_cv_lib_XCurses=yes
15781
15782 else
15783
15784 LDFLAGS="$LDFLAGS $X_LIBS"
15785
15786 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15787
15788 echo "${as_me:-configure}:15788: testing checking additions to CFLAGS ..." 1>&5
15789
15790 cf_check_cflags="$CFLAGS"
15791 cf_check_cppflags="$CPPFLAGS"
15792
15793 cf_fix_cppflags=no
15794 cf_new_cflags=
15795 cf_new_cppflags=
15796 cf_new_extra_cppflags=
15797
15798 for cf_add_cflags in $X_CFLAGS
15799 do
15800 case "$cf_fix_cppflags" in
15801 (no)
15802         case "$cf_add_cflags" in
15803         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15804                 case "$cf_add_cflags" in
15805                 (-D*)
15806                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15807
15808                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15809                                 && test -z "${cf_tst_cflags}" \
15810                                 && cf_fix_cppflags=yes
15811
15812                         if test "$cf_fix_cppflags" = yes ; then
15813
15814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15816
15817                                 continue
15818                         elif test "${cf_tst_cflags}" = "\"'" ; then
15819
15820         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15821         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15822
15823                                 continue
15824                         fi
15825                         ;;
15826                 esac
15827                 case "$CPPFLAGS" in
15828                 (*$cf_add_cflags)
15829                         ;;
15830                 (*)
15831                         case "$cf_add_cflags" in
15832                         (-D*)
15833                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15834
15835 CPPFLAGS=`echo "$CPPFLAGS" | \
15836         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15837                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15838
15839                                 ;;
15840                         esac
15841
15842         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15843         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15844
15845                         ;;
15846                 esac
15847                 ;;
15848         (*)
15849
15850         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15851         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15852
15853                 ;;
15854         esac
15855         ;;
15856 (yes)
15857
15858         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15859         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15860
15861         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15862
15863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15864                 && test -z "${cf_tst_cflags}" \
15865                 && cf_fix_cppflags=no
15866         ;;
15867 esac
15868 done
15869
15870 if test -n "$cf_new_cflags" ; then
15871         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15872
15873 echo "${as_me:-configure}:15873: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15874
15875         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15876         CFLAGS="${CFLAGS}$cf_new_cflags"
15877
15878 fi
15879
15880 if test -n "$cf_new_cppflags" ; then
15881         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15882
15883 echo "${as_me:-configure}:15883: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15884
15885         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15886         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15887
15888 fi
15889
15890 if test -n "$cf_new_extra_cppflags" ; then
15891         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15892
15893 echo "${as_me:-configure}:15893: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15894
15895         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15896         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15897
15898 fi
15899
15900 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15901 cat >"conftest.$ac_ext" <<_ACEOF
15902 #line 15902 "configure"
15903 #include "confdefs.h"
15904 #include <stdio.h>
15905 int
15906 main (void)
15907 {
15908 printf("Hello world");
15909   ;
15910   return 0;
15911 }
15912 _ACEOF
15913 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15914 if { (eval echo "$as_me:15914: \"$ac_link\"") >&5
15915   (eval $ac_link) 2>&5
15916   ac_status=$?
15917   echo "$as_me:15917: \$? = $ac_status" >&5
15918   (exit "$ac_status"); } &&
15919          { ac_try='test -s "conftest$ac_exeext"'
15920   { (eval echo "$as_me:15920: \"$ac_try\"") >&5
15921   (eval $ac_try) 2>&5
15922   ac_status=$?
15923   echo "$as_me:15923: \$? = $ac_status" >&5
15924   (exit "$ac_status"); }; }; then
15925   :
15926 else
15927   echo "$as_me: failed program was:" >&5
15928 cat "conftest.$ac_ext" >&5
15929 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15930
15931 echo "${as_me:-configure}:15931: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15932
15933          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15934                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15935
15936 echo "${as_me:-configure}:15936: testing but keeping change to \$CPPFLAGS ..." 1>&5
15937
15938          fi
15939          CFLAGS="$cf_check_cflags"
15940 fi
15941 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15942 fi
15943
15944 echo "$as_me:15944: checking for XOpenDisplay in -lX11" >&5
15945 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15946 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15947   echo $ECHO_N "(cached) $ECHO_C" >&6
15948 else
15949   ac_check_lib_save_LIBS=$LIBS
15950 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15951 cat >"conftest.$ac_ext" <<_ACEOF
15952 #line 15952 "configure"
15953 #include "confdefs.h"
15954
15955 /* Override any gcc2 internal prototype to avoid an error.  */
15956 #ifdef __cplusplus
15957 extern "C"
15958 #endif
15959 /* We use char because int might match the return type of a gcc2
15960    builtin and then its argument prototype would still apply.  */
15961 char XOpenDisplay ();
15962 int
15963 main (void)
15964 {
15965 XOpenDisplay ();
15966   ;
15967   return 0;
15968 }
15969 _ACEOF
15970 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15971 if { (eval echo "$as_me:15971: \"$ac_link\"") >&5
15972   (eval $ac_link) 2>&5
15973   ac_status=$?
15974   echo "$as_me:15974: \$? = $ac_status" >&5
15975   (exit "$ac_status"); } &&
15976          { ac_try='test -s "conftest$ac_exeext"'
15977   { (eval echo "$as_me:15977: \"$ac_try\"") >&5
15978   (eval $ac_try) 2>&5
15979   ac_status=$?
15980   echo "$as_me:15980: \$? = $ac_status" >&5
15981   (exit "$ac_status"); }; }; then
15982   ac_cv_lib_X11_XOpenDisplay=yes
15983 else
15984   echo "$as_me: failed program was:" >&5
15985 cat "conftest.$ac_ext" >&5
15986 ac_cv_lib_X11_XOpenDisplay=no
15987 fi
15988 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15989 LIBS=$ac_check_lib_save_LIBS
15990 fi
15991 echo "$as_me:15991: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15992 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15993 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15994
15995 cf_add_libs="$LIBS"
15996 # reverse order
15997 cf_add_0lib=
15998 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15999 # filter duplicates
16000 for cf_add_1lib in $cf_add_0lib; do
16001         for cf_add_2lib in $cf_add_libs; do
16002                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16003                         cf_add_1lib=
16004                         break
16005                 fi
16006         done
16007         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16008 done
16009 LIBS="$cf_add_libs"
16010
16011 fi
16012
16013 echo "$as_me:16013: checking for XCurses library" >&5
16014 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16015 if test "${cf_cv_lib_XCurses+set}" = set; then
16016   echo $ECHO_N "(cached) $ECHO_C" >&6
16017 else
16018
16019 cf_add_libs="$LIBS"
16020 # reverse order
16021 cf_add_0lib=
16022 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16023 # filter duplicates
16024 for cf_add_1lib in $cf_add_0lib; do
16025         for cf_add_2lib in $cf_add_libs; do
16026                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16027                         cf_add_1lib=
16028                         break
16029                 fi
16030         done
16031         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16032 done
16033 LIBS="$cf_add_libs"
16034
16035 cat >"conftest.$ac_ext" <<_ACEOF
16036 #line 16036 "configure"
16037 #include "confdefs.h"
16038
16039 #include <xcurses.h>
16040 char *XCursesProgramName = "test";
16041
16042 int
16043 main (void)
16044 {
16045 XCursesExit();
16046   ;
16047   return 0;
16048 }
16049 _ACEOF
16050 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16051 if { (eval echo "$as_me:16051: \"$ac_link\"") >&5
16052   (eval $ac_link) 2>&5
16053   ac_status=$?
16054   echo "$as_me:16054: \$? = $ac_status" >&5
16055   (exit "$ac_status"); } &&
16056          { ac_try='test -s "conftest$ac_exeext"'
16057   { (eval echo "$as_me:16057: \"$ac_try\"") >&5
16058   (eval $ac_try) 2>&5
16059   ac_status=$?
16060   echo "$as_me:16060: \$? = $ac_status" >&5
16061   (exit "$ac_status"); }; }; then
16062   cf_cv_lib_XCurses=yes
16063 else
16064   echo "$as_me: failed program was:" >&5
16065 cat "conftest.$ac_ext" >&5
16066 cf_cv_lib_XCurses=no
16067 fi
16068 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16069
16070 fi
16071 echo "$as_me:16071: result: $cf_cv_lib_XCurses" >&5
16072 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16073
16074 fi
16075
16076 if test "$cf_cv_lib_XCurses" = yes ; then
16077
16078 cat >>confdefs.h <<\EOF
16079 #define UNIX 1
16080 EOF
16081
16082 cat >>confdefs.h <<\EOF
16083 #define XCURSES 1
16084 EOF
16085
16086         echo "$as_me:16086: checking for xcurses.h" >&5
16087 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16088 if test "${ac_cv_header_xcurses_h+set}" = set; then
16089   echo $ECHO_N "(cached) $ECHO_C" >&6
16090 else
16091   cat >"conftest.$ac_ext" <<_ACEOF
16092 #line 16092 "configure"
16093 #include "confdefs.h"
16094 #include <xcurses.h>
16095 _ACEOF
16096 if { (eval echo "$as_me:16096: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16097   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16098   ac_status=$?
16099   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16100   rm -f conftest.er1
16101   cat conftest.err >&5
16102   echo "$as_me:16102: \$? = $ac_status" >&5
16103   (exit "$ac_status"); } >/dev/null; then
16104   if test -s conftest.err; then
16105     ac_cpp_err=$ac_c_preproc_warn_flag
16106   else
16107     ac_cpp_err=
16108   fi
16109 else
16110   ac_cpp_err=yes
16111 fi
16112 if test -z "$ac_cpp_err"; then
16113   ac_cv_header_xcurses_h=yes
16114 else
16115   echo "$as_me: failed program was:" >&5
16116   cat "conftest.$ac_ext" >&5
16117   ac_cv_header_xcurses_h=no
16118 fi
16119 rm -f conftest.err "conftest.$ac_ext"
16120 fi
16121 echo "$as_me:16121: result: $ac_cv_header_xcurses_h" >&5
16122 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16123 if test "$ac_cv_header_xcurses_h" = yes; then
16124
16125 cat >>confdefs.h <<\EOF
16126 #define HAVE_XCURSES 1
16127 EOF
16128
16129 fi
16130
16131 else
16132         { { echo "$as_me:16132: error: Cannot link with XCurses" >&5
16133 echo "$as_me: error: Cannot link with XCurses" >&2;}
16134    { (exit 1); exit 1; }; }
16135 fi
16136
16137         ;;
16138 (*)
16139         { { echo "$as_me:16139: error: unexpected screen-value: $cf_cv_screen" >&5
16140 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16141    { (exit 1); exit 1; }; }
16142         ;;
16143 esac
16144
16145 : ${cf_nculib_root:=$cf_cv_screen}
16146 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16147 echo "$as_me:16147: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16148 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16149 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16150   echo $ECHO_N "(cached) $ECHO_C" >&6
16151 else
16152   ac_check_lib_save_LIBS=$LIBS
16153 LIBS="-l$cf_nculib_root  $LIBS"
16154 cat >"conftest.$ac_ext" <<_ACEOF
16155 #line 16155 "configure"
16156 #include "confdefs.h"
16157
16158 /* Override any gcc2 internal prototype to avoid an error.  */
16159 #ifdef __cplusplus
16160 extern "C"
16161 #endif
16162 /* We use char because int might match the return type of a gcc2
16163    builtin and then its argument prototype would still apply.  */
16164 char _nc_init_pthreads ();
16165 int
16166 main (void)
16167 {
16168 _nc_init_pthreads ();
16169   ;
16170   return 0;
16171 }
16172 _ACEOF
16173 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16174 if { (eval echo "$as_me:16174: \"$ac_link\"") >&5
16175   (eval $ac_link) 2>&5
16176   ac_status=$?
16177   echo "$as_me:16177: \$? = $ac_status" >&5
16178   (exit "$ac_status"); } &&
16179          { ac_try='test -s "conftest$ac_exeext"'
16180   { (eval echo "$as_me:16180: \"$ac_try\"") >&5
16181   (eval $ac_try) 2>&5
16182   ac_status=$?
16183   echo "$as_me:16183: \$? = $ac_status" >&5
16184   (exit "$ac_status"); }; }; then
16185   eval "$as_ac_Lib=yes"
16186 else
16187   echo "$as_me: failed program was:" >&5
16188 cat "conftest.$ac_ext" >&5
16189 eval "$as_ac_Lib=no"
16190 fi
16191 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16192 LIBS=$ac_check_lib_save_LIBS
16193 fi
16194 echo "$as_me:16194: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16195 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16196 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16197   cf_cv_ncurses_pthreads=yes
16198 else
16199   cf_cv_ncurses_pthreads=no
16200 fi
16201
16202 if test "$cf_cv_ncurses_pthreads" = yes
16203 then
16204
16205 cf_add_libs="$LIBS"
16206 # reverse order
16207 cf_add_0lib=
16208 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16209 # filter duplicates
16210 for cf_add_1lib in $cf_add_0lib; do
16211         for cf_add_2lib in $cf_add_libs; do
16212                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16213                         cf_add_1lib=
16214                         break
16215                 fi
16216         done
16217         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16218 done
16219 LIBS="$cf_add_libs"
16220
16221 fi
16222
16223 case $cf_cv_screen in
16224 (ncurses*)
16225         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16226         ;;
16227 esac
16228
16229 echo "$as_me:16229: checking for X11 rgb file" >&5
16230 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16231
16232 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16233 if test "${with_x11_rgb+set}" = set; then
16234   withval="$with_x11_rgb"
16235   RGB_PATH=$withval
16236 else
16237   RGB_PATH=auto
16238 fi;
16239
16240 if test "x$RGB_PATH" = xauto
16241 then
16242         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16243         for cf_path in \
16244                 /opt/local/share/X11/rgb.txt \
16245                 /opt/X11/share/X11/rgb.txt \
16246                 /usr/share/X11/rgb.txt \
16247                 /usr/X11/share/X11/rgb.txt \
16248                 /usr/X11/lib/X11/rgb.txt \
16249                 /usr/lib/X11/rgb.txt \
16250                 /etc/X11/rgb.txt \
16251                 /usr/pkg/lib/X11/rgb.txt \
16252                 /usr/X11R7/lib/X11/rgb.txt \
16253                 /usr/X11R6/lib/X11/rgb.txt \
16254                 /usr/X11R5/lib/X11/rgb.txt \
16255                 /usr/X11R4/lib/X11/rgb.txt \
16256                 /usr/local/lib/X11/rgb.txt \
16257                 /usr/local/share/X11/rgb.txt \
16258                 /usr/lib64/X11/rgb.txt
16259         do
16260                 if test -f "$cf_path" ; then
16261                         RGB_PATH="$cf_path"
16262                         break
16263                 fi
16264         done
16265 else
16266         cf_path=$RGB_PATH
16267
16268 if test "x$prefix" != xNONE; then
16269         cf_path_syntax="$prefix"
16270 else
16271         cf_path_syntax="$ac_default_prefix"
16272 fi
16273
16274 case ".$cf_path" in
16275 (.\$\(*\)*|.\'*\'*)
16276         ;;
16277 (..|./*|.\\*)
16278         ;;
16279 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16280         ;;
16281 (.\$\{*prefix\}*|.\$\{*dir\}*)
16282         eval cf_path="$cf_path"
16283         case ".$cf_path" in
16284         (.NONE/*)
16285                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16286                 ;;
16287         esac
16288         ;;
16289 (.no|.NONE/*)
16290         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16291         ;;
16292 (*)
16293         { { echo "$as_me:16293: error: expected a pathname, not \"$cf_path\"" >&5
16294 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16295    { (exit 1); exit 1; }; }
16296         ;;
16297 esac
16298
16299 fi
16300
16301 echo "$as_me:16301: result: $RGB_PATH" >&5
16302 echo "${ECHO_T}$RGB_PATH" >&6
16303
16304 cat >>confdefs.h <<EOF
16305 #define RGB_PATH "$cf_path"
16306 EOF
16307
16308 no_x11_rgb=
16309 if test "$RGB_PATH" = no
16310 then
16311         no_x11_rgb="#"
16312 fi
16313
16314 cf_curses_headers=
16315
16316 case $cf_cv_screen in
16317 (pdcurses)
16318         cf_default_panel=no
16319         cf_default_form=no
16320         cf_default_menu=no
16321         cf_default_tinfo=no
16322         ;;
16323 (xcurses|bsdcurses)
16324         cf_default_panel=no
16325         cf_default_form=no
16326         cf_default_menu=no
16327         cf_default_tinfo=yes
16328         ;;
16329 (*)
16330         cf_default_panel=yes
16331         cf_default_form=yes
16332         cf_default_menu=yes
16333         cf_default_tinfo=yes
16334         case $cf_cv_screen in
16335         (ncurses*)
16336                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16337                 ;;
16338         esac
16339         ;;
16340 esac
16341
16342 echo "$as_me:16342: checking for desired basename for form library" >&5
16343 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16344
16345 # Check whether --with-form-libname or --without-form-libname was given.
16346 if test "${with_form_libname+set}" = set; then
16347   withval="$with_form_libname"
16348   with_lib_basename=$withval
16349 else
16350   with_lib_basename=form
16351 fi;
16352 FORM_NAME="$with_lib_basename"
16353
16354 case "x$FORM_NAME" in
16355 (x|xno|xnone|xyes)
16356         FORM_NAME=form
16357         ;;
16358 (*)
16359         ;;
16360 esac
16361
16362 echo "$as_me:16362: result: $FORM_NAME" >&5
16363 echo "${ECHO_T}$FORM_NAME" >&6
16364
16365 echo "$as_me:16365: checking for desired basename for menu library" >&5
16366 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16367
16368 # Check whether --with-menu-libname or --without-menu-libname was given.
16369 if test "${with_menu_libname+set}" = set; then
16370   withval="$with_menu_libname"
16371   with_lib_basename=$withval
16372 else
16373   with_lib_basename=menu
16374 fi;
16375 MENU_NAME="$with_lib_basename"
16376
16377 case "x$MENU_NAME" in
16378 (x|xno|xnone|xyes)
16379         MENU_NAME=menu
16380         ;;
16381 (*)
16382         ;;
16383 esac
16384
16385 echo "$as_me:16385: result: $MENU_NAME" >&5
16386 echo "${ECHO_T}$MENU_NAME" >&6
16387
16388 echo "$as_me:16388: checking for desired basename for panel library" >&5
16389 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16390
16391 # Check whether --with-panel-libname or --without-panel-libname was given.
16392 if test "${with_panel_libname+set}" = set; then
16393   withval="$with_panel_libname"
16394   with_lib_basename=$withval
16395 else
16396   with_lib_basename=panel
16397 fi;
16398 PANEL_NAME="$with_lib_basename"
16399
16400 case "x$PANEL_NAME" in
16401 (x|xno|xnone|xyes)
16402         PANEL_NAME=panel
16403         ;;
16404 (*)
16405         ;;
16406 esac
16407
16408 echo "$as_me:16408: result: $PANEL_NAME" >&5
16409 echo "${ECHO_T}$PANEL_NAME" >&6
16410
16411 echo "$as_me:16411: checking if you want to check for panel functions" >&5
16412 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16413
16414 # Check whether --enable-panel or --disable-panel was given.
16415 if test "${enable_panel+set}" = set; then
16416   enableval="$enable_panel"
16417   test "$enableval" != no && enableval=yes
16418         if test "$enableval" != "yes" ; then
16419     cf_enable_panel=no
16420         else
16421                 cf_enable_panel=$cf_default_panel
16422         fi
16423 else
16424   enableval=yes
16425         cf_enable_panel=$cf_default_panel
16426
16427 fi;
16428 echo "$as_me:16428: result: $cf_enable_panel" >&5
16429 echo "${ECHO_T}$cf_enable_panel" >&6
16430 if test $cf_enable_panel = yes
16431 then
16432
16433 cf_have_curses_lib=no
16434
16435 : ${NCURSES_CONFIG_PKG:=none}
16436 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16437         :
16438 elif test "x${PKG_CONFIG:=none}" != xnone; then
16439         echo "$as_me:16439: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16440 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16441         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16442                 echo "$as_me:16442: result: yes" >&5
16443 echo "${ECHO_T}yes" >&6
16444
16445                 echo "$as_me:16445: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16446 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16447
16448                 cf_save_CPPFLAGS="$CPPFLAGS"
16449                 cf_save_LIBS="$LIBS"
16450
16451 cf_fix_cppflags=no
16452 cf_new_cflags=
16453 cf_new_cppflags=
16454 cf_new_extra_cppflags=
16455
16456 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16457 do
16458 case "$cf_fix_cppflags" in
16459 (no)
16460         case "$cf_add_cflags" in
16461         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16462                 case "$cf_add_cflags" in
16463                 (-D*)
16464                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16465
16466                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16467                                 && test -z "${cf_tst_cflags}" \
16468                                 && cf_fix_cppflags=yes
16469
16470                         if test "$cf_fix_cppflags" = yes ; then
16471
16472         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16473         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16474
16475                                 continue
16476                         elif test "${cf_tst_cflags}" = "\"'" ; then
16477
16478         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16479         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16480
16481                                 continue
16482                         fi
16483                         ;;
16484                 esac
16485                 case "$CPPFLAGS" in
16486                 (*$cf_add_cflags)
16487                         ;;
16488                 (*)
16489                         case "$cf_add_cflags" in
16490                         (-D*)
16491                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16492
16493 CPPFLAGS=`echo "$CPPFLAGS" | \
16494         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16495                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16496
16497                                 ;;
16498                         esac
16499
16500         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16501         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16502
16503                         ;;
16504                 esac
16505                 ;;
16506         (*)
16507
16508         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16509         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16510
16511                 ;;
16512         esac
16513         ;;
16514 (yes)
16515
16516         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16517         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16518
16519         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16520
16521         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16522                 && test -z "${cf_tst_cflags}" \
16523                 && cf_fix_cppflags=no
16524         ;;
16525 esac
16526 done
16527
16528 if test -n "$cf_new_cflags" ; then
16529
16530         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16531         CFLAGS="${CFLAGS}$cf_new_cflags"
16532
16533 fi
16534
16535 if test -n "$cf_new_cppflags" ; then
16536
16537         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16538         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16539
16540 fi
16541
16542 if test -n "$cf_new_extra_cppflags" ; then
16543
16544         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16545         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16546
16547 fi
16548
16549 cf_add_libs="$LIBS"
16550 # reverse order
16551 cf_add_0lib=
16552 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16553 # filter duplicates
16554 for cf_add_1lib in $cf_add_0lib; do
16555         for cf_add_2lib in $cf_add_libs; do
16556                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16557                         cf_add_1lib=
16558                         break
16559                 fi
16560         done
16561         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16562 done
16563 LIBS="$cf_add_libs"
16564
16565                 cat >"conftest.$ac_ext" <<_ACEOF
16566 #line 16566 "configure"
16567 #include "confdefs.h"
16568 #include <$PANEL_NAME.h>
16569 int
16570 main (void)
16571 {
16572 (void) new_panel ( 0 );
16573   ;
16574   return 0;
16575 }
16576 _ACEOF
16577 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16578 if { (eval echo "$as_me:16578: \"$ac_link\"") >&5
16579   (eval $ac_link) 2>&5
16580   ac_status=$?
16581   echo "$as_me:16581: \$? = $ac_status" >&5
16582   (exit "$ac_status"); } &&
16583          { ac_try='test -s "conftest$ac_exeext"'
16584   { (eval echo "$as_me:16584: \"$ac_try\"") >&5
16585   (eval $ac_try) 2>&5
16586   ac_status=$?
16587   echo "$as_me:16587: \$? = $ac_status" >&5
16588   (exit "$ac_status"); }; }; then
16589   if test "$cross_compiling" = yes; then
16590   cf_have_curses_lib=maybe
16591 else
16592   cat >"conftest.$ac_ext" <<_ACEOF
16593 #line 16593 "configure"
16594 #include "confdefs.h"
16595 #include <$PANEL_NAME.h>
16596                                 int main(void)
16597                                 { (void) new_panel ( 0 ); return 0; }
16598 _ACEOF
16599 rm -f "conftest$ac_exeext"
16600 if { (eval echo "$as_me:16600: \"$ac_link\"") >&5
16601   (eval $ac_link) 2>&5
16602   ac_status=$?
16603   echo "$as_me:16603: \$? = $ac_status" >&5
16604   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16605   { (eval echo "$as_me:16605: \"$ac_try\"") >&5
16606   (eval $ac_try) 2>&5
16607   ac_status=$?
16608   echo "$as_me:16608: \$? = $ac_status" >&5
16609   (exit "$ac_status"); }; }; then
16610   cf_have_curses_lib=yes
16611 else
16612   echo "$as_me: program exited with status $ac_status" >&5
16613 echo "$as_me: failed program was:" >&5
16614 cat "conftest.$ac_ext" >&5
16615 cf_have_curses_lib=no
16616 fi
16617 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16618 fi
16619 else
16620   echo "$as_me: failed program was:" >&5
16621 cat "conftest.$ac_ext" >&5
16622 cf_have_curses_lib=no
16623 fi
16624 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16625                 echo "$as_me:16625: result: $cf_have_curses_lib" >&5
16626 echo "${ECHO_T}$cf_have_curses_lib" >&6
16627                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16628                 if test "$cf_have_curses_lib" != "yes"
16629                 then
16630                         CPPFLAGS="$cf_save_CPPFLAGS"
16631                         LIBS="$cf_save_LIBS"
16632                 else
16633
16634 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16635
16636                         cat >>confdefs.h <<EOF
16637 #define $cf_upper 1
16638 EOF
16639
16640                 fi
16641         fi
16642 fi
16643 if test "$cf_have_curses_lib" = no; then
16644         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16645 echo "$as_me:16645: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16646 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16647 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16648   echo $ECHO_N "(cached) $ECHO_C" >&6
16649 else
16650   ac_check_lib_save_LIBS=$LIBS
16651 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16652 cat >"conftest.$ac_ext" <<_ACEOF
16653 #line 16653 "configure"
16654 #include "confdefs.h"
16655
16656 /* Override any gcc2 internal prototype to avoid an error.  */
16657 #ifdef __cplusplus
16658 extern "C"
16659 #endif
16660 /* We use char because int might match the return type of a gcc2
16661    builtin and then its argument prototype would still apply.  */
16662 char new_panel ();
16663 int
16664 main (void)
16665 {
16666 new_panel ();
16667   ;
16668   return 0;
16669 }
16670 _ACEOF
16671 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16672 if { (eval echo "$as_me:16672: \"$ac_link\"") >&5
16673   (eval $ac_link) 2>&5
16674   ac_status=$?
16675   echo "$as_me:16675: \$? = $ac_status" >&5
16676   (exit "$ac_status"); } &&
16677          { ac_try='test -s "conftest$ac_exeext"'
16678   { (eval echo "$as_me:16678: \"$ac_try\"") >&5
16679   (eval $ac_try) 2>&5
16680   ac_status=$?
16681   echo "$as_me:16681: \$? = $ac_status" >&5
16682   (exit "$ac_status"); }; }; then
16683   eval "$as_ac_Lib=yes"
16684 else
16685   echo "$as_me: failed program was:" >&5
16686 cat "conftest.$ac_ext" >&5
16687 eval "$as_ac_Lib=no"
16688 fi
16689 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16690 LIBS=$ac_check_lib_save_LIBS
16691 fi
16692 echo "$as_me:16692: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16693 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16694 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16695
16696 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16697
16698 cf_add_libs="$LIBS"
16699 # reverse order
16700 cf_add_0lib=
16701 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16702 # filter duplicates
16703 for cf_add_1lib in $cf_add_0lib; do
16704         for cf_add_2lib in $cf_add_libs; do
16705                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16706                         cf_add_1lib=
16707                         break
16708                 fi
16709         done
16710         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16711 done
16712 LIBS="$cf_add_libs"
16713
16714                 cat >>confdefs.h <<EOF
16715 #define $cf_upper 1
16716 EOF
16717
16718 fi
16719
16720 fi
16721
16722         cf_curses_headers="$cf_curses_headers panel.h"
16723 fi
16724
16725 echo "$as_me:16725: checking if you want to check for menu functions" >&5
16726 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16727
16728 # Check whether --enable-menu or --disable-menu was given.
16729 if test "${enable_menu+set}" = set; then
16730   enableval="$enable_menu"
16731   test "$enableval" != no && enableval=yes
16732         if test "$enableval" != "yes" ; then
16733     cf_enable_menu=no
16734         else
16735                 cf_enable_menu=$cf_default_menu
16736         fi
16737 else
16738   enableval=yes
16739         cf_enable_menu=$cf_default_menu
16740
16741 fi;
16742 echo "$as_me:16742: result: $cf_enable_menu" >&5
16743 echo "${ECHO_T}$cf_enable_menu" >&6
16744 if test $cf_enable_menu = yes
16745 then
16746         case $cf_cv_screen in
16747         (ncurses*)
16748                 ;;
16749         (curses*)
16750
16751 echo "$as_me:16751: checking for NetBSD menu.h" >&5
16752 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16753 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16754   echo $ECHO_N "(cached) $ECHO_C" >&6
16755 else
16756
16757 cat >"conftest.$ac_ext" <<_ACEOF
16758 #line 16758 "configure"
16759 #include "confdefs.h"
16760
16761 #include <${cf_cv_ncurses_header:-curses.h}>
16762 #include <menu.h>
16763
16764 int
16765 main (void)
16766 {
16767
16768         MENU *menu;
16769         int y = menu->max_item_width;
16770
16771   ;
16772   return 0;
16773 }
16774 _ACEOF
16775 rm -f "conftest.$ac_objext"
16776 if { (eval echo "$as_me:16776: \"$ac_compile\"") >&5
16777   (eval $ac_compile) 2>&5
16778   ac_status=$?
16779   echo "$as_me:16779: \$? = $ac_status" >&5
16780   (exit "$ac_status"); } &&
16781          { ac_try='test -s "conftest.$ac_objext"'
16782   { (eval echo "$as_me:16782: \"$ac_try\"") >&5
16783   (eval $ac_try) 2>&5
16784   ac_status=$?
16785   echo "$as_me:16785: \$? = $ac_status" >&5
16786   (exit "$ac_status"); }; }; then
16787   cf_cv_netbsd_menu_h=yes
16788
16789 else
16790   echo "$as_me: failed program was:" >&5
16791 cat "conftest.$ac_ext" >&5
16792 cf_cv_netbsd_menu_h=no
16793 fi
16794 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16795
16796 fi
16797 echo "$as_me:16797: result: $cf_cv_netbsd_menu_h" >&5
16798 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16799
16800 test "$cf_cv_netbsd_menu_h" = yes &&
16801 cat >>confdefs.h <<\EOF
16802 #define HAVE_NETBSD_MENU_H 1
16803 EOF
16804
16805                 ;;
16806         esac
16807
16808 cf_have_curses_lib=no
16809
16810 : ${NCURSES_CONFIG_PKG:=none}
16811 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16812         :
16813 elif test "x${PKG_CONFIG:=none}" != xnone; then
16814         echo "$as_me:16814: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16815 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16816         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
16817                 echo "$as_me:16817: result: yes" >&5
16818 echo "${ECHO_T}yes" >&6
16819
16820                 echo "$as_me:16820: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16821 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16822
16823                 cf_save_CPPFLAGS="$CPPFLAGS"
16824                 cf_save_LIBS="$LIBS"
16825
16826 cf_fix_cppflags=no
16827 cf_new_cflags=
16828 cf_new_cppflags=
16829 cf_new_extra_cppflags=
16830
16831 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
16832 do
16833 case "$cf_fix_cppflags" in
16834 (no)
16835         case "$cf_add_cflags" in
16836         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16837                 case "$cf_add_cflags" in
16838                 (-D*)
16839                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16840
16841                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16842                                 && test -z "${cf_tst_cflags}" \
16843                                 && cf_fix_cppflags=yes
16844
16845                         if test "$cf_fix_cppflags" = yes ; then
16846
16847         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16848         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16849
16850                                 continue
16851                         elif test "${cf_tst_cflags}" = "\"'" ; then
16852
16853         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16854         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16855
16856                                 continue
16857                         fi
16858                         ;;
16859                 esac
16860                 case "$CPPFLAGS" in
16861                 (*$cf_add_cflags)
16862                         ;;
16863                 (*)
16864                         case "$cf_add_cflags" in
16865                         (-D*)
16866                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16867
16868 CPPFLAGS=`echo "$CPPFLAGS" | \
16869         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16870                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16871
16872                                 ;;
16873                         esac
16874
16875         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16876         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16877
16878                         ;;
16879                 esac
16880                 ;;
16881         (*)
16882
16883         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16884         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16885
16886                 ;;
16887         esac
16888         ;;
16889 (yes)
16890
16891         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16892         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16893
16894         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16895
16896         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16897                 && test -z "${cf_tst_cflags}" \
16898                 && cf_fix_cppflags=no
16899         ;;
16900 esac
16901 done
16902
16903 if test -n "$cf_new_cflags" ; then
16904
16905         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16906         CFLAGS="${CFLAGS}$cf_new_cflags"
16907
16908 fi
16909
16910 if test -n "$cf_new_cppflags" ; then
16911
16912         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16913         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16914
16915 fi
16916
16917 if test -n "$cf_new_extra_cppflags" ; then
16918
16919         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16920         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16921
16922 fi
16923
16924 cf_add_libs="$LIBS"
16925 # reverse order
16926 cf_add_0lib=
16927 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16928 # filter duplicates
16929 for cf_add_1lib in $cf_add_0lib; do
16930         for cf_add_2lib in $cf_add_libs; do
16931                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16932                         cf_add_1lib=
16933                         break
16934                 fi
16935         done
16936         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16937 done
16938 LIBS="$cf_add_libs"
16939
16940                 cat >"conftest.$ac_ext" <<_ACEOF
16941 #line 16941 "configure"
16942 #include "confdefs.h"
16943 #include <$MENU_NAME.h>
16944 int
16945 main (void)
16946 {
16947 (void) menu_driver ( 0,0 );
16948   ;
16949   return 0;
16950 }
16951 _ACEOF
16952 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16953 if { (eval echo "$as_me:16953: \"$ac_link\"") >&5
16954   (eval $ac_link) 2>&5
16955   ac_status=$?
16956   echo "$as_me:16956: \$? = $ac_status" >&5
16957   (exit "$ac_status"); } &&
16958          { ac_try='test -s "conftest$ac_exeext"'
16959   { (eval echo "$as_me:16959: \"$ac_try\"") >&5
16960   (eval $ac_try) 2>&5
16961   ac_status=$?
16962   echo "$as_me:16962: \$? = $ac_status" >&5
16963   (exit "$ac_status"); }; }; then
16964   if test "$cross_compiling" = yes; then
16965   cf_have_curses_lib=maybe
16966 else
16967   cat >"conftest.$ac_ext" <<_ACEOF
16968 #line 16968 "configure"
16969 #include "confdefs.h"
16970 #include <$MENU_NAME.h>
16971                                 int main(void)
16972                                 { (void) menu_driver ( 0,0 ); return 0; }
16973 _ACEOF
16974 rm -f "conftest$ac_exeext"
16975 if { (eval echo "$as_me:16975: \"$ac_link\"") >&5
16976   (eval $ac_link) 2>&5
16977   ac_status=$?
16978   echo "$as_me:16978: \$? = $ac_status" >&5
16979   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16980   { (eval echo "$as_me:16980: \"$ac_try\"") >&5
16981   (eval $ac_try) 2>&5
16982   ac_status=$?
16983   echo "$as_me:16983: \$? = $ac_status" >&5
16984   (exit "$ac_status"); }; }; then
16985   cf_have_curses_lib=yes
16986 else
16987   echo "$as_me: program exited with status $ac_status" >&5
16988 echo "$as_me: failed program was:" >&5
16989 cat "conftest.$ac_ext" >&5
16990 cf_have_curses_lib=no
16991 fi
16992 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16993 fi
16994 else
16995   echo "$as_me: failed program was:" >&5
16996 cat "conftest.$ac_ext" >&5
16997 cf_have_curses_lib=no
16998 fi
16999 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17000                 echo "$as_me:17000: result: $cf_have_curses_lib" >&5
17001 echo "${ECHO_T}$cf_have_curses_lib" >&6
17002                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17003                 if test "$cf_have_curses_lib" != "yes"
17004                 then
17005                         CPPFLAGS="$cf_save_CPPFLAGS"
17006                         LIBS="$cf_save_LIBS"
17007                 else
17008
17009 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17010
17011                         cat >>confdefs.h <<EOF
17012 #define $cf_upper 1
17013 EOF
17014
17015                 fi
17016         fi
17017 fi
17018 if test "$cf_have_curses_lib" = no; then
17019         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17020 echo "$as_me:17020: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17021 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17022 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17023   echo $ECHO_N "(cached) $ECHO_C" >&6
17024 else
17025   ac_check_lib_save_LIBS=$LIBS
17026 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17027 cat >"conftest.$ac_ext" <<_ACEOF
17028 #line 17028 "configure"
17029 #include "confdefs.h"
17030
17031 /* Override any gcc2 internal prototype to avoid an error.  */
17032 #ifdef __cplusplus
17033 extern "C"
17034 #endif
17035 /* We use char because int might match the return type of a gcc2
17036    builtin and then its argument prototype would still apply.  */
17037 char menu_driver ();
17038 int
17039 main (void)
17040 {
17041 menu_driver ();
17042   ;
17043   return 0;
17044 }
17045 _ACEOF
17046 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17047 if { (eval echo "$as_me:17047: \"$ac_link\"") >&5
17048   (eval $ac_link) 2>&5
17049   ac_status=$?
17050   echo "$as_me:17050: \$? = $ac_status" >&5
17051   (exit "$ac_status"); } &&
17052          { ac_try='test -s "conftest$ac_exeext"'
17053   { (eval echo "$as_me:17053: \"$ac_try\"") >&5
17054   (eval $ac_try) 2>&5
17055   ac_status=$?
17056   echo "$as_me:17056: \$? = $ac_status" >&5
17057   (exit "$ac_status"); }; }; then
17058   eval "$as_ac_Lib=yes"
17059 else
17060   echo "$as_me: failed program was:" >&5
17061 cat "conftest.$ac_ext" >&5
17062 eval "$as_ac_Lib=no"
17063 fi
17064 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17065 LIBS=$ac_check_lib_save_LIBS
17066 fi
17067 echo "$as_me:17067: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17068 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17069 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17070
17071 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17072
17073 cf_add_libs="$LIBS"
17074 # reverse order
17075 cf_add_0lib=
17076 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17077 # filter duplicates
17078 for cf_add_1lib in $cf_add_0lib; do
17079         for cf_add_2lib in $cf_add_libs; do
17080                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17081                         cf_add_1lib=
17082                         break
17083                 fi
17084         done
17085         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17086 done
17087 LIBS="$cf_add_libs"
17088
17089                 cat >>confdefs.h <<EOF
17090 #define $cf_upper 1
17091 EOF
17092
17093 fi
17094
17095 fi
17096
17097         cf_curses_headers="$cf_curses_headers menu.h"
17098 fi
17099
17100 echo "$as_me:17100: checking if you want to check for form functions" >&5
17101 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17102
17103 # Check whether --enable-form or --disable-form was given.
17104 if test "${enable_form+set}" = set; then
17105   enableval="$enable_form"
17106   test "$enableval" != no && enableval=yes
17107         if test "$enableval" != "yes" ; then
17108     cf_enable_form=no
17109         else
17110                 cf_enable_form=$cf_default_form
17111         fi
17112 else
17113   enableval=yes
17114         cf_enable_form=$cf_default_form
17115
17116 fi;
17117 echo "$as_me:17117: result: $cf_enable_form" >&5
17118 echo "${ECHO_T}$cf_enable_form" >&6
17119 if test $cf_enable_form = yes
17120 then
17121         case $cf_cv_screen in
17122         (ncurses*)
17123                 ;;
17124         (curses*)
17125
17126 echo "$as_me:17126: checking for NetBSD form.h" >&5
17127 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17128 if test "${cf_cv_netbsd_form_h+set}" = set; then
17129   echo $ECHO_N "(cached) $ECHO_C" >&6
17130 else
17131
17132 cat >"conftest.$ac_ext" <<_ACEOF
17133 #line 17133 "configure"
17134 #include "confdefs.h"
17135
17136 #include <${cf_cv_ncurses_header:-curses.h}>
17137 #include <form.h>
17138
17139 int
17140 main (void)
17141 {
17142
17143         FORM *form;
17144         int y = current_field(form)->cursor_ypos;
17145         int x = current_field(form)->cursor_xpos;
17146
17147   ;
17148   return 0;
17149 }
17150 _ACEOF
17151 rm -f "conftest.$ac_objext"
17152 if { (eval echo "$as_me:17152: \"$ac_compile\"") >&5
17153   (eval $ac_compile) 2>&5
17154   ac_status=$?
17155   echo "$as_me:17155: \$? = $ac_status" >&5
17156   (exit "$ac_status"); } &&
17157          { ac_try='test -s "conftest.$ac_objext"'
17158   { (eval echo "$as_me:17158: \"$ac_try\"") >&5
17159   (eval $ac_try) 2>&5
17160   ac_status=$?
17161   echo "$as_me:17161: \$? = $ac_status" >&5
17162   (exit "$ac_status"); }; }; then
17163   cf_cv_netbsd_form_h=yes
17164
17165 else
17166   echo "$as_me: failed program was:" >&5
17167 cat "conftest.$ac_ext" >&5
17168 cf_cv_netbsd_form_h=no
17169 fi
17170 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17171
17172 fi
17173 echo "$as_me:17173: result: $cf_cv_netbsd_form_h" >&5
17174 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17175
17176 test "$cf_cv_netbsd_form_h" = yes &&
17177 cat >>confdefs.h <<\EOF
17178 #define HAVE_NETBSD_FORM_H 1
17179 EOF
17180
17181                 ;;
17182         esac
17183
17184 cf_have_curses_lib=no
17185
17186 : ${NCURSES_CONFIG_PKG:=none}
17187 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17188         :
17189 elif test "x${PKG_CONFIG:=none}" != xnone; then
17190         echo "$as_me:17190: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17191 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17192         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17193                 echo "$as_me:17193: result: yes" >&5
17194 echo "${ECHO_T}yes" >&6
17195
17196                 echo "$as_me:17196: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17197 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17198
17199                 cf_save_CPPFLAGS="$CPPFLAGS"
17200                 cf_save_LIBS="$LIBS"
17201
17202 cf_fix_cppflags=no
17203 cf_new_cflags=
17204 cf_new_cppflags=
17205 cf_new_extra_cppflags=
17206
17207 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17208 do
17209 case "$cf_fix_cppflags" in
17210 (no)
17211         case "$cf_add_cflags" in
17212         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17213                 case "$cf_add_cflags" in
17214                 (-D*)
17215                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17216
17217                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17218                                 && test -z "${cf_tst_cflags}" \
17219                                 && cf_fix_cppflags=yes
17220
17221                         if test "$cf_fix_cppflags" = yes ; then
17222
17223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17225
17226                                 continue
17227                         elif test "${cf_tst_cflags}" = "\"'" ; then
17228
17229         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17230         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17231
17232                                 continue
17233                         fi
17234                         ;;
17235                 esac
17236                 case "$CPPFLAGS" in
17237                 (*$cf_add_cflags)
17238                         ;;
17239                 (*)
17240                         case "$cf_add_cflags" in
17241                         (-D*)
17242                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17243
17244 CPPFLAGS=`echo "$CPPFLAGS" | \
17245         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17246                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17247
17248                                 ;;
17249                         esac
17250
17251         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17252         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17253
17254                         ;;
17255                 esac
17256                 ;;
17257         (*)
17258
17259         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17260         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17261
17262                 ;;
17263         esac
17264         ;;
17265 (yes)
17266
17267         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17268         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17269
17270         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17271
17272         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17273                 && test -z "${cf_tst_cflags}" \
17274                 && cf_fix_cppflags=no
17275         ;;
17276 esac
17277 done
17278
17279 if test -n "$cf_new_cflags" ; then
17280
17281         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17282         CFLAGS="${CFLAGS}$cf_new_cflags"
17283
17284 fi
17285
17286 if test -n "$cf_new_cppflags" ; then
17287
17288         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17289         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17290
17291 fi
17292
17293 if test -n "$cf_new_extra_cppflags" ; then
17294
17295         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17296         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17297
17298 fi
17299
17300 cf_add_libs="$LIBS"
17301 # reverse order
17302 cf_add_0lib=
17303 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17304 # filter duplicates
17305 for cf_add_1lib in $cf_add_0lib; do
17306         for cf_add_2lib in $cf_add_libs; do
17307                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17308                         cf_add_1lib=
17309                         break
17310                 fi
17311         done
17312         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17313 done
17314 LIBS="$cf_add_libs"
17315
17316                 cat >"conftest.$ac_ext" <<_ACEOF
17317 #line 17317 "configure"
17318 #include "confdefs.h"
17319 #include <$FORM_NAME.h>
17320 int
17321 main (void)
17322 {
17323 (void) form_driver ( 0,0 );
17324   ;
17325   return 0;
17326 }
17327 _ACEOF
17328 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17329 if { (eval echo "$as_me:17329: \"$ac_link\"") >&5
17330   (eval $ac_link) 2>&5
17331   ac_status=$?
17332   echo "$as_me:17332: \$? = $ac_status" >&5
17333   (exit "$ac_status"); } &&
17334          { ac_try='test -s "conftest$ac_exeext"'
17335   { (eval echo "$as_me:17335: \"$ac_try\"") >&5
17336   (eval $ac_try) 2>&5
17337   ac_status=$?
17338   echo "$as_me:17338: \$? = $ac_status" >&5
17339   (exit "$ac_status"); }; }; then
17340   if test "$cross_compiling" = yes; then
17341   cf_have_curses_lib=maybe
17342 else
17343   cat >"conftest.$ac_ext" <<_ACEOF
17344 #line 17344 "configure"
17345 #include "confdefs.h"
17346 #include <$FORM_NAME.h>
17347                                 int main(void)
17348                                 { (void) form_driver ( 0,0 ); return 0; }
17349 _ACEOF
17350 rm -f "conftest$ac_exeext"
17351 if { (eval echo "$as_me:17351: \"$ac_link\"") >&5
17352   (eval $ac_link) 2>&5
17353   ac_status=$?
17354   echo "$as_me:17354: \$? = $ac_status" >&5
17355   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17356   { (eval echo "$as_me:17356: \"$ac_try\"") >&5
17357   (eval $ac_try) 2>&5
17358   ac_status=$?
17359   echo "$as_me:17359: \$? = $ac_status" >&5
17360   (exit "$ac_status"); }; }; then
17361   cf_have_curses_lib=yes
17362 else
17363   echo "$as_me: program exited with status $ac_status" >&5
17364 echo "$as_me: failed program was:" >&5
17365 cat "conftest.$ac_ext" >&5
17366 cf_have_curses_lib=no
17367 fi
17368 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17369 fi
17370 else
17371   echo "$as_me: failed program was:" >&5
17372 cat "conftest.$ac_ext" >&5
17373 cf_have_curses_lib=no
17374 fi
17375 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17376                 echo "$as_me:17376: result: $cf_have_curses_lib" >&5
17377 echo "${ECHO_T}$cf_have_curses_lib" >&6
17378                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17379                 if test "$cf_have_curses_lib" != "yes"
17380                 then
17381                         CPPFLAGS="$cf_save_CPPFLAGS"
17382                         LIBS="$cf_save_LIBS"
17383                 else
17384
17385 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17386
17387                         cat >>confdefs.h <<EOF
17388 #define $cf_upper 1
17389 EOF
17390
17391                 fi
17392         fi
17393 fi
17394 if test "$cf_have_curses_lib" = no; then
17395         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17396 echo "$as_me:17396: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17397 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17398 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17399   echo $ECHO_N "(cached) $ECHO_C" >&6
17400 else
17401   ac_check_lib_save_LIBS=$LIBS
17402 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17403 cat >"conftest.$ac_ext" <<_ACEOF
17404 #line 17404 "configure"
17405 #include "confdefs.h"
17406
17407 /* Override any gcc2 internal prototype to avoid an error.  */
17408 #ifdef __cplusplus
17409 extern "C"
17410 #endif
17411 /* We use char because int might match the return type of a gcc2
17412    builtin and then its argument prototype would still apply.  */
17413 char form_driver ();
17414 int
17415 main (void)
17416 {
17417 form_driver ();
17418   ;
17419   return 0;
17420 }
17421 _ACEOF
17422 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17423 if { (eval echo "$as_me:17423: \"$ac_link\"") >&5
17424   (eval $ac_link) 2>&5
17425   ac_status=$?
17426   echo "$as_me:17426: \$? = $ac_status" >&5
17427   (exit "$ac_status"); } &&
17428          { ac_try='test -s "conftest$ac_exeext"'
17429   { (eval echo "$as_me:17429: \"$ac_try\"") >&5
17430   (eval $ac_try) 2>&5
17431   ac_status=$?
17432   echo "$as_me:17432: \$? = $ac_status" >&5
17433   (exit "$ac_status"); }; }; then
17434   eval "$as_ac_Lib=yes"
17435 else
17436   echo "$as_me: failed program was:" >&5
17437 cat "conftest.$ac_ext" >&5
17438 eval "$as_ac_Lib=no"
17439 fi
17440 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17441 LIBS=$ac_check_lib_save_LIBS
17442 fi
17443 echo "$as_me:17443: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17444 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17445 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17446
17447 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17448
17449 cf_add_libs="$LIBS"
17450 # reverse order
17451 cf_add_0lib=
17452 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17453 # filter duplicates
17454 for cf_add_1lib in $cf_add_0lib; do
17455         for cf_add_2lib in $cf_add_libs; do
17456                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17457                         cf_add_1lib=
17458                         break
17459                 fi
17460         done
17461         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17462 done
17463 LIBS="$cf_add_libs"
17464
17465                 cat >>confdefs.h <<EOF
17466 #define $cf_upper 1
17467 EOF
17468
17469 fi
17470
17471 fi
17472
17473         cf_curses_headers="$cf_curses_headers form.h"
17474 fi
17475
17476 # look for curses-related headers
17477
17478 for ac_header in $cf_curses_headers
17479 do
17480 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17481 echo "$as_me:17481: checking for $ac_header" >&5
17482 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17483 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17484   echo $ECHO_N "(cached) $ECHO_C" >&6
17485 else
17486   cat >"conftest.$ac_ext" <<_ACEOF
17487 #line 17487 "configure"
17488 #include "confdefs.h"
17489 #include <$ac_header>
17490 _ACEOF
17491 if { (eval echo "$as_me:17491: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17492   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17493   ac_status=$?
17494   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17495   rm -f conftest.er1
17496   cat conftest.err >&5
17497   echo "$as_me:17497: \$? = $ac_status" >&5
17498   (exit "$ac_status"); } >/dev/null; then
17499   if test -s conftest.err; then
17500     ac_cpp_err=$ac_c_preproc_warn_flag
17501   else
17502     ac_cpp_err=
17503   fi
17504 else
17505   ac_cpp_err=yes
17506 fi
17507 if test -z "$ac_cpp_err"; then
17508   eval "$as_ac_Header=yes"
17509 else
17510   echo "$as_me: failed program was:" >&5
17511   cat "conftest.$ac_ext" >&5
17512   eval "$as_ac_Header=no"
17513 fi
17514 rm -f conftest.err "conftest.$ac_ext"
17515 fi
17516 echo "$as_me:17516: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17517 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17518 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17519   cat >>confdefs.h <<EOF
17520 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17521 EOF
17522
17523 fi
17524 done
17525
17526 echo "$as_me:17526: checking for ANSI C header files" >&5
17527 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17528 if test "${ac_cv_header_stdc+set}" = set; then
17529   echo $ECHO_N "(cached) $ECHO_C" >&6
17530 else
17531   cat >"conftest.$ac_ext" <<_ACEOF
17532 #line 17532 "configure"
17533 #include "confdefs.h"
17534 #include <stdlib.h>
17535 #include <stdarg.h>
17536 #include <string.h>
17537 #include <float.h>
17538
17539 _ACEOF
17540 if { (eval echo "$as_me:17540: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17541   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17542   ac_status=$?
17543   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17544   rm -f conftest.er1
17545   cat conftest.err >&5
17546   echo "$as_me:17546: \$? = $ac_status" >&5
17547   (exit "$ac_status"); } >/dev/null; then
17548   if test -s conftest.err; then
17549     ac_cpp_err=$ac_c_preproc_warn_flag
17550   else
17551     ac_cpp_err=
17552   fi
17553 else
17554   ac_cpp_err=yes
17555 fi
17556 if test -z "$ac_cpp_err"; then
17557   ac_cv_header_stdc=yes
17558 else
17559   echo "$as_me: failed program was:" >&5
17560   cat "conftest.$ac_ext" >&5
17561   ac_cv_header_stdc=no
17562 fi
17563 rm -f conftest.err "conftest.$ac_ext"
17564
17565 if test $ac_cv_header_stdc = yes; then
17566   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17567   cat >"conftest.$ac_ext" <<_ACEOF
17568 #line 17568 "configure"
17569 #include "confdefs.h"
17570 #include <string.h>
17571
17572 _ACEOF
17573 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17574   $EGREP "memchr" >/dev/null 2>&1; then
17575   :
17576 else
17577   ac_cv_header_stdc=no
17578 fi
17579 rm -rf conftest*
17580
17581 fi
17582
17583 if test $ac_cv_header_stdc = yes; then
17584   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17585   cat >"conftest.$ac_ext" <<_ACEOF
17586 #line 17586 "configure"
17587 #include "confdefs.h"
17588 #include <stdlib.h>
17589
17590 _ACEOF
17591 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17592   $EGREP "free" >/dev/null 2>&1; then
17593   :
17594 else
17595   ac_cv_header_stdc=no
17596 fi
17597 rm -rf conftest*
17598
17599 fi
17600
17601 if test $ac_cv_header_stdc = yes; then
17602   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17603   if test "$cross_compiling" = yes; then
17604   :
17605 else
17606   cat >"conftest.$ac_ext" <<_ACEOF
17607 #line 17607 "configure"
17608 #include "confdefs.h"
17609 #include <ctype.h>
17610 #if ((' ' & 0x0FF) == 0x020)
17611 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17612 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17613 #else
17614 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17615                      || ('j' <= (c) && (c) <= 'r') \
17616                      || ('s' <= (c) && (c) <= 'z'))
17617 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17618 #endif
17619
17620 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17621 int
17622 main (void)
17623 {
17624   int i;
17625   for (i = 0; i < 256; i++)
17626     if (XOR (islower (i), ISLOWER (i))
17627         || toupper (i) != TOUPPER (i))
17628       $ac_main_return(2);
17629   $ac_main_return (0);
17630 }
17631 _ACEOF
17632 rm -f "conftest$ac_exeext"
17633 if { (eval echo "$as_me:17633: \"$ac_link\"") >&5
17634   (eval $ac_link) 2>&5
17635   ac_status=$?
17636   echo "$as_me:17636: \$? = $ac_status" >&5
17637   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17638   { (eval echo "$as_me:17638: \"$ac_try\"") >&5
17639   (eval $ac_try) 2>&5
17640   ac_status=$?
17641   echo "$as_me:17641: \$? = $ac_status" >&5
17642   (exit "$ac_status"); }; }; then
17643   :
17644 else
17645   echo "$as_me: program exited with status $ac_status" >&5
17646 echo "$as_me: failed program was:" >&5
17647 cat "conftest.$ac_ext" >&5
17648 ac_cv_header_stdc=no
17649 fi
17650 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17651 fi
17652 fi
17653 fi
17654 echo "$as_me:17654: result: $ac_cv_header_stdc" >&5
17655 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17656 if test $ac_cv_header_stdc = yes; then
17657
17658 cat >>confdefs.h <<\EOF
17659 #define STDC_HEADERS 1
17660 EOF
17661
17662 fi
17663
17664 echo "$as_me:17664: checking whether time.h and sys/time.h may both be included" >&5
17665 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17666 if test "${ac_cv_header_time+set}" = set; then
17667   echo $ECHO_N "(cached) $ECHO_C" >&6
17668 else
17669   cat >"conftest.$ac_ext" <<_ACEOF
17670 #line 17670 "configure"
17671 #include "confdefs.h"
17672 #include <sys/types.h>
17673 #include <sys/time.h>
17674 #include <time.h>
17675
17676 int
17677 main (void)
17678 {
17679 if ((struct tm *) 0)
17680 return 0;
17681   ;
17682   return 0;
17683 }
17684 _ACEOF
17685 rm -f "conftest.$ac_objext"
17686 if { (eval echo "$as_me:17686: \"$ac_compile\"") >&5
17687   (eval $ac_compile) 2>&5
17688   ac_status=$?
17689   echo "$as_me:17689: \$? = $ac_status" >&5
17690   (exit "$ac_status"); } &&
17691          { ac_try='test -s "conftest.$ac_objext"'
17692   { (eval echo "$as_me:17692: \"$ac_try\"") >&5
17693   (eval $ac_try) 2>&5
17694   ac_status=$?
17695   echo "$as_me:17695: \$? = $ac_status" >&5
17696   (exit "$ac_status"); }; }; then
17697   ac_cv_header_time=yes
17698 else
17699   echo "$as_me: failed program was:" >&5
17700 cat "conftest.$ac_ext" >&5
17701 ac_cv_header_time=no
17702 fi
17703 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17704 fi
17705 echo "$as_me:17705: result: $ac_cv_header_time" >&5
17706 echo "${ECHO_T}$ac_cv_header_time" >&6
17707 if test $ac_cv_header_time = yes; then
17708
17709 cat >>confdefs.h <<\EOF
17710 #define TIME_WITH_SYS_TIME 1
17711 EOF
17712
17713 fi
17714
17715 for ac_header in \
17716 getopt.h \
17717 locale.h \
17718 math.h \
17719 stdarg.h \
17720 stdint.h \
17721 sys/ioctl.h \
17722 sys/select.h \
17723 sys/time.h \
17724 termios.h \
17725 unistd.h \
17726
17727 do
17728 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17729 echo "$as_me:17729: checking for $ac_header" >&5
17730 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17731 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17732   echo $ECHO_N "(cached) $ECHO_C" >&6
17733 else
17734   cat >"conftest.$ac_ext" <<_ACEOF
17735 #line 17735 "configure"
17736 #include "confdefs.h"
17737 #include <$ac_header>
17738 _ACEOF
17739 if { (eval echo "$as_me:17739: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17740   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17741   ac_status=$?
17742   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17743   rm -f conftest.er1
17744   cat conftest.err >&5
17745   echo "$as_me:17745: \$? = $ac_status" >&5
17746   (exit "$ac_status"); } >/dev/null; then
17747   if test -s conftest.err; then
17748     ac_cpp_err=$ac_c_preproc_warn_flag
17749   else
17750     ac_cpp_err=
17751   fi
17752 else
17753   ac_cpp_err=yes
17754 fi
17755 if test -z "$ac_cpp_err"; then
17756   eval "$as_ac_Header=yes"
17757 else
17758   echo "$as_me: failed program was:" >&5
17759   cat "conftest.$ac_ext" >&5
17760   eval "$as_ac_Header=no"
17761 fi
17762 rm -f conftest.err "conftest.$ac_ext"
17763 fi
17764 echo "$as_me:17764: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17765 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17766 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17767   cat >>confdefs.h <<EOF
17768 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17769 EOF
17770
17771 fi
17772 done
17773
17774 for ac_header in unistd.h getopt.h
17775 do
17776 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17777 echo "$as_me:17777: checking for $ac_header" >&5
17778 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17779 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17780   echo $ECHO_N "(cached) $ECHO_C" >&6
17781 else
17782   cat >"conftest.$ac_ext" <<_ACEOF
17783 #line 17783 "configure"
17784 #include "confdefs.h"
17785 #include <$ac_header>
17786 _ACEOF
17787 if { (eval echo "$as_me:17787: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17788   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17789   ac_status=$?
17790   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17791   rm -f conftest.er1
17792   cat conftest.err >&5
17793   echo "$as_me:17793: \$? = $ac_status" >&5
17794   (exit "$ac_status"); } >/dev/null; then
17795   if test -s conftest.err; then
17796     ac_cpp_err=$ac_c_preproc_warn_flag
17797   else
17798     ac_cpp_err=
17799   fi
17800 else
17801   ac_cpp_err=yes
17802 fi
17803 if test -z "$ac_cpp_err"; then
17804   eval "$as_ac_Header=yes"
17805 else
17806   echo "$as_me: failed program was:" >&5
17807   cat "conftest.$ac_ext" >&5
17808   eval "$as_ac_Header=no"
17809 fi
17810 rm -f conftest.err "conftest.$ac_ext"
17811 fi
17812 echo "$as_me:17812: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17813 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17814 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17815   cat >>confdefs.h <<EOF
17816 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17817 EOF
17818
17819 fi
17820 done
17821
17822 echo "$as_me:17822: checking for header declaring getopt variables" >&5
17823 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17824 if test "${cf_cv_getopt_header+set}" = set; then
17825   echo $ECHO_N "(cached) $ECHO_C" >&6
17826 else
17827
17828 cf_cv_getopt_header=none
17829 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17830 do
17831 cat >"conftest.$ac_ext" <<_ACEOF
17832 #line 17832 "configure"
17833 #include "confdefs.h"
17834
17835 #include <$cf_header>
17836 int
17837 main (void)
17838 {
17839 int x = optind; char *y = optarg
17840   ;
17841   return 0;
17842 }
17843 _ACEOF
17844 rm -f "conftest.$ac_objext"
17845 if { (eval echo "$as_me:17845: \"$ac_compile\"") >&5
17846   (eval $ac_compile) 2>&5
17847   ac_status=$?
17848   echo "$as_me:17848: \$? = $ac_status" >&5
17849   (exit "$ac_status"); } &&
17850          { ac_try='test -s "conftest.$ac_objext"'
17851   { (eval echo "$as_me:17851: \"$ac_try\"") >&5
17852   (eval $ac_try) 2>&5
17853   ac_status=$?
17854   echo "$as_me:17854: \$? = $ac_status" >&5
17855   (exit "$ac_status"); }; }; then
17856   cf_cv_getopt_header=$cf_header
17857  break
17858 else
17859   echo "$as_me: failed program was:" >&5
17860 cat "conftest.$ac_ext" >&5
17861 fi
17862 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17863 done
17864
17865 fi
17866 echo "$as_me:17866: result: $cf_cv_getopt_header" >&5
17867 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17868 if test "$cf_cv_getopt_header" != none ; then
17869
17870 cat >>confdefs.h <<\EOF
17871 #define HAVE_GETOPT_HEADER 1
17872 EOF
17873
17874 fi
17875 if test "$cf_cv_getopt_header" = getopt.h ; then
17876
17877 cat >>confdefs.h <<\EOF
17878 #define NEED_GETOPT_H 1
17879 EOF
17880
17881 fi
17882
17883 for ac_func in \
17884 getopt \
17885 gettimeofday \
17886 snprintf \
17887 strdup \
17888 strstr \
17889 tsearch \
17890
17891 do
17892 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17893 echo "$as_me:17893: checking for $ac_func" >&5
17894 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17895 if eval "test \"\${$as_ac_var+set}\" = set"; then
17896   echo $ECHO_N "(cached) $ECHO_C" >&6
17897 else
17898   cat >"conftest.$ac_ext" <<_ACEOF
17899 #line 17899 "configure"
17900 #include "confdefs.h"
17901 #define $ac_func autoconf_temporary
17902 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17903 #undef $ac_func
17904
17905 #ifdef __cplusplus
17906 extern "C"
17907 #endif
17908
17909 /* We use char because int might match the return type of a gcc2
17910    builtin and then its argument prototype would still apply.  */
17911 char $ac_func (void);
17912
17913 int
17914 main (void)
17915 {
17916
17917 /* The GNU C library defines stubs for functions which it implements
17918     to always fail with ENOSYS.  Some functions are actually named
17919     something starting with __ and the normal name is an alias.  */
17920 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17921 #error found stub for $ac_func
17922 #endif
17923
17924         return $ac_func ();
17925   ;
17926   return 0;
17927 }
17928 _ACEOF
17929 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17930 if { (eval echo "$as_me:17930: \"$ac_link\"") >&5
17931   (eval $ac_link) 2>&5
17932   ac_status=$?
17933   echo "$as_me:17933: \$? = $ac_status" >&5
17934   (exit "$ac_status"); } &&
17935          { ac_try='test -s "conftest$ac_exeext"'
17936   { (eval echo "$as_me:17936: \"$ac_try\"") >&5
17937   (eval $ac_try) 2>&5
17938   ac_status=$?
17939   echo "$as_me:17939: \$? = $ac_status" >&5
17940   (exit "$ac_status"); }; }; then
17941   eval "$as_ac_var=yes"
17942 else
17943   echo "$as_me: failed program was:" >&5
17944 cat "conftest.$ac_ext" >&5
17945 eval "$as_ac_var=no"
17946 fi
17947 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17948 fi
17949 echo "$as_me:17949: result: `eval echo '${'"$as_ac_var"'}'`" >&5
17950 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
17951 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
17952   cat >>confdefs.h <<EOF
17953 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17954 EOF
17955
17956 fi
17957 done
17958
17959 # use a compile-check to work with ncurses*-config and subdirectory includes
17960 echo "$as_me:17960: checking if we can use termcap.h" >&5
17961 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17962 if test "${cf_cv_have_termcap_h+set}" = set; then
17963   echo $ECHO_N "(cached) $ECHO_C" >&6
17964 else
17965
17966         cat >"conftest.$ac_ext" <<_ACEOF
17967 #line 17967 "configure"
17968 #include "confdefs.h"
17969
17970 #include <curses.h>
17971 #ifdef NCURSES_VERSION
17972 #undef NCURSES_VERSION
17973 #endif
17974 #include <termcap.h>
17975 #ifndef NCURSES_VERSION
17976 #error wrong header
17977 #endif
17978
17979 int
17980 main (void)
17981 {
17982 return 0;
17983   ;
17984   return 0;
17985 }
17986 _ACEOF
17987 rm -f "conftest.$ac_objext"
17988 if { (eval echo "$as_me:17988: \"$ac_compile\"") >&5
17989   (eval $ac_compile) 2>&5
17990   ac_status=$?
17991   echo "$as_me:17991: \$? = $ac_status" >&5
17992   (exit "$ac_status"); } &&
17993          { ac_try='test -s "conftest.$ac_objext"'
17994   { (eval echo "$as_me:17994: \"$ac_try\"") >&5
17995   (eval $ac_try) 2>&5
17996   ac_status=$?
17997   echo "$as_me:17997: \$? = $ac_status" >&5
17998   (exit "$ac_status"); }; }; then
17999   cf_cv_have_termcap_h=yes
18000 else
18001   echo "$as_me: failed program was:" >&5
18002 cat "conftest.$ac_ext" >&5
18003 cf_cv_have_termcap_h=no
18004 fi
18005 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18006 fi
18007 echo "$as_me:18007: result: $cf_cv_have_termcap_h" >&5
18008 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18009 if test "x$cf_cv_have_termcap_h" = xyes
18010 then
18011
18012 cat >>confdefs.h <<\EOF
18013 #define HAVE_TERMCAP_H 1
18014 EOF
18015
18016 else
18017 echo "$as_me:18017: checking if we can use ncurses/termcap.h" >&5
18018 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18019 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18020   echo $ECHO_N "(cached) $ECHO_C" >&6
18021 else
18022
18023         cat >"conftest.$ac_ext" <<_ACEOF
18024 #line 18024 "configure"
18025 #include "confdefs.h"
18026
18027 #include <ncurses/curses.h>
18028 #ifdef NCURSES_VERSION
18029 #undef NCURSES_VERSION
18030 #endif
18031 #include <ncurses/termcap.h>
18032 #ifndef NCURSES_VERSION
18033 #error wrong header
18034 #endif
18035
18036 int
18037 main (void)
18038 {
18039 return 0;
18040   ;
18041   return 0;
18042 }
18043 _ACEOF
18044 rm -f "conftest.$ac_objext"
18045 if { (eval echo "$as_me:18045: \"$ac_compile\"") >&5
18046   (eval $ac_compile) 2>&5
18047   ac_status=$?
18048   echo "$as_me:18048: \$? = $ac_status" >&5
18049   (exit "$ac_status"); } &&
18050          { ac_try='test -s "conftest.$ac_objext"'
18051   { (eval echo "$as_me:18051: \"$ac_try\"") >&5
18052   (eval $ac_try) 2>&5
18053   ac_status=$?
18054   echo "$as_me:18054: \$? = $ac_status" >&5
18055   (exit "$ac_status"); }; }; then
18056   cf_cv_have_ncurses_termcap_h=yes
18057 else
18058   echo "$as_me: failed program was:" >&5
18059 cat "conftest.$ac_ext" >&5
18060 cf_cv_have_ncurses_termcap_h=no
18061 fi
18062 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18063 fi
18064 echo "$as_me:18064: result: $cf_cv_have_ncurses_termcap_h" >&5
18065 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18066 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18067 cat >>confdefs.h <<\EOF
18068 #define HAVE_NCURSES_TERMCAP_H 1
18069 EOF
18070
18071 fi
18072
18073 if test "x$ac_cv_func_getopt" = xno; then
18074         { { echo "$as_me:18074: error: getopt is required for building programs" >&5
18075 echo "$as_me: error: getopt is required for building programs" >&2;}
18076    { (exit 1); exit 1; }; }
18077 fi
18078
18079 if test "$cf_enable_widec" = yes; then
18080
18081 for ac_func in \
18082 mblen \
18083 mbrlen \
18084 mbrtowc \
18085 mbsrtowcs \
18086 mbstowcs \
18087 mbtowc \
18088 wcsrtombs \
18089 wcstombs \
18090
18091 do
18092 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18093 echo "$as_me:18093: checking for $ac_func" >&5
18094 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18095 if eval "test \"\${$as_ac_var+set}\" = set"; then
18096   echo $ECHO_N "(cached) $ECHO_C" >&6
18097 else
18098   cat >"conftest.$ac_ext" <<_ACEOF
18099 #line 18099 "configure"
18100 #include "confdefs.h"
18101 #define $ac_func autoconf_temporary
18102 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18103 #undef $ac_func
18104
18105 #ifdef __cplusplus
18106 extern "C"
18107 #endif
18108
18109 /* We use char because int might match the return type of a gcc2
18110    builtin and then its argument prototype would still apply.  */
18111 char $ac_func (void);
18112
18113 int
18114 main (void)
18115 {
18116
18117 /* The GNU C library defines stubs for functions which it implements
18118     to always fail with ENOSYS.  Some functions are actually named
18119     something starting with __ and the normal name is an alias.  */
18120 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18121 #error found stub for $ac_func
18122 #endif
18123
18124         return $ac_func ();
18125   ;
18126   return 0;
18127 }
18128 _ACEOF
18129 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18130 if { (eval echo "$as_me:18130: \"$ac_link\"") >&5
18131   (eval $ac_link) 2>&5
18132   ac_status=$?
18133   echo "$as_me:18133: \$? = $ac_status" >&5
18134   (exit "$ac_status"); } &&
18135          { ac_try='test -s "conftest$ac_exeext"'
18136   { (eval echo "$as_me:18136: \"$ac_try\"") >&5
18137   (eval $ac_try) 2>&5
18138   ac_status=$?
18139   echo "$as_me:18139: \$? = $ac_status" >&5
18140   (exit "$ac_status"); }; }; then
18141   eval "$as_ac_var=yes"
18142 else
18143   echo "$as_me: failed program was:" >&5
18144 cat "conftest.$ac_ext" >&5
18145 eval "$as_ac_var=no"
18146 fi
18147 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18148 fi
18149 echo "$as_me:18149: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18150 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18151 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18152   cat >>confdefs.h <<EOF
18153 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18154 EOF
18155
18156 fi
18157 done
18158
18159 fi
18160
18161 echo "$as_me:18161: checking definition to turn on extended curses functions" >&5
18162 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18163 if test "${cf_cv_need_xopen_extension+set}" = set; then
18164   echo $ECHO_N "(cached) $ECHO_C" >&6
18165 else
18166
18167 cf_cv_need_xopen_extension=unknown
18168 cat >"conftest.$ac_ext" <<_ACEOF
18169 #line 18169 "configure"
18170 #include "confdefs.h"
18171
18172 #include <stdlib.h>
18173 #include <${cf_cv_ncurses_header:-curses.h}>
18174 int
18175 main (void)
18176 {
18177
18178 #if defined(NCURSES_VERSION_PATCH)
18179 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18180         make an error
18181 #endif
18182 #endif
18183 #ifdef NCURSES_VERSION
18184         cchar_t check;
18185         int check2 = curs_set((int)sizeof(check));
18186 #endif
18187         long x = winnstr(stdscr, "", 0);
18188         int x1, y1;
18189 #ifdef NCURSES_VERSION
18190         (void)check2;
18191 #endif
18192         getbegyx(stdscr, y1, x1);
18193         (void)x;
18194         (void)y1;
18195         (void)x1;
18196
18197   ;
18198   return 0;
18199 }
18200 _ACEOF
18201 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18202 if { (eval echo "$as_me:18202: \"$ac_link\"") >&5
18203   (eval $ac_link) 2>&5
18204   ac_status=$?
18205   echo "$as_me:18205: \$? = $ac_status" >&5
18206   (exit "$ac_status"); } &&
18207          { ac_try='test -s "conftest$ac_exeext"'
18208   { (eval echo "$as_me:18208: \"$ac_try\"") >&5
18209   (eval $ac_try) 2>&5
18210   ac_status=$?
18211   echo "$as_me:18211: \$? = $ac_status" >&5
18212   (exit "$ac_status"); }; }; then
18213   cf_cv_need_xopen_extension=none
18214 else
18215   echo "$as_me: failed program was:" >&5
18216 cat "conftest.$ac_ext" >&5
18217
18218         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18219         do
18220                 cat >"conftest.$ac_ext" <<_ACEOF
18221 #line 18221 "configure"
18222 #include "confdefs.h"
18223
18224 #define $cf_try_xopen_extension 1
18225 #include <stdlib.h>
18226 #include <${cf_cv_ncurses_header:-curses.h}>
18227 int
18228 main (void)
18229 {
18230
18231 #ifdef NCURSES_VERSION
18232                 cchar_t check;
18233                 int check2 = curs_set((int)sizeof(check));
18234 #endif
18235                 long x = winnstr(stdscr, "", 0);
18236                 int x1, y1;
18237                 getbegyx(stdscr, y1, x1);
18238 #ifdef NCURSES_VERSION
18239                 (void)check2;
18240 #endif
18241                 (void)x;
18242                 (void)y1;
18243                 (void)x1;
18244
18245   ;
18246   return 0;
18247 }
18248 _ACEOF
18249 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18250 if { (eval echo "$as_me:18250: \"$ac_link\"") >&5
18251   (eval $ac_link) 2>&5
18252   ac_status=$?
18253   echo "$as_me:18253: \$? = $ac_status" >&5
18254   (exit "$ac_status"); } &&
18255          { ac_try='test -s "conftest$ac_exeext"'
18256   { (eval echo "$as_me:18256: \"$ac_try\"") >&5
18257   (eval $ac_try) 2>&5
18258   ac_status=$?
18259   echo "$as_me:18259: \$? = $ac_status" >&5
18260   (exit "$ac_status"); }; }; then
18261   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18262 else
18263   echo "$as_me: failed program was:" >&5
18264 cat "conftest.$ac_ext" >&5
18265 fi
18266 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18267         done
18268
18269 fi
18270 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18271
18272 fi
18273 echo "$as_me:18273: result: $cf_cv_need_xopen_extension" >&5
18274 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18275
18276 case "$cf_cv_need_xopen_extension" in
18277 (*_*)
18278
18279         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18280         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18281
18282         ;;
18283 esac
18284
18285 echo "$as_me:18285: checking for term.h" >&5
18286 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18287 if test "${cf_cv_term_header+set}" = set; then
18288   echo $ECHO_N "(cached) $ECHO_C" >&6
18289 else
18290
18291 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18292 # for <term.h> if we do not find the variant.
18293
18294 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18295
18296 case "${cf_cv_ncurses_header:-curses.h}" in
18297 (*/*)
18298         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18299         cf_header_list="$cf_header_item $cf_header_list"
18300         ;;
18301 esac
18302
18303 for cf_header in $cf_header_list
18304 do
18305         cat >"conftest.$ac_ext" <<_ACEOF
18306 #line 18306 "configure"
18307 #include "confdefs.h"
18308
18309 #include <${cf_cv_ncurses_header:-curses.h}>
18310 #include <${cf_header}>
18311 int
18312 main (void)
18313 {
18314 WINDOW *x; (void)x
18315   ;
18316   return 0;
18317 }
18318 _ACEOF
18319 rm -f "conftest.$ac_objext"
18320 if { (eval echo "$as_me:18320: \"$ac_compile\"") >&5
18321   (eval $ac_compile) 2>&5
18322   ac_status=$?
18323   echo "$as_me:18323: \$? = $ac_status" >&5
18324   (exit "$ac_status"); } &&
18325          { ac_try='test -s "conftest.$ac_objext"'
18326   { (eval echo "$as_me:18326: \"$ac_try\"") >&5
18327   (eval $ac_try) 2>&5
18328   ac_status=$?
18329   echo "$as_me:18329: \$? = $ac_status" >&5
18330   (exit "$ac_status"); }; }; then
18331   cf_cv_term_header=$cf_header
18332          break
18333 else
18334   echo "$as_me: failed program was:" >&5
18335 cat "conftest.$ac_ext" >&5
18336 cf_cv_term_header=no
18337 fi
18338 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18339 done
18340
18341 case "$cf_cv_term_header" in
18342 (no)
18343         # If curses is ncurses, some packagers still mess it up by trying to make
18344         # us use GNU termcap.  This handles the most common case.
18345         for cf_header in ncurses/term.h ncursesw/term.h
18346         do
18347                 cat >"conftest.$ac_ext" <<_ACEOF
18348 #line 18348 "configure"
18349 #include "confdefs.h"
18350
18351 #include <${cf_cv_ncurses_header:-curses.h}>
18352 #ifdef NCURSES_VERSION
18353 #include <${cf_header}>
18354 #else
18355 make an error
18356 #endif
18357 int
18358 main (void)
18359 {
18360 WINDOW *x; (void)x
18361   ;
18362   return 0;
18363 }
18364 _ACEOF
18365 rm -f "conftest.$ac_objext"
18366 if { (eval echo "$as_me:18366: \"$ac_compile\"") >&5
18367   (eval $ac_compile) 2>&5
18368   ac_status=$?
18369   echo "$as_me:18369: \$? = $ac_status" >&5
18370   (exit "$ac_status"); } &&
18371          { ac_try='test -s "conftest.$ac_objext"'
18372   { (eval echo "$as_me:18372: \"$ac_try\"") >&5
18373   (eval $ac_try) 2>&5
18374   ac_status=$?
18375   echo "$as_me:18375: \$? = $ac_status" >&5
18376   (exit "$ac_status"); }; }; then
18377   cf_cv_term_header=$cf_header
18378                          break
18379 else
18380   echo "$as_me: failed program was:" >&5
18381 cat "conftest.$ac_ext" >&5
18382 cf_cv_term_header=no
18383 fi
18384 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18385         done
18386         ;;
18387 esac
18388
18389 fi
18390 echo "$as_me:18390: result: $cf_cv_term_header" >&5
18391 echo "${ECHO_T}$cf_cv_term_header" >&6
18392
18393 case "$cf_cv_term_header" in
18394 (term.h)
18395
18396 cat >>confdefs.h <<\EOF
18397 #define HAVE_TERM_H 1
18398 EOF
18399
18400         ;;
18401 (ncurses/term.h)
18402
18403 cat >>confdefs.h <<\EOF
18404 #define HAVE_NCURSES_TERM_H 1
18405 EOF
18406
18407         ;;
18408 (ncursesw/term.h)
18409
18410 cat >>confdefs.h <<\EOF
18411 #define HAVE_NCURSESW_TERM_H 1
18412 EOF
18413
18414         ;;
18415 esac
18416
18417 echo "$as_me:18417: checking for unctrl.h" >&5
18418 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18419 if test "${cf_cv_unctrl_header+set}" = set; then
18420   echo $ECHO_N "(cached) $ECHO_C" >&6
18421 else
18422
18423 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18424 # for <unctrl.h> if we do not find the variant.
18425
18426 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18427
18428 case "${cf_cv_ncurses_header:-curses.h}" in
18429 (*/*)
18430         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18431         cf_header_list="$cf_header_item $cf_header_list"
18432         ;;
18433 esac
18434
18435 for cf_header in $cf_header_list
18436 do
18437         cat >"conftest.$ac_ext" <<_ACEOF
18438 #line 18438 "configure"
18439 #include "confdefs.h"
18440
18441 #include <${cf_cv_ncurses_header:-curses.h}>
18442 #include <${cf_header}>
18443 int
18444 main (void)
18445 {
18446 WINDOW *x; (void)x
18447   ;
18448   return 0;
18449 }
18450 _ACEOF
18451 rm -f "conftest.$ac_objext"
18452 if { (eval echo "$as_me:18452: \"$ac_compile\"") >&5
18453   (eval $ac_compile) 2>&5
18454   ac_status=$?
18455   echo "$as_me:18455: \$? = $ac_status" >&5
18456   (exit "$ac_status"); } &&
18457          { ac_try='test -s "conftest.$ac_objext"'
18458   { (eval echo "$as_me:18458: \"$ac_try\"") >&5
18459   (eval $ac_try) 2>&5
18460   ac_status=$?
18461   echo "$as_me:18461: \$? = $ac_status" >&5
18462   (exit "$ac_status"); }; }; then
18463   cf_cv_unctrl_header=$cf_header
18464          break
18465 else
18466   echo "$as_me: failed program was:" >&5
18467 cat "conftest.$ac_ext" >&5
18468 cf_cv_unctrl_header=no
18469 fi
18470 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18471 done
18472
18473 fi
18474 echo "$as_me:18474: result: $cf_cv_unctrl_header" >&5
18475 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18476
18477 case "$cf_cv_unctrl_header" in
18478 (no)
18479         { echo "$as_me:18479: WARNING: unctrl.h header not found" >&5
18480 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18481         ;;
18482 esac
18483
18484 case "$cf_cv_unctrl_header" in
18485 (unctrl.h)
18486
18487 cat >>confdefs.h <<\EOF
18488 #define HAVE_UNCTRL_H 1
18489 EOF
18490
18491         ;;
18492 (ncurses/unctrl.h)
18493
18494 cat >>confdefs.h <<\EOF
18495 #define HAVE_NCURSES_UNCTRL_H 1
18496 EOF
18497
18498         ;;
18499 (ncursesw/unctrl.h)
18500
18501 cat >>confdefs.h <<\EOF
18502 #define HAVE_NCURSESW_UNCTRL_H 1
18503 EOF
18504
18505         ;;
18506 esac
18507
18508 for cf_func in \
18509 alloc_pair \
18510 assume_default_colors \
18511 chgat \
18512 color_content \
18513 color_set \
18514 copywin \
18515 delscreen \
18516 dupwin \
18517 exit_curses \
18518 exit_terminfo \
18519 filter \
18520 getbegx \
18521 getcurx \
18522 getmaxx \
18523 getnstr \
18524 getparx \
18525 getwin \
18526 halfdelay \
18527 init_extended_color \
18528 mvderwin \
18529 mvvline \
18530 mvwin \
18531 mvwvline \
18532 napms \
18533 newpad \
18534 putwin \
18535 reset_color_pairs \
18536 resize_term \
18537 resizeterm \
18538 restartterm \
18539 ripoffline \
18540 scr_dump \
18541 setupterm \
18542 slk_color \
18543 slk_init \
18544 termattrs \
18545 termname \
18546 tgetent \
18547 tigetnum \
18548 tigetstr \
18549 tputs_sp \
18550 typeahead \
18551 use_default_colors \
18552 use_env \
18553 use_extended_names \
18554 use_screen \
18555 use_window \
18556 vid_puts \
18557 vidputs \
18558 vsscanf \
18559 vw_printw \
18560 wchgat \
18561 winsdelln \
18562 winsstr \
18563 wresize \
18564 wsyncdown \
18565 _tracef \
18566
18567 do
18568
18569 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18570
18571         echo "$as_me:18571: checking for ${cf_func}" >&5
18572 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18573
18574 echo "${as_me:-configure}:18574: testing ${cf_func} ..." 1>&5
18575
18576         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18577   echo $ECHO_N "(cached) $ECHO_C" >&6
18578 else
18579
18580                 eval cf_result='$ac_cv_func_'$cf_func
18581                 if test ".$cf_result" != ".no"; then
18582                         cat >"conftest.$ac_ext" <<_ACEOF
18583 #line 18583 "configure"
18584 #include "confdefs.h"
18585
18586 #ifdef HAVE_XCURSES
18587 #include <xcurses.h>
18588 char * XCursesProgramName = "test";
18589 #else
18590 #include <${cf_cv_ncurses_header:-curses.h}>
18591 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18592 #include <ncursesw/term.h>
18593 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18594 #include <ncurses/term.h>
18595 #elif defined(HAVE_TERM_H)
18596 #include <term.h>
18597 #endif
18598 #endif
18599
18600 int
18601 main (void)
18602 {
18603
18604 #ifndef ${cf_func}
18605 long foo = (long)(&${cf_func});
18606 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18607 if (foo + 1234L > 5678L)
18608         ${cf_cv_main_return:-return}(foo != 0);
18609 #endif
18610
18611   ;
18612   return 0;
18613 }
18614 _ACEOF
18615 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18616 if { (eval echo "$as_me:18616: \"$ac_link\"") >&5
18617   (eval $ac_link) 2>&5
18618   ac_status=$?
18619   echo "$as_me:18619: \$? = $ac_status" >&5
18620   (exit "$ac_status"); } &&
18621          { ac_try='test -s "conftest$ac_exeext"'
18622   { (eval echo "$as_me:18622: \"$ac_try\"") >&5
18623   (eval $ac_try) 2>&5
18624   ac_status=$?
18625   echo "$as_me:18625: \$? = $ac_status" >&5
18626   (exit "$ac_status"); }; }; then
18627   cf_result=yes
18628 else
18629   echo "$as_me: failed program was:" >&5
18630 cat "conftest.$ac_ext" >&5
18631 cf_result=no
18632 fi
18633 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18634                 fi
18635                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18636
18637 fi
18638
18639         # use the computed/retrieved cache-value:
18640         eval 'cf_result=$cf_cv_func_'$cf_func
18641         echo "$as_me:18641: result: $cf_result" >&5
18642 echo "${ECHO_T}$cf_result" >&6
18643         if test "$cf_result" != no; then
18644                 cat >>confdefs.h <<EOF
18645 #define HAVE_${cf_tr_func} 1
18646 EOF
18647
18648         fi
18649 done
18650
18651 for cf_func in tputs
18652 do
18653
18654 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18655
18656         echo "$as_me:18656: checking for ${cf_func}" >&5
18657 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18658
18659 echo "${as_me:-configure}:18659: testing ${cf_func} ..." 1>&5
18660
18661         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18662   echo $ECHO_N "(cached) $ECHO_C" >&6
18663 else
18664
18665                 eval cf_result='$ac_cv_func_'$cf_func
18666                 if test ".$cf_result" != ".no"; then
18667                         cat >"conftest.$ac_ext" <<_ACEOF
18668 #line 18668 "configure"
18669 #include "confdefs.h"
18670
18671 #ifdef HAVE_XCURSES
18672 #include <xcurses.h>
18673 char * XCursesProgramName = "test";
18674 #else
18675 #include <${cf_cv_ncurses_header:-curses.h}>
18676 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18677 #include <ncursesw/term.h>
18678 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18679 #include <ncurses/term.h>
18680 #elif defined(HAVE_TERM_H)
18681 #include <term.h>
18682 #endif
18683 #endif
18684
18685 int
18686 main (void)
18687 {
18688
18689 #ifndef ${cf_func}
18690 long foo = (long)(&${cf_func});
18691 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18692 if (foo + 1234L > 5678L)
18693         ${cf_cv_main_return:-return}(foo != 0);
18694 #endif
18695
18696   ;
18697   return 0;
18698 }
18699 _ACEOF
18700 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18701 if { (eval echo "$as_me:18701: \"$ac_link\"") >&5
18702   (eval $ac_link) 2>&5
18703   ac_status=$?
18704   echo "$as_me:18704: \$? = $ac_status" >&5
18705   (exit "$ac_status"); } &&
18706          { ac_try='test -s "conftest$ac_exeext"'
18707   { (eval echo "$as_me:18707: \"$ac_try\"") >&5
18708   (eval $ac_try) 2>&5
18709   ac_status=$?
18710   echo "$as_me:18710: \$? = $ac_status" >&5
18711   (exit "$ac_status"); }; }; then
18712   cf_result=yes
18713 else
18714   echo "$as_me: failed program was:" >&5
18715 cat "conftest.$ac_ext" >&5
18716 cf_result=no
18717 fi
18718 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18719                 fi
18720                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18721
18722 fi
18723
18724         # use the computed/retrieved cache-value:
18725         eval 'cf_result=$cf_cv_func_'$cf_func
18726         echo "$as_me:18726: result: $cf_result" >&5
18727 echo "${ECHO_T}$cf_result" >&6
18728         if test "$cf_result" != no; then
18729                 cat >>confdefs.h <<EOF
18730 #define HAVE_${cf_tr_func} 1
18731 EOF
18732
18733         fi
18734 done
18735
18736 if test "x$cf_cv_func_tputs" = xyes
18737 then
18738         cf_done=no
18739         for cf_arg in int char
18740         do
18741                 for cf_ret in int void
18742                 do
18743                         if test "$cf_ret" = void
18744                         then
18745                                 cf_return="/* nothing */"
18746                         else
18747                                 cf_return="return value"
18748                         fi
18749                         cat >"conftest.$ac_ext" <<_ACEOF
18750 #line 18750 "configure"
18751 #include "confdefs.h"
18752
18753 #include <${cf_cv_ncurses_header:-curses.h}>
18754 #include <$cf_cv_term_header>
18755
18756 static $cf_ret outc($cf_arg value) { $cf_return; }
18757
18758 int
18759 main (void)
18760 {
18761
18762         tputs("hello", 0, outc);
18763         ${cf_cv_main_return:-return}(0);
18764
18765   ;
18766   return 0;
18767 }
18768 _ACEOF
18769 rm -f "conftest.$ac_objext"
18770 if { (eval echo "$as_me:18770: \"$ac_compile\"") >&5
18771   (eval $ac_compile) 2>&5
18772   ac_status=$?
18773   echo "$as_me:18773: \$? = $ac_status" >&5
18774   (exit "$ac_status"); } &&
18775          { ac_try='test -s "conftest.$ac_objext"'
18776   { (eval echo "$as_me:18776: \"$ac_try\"") >&5
18777   (eval $ac_try) 2>&5
18778   ac_status=$?
18779   echo "$as_me:18779: \$? = $ac_status" >&5
18780   (exit "$ac_status"); }; }; then
18781
18782                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18783
18784 echo "${as_me:-configure}:18784: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18785
18786                 cat >>confdefs.h <<EOF
18787 #define TPUTS_ARG               $cf_arg
18788 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18789 #define TPUTS_RETURN(value)     $cf_return
18790 EOF
18791                 cf_done=yes
18792                 break
18793
18794 else
18795   echo "$as_me: failed program was:" >&5
18796 cat "conftest.$ac_ext" >&5
18797 fi
18798 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18799                 done
18800                 test "$cf_done" = yes && break
18801         done
18802 fi
18803
18804 echo "$as_me:18804: checking for ncurses extended functions" >&5
18805 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18806 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18807   echo $ECHO_N "(cached) $ECHO_C" >&6
18808 else
18809
18810 cat >"conftest.$ac_ext" <<_ACEOF
18811 #line 18811 "configure"
18812 #include "confdefs.h"
18813
18814 #include <${cf_cv_ncurses_header:-curses.h}>
18815 int
18816 main (void)
18817 {
18818
18819 int x = NCURSES_EXT_FUNCS
18820
18821   ;
18822   return 0;
18823 }
18824 _ACEOF
18825 rm -f "conftest.$ac_objext"
18826 if { (eval echo "$as_me:18826: \"$ac_compile\"") >&5
18827   (eval $ac_compile) 2>&5
18828   ac_status=$?
18829   echo "$as_me:18829: \$? = $ac_status" >&5
18830   (exit "$ac_status"); } &&
18831          { ac_try='test -s "conftest.$ac_objext"'
18832   { (eval echo "$as_me:18832: \"$ac_try\"") >&5
18833   (eval $ac_try) 2>&5
18834   ac_status=$?
18835   echo "$as_me:18835: \$? = $ac_status" >&5
18836   (exit "$ac_status"); }; }; then
18837   cf_cv_ncurses_ext_funcs=defined
18838 else
18839   echo "$as_me: failed program was:" >&5
18840 cat "conftest.$ac_ext" >&5
18841
18842 cat >"conftest.$ac_ext" <<_ACEOF
18843 #line 18843 "configure"
18844 #include "confdefs.h"
18845
18846 #include <${cf_cv_ncurses_header:-curses.h}>
18847 int
18848 main (void)
18849 {
18850
18851         (void) assume_default_colors (0, 0);
18852         (void) curses_version ();
18853         (void) define_key (0, 0);
18854         (void) is_term_resized (0, 0);
18855         (void) key_defined (0);
18856         (void) keybound (0, 0);
18857         (void) keyok (0, 0);
18858         (void) resize_term (0, 0);
18859         (void) resizeterm (0, 0);
18860         (void) use_default_colors ();
18861         (void) use_extended_names (0);
18862         (void) wresize (0, 0, 0);
18863   ;
18864   return 0;
18865 }
18866 _ACEOF
18867 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18868 if { (eval echo "$as_me:18868: \"$ac_link\"") >&5
18869   (eval $ac_link) 2>&5
18870   ac_status=$?
18871   echo "$as_me:18871: \$? = $ac_status" >&5
18872   (exit "$ac_status"); } &&
18873          { ac_try='test -s "conftest$ac_exeext"'
18874   { (eval echo "$as_me:18874: \"$ac_try\"") >&5
18875   (eval $ac_try) 2>&5
18876   ac_status=$?
18877   echo "$as_me:18877: \$? = $ac_status" >&5
18878   (exit "$ac_status"); }; }; then
18879   cf_cv_ncurses_ext_funcs=yes
18880 else
18881   echo "$as_me: failed program was:" >&5
18882 cat "conftest.$ac_ext" >&5
18883 cf_cv_ncurses_ext_funcs=no
18884 fi
18885 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18886
18887 fi
18888 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18889
18890 fi
18891 echo "$as_me:18891: result: $cf_cv_ncurses_ext_funcs" >&5
18892 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18893 test "$cf_cv_ncurses_ext_funcs" = yes &&
18894 cat >>confdefs.h <<\EOF
18895 #define NCURSES_EXT_FUNCS 1
18896 EOF
18897
18898 if test "$cf_enable_widec" = yes
18899 then
18900         # workaround for systems with ncurses before 20111029, due to change of
18901         # feature test macro from _XPG5 to _XOPEN_SOURCE
18902         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18903         then
18904                 cf_define_xpg5=no
18905                 echo "$as_me:18905: checking if _XPG5 should be defined to enable wide-characters" >&5
18906 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18907
18908                 cat >"conftest.$ac_ext" <<_ACEOF
18909 #line 18909 "configure"
18910 #include "confdefs.h"
18911
18912 #include <${cf_cv_ncurses_header:-curses.h}>
18913 int
18914 main (void)
18915 {
18916 int x = _XPG5
18917   ;
18918   return 0;
18919 }
18920 _ACEOF
18921 rm -f "conftest.$ac_objext"
18922 if { (eval echo "$as_me:18922: \"$ac_compile\"") >&5
18923   (eval $ac_compile) 2>&5
18924   ac_status=$?
18925   echo "$as_me:18925: \$? = $ac_status" >&5
18926   (exit "$ac_status"); } &&
18927          { ac_try='test -s "conftest.$ac_objext"'
18928   { (eval echo "$as_me:18928: \"$ac_try\"") >&5
18929   (eval $ac_try) 2>&5
18930   ac_status=$?
18931   echo "$as_me:18931: \$? = $ac_status" >&5
18932   (exit "$ac_status"); }; }; then
18933   :
18934 else
18935   echo "$as_me: failed program was:" >&5
18936 cat "conftest.$ac_ext" >&5
18937 cf_save_cppflags="$CPPFLAGS"
18938                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18939                          cat >"conftest.$ac_ext" <<_ACEOF
18940 #line 18940 "configure"
18941 #include "confdefs.h"
18942
18943 #include <${cf_cv_ncurses_header:-curses.h}>
18944 int
18945 main (void)
18946 {
18947 int x = _XPG5
18948   ;
18949   return 0;
18950 }
18951 _ACEOF
18952 rm -f "conftest.$ac_objext"
18953 if { (eval echo "$as_me:18953: \"$ac_compile\"") >&5
18954   (eval $ac_compile) 2>&5
18955   ac_status=$?
18956   echo "$as_me:18956: \$? = $ac_status" >&5
18957   (exit "$ac_status"); } &&
18958          { ac_try='test -s "conftest.$ac_objext"'
18959   { (eval echo "$as_me:18959: \"$ac_try\"") >&5
18960   (eval $ac_try) 2>&5
18961   ac_status=$?
18962   echo "$as_me:18962: \$? = $ac_status" >&5
18963   (exit "$ac_status"); }; }; then
18964   cf_define_xpg5=yes
18965 else
18966   echo "$as_me: failed program was:" >&5
18967 cat "conftest.$ac_ext" >&5
18968 fi
18969 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18970                          CPPFLAGS="$cf_save_cppflags"
18971 fi
18972 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18973                 echo "$as_me:18973: result: $cf_define_xpg5" >&5
18974 echo "${ECHO_T}$cf_define_xpg5" >&6
18975
18976                 if test "$cf_define_xpg5" = yes
18977                 then
18978                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18979                 fi
18980         fi
18981
18982         echo "$as_me:18982: checking for wide-character functions" >&5
18983 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18984 if test "${cf_cv_widechar_funcs+set}" = set; then
18985   echo $ECHO_N "(cached) $ECHO_C" >&6
18986 else
18987
18988         cat >"conftest.$ac_ext" <<_ACEOF
18989 #line 18989 "configure"
18990 #include "confdefs.h"
18991
18992 #include <${cf_cv_ncurses_header:-curses.h}>
18993 int
18994 main (void)
18995 {
18996
18997                 static wchar_t src_wchar[2];
18998                 static cchar_t dst_cchar;
18999                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19000
19001   ;
19002   return 0;
19003 }
19004 _ACEOF
19005 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19006 if { (eval echo "$as_me:19006: \"$ac_link\"") >&5
19007   (eval $ac_link) 2>&5
19008   ac_status=$?
19009   echo "$as_me:19009: \$? = $ac_status" >&5
19010   (exit "$ac_status"); } &&
19011          { ac_try='test -s "conftest$ac_exeext"'
19012   { (eval echo "$as_me:19012: \"$ac_try\"") >&5
19013   (eval $ac_try) 2>&5
19014   ac_status=$?
19015   echo "$as_me:19015: \$? = $ac_status" >&5
19016   (exit "$ac_status"); }; }; then
19017   cf_cv_widechar_funcs=yes
19018 else
19019   echo "$as_me: failed program was:" >&5
19020 cat "conftest.$ac_ext" >&5
19021 cf_cv_widechar_funcs=no
19022 fi
19023 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19024
19025 fi
19026 echo "$as_me:19026: result: $cf_cv_widechar_funcs" >&5
19027 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19028         if test "$cf_cv_widechar_funcs" != no ; then
19029
19030 cat >>confdefs.h <<\EOF
19031 #define USE_WIDEC_SUPPORT 1
19032 EOF
19033
19034         else
19035                 cat >>confdefs.h <<\EOF
19036 #define USE_WIDEC_SUPPORT 0
19037 EOF
19038
19039         fi
19040 else
19041         cat >>confdefs.h <<\EOF
19042 #define USE_WIDEC_SUPPORT 0
19043 EOF
19044
19045 fi
19046
19047 echo "$as_me:19047: checking if $cf_cv_screen library uses pthreads" >&5
19048 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19049 if test "${cf_cv_use_pthreads+set}" = set; then
19050   echo $ECHO_N "(cached) $ECHO_C" >&6
19051 else
19052
19053 cat >"conftest.$ac_ext" <<_ACEOF
19054 #line 19054 "configure"
19055 #include "confdefs.h"
19056
19057 #include <${cf_cv_ncurses_header:-curses.h}>
19058 extern void _nc_init_pthreads(void);
19059
19060 int
19061 main (void)
19062 {
19063
19064         initscr();
19065         _nc_init_pthreads();
19066
19067   ;
19068   return 0;
19069 }
19070 _ACEOF
19071 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19072 if { (eval echo "$as_me:19072: \"$ac_link\"") >&5
19073   (eval $ac_link) 2>&5
19074   ac_status=$?
19075   echo "$as_me:19075: \$? = $ac_status" >&5
19076   (exit "$ac_status"); } &&
19077          { ac_try='test -s "conftest$ac_exeext"'
19078   { (eval echo "$as_me:19078: \"$ac_try\"") >&5
19079   (eval $ac_try) 2>&5
19080   ac_status=$?
19081   echo "$as_me:19081: \$? = $ac_status" >&5
19082   (exit "$ac_status"); }; }; then
19083   cf_cv_use_pthreads=yes
19084 else
19085   echo "$as_me: failed program was:" >&5
19086 cat "conftest.$ac_ext" >&5
19087 cf_cv_use_pthreads=no
19088 fi
19089 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19090
19091 fi
19092 echo "$as_me:19092: result: $cf_cv_use_pthreads" >&5
19093 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19094 test $cf_cv_use_pthreads = yes &&
19095 cat >>confdefs.h <<\EOF
19096 #define USE_PTHREADS 1
19097 EOF
19098
19099 echo "$as_me:19099: checking if sys/time.h works with sys/select.h" >&5
19100 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19101 if test "${cf_cv_sys_time_select+set}" = set; then
19102   echo $ECHO_N "(cached) $ECHO_C" >&6
19103 else
19104
19105 cat >"conftest.$ac_ext" <<_ACEOF
19106 #line 19106 "configure"
19107 #include "confdefs.h"
19108
19109 #include <sys/types.h>
19110 #ifdef HAVE_SYS_TIME_H
19111 #include <sys/time.h>
19112 #endif
19113 #ifdef HAVE_SYS_SELECT_H
19114 #include <sys/select.h>
19115 #endif
19116
19117 int
19118 main (void)
19119 {
19120
19121   ;
19122   return 0;
19123 }
19124 _ACEOF
19125 rm -f "conftest.$ac_objext"
19126 if { (eval echo "$as_me:19126: \"$ac_compile\"") >&5
19127   (eval $ac_compile) 2>&5
19128   ac_status=$?
19129   echo "$as_me:19129: \$? = $ac_status" >&5
19130   (exit "$ac_status"); } &&
19131          { ac_try='test -s "conftest.$ac_objext"'
19132   { (eval echo "$as_me:19132: \"$ac_try\"") >&5
19133   (eval $ac_try) 2>&5
19134   ac_status=$?
19135   echo "$as_me:19135: \$? = $ac_status" >&5
19136   (exit "$ac_status"); }; }; then
19137   cf_cv_sys_time_select=yes
19138 else
19139   echo "$as_me: failed program was:" >&5
19140 cat "conftest.$ac_ext" >&5
19141 cf_cv_sys_time_select=no
19142 fi
19143 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19144
19145 fi
19146
19147 echo "$as_me:19147: result: $cf_cv_sys_time_select" >&5
19148 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19149 test "$cf_cv_sys_time_select" = yes &&
19150 cat >>confdefs.h <<\EOF
19151 #define HAVE_SYS_TIME_SELECT 1
19152 EOF
19153
19154 # special check for test/ditto.c
19155
19156 echo "$as_me:19156: checking for openpty in -lutil" >&5
19157 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19158 if test "${ac_cv_lib_util_openpty+set}" = set; then
19159   echo $ECHO_N "(cached) $ECHO_C" >&6
19160 else
19161   ac_check_lib_save_LIBS=$LIBS
19162 LIBS="-lutil  $LIBS"
19163 cat >"conftest.$ac_ext" <<_ACEOF
19164 #line 19164 "configure"
19165 #include "confdefs.h"
19166
19167 /* Override any gcc2 internal prototype to avoid an error.  */
19168 #ifdef __cplusplus
19169 extern "C"
19170 #endif
19171 /* We use char because int might match the return type of a gcc2
19172    builtin and then its argument prototype would still apply.  */
19173 char openpty ();
19174 int
19175 main (void)
19176 {
19177 openpty ();
19178   ;
19179   return 0;
19180 }
19181 _ACEOF
19182 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19183 if { (eval echo "$as_me:19183: \"$ac_link\"") >&5
19184   (eval $ac_link) 2>&5
19185   ac_status=$?
19186   echo "$as_me:19186: \$? = $ac_status" >&5
19187   (exit "$ac_status"); } &&
19188          { ac_try='test -s "conftest$ac_exeext"'
19189   { (eval echo "$as_me:19189: \"$ac_try\"") >&5
19190   (eval $ac_try) 2>&5
19191   ac_status=$?
19192   echo "$as_me:19192: \$? = $ac_status" >&5
19193   (exit "$ac_status"); }; }; then
19194   ac_cv_lib_util_openpty=yes
19195 else
19196   echo "$as_me: failed program was:" >&5
19197 cat "conftest.$ac_ext" >&5
19198 ac_cv_lib_util_openpty=no
19199 fi
19200 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19201 LIBS=$ac_check_lib_save_LIBS
19202 fi
19203 echo "$as_me:19203: result: $ac_cv_lib_util_openpty" >&5
19204 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19205 if test "$ac_cv_lib_util_openpty" = yes; then
19206   cf_cv_lib_util=yes
19207 else
19208   cf_cv_lib_util=no
19209 fi
19210
19211 echo "$as_me:19211: checking for openpty header" >&5
19212 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19213 if test "${cf_cv_func_openpty+set}" = set; then
19214   echo $ECHO_N "(cached) $ECHO_C" >&6
19215 else
19216
19217         cf_save_LIBS="$LIBS"
19218         test "$cf_cv_lib_util" = yes && {
19219 cf_add_libs="$LIBS"
19220 # reverse order
19221 cf_add_0lib=
19222 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19223 # filter duplicates
19224 for cf_add_1lib in $cf_add_0lib; do
19225         for cf_add_2lib in $cf_add_libs; do
19226                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19227                         cf_add_1lib=
19228                         break
19229                 fi
19230         done
19231         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19232 done
19233 LIBS="$cf_add_libs"
19234  }
19235         for cf_header in pty.h libutil.h util.h
19236         do
19237         cat >"conftest.$ac_ext" <<_ACEOF
19238 #line 19238 "configure"
19239 #include "confdefs.h"
19240
19241 #include <$cf_header>
19242
19243 int
19244 main (void)
19245 {
19246
19247         int x = openpty((int *)0, (int *)0, (char *)0,
19248                                    (struct termios *)0, (struct winsize *)0);
19249
19250   ;
19251   return 0;
19252 }
19253 _ACEOF
19254 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19255 if { (eval echo "$as_me:19255: \"$ac_link\"") >&5
19256   (eval $ac_link) 2>&5
19257   ac_status=$?
19258   echo "$as_me:19258: \$? = $ac_status" >&5
19259   (exit "$ac_status"); } &&
19260          { ac_try='test -s "conftest$ac_exeext"'
19261   { (eval echo "$as_me:19261: \"$ac_try\"") >&5
19262   (eval $ac_try) 2>&5
19263   ac_status=$?
19264   echo "$as_me:19264: \$? = $ac_status" >&5
19265   (exit "$ac_status"); }; }; then
19266
19267                 cf_cv_func_openpty=$cf_header
19268                 break
19269
19270 else
19271   echo "$as_me: failed program was:" >&5
19272 cat "conftest.$ac_ext" >&5
19273
19274                 cf_cv_func_openpty=no
19275
19276 fi
19277 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19278         done
19279         LIBS="$cf_save_LIBS"
19280
19281 fi
19282 echo "$as_me:19282: result: $cf_cv_func_openpty" >&5
19283 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19284
19285 if test "$cf_cv_func_openpty" != no ; then
19286
19287 cat >>confdefs.h <<EOF
19288 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19289 EOF
19290
19291 cat >>confdefs.h <<\EOF
19292 #define USE_XTERM_PTY 1
19293 EOF
19294
19295         if test "x$cf_cv_lib_util" = xyes ; then
19296
19297 cf_add_libs="$TEST_LIBS"
19298 # reverse order
19299 cf_add_0lib=
19300 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19301 # filter duplicates
19302 for cf_add_1lib in $cf_add_0lib; do
19303         for cf_add_2lib in $cf_add_libs; do
19304                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19305                         cf_add_1lib=
19306                         break
19307                 fi
19308         done
19309         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19310 done
19311 TEST_LIBS="$cf_add_libs"
19312
19313         fi
19314 fi
19315
19316 echo "$as_me:19316: checking for function curses_version" >&5
19317 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19318 if test "${cf_cv_func_curses_version+set}" = set; then
19319   echo $ECHO_N "(cached) $ECHO_C" >&6
19320 else
19321
19322 if test "$cross_compiling" = yes; then
19323   cf_cv_func_curses_version=unknown
19324 else
19325   cat >"conftest.$ac_ext" <<_ACEOF
19326 #line 19326 "configure"
19327 #include "confdefs.h"
19328
19329 #include <${cf_cv_ncurses_header:-curses.h}>
19330 int main(void)
19331 {
19332         char temp[1024];
19333         sprintf(temp, "%s\\n", curses_version());
19334         ${cf_cv_main_return:-return}(0);
19335 }
19336
19337 _ACEOF
19338 rm -f "conftest$ac_exeext"
19339 if { (eval echo "$as_me:19339: \"$ac_link\"") >&5
19340   (eval $ac_link) 2>&5
19341   ac_status=$?
19342   echo "$as_me:19342: \$? = $ac_status" >&5
19343   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19344   { (eval echo "$as_me:19344: \"$ac_try\"") >&5
19345   (eval $ac_try) 2>&5
19346   ac_status=$?
19347   echo "$as_me:19347: \$? = $ac_status" >&5
19348   (exit "$ac_status"); }; }; then
19349   cf_cv_func_curses_version=yes
19350
19351 else
19352   echo "$as_me: program exited with status $ac_status" >&5
19353 echo "$as_me: failed program was:" >&5
19354 cat "conftest.$ac_ext" >&5
19355 cf_cv_func_curses_version=no
19356
19357 fi
19358 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19359 fi
19360 rm -f core
19361 fi
19362 echo "$as_me:19362: result: $cf_cv_func_curses_version" >&5
19363 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19364 test "$cf_cv_func_curses_version" = yes &&
19365 cat >>confdefs.h <<\EOF
19366 #define HAVE_CURSES_VERSION 1
19367 EOF
19368
19369 echo "$as_me:19369: checking for alternate character set array" >&5
19370 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19371 if test "${cf_cv_curses_acs_map+set}" = set; then
19372   echo $ECHO_N "(cached) $ECHO_C" >&6
19373 else
19374
19375 cf_cv_curses_acs_map=unknown
19376 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19377 do
19378 cat >"conftest.$ac_ext" <<_ACEOF
19379 #line 19379 "configure"
19380 #include "confdefs.h"
19381
19382 #include <${cf_cv_ncurses_header:-curses.h}>
19383
19384 int
19385 main (void)
19386 {
19387
19388 ${name}['k'] = ACS_PLUS
19389
19390   ;
19391   return 0;
19392 }
19393 _ACEOF
19394 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19395 if { (eval echo "$as_me:19395: \"$ac_link\"") >&5
19396   (eval $ac_link) 2>&5
19397   ac_status=$?
19398   echo "$as_me:19398: \$? = $ac_status" >&5
19399   (exit "$ac_status"); } &&
19400          { ac_try='test -s "conftest$ac_exeext"'
19401   { (eval echo "$as_me:19401: \"$ac_try\"") >&5
19402   (eval $ac_try) 2>&5
19403   ac_status=$?
19404   echo "$as_me:19404: \$? = $ac_status" >&5
19405   (exit "$ac_status"); }; }; then
19406   cf_cv_curses_acs_map=$name; break
19407 else
19408   echo "$as_me: failed program was:" >&5
19409 cat "conftest.$ac_ext" >&5
19410 fi
19411 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19412 done
19413
19414 fi
19415 echo "$as_me:19415: result: $cf_cv_curses_acs_map" >&5
19416 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19417
19418 test "$cf_cv_curses_acs_map" != unknown &&
19419 cat >>confdefs.h <<EOF
19420 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19421 EOF
19422
19423 if test "$cf_enable_widec" = yes; then
19424
19425 echo "$as_me:19425: checking for wide alternate character set array" >&5
19426 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19427 if test "${cf_cv_curses_wacs_map+set}" = set; then
19428   echo $ECHO_N "(cached) $ECHO_C" >&6
19429 else
19430
19431         cf_cv_curses_wacs_map=unknown
19432         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19433         do
19434         cat >"conftest.$ac_ext" <<_ACEOF
19435 #line 19435 "configure"
19436 #include "confdefs.h"
19437
19438 #ifndef _XOPEN_SOURCE_EXTENDED
19439 #define _XOPEN_SOURCE_EXTENDED
19440 #endif
19441 #include <${cf_cv_ncurses_header:-curses.h}>
19442 int
19443 main (void)
19444 {
19445 void *foo = &(${name}['k']); (void)foo
19446   ;
19447   return 0;
19448 }
19449 _ACEOF
19450 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19451 if { (eval echo "$as_me:19451: \"$ac_link\"") >&5
19452   (eval $ac_link) 2>&5
19453   ac_status=$?
19454   echo "$as_me:19454: \$? = $ac_status" >&5
19455   (exit "$ac_status"); } &&
19456          { ac_try='test -s "conftest$ac_exeext"'
19457   { (eval echo "$as_me:19457: \"$ac_try\"") >&5
19458   (eval $ac_try) 2>&5
19459   ac_status=$?
19460   echo "$as_me:19460: \$? = $ac_status" >&5
19461   (exit "$ac_status"); }; }; then
19462   cf_cv_curses_wacs_map=$name
19463          break
19464 else
19465   echo "$as_me: failed program was:" >&5
19466 cat "conftest.$ac_ext" >&5
19467 fi
19468 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19469         done
19470 fi
19471 echo "$as_me:19471: result: $cf_cv_curses_wacs_map" >&5
19472 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19473
19474 test "$cf_cv_curses_wacs_map" != unknown &&
19475 cat >>confdefs.h <<EOF
19476 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19477 EOF
19478
19479 echo "$as_me:19479: checking for wide alternate character constants" >&5
19480 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19481 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19482   echo $ECHO_N "(cached) $ECHO_C" >&6
19483 else
19484
19485 cf_cv_curses_wacs_symbols=no
19486 if test "$cf_cv_curses_wacs_map" != unknown
19487 then
19488         cat >"conftest.$ac_ext" <<_ACEOF
19489 #line 19489 "configure"
19490 #include "confdefs.h"
19491
19492 #ifndef _XOPEN_SOURCE_EXTENDED
19493 #define _XOPEN_SOURCE_EXTENDED
19494 #endif
19495 #include <${cf_cv_ncurses_header:-curses.h}>
19496 int
19497 main (void)
19498 {
19499 cchar_t *foo = WACS_PLUS;
19500          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
19501   ;
19502   return 0;
19503 }
19504 _ACEOF
19505 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19506 if { (eval echo "$as_me:19506: \"$ac_link\"") >&5
19507   (eval $ac_link) 2>&5
19508   ac_status=$?
19509   echo "$as_me:19509: \$? = $ac_status" >&5
19510   (exit "$ac_status"); } &&
19511          { ac_try='test -s "conftest$ac_exeext"'
19512   { (eval echo "$as_me:19512: \"$ac_try\"") >&5
19513   (eval $ac_try) 2>&5
19514   ac_status=$?
19515   echo "$as_me:19515: \$? = $ac_status" >&5
19516   (exit "$ac_status"); }; }; then
19517   cf_cv_curses_wacs_symbols=yes
19518 else
19519   echo "$as_me: failed program was:" >&5
19520 cat "conftest.$ac_ext" >&5
19521 fi
19522 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19523 else
19524         cat >"conftest.$ac_ext" <<_ACEOF
19525 #line 19525 "configure"
19526 #include "confdefs.h"
19527
19528 #ifndef _XOPEN_SOURCE_EXTENDED
19529 #define _XOPEN_SOURCE_EXTENDED
19530 #endif
19531 #include <${cf_cv_ncurses_header:-curses.h}>
19532 int
19533 main (void)
19534 {
19535 cchar_t *foo = WACS_PLUS; (void)foo
19536   ;
19537   return 0;
19538 }
19539 _ACEOF
19540 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19541 if { (eval echo "$as_me:19541: \"$ac_link\"") >&5
19542   (eval $ac_link) 2>&5
19543   ac_status=$?
19544   echo "$as_me:19544: \$? = $ac_status" >&5
19545   (exit "$ac_status"); } &&
19546          { ac_try='test -s "conftest$ac_exeext"'
19547   { (eval echo "$as_me:19547: \"$ac_try\"") >&5
19548   (eval $ac_try) 2>&5
19549   ac_status=$?
19550   echo "$as_me:19550: \$? = $ac_status" >&5
19551   (exit "$ac_status"); }; }; then
19552   cf_cv_curses_wacs_symbols=yes
19553 else
19554   echo "$as_me: failed program was:" >&5
19555 cat "conftest.$ac_ext" >&5
19556 fi
19557 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19558 fi
19559
19560 fi
19561 echo "$as_me:19561: result: $cf_cv_curses_wacs_symbols" >&5
19562 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19563
19564 test "$cf_cv_curses_wacs_symbols" != no &&
19565 cat >>confdefs.h <<\EOF
19566 #define CURSES_WACS_SYMBOLS 1
19567 EOF
19568
19569 fi
19570
19571 echo "$as_me:19571: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19572 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19573 cat >"conftest.$ac_ext" <<_ACEOF
19574 #line 19574 "configure"
19575 #include "confdefs.h"
19576
19577 #ifndef _XOPEN_SOURCE_EXTENDED
19578 #define _XOPEN_SOURCE_EXTENDED
19579 #endif
19580 #include <${cf_cv_ncurses_header:-curses.h}>
19581 int
19582 main (void)
19583 {
19584
19585 attr_t foo
19586
19587   ;
19588   return 0;
19589 }
19590 _ACEOF
19591 rm -f "conftest.$ac_objext"
19592 if { (eval echo "$as_me:19592: \"$ac_compile\"") >&5
19593   (eval $ac_compile) 2>&5
19594   ac_status=$?
19595   echo "$as_me:19595: \$? = $ac_status" >&5
19596   (exit "$ac_status"); } &&
19597          { ac_try='test -s "conftest.$ac_objext"'
19598   { (eval echo "$as_me:19598: \"$ac_try\"") >&5
19599   (eval $ac_try) 2>&5
19600   ac_status=$?
19601   echo "$as_me:19601: \$? = $ac_status" >&5
19602   (exit "$ac_status"); }; }; then
19603   cf_result=yes
19604 else
19605   echo "$as_me: failed program was:" >&5
19606 cat "conftest.$ac_ext" >&5
19607 cf_result=no
19608 fi
19609 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19610 echo "$as_me:19610: result: $cf_result" >&5
19611 echo "${ECHO_T}$cf_result" >&6
19612 if test "$cf_result" = yes ; then
19613
19614 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19615
19616 cat >>confdefs.h <<EOF
19617 #define $cf_result 1
19618 EOF
19619
19620 else
19621
19622 cat >>confdefs.h <<EOF
19623 #define attr_t long
19624 EOF
19625
19626 fi
19627
19628 if test "$cf_enable_widec" = yes; then
19629
19630 # This is needed on Tru64 5.0 to declare mbstate_t
19631 echo "$as_me:19631: checking if we must include wchar.h to declare mbstate_t" >&5
19632 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19633 if test "${cf_cv_mbstate_t+set}" = set; then
19634   echo $ECHO_N "(cached) $ECHO_C" >&6
19635 else
19636
19637 cat >"conftest.$ac_ext" <<_ACEOF
19638 #line 19638 "configure"
19639 #include "confdefs.h"
19640
19641 #include <stdlib.h>
19642 #include <stdarg.h>
19643 #include <stdio.h>
19644 #ifdef HAVE_LIBUTF8_H
19645 #include <libutf8.h>
19646 #endif
19647 int
19648 main (void)
19649 {
19650 mbstate_t state
19651   ;
19652   return 0;
19653 }
19654 _ACEOF
19655 rm -f "conftest.$ac_objext"
19656 if { (eval echo "$as_me:19656: \"$ac_compile\"") >&5
19657   (eval $ac_compile) 2>&5
19658   ac_status=$?
19659   echo "$as_me:19659: \$? = $ac_status" >&5
19660   (exit "$ac_status"); } &&
19661          { ac_try='test -s "conftest.$ac_objext"'
19662   { (eval echo "$as_me:19662: \"$ac_try\"") >&5
19663   (eval $ac_try) 2>&5
19664   ac_status=$?
19665   echo "$as_me:19665: \$? = $ac_status" >&5
19666   (exit "$ac_status"); }; }; then
19667   cf_cv_mbstate_t=no
19668 else
19669   echo "$as_me: failed program was:" >&5
19670 cat "conftest.$ac_ext" >&5
19671 cat >"conftest.$ac_ext" <<_ACEOF
19672 #line 19672 "configure"
19673 #include "confdefs.h"
19674
19675 #include <stdlib.h>
19676 #include <stdarg.h>
19677 #include <stdio.h>
19678 #include <wchar.h>
19679 #ifdef HAVE_LIBUTF8_H
19680 #include <libutf8.h>
19681 #endif
19682 int
19683 main (void)
19684 {
19685 mbstate_t value
19686   ;
19687   return 0;
19688 }
19689 _ACEOF
19690 rm -f "conftest.$ac_objext"
19691 if { (eval echo "$as_me:19691: \"$ac_compile\"") >&5
19692   (eval $ac_compile) 2>&5
19693   ac_status=$?
19694   echo "$as_me:19694: \$? = $ac_status" >&5
19695   (exit "$ac_status"); } &&
19696          { ac_try='test -s "conftest.$ac_objext"'
19697   { (eval echo "$as_me:19697: \"$ac_try\"") >&5
19698   (eval $ac_try) 2>&5
19699   ac_status=$?
19700   echo "$as_me:19700: \$? = $ac_status" >&5
19701   (exit "$ac_status"); }; }; then
19702   cf_cv_mbstate_t=yes
19703 else
19704   echo "$as_me: failed program was:" >&5
19705 cat "conftest.$ac_ext" >&5
19706 cf_cv_mbstate_t=unknown
19707 fi
19708 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19709 fi
19710 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19711 fi
19712 echo "$as_me:19712: result: $cf_cv_mbstate_t" >&5
19713 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19714
19715 if test "$cf_cv_mbstate_t" = yes ; then
19716
19717 cat >>confdefs.h <<\EOF
19718 #define NEED_WCHAR_H 1
19719 EOF
19720
19721         NEED_WCHAR_H=1
19722 fi
19723
19724 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19725 if test "$cf_cv_mbstate_t" = unknown ; then
19726         NCURSES_MBSTATE_T=1
19727 fi
19728
19729 # if we find mbstate_t in either place, use substitution to provide a fallback.
19730 if test "$cf_cv_mbstate_t" != unknown ; then
19731         NCURSES_OK_MBSTATE_T=1
19732 fi
19733
19734 # This is needed on Tru64 5.0 to declare wchar_t
19735 echo "$as_me:19735: checking if we must include wchar.h to declare wchar_t" >&5
19736 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19737 if test "${cf_cv_wchar_t+set}" = set; then
19738   echo $ECHO_N "(cached) $ECHO_C" >&6
19739 else
19740
19741 cat >"conftest.$ac_ext" <<_ACEOF
19742 #line 19742 "configure"
19743 #include "confdefs.h"
19744
19745 #include <stdlib.h>
19746 #include <stdarg.h>
19747 #include <stdio.h>
19748 #ifdef HAVE_LIBUTF8_H
19749 #include <libutf8.h>
19750 #endif
19751 int
19752 main (void)
19753 {
19754 wchar_t state
19755   ;
19756   return 0;
19757 }
19758 _ACEOF
19759 rm -f "conftest.$ac_objext"
19760 if { (eval echo "$as_me:19760: \"$ac_compile\"") >&5
19761   (eval $ac_compile) 2>&5
19762   ac_status=$?
19763   echo "$as_me:19763: \$? = $ac_status" >&5
19764   (exit "$ac_status"); } &&
19765          { ac_try='test -s "conftest.$ac_objext"'
19766   { (eval echo "$as_me:19766: \"$ac_try\"") >&5
19767   (eval $ac_try) 2>&5
19768   ac_status=$?
19769   echo "$as_me:19769: \$? = $ac_status" >&5
19770   (exit "$ac_status"); }; }; then
19771   cf_cv_wchar_t=no
19772 else
19773   echo "$as_me: failed program was:" >&5
19774 cat "conftest.$ac_ext" >&5
19775 cat >"conftest.$ac_ext" <<_ACEOF
19776 #line 19776 "configure"
19777 #include "confdefs.h"
19778
19779 #include <stdlib.h>
19780 #include <stdarg.h>
19781 #include <stdio.h>
19782 #include <wchar.h>
19783 #ifdef HAVE_LIBUTF8_H
19784 #include <libutf8.h>
19785 #endif
19786 int
19787 main (void)
19788 {
19789 wchar_t value
19790   ;
19791   return 0;
19792 }
19793 _ACEOF
19794 rm -f "conftest.$ac_objext"
19795 if { (eval echo "$as_me:19795: \"$ac_compile\"") >&5
19796   (eval $ac_compile) 2>&5
19797   ac_status=$?
19798   echo "$as_me:19798: \$? = $ac_status" >&5
19799   (exit "$ac_status"); } &&
19800          { ac_try='test -s "conftest.$ac_objext"'
19801   { (eval echo "$as_me:19801: \"$ac_try\"") >&5
19802   (eval $ac_try) 2>&5
19803   ac_status=$?
19804   echo "$as_me:19804: \$? = $ac_status" >&5
19805   (exit "$ac_status"); }; }; then
19806   cf_cv_wchar_t=yes
19807 else
19808   echo "$as_me: failed program was:" >&5
19809 cat "conftest.$ac_ext" >&5
19810 cf_cv_wchar_t=unknown
19811 fi
19812 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19813 fi
19814 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19815 fi
19816 echo "$as_me:19816: result: $cf_cv_wchar_t" >&5
19817 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19818
19819 if test "$cf_cv_wchar_t" = yes ; then
19820
19821 cat >>confdefs.h <<\EOF
19822 #define NEED_WCHAR_H 1
19823 EOF
19824
19825         NEED_WCHAR_H=1
19826 fi
19827
19828 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19829 if test "$cf_cv_wchar_t" = unknown ; then
19830         NCURSES_WCHAR_T=1
19831 fi
19832
19833 # if we find wchar_t in either place, use substitution to provide a fallback.
19834 if test "$cf_cv_wchar_t" != unknown ; then
19835         NCURSES_OK_WCHAR_T=1
19836 fi
19837
19838 # This is needed on Tru64 5.0 to declare wint_t
19839 echo "$as_me:19839: checking if we must include wchar.h to declare wint_t" >&5
19840 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19841 if test "${cf_cv_wint_t+set}" = set; then
19842   echo $ECHO_N "(cached) $ECHO_C" >&6
19843 else
19844
19845 cat >"conftest.$ac_ext" <<_ACEOF
19846 #line 19846 "configure"
19847 #include "confdefs.h"
19848
19849 #include <stdlib.h>
19850 #include <stdarg.h>
19851 #include <stdio.h>
19852 #ifdef HAVE_LIBUTF8_H
19853 #include <libutf8.h>
19854 #endif
19855 int
19856 main (void)
19857 {
19858 wint_t state
19859   ;
19860   return 0;
19861 }
19862 _ACEOF
19863 rm -f "conftest.$ac_objext"
19864 if { (eval echo "$as_me:19864: \"$ac_compile\"") >&5
19865   (eval $ac_compile) 2>&5
19866   ac_status=$?
19867   echo "$as_me:19867: \$? = $ac_status" >&5
19868   (exit "$ac_status"); } &&
19869          { ac_try='test -s "conftest.$ac_objext"'
19870   { (eval echo "$as_me:19870: \"$ac_try\"") >&5
19871   (eval $ac_try) 2>&5
19872   ac_status=$?
19873   echo "$as_me:19873: \$? = $ac_status" >&5
19874   (exit "$ac_status"); }; }; then
19875   cf_cv_wint_t=no
19876 else
19877   echo "$as_me: failed program was:" >&5
19878 cat "conftest.$ac_ext" >&5
19879 cat >"conftest.$ac_ext" <<_ACEOF
19880 #line 19880 "configure"
19881 #include "confdefs.h"
19882
19883 #include <stdlib.h>
19884 #include <stdarg.h>
19885 #include <stdio.h>
19886 #include <wchar.h>
19887 #ifdef HAVE_LIBUTF8_H
19888 #include <libutf8.h>
19889 #endif
19890 int
19891 main (void)
19892 {
19893 wint_t value
19894   ;
19895   return 0;
19896 }
19897 _ACEOF
19898 rm -f "conftest.$ac_objext"
19899 if { (eval echo "$as_me:19899: \"$ac_compile\"") >&5
19900   (eval $ac_compile) 2>&5
19901   ac_status=$?
19902   echo "$as_me:19902: \$? = $ac_status" >&5
19903   (exit "$ac_status"); } &&
19904          { ac_try='test -s "conftest.$ac_objext"'
19905   { (eval echo "$as_me:19905: \"$ac_try\"") >&5
19906   (eval $ac_try) 2>&5
19907   ac_status=$?
19908   echo "$as_me:19908: \$? = $ac_status" >&5
19909   (exit "$ac_status"); }; }; then
19910   cf_cv_wint_t=yes
19911 else
19912   echo "$as_me: failed program was:" >&5
19913 cat "conftest.$ac_ext" >&5
19914 cf_cv_wint_t=unknown
19915 fi
19916 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19917 fi
19918 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19919 fi
19920 echo "$as_me:19920: result: $cf_cv_wint_t" >&5
19921 echo "${ECHO_T}$cf_cv_wint_t" >&6
19922
19923 if test "$cf_cv_wint_t" = yes ; then
19924
19925 cat >>confdefs.h <<\EOF
19926 #define NEED_WCHAR_H 1
19927 EOF
19928
19929         NEED_WCHAR_H=1
19930 fi
19931
19932 # if we do not find wint_t in either place, use substitution to provide a fallback.
19933 if test "$cf_cv_wint_t" = unknown ; then
19934         NCURSES_WINT_T=1
19935 fi
19936
19937 # if we find wint_t in either place, use substitution to provide a fallback.
19938 if test "$cf_cv_wint_t" != unknown ; then
19939         NCURSES_OK_WINT_T=1
19940 fi
19941
19942         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19943
19944 echo "$as_me:19944: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19945 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19946 cat >"conftest.$ac_ext" <<_ACEOF
19947 #line 19947 "configure"
19948 #include "confdefs.h"
19949
19950 #ifndef _XOPEN_SOURCE_EXTENDED
19951 #define _XOPEN_SOURCE_EXTENDED
19952 #endif
19953 #include <${cf_cv_ncurses_header:-curses.h}>
19954 int
19955 main (void)
19956 {
19957
19958 mbstate_t foo
19959
19960   ;
19961   return 0;
19962 }
19963 _ACEOF
19964 rm -f "conftest.$ac_objext"
19965 if { (eval echo "$as_me:19965: \"$ac_compile\"") >&5
19966   (eval $ac_compile) 2>&5
19967   ac_status=$?
19968   echo "$as_me:19968: \$? = $ac_status" >&5
19969   (exit "$ac_status"); } &&
19970          { ac_try='test -s "conftest.$ac_objext"'
19971   { (eval echo "$as_me:19971: \"$ac_try\"") >&5
19972   (eval $ac_try) 2>&5
19973   ac_status=$?
19974   echo "$as_me:19974: \$? = $ac_status" >&5
19975   (exit "$ac_status"); }; }; then
19976   cf_result=yes
19977 else
19978   echo "$as_me: failed program was:" >&5
19979 cat "conftest.$ac_ext" >&5
19980 cf_result=no
19981 fi
19982 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19983 echo "$as_me:19983: result: $cf_result" >&5
19984 echo "${ECHO_T}$cf_result" >&6
19985 if test "$cf_result" = yes ; then
19986
19987 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19988
19989 cat >>confdefs.h <<EOF
19990 #define $cf_result 1
19991 EOF
19992
19993 else
19994
19995 cat >>confdefs.h <<EOF
19996 #define mbstate_t long
19997 EOF
19998
19999 fi
20000
20001         fi
20002
20003         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20004
20005 echo "$as_me:20005: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20006 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20007 cat >"conftest.$ac_ext" <<_ACEOF
20008 #line 20008 "configure"
20009 #include "confdefs.h"
20010
20011 #ifndef _XOPEN_SOURCE_EXTENDED
20012 #define _XOPEN_SOURCE_EXTENDED
20013 #endif
20014 #include <${cf_cv_ncurses_header:-curses.h}>
20015 int
20016 main (void)
20017 {
20018
20019 wchar_t foo
20020
20021   ;
20022   return 0;
20023 }
20024 _ACEOF
20025 rm -f "conftest.$ac_objext"
20026 if { (eval echo "$as_me:20026: \"$ac_compile\"") >&5
20027   (eval $ac_compile) 2>&5
20028   ac_status=$?
20029   echo "$as_me:20029: \$? = $ac_status" >&5
20030   (exit "$ac_status"); } &&
20031          { ac_try='test -s "conftest.$ac_objext"'
20032   { (eval echo "$as_me:20032: \"$ac_try\"") >&5
20033   (eval $ac_try) 2>&5
20034   ac_status=$?
20035   echo "$as_me:20035: \$? = $ac_status" >&5
20036   (exit "$ac_status"); }; }; then
20037   cf_result=yes
20038 else
20039   echo "$as_me: failed program was:" >&5
20040 cat "conftest.$ac_ext" >&5
20041 cf_result=no
20042 fi
20043 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20044 echo "$as_me:20044: result: $cf_result" >&5
20045 echo "${ECHO_T}$cf_result" >&6
20046 if test "$cf_result" = yes ; then
20047
20048 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20049
20050 cat >>confdefs.h <<EOF
20051 #define $cf_result 1
20052 EOF
20053
20054 else
20055
20056 cat >>confdefs.h <<EOF
20057 #define wchar_t long
20058 EOF
20059
20060 fi
20061
20062         fi
20063
20064         if test "$NCURSES_OK_WINT_T" = 0 ; then
20065
20066 echo "$as_me:20066: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20067 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20068 cat >"conftest.$ac_ext" <<_ACEOF
20069 #line 20069 "configure"
20070 #include "confdefs.h"
20071
20072 #ifndef _XOPEN_SOURCE_EXTENDED
20073 #define _XOPEN_SOURCE_EXTENDED
20074 #endif
20075 #include <${cf_cv_ncurses_header:-curses.h}>
20076 int
20077 main (void)
20078 {
20079
20080 wint_t foo
20081
20082   ;
20083   return 0;
20084 }
20085 _ACEOF
20086 rm -f "conftest.$ac_objext"
20087 if { (eval echo "$as_me:20087: \"$ac_compile\"") >&5
20088   (eval $ac_compile) 2>&5
20089   ac_status=$?
20090   echo "$as_me:20090: \$? = $ac_status" >&5
20091   (exit "$ac_status"); } &&
20092          { ac_try='test -s "conftest.$ac_objext"'
20093   { (eval echo "$as_me:20093: \"$ac_try\"") >&5
20094   (eval $ac_try) 2>&5
20095   ac_status=$?
20096   echo "$as_me:20096: \$? = $ac_status" >&5
20097   (exit "$ac_status"); }; }; then
20098   cf_result=yes
20099 else
20100   echo "$as_me: failed program was:" >&5
20101 cat "conftest.$ac_ext" >&5
20102 cf_result=no
20103 fi
20104 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20105 echo "$as_me:20105: result: $cf_result" >&5
20106 echo "${ECHO_T}$cf_result" >&6
20107 if test "$cf_result" = yes ; then
20108
20109 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20110
20111 cat >>confdefs.h <<EOF
20112 #define $cf_result 1
20113 EOF
20114
20115 else
20116
20117 cat >>confdefs.h <<EOF
20118 #define wint_t long
20119 EOF
20120
20121 fi
20122
20123         fi
20124 fi
20125
20126 for cf_data in \
20127 TABSIZE \
20128 curscr \
20129 ospeed \
20130 boolnames \
20131 boolfnames \
20132 ttytype
20133 do
20134 echo "$as_me:20134: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20135 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20136
20137 cat >"conftest.$ac_ext" <<_ACEOF
20138 #line 20138 "configure"
20139 #include "confdefs.h"
20140
20141 #ifdef HAVE_XCURSES
20142 #include <xcurses.h>
20143 char * XCursesProgramName = "test";
20144 #else
20145 #include <${cf_cv_ncurses_header:-curses.h}>
20146 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20147 #include <ncursesw/term.h>
20148 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20149 #include <ncurses/term.h>
20150 #elif defined(HAVE_TERM_H)
20151 #include <term.h>
20152 #endif
20153 #endif
20154
20155 int
20156 main (void)
20157 {
20158
20159 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20160         const void *foo = (const void *)($cf_data);
20161 #else
20162         const void *foo = &($cf_data);
20163 #endif
20164         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20165
20166   ;
20167   return 0;
20168 }
20169 _ACEOF
20170 rm -f "conftest.$ac_objext"
20171 if { (eval echo "$as_me:20171: \"$ac_compile\"") >&5
20172   (eval $ac_compile) 2>&5
20173   ac_status=$?
20174   echo "$as_me:20174: \$? = $ac_status" >&5
20175   (exit "$ac_status"); } &&
20176          { ac_try='test -s "conftest.$ac_objext"'
20177   { (eval echo "$as_me:20177: \"$ac_try\"") >&5
20178   (eval $ac_try) 2>&5
20179   ac_status=$?
20180   echo "$as_me:20180: \$? = $ac_status" >&5
20181   (exit "$ac_status"); }; }; then
20182   cf_result=yes
20183
20184 else
20185   echo "$as_me: failed program was:" >&5
20186 cat "conftest.$ac_ext" >&5
20187 cf_result=no
20188 fi
20189 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20190 echo "$as_me:20190: result: $cf_result" >&5
20191 echo "${ECHO_T}$cf_result" >&6
20192
20193 if test "$cf_result" = yes ; then
20194
20195 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20196
20197         cat >>confdefs.h <<EOF
20198 #define $cf_result 1
20199 EOF
20200
20201 else
20202         echo "$as_me:20202: checking for data $cf_data in library" >&5
20203 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20204         # BSD linkers insist on making weak linkage, but resolve at runtime.
20205         if test "$cross_compiling" = yes; then
20206
20207         # cross-compiling
20208         cat >"conftest.$ac_ext" <<_ACEOF
20209 #line 20209 "configure"
20210 #include "confdefs.h"
20211
20212 #ifdef HAVE_XCURSES
20213 #include <xcurses.h>
20214 char * XCursesProgramName = "test";
20215 #else
20216 #include <${cf_cv_ncurses_header:-curses.h}>
20217 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20218 #include <ncursesw/term.h>
20219 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20220 #include <ncurses/term.h>
20221 #elif defined(HAVE_TERM_H)
20222 #include <term.h>
20223 #endif
20224 #endif
20225
20226 extern char $cf_data;
20227 int
20228 main (void)
20229 {
20230
20231         do {
20232
20233 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20234         const void *foo = (const void *)($cf_data);
20235 #else
20236         const void *foo = &($cf_data);
20237 #endif
20238         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20239
20240                 ${cf_cv_main_return:-return}(foo == 0);
20241         } while (0)
20242
20243   ;
20244   return 0;
20245 }
20246 _ACEOF
20247 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20248 if { (eval echo "$as_me:20248: \"$ac_link\"") >&5
20249   (eval $ac_link) 2>&5
20250   ac_status=$?
20251   echo "$as_me:20251: \$? = $ac_status" >&5
20252   (exit "$ac_status"); } &&
20253          { ac_try='test -s "conftest$ac_exeext"'
20254   { (eval echo "$as_me:20254: \"$ac_try\"") >&5
20255   (eval $ac_try) 2>&5
20256   ac_status=$?
20257   echo "$as_me:20257: \$? = $ac_status" >&5
20258   (exit "$ac_status"); }; }; then
20259   cf_result=yes
20260 else
20261   echo "$as_me: failed program was:" >&5
20262 cat "conftest.$ac_ext" >&5
20263 cf_result=no
20264 fi
20265 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20266
20267 else
20268   cat >"conftest.$ac_ext" <<_ACEOF
20269 #line 20269 "configure"
20270 #include "confdefs.h"
20271
20272 #ifdef HAVE_XCURSES
20273 #include <xcurses.h>
20274 char * XCursesProgramName = "test";
20275 #else
20276 #include <${cf_cv_ncurses_header:-curses.h}>
20277 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20278 #include <ncursesw/term.h>
20279 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20280 #include <ncurses/term.h>
20281 #elif defined(HAVE_TERM_H)
20282 #include <term.h>
20283 #endif
20284 #endif
20285
20286 extern char $cf_data;
20287 int main(void)
20288 {
20289
20290 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20291         const void *foo = (const void *)($cf_data);
20292 #else
20293         const void *foo = &($cf_data);
20294 #endif
20295         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20296
20297         ${cf_cv_main_return:-return}(foo == 0);
20298 }
20299 _ACEOF
20300 rm -f "conftest$ac_exeext"
20301 if { (eval echo "$as_me:20301: \"$ac_link\"") >&5
20302   (eval $ac_link) 2>&5
20303   ac_status=$?
20304   echo "$as_me:20304: \$? = $ac_status" >&5
20305   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20306   { (eval echo "$as_me:20306: \"$ac_try\"") >&5
20307   (eval $ac_try) 2>&5
20308   ac_status=$?
20309   echo "$as_me:20309: \$? = $ac_status" >&5
20310   (exit "$ac_status"); }; }; then
20311   cf_result=yes
20312
20313 else
20314   echo "$as_me: program exited with status $ac_status" >&5
20315 echo "$as_me: failed program was:" >&5
20316 cat "conftest.$ac_ext" >&5
20317 cf_result=no
20318 fi
20319 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20320 fi
20321         echo "$as_me:20321: result: $cf_result" >&5
20322 echo "${ECHO_T}$cf_result" >&6
20323         if test "$cf_result" = yes ; then
20324
20325 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20326
20327                 cat >>confdefs.h <<EOF
20328 #define $cf_result 1
20329 EOF
20330
20331                 # do not exit loop here, since we prefer system's declarations
20332         fi
20333 fi
20334 done
20335
20336 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20337 then
20338         echo "$as_me:20338: checking for X" >&5
20339 echo $ECHO_N "checking for X... $ECHO_C" >&6
20340
20341 # Check whether --with-x or --without-x was given.
20342 if test "${with_x+set}" = set; then
20343   withval="$with_x"
20344
20345 fi;
20346 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20347 if test "x$with_x" = xno; then
20348   # The user explicitly disabled X.
20349   have_x=disabled
20350 else
20351   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20352     # Both variables are already set.
20353     have_x=yes
20354   else
20355     if test "${ac_cv_have_x+set}" = set; then
20356   echo $ECHO_N "(cached) $ECHO_C" >&6
20357 else
20358   # One or both of the vars are not set, and there is no cached value.
20359 ac_x_includes=no ac_x_libraries=no
20360 rm -fr conftest.dir
20361 if mkdir conftest.dir; then
20362   cd conftest.dir
20363   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20364   cat >Imakefile <<'EOF'
20365 acfindx:
20366         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20367 EOF
20368   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20369     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20370     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20371     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20372     for ac_extension in a so sl dylib dll; do
20373       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20374          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20375         ac_im_usrlibdir=$ac_im_libdir; break
20376       fi
20377     done
20378     # Screen out bogus values from the imake configuration.  They are
20379     # bogus both because they are the default anyway, and because
20380     # using them would break gcc on systems where it needs fixed includes.
20381     case $ac_im_incroot in
20382         /usr/include) ;;
20383         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20384     esac
20385     case $ac_im_usrlibdir in
20386         /usr/lib | /lib) ;;
20387         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20388     esac
20389   fi
20390   cd ..
20391   rm -fr conftest.dir
20392 fi
20393
20394 # Standard set of common directories for X headers.
20395 # Check X11 before X11Rn because it is often a symlink to the current release.
20396 ac_x_header_dirs='
20397 /usr/X11/include
20398 /usr/X11R7/include
20399 /usr/X11R6/include
20400 /usr/X11R5/include
20401 /usr/X11R4/include
20402
20403 /opt/local/include
20404 /opt/X11/include
20405
20406 /usr/include/X11
20407 /usr/include/X11R7
20408 /usr/include/X11R6
20409 /usr/include/X11R5
20410 /usr/include/X11R4
20411
20412 /usr/local/X11/include
20413 /usr/local/X11R7/include
20414 /usr/local/X11R6/include
20415 /usr/local/X11R5/include
20416 /usr/local/X11R4/include
20417
20418 /usr/local/include/X11
20419 /usr/local/include/X11R7
20420 /usr/local/include/X11R6
20421 /usr/local/include/X11R5
20422 /usr/local/include/X11R4
20423
20424 /usr/X386/include
20425 /usr/x386/include
20426 /usr/XFree86/include/X11
20427
20428 /usr/include
20429 /usr/local/include
20430 /usr/unsupported/include
20431 /usr/athena/include
20432 /usr/local/x11r5/include
20433 /usr/lpp/Xamples/include
20434
20435 /usr/openwin/include
20436 /usr/openwin/share/include'
20437
20438 if test "$ac_x_includes" = no; then
20439   # Guess where to find include files, by looking for Intrinsic.h.
20440   # First, try using that file with no special directory specified.
20441   cat >"conftest.$ac_ext" <<_ACEOF
20442 #line 20442 "configure"
20443 #include "confdefs.h"
20444 #include <X11/Intrinsic.h>
20445 _ACEOF
20446 if { (eval echo "$as_me:20446: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20447   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20448   ac_status=$?
20449   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20450   rm -f conftest.er1
20451   cat conftest.err >&5
20452   echo "$as_me:20452: \$? = $ac_status" >&5
20453   (exit "$ac_status"); } >/dev/null; then
20454   if test -s conftest.err; then
20455     ac_cpp_err=$ac_c_preproc_warn_flag
20456   else
20457     ac_cpp_err=
20458   fi
20459 else
20460   ac_cpp_err=yes
20461 fi
20462 if test -z "$ac_cpp_err"; then
20463   # We can compile using X headers with no special include directory.
20464 ac_x_includes=
20465 else
20466   echo "$as_me: failed program was:" >&5
20467   cat "conftest.$ac_ext" >&5
20468   for ac_dir in $ac_x_header_dirs; do
20469   if test -r "$ac_dir/X11/Intrinsic.h"; then
20470     ac_x_includes=$ac_dir
20471     break
20472   fi
20473 done
20474 fi
20475 rm -f conftest.err "conftest.$ac_ext"
20476 fi # $ac_x_includes = no
20477
20478 if test "$ac_x_libraries" = no; then
20479   # Check for the libraries.
20480   # See if we find them without any special options.
20481   # Don't add to $LIBS permanently.
20482   ac_save_LIBS=$LIBS
20483   LIBS="-lXt $LIBS"
20484   cat >"conftest.$ac_ext" <<_ACEOF
20485 #line 20485 "configure"
20486 #include "confdefs.h"
20487 #include <X11/Intrinsic.h>
20488 int
20489 main (void)
20490 {
20491 XtMalloc (0)
20492   ;
20493   return 0;
20494 }
20495 _ACEOF
20496 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20497 if { (eval echo "$as_me:20497: \"$ac_link\"") >&5
20498   (eval $ac_link) 2>&5
20499   ac_status=$?
20500   echo "$as_me:20500: \$? = $ac_status" >&5
20501   (exit "$ac_status"); } &&
20502          { ac_try='test -s "conftest$ac_exeext"'
20503   { (eval echo "$as_me:20503: \"$ac_try\"") >&5
20504   (eval $ac_try) 2>&5
20505   ac_status=$?
20506   echo "$as_me:20506: \$? = $ac_status" >&5
20507   (exit "$ac_status"); }; }; then
20508   LIBS=$ac_save_LIBS
20509 # We can link X programs with no special library path.
20510 ac_x_libraries=
20511 else
20512   echo "$as_me: failed program was:" >&5
20513 cat "conftest.$ac_ext" >&5
20514 LIBS=$ac_save_LIBS
20515 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20516 do
20517   # Don't even attempt the hair of trying to link an X program!
20518   for ac_extension in a so sl dylib dll; do
20519     if test -r "$ac_dir/libXt.$ac_extension"; then
20520       ac_x_libraries=$ac_dir
20521       break 2
20522     fi
20523   done
20524 done
20525 fi
20526 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20527 fi # $ac_x_libraries = no
20528
20529 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20530   # Didn't find X anywhere.  Cache the known absence of X.
20531   ac_cv_have_x="have_x=no"
20532 else
20533   # Record where we found X for the cache.
20534   ac_cv_have_x="have_x=yes \
20535                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20536 fi
20537 fi
20538
20539   fi
20540   eval "$ac_cv_have_x"
20541 fi # $with_x != no
20542
20543 if test "$have_x" != yes; then
20544   echo "$as_me:20544: result: $have_x" >&5
20545 echo "${ECHO_T}$have_x" >&6
20546   no_x=yes
20547 else
20548   # If each of the values was on the command line, it overrides each guess.
20549   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20550   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20551   # Update the cache value to reflect the command line values.
20552   ac_cv_have_x="have_x=yes \
20553                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20554   echo "$as_me:20554: result: libraries $x_libraries, headers $x_includes" >&5
20555 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20556 fi
20557
20558         if test "$no_x" = yes; then
20559   # Not all programs may use this symbol, but it does not hurt to define it.
20560
20561 cat >>confdefs.h <<\EOF
20562 #define X_DISPLAY_MISSING 1
20563 EOF
20564
20565   X_CFLAGS=
20566   X_PRE_LIBS=
20567   X_LIBS=
20568   X_EXTRA_LIBS=
20569 else
20570   if test -n "$x_includes"; then
20571     X_CFLAGS="$X_CFLAGS -I$x_includes"
20572   fi
20573
20574   # It would also be nice to do this for all -L options, not just this one.
20575   if test -n "$x_libraries"; then
20576     X_LIBS="$X_LIBS -L$x_libraries"
20577     # For Solaris; some versions of Sun CC require a space after -R and
20578     # others require no space.  Words are not sufficient . . . .
20579     case `(uname -sr) 2>/dev/null` in
20580     "SunOS 5"*)
20581       echo "$as_me:20581: checking whether -R must be followed by a space" >&5
20582 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20583       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20584       cat >"conftest.$ac_ext" <<_ACEOF
20585 #line 20585 "configure"
20586 #include "confdefs.h"
20587
20588 int
20589 main (void)
20590 {
20591
20592   ;
20593   return 0;
20594 }
20595 _ACEOF
20596 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20597 if { (eval echo "$as_me:20597: \"$ac_link\"") >&5
20598   (eval $ac_link) 2>&5
20599   ac_status=$?
20600   echo "$as_me:20600: \$? = $ac_status" >&5
20601   (exit "$ac_status"); } &&
20602          { ac_try='test -s "conftest$ac_exeext"'
20603   { (eval echo "$as_me:20603: \"$ac_try\"") >&5
20604   (eval $ac_try) 2>&5
20605   ac_status=$?
20606   echo "$as_me:20606: \$? = $ac_status" >&5
20607   (exit "$ac_status"); }; }; then
20608   ac_R_nospace=yes
20609 else
20610   echo "$as_me: failed program was:" >&5
20611 cat "conftest.$ac_ext" >&5
20612 ac_R_nospace=no
20613 fi
20614 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20615       if test $ac_R_nospace = yes; then
20616         echo "$as_me:20616: result: no" >&5
20617 echo "${ECHO_T}no" >&6
20618         X_LIBS="$X_LIBS -R$x_libraries"
20619       else
20620         LIBS="$ac_xsave_LIBS -R $x_libraries"
20621         cat >"conftest.$ac_ext" <<_ACEOF
20622 #line 20622 "configure"
20623 #include "confdefs.h"
20624
20625 int
20626 main (void)
20627 {
20628
20629   ;
20630   return 0;
20631 }
20632 _ACEOF
20633 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20634 if { (eval echo "$as_me:20634: \"$ac_link\"") >&5
20635   (eval $ac_link) 2>&5
20636   ac_status=$?
20637   echo "$as_me:20637: \$? = $ac_status" >&5
20638   (exit "$ac_status"); } &&
20639          { ac_try='test -s "conftest$ac_exeext"'
20640   { (eval echo "$as_me:20640: \"$ac_try\"") >&5
20641   (eval $ac_try) 2>&5
20642   ac_status=$?
20643   echo "$as_me:20643: \$? = $ac_status" >&5
20644   (exit "$ac_status"); }; }; then
20645   ac_R_space=yes
20646 else
20647   echo "$as_me: failed program was:" >&5
20648 cat "conftest.$ac_ext" >&5
20649 ac_R_space=no
20650 fi
20651 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20652         if test $ac_R_space = yes; then
20653           echo "$as_me:20653: result: yes" >&5
20654 echo "${ECHO_T}yes" >&6
20655           X_LIBS="$X_LIBS -R $x_libraries"
20656         else
20657           echo "$as_me:20657: result: neither works" >&5
20658 echo "${ECHO_T}neither works" >&6
20659         fi
20660       fi
20661       LIBS=$ac_xsave_LIBS
20662     esac
20663   fi
20664
20665   # Check for system-dependent libraries X programs must link with.
20666   # Do this before checking for the system-independent R6 libraries
20667   # (-lICE), since we may need -lsocket or whatever for X linking.
20668
20669   if test "$ISC" = yes; then
20670     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20671   else
20672     # Martyn Johnson says this is needed for Ultrix, if the X
20673     # libraries were built with DECnet support.  And Karl Berry says
20674     # the Alpha needs dnet_stub (dnet does not exist).
20675     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20676     cat >"conftest.$ac_ext" <<_ACEOF
20677 #line 20677 "configure"
20678 #include "confdefs.h"
20679
20680 /* Override any gcc2 internal prototype to avoid an error.  */
20681 #ifdef __cplusplus
20682 extern "C"
20683 #endif
20684 /* We use char because int might match the return type of a gcc2
20685    builtin and then its argument prototype would still apply.  */
20686 char XOpenDisplay ();
20687 int
20688 main (void)
20689 {
20690 XOpenDisplay ();
20691   ;
20692   return 0;
20693 }
20694 _ACEOF
20695 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20696 if { (eval echo "$as_me:20696: \"$ac_link\"") >&5
20697   (eval $ac_link) 2>&5
20698   ac_status=$?
20699   echo "$as_me:20699: \$? = $ac_status" >&5
20700   (exit "$ac_status"); } &&
20701          { ac_try='test -s "conftest$ac_exeext"'
20702   { (eval echo "$as_me:20702: \"$ac_try\"") >&5
20703   (eval $ac_try) 2>&5
20704   ac_status=$?
20705   echo "$as_me:20705: \$? = $ac_status" >&5
20706   (exit "$ac_status"); }; }; then
20707   :
20708 else
20709   echo "$as_me: failed program was:" >&5
20710 cat "conftest.$ac_ext" >&5
20711 echo "$as_me:20711: checking for dnet_ntoa in -ldnet" >&5
20712 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20713 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20714   echo $ECHO_N "(cached) $ECHO_C" >&6
20715 else
20716   ac_check_lib_save_LIBS=$LIBS
20717 LIBS="-ldnet  $LIBS"
20718 cat >"conftest.$ac_ext" <<_ACEOF
20719 #line 20719 "configure"
20720 #include "confdefs.h"
20721
20722 /* Override any gcc2 internal prototype to avoid an error.  */
20723 #ifdef __cplusplus
20724 extern "C"
20725 #endif
20726 /* We use char because int might match the return type of a gcc2
20727    builtin and then its argument prototype would still apply.  */
20728 char dnet_ntoa ();
20729 int
20730 main (void)
20731 {
20732 dnet_ntoa ();
20733   ;
20734   return 0;
20735 }
20736 _ACEOF
20737 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20738 if { (eval echo "$as_me:20738: \"$ac_link\"") >&5
20739   (eval $ac_link) 2>&5
20740   ac_status=$?
20741   echo "$as_me:20741: \$? = $ac_status" >&5
20742   (exit "$ac_status"); } &&
20743          { ac_try='test -s "conftest$ac_exeext"'
20744   { (eval echo "$as_me:20744: \"$ac_try\"") >&5
20745   (eval $ac_try) 2>&5
20746   ac_status=$?
20747   echo "$as_me:20747: \$? = $ac_status" >&5
20748   (exit "$ac_status"); }; }; then
20749   ac_cv_lib_dnet_dnet_ntoa=yes
20750 else
20751   echo "$as_me: failed program was:" >&5
20752 cat "conftest.$ac_ext" >&5
20753 ac_cv_lib_dnet_dnet_ntoa=no
20754 fi
20755 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20756 LIBS=$ac_check_lib_save_LIBS
20757 fi
20758 echo "$as_me:20758: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20759 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20760 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
20761   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20762 fi
20763
20764     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20765       echo "$as_me:20765: checking for dnet_ntoa in -ldnet_stub" >&5
20766 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20767 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20768   echo $ECHO_N "(cached) $ECHO_C" >&6
20769 else
20770   ac_check_lib_save_LIBS=$LIBS
20771 LIBS="-ldnet_stub  $LIBS"
20772 cat >"conftest.$ac_ext" <<_ACEOF
20773 #line 20773 "configure"
20774 #include "confdefs.h"
20775
20776 /* Override any gcc2 internal prototype to avoid an error.  */
20777 #ifdef __cplusplus
20778 extern "C"
20779 #endif
20780 /* We use char because int might match the return type of a gcc2
20781    builtin and then its argument prototype would still apply.  */
20782 char dnet_ntoa ();
20783 int
20784 main (void)
20785 {
20786 dnet_ntoa ();
20787   ;
20788   return 0;
20789 }
20790 _ACEOF
20791 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20792 if { (eval echo "$as_me:20792: \"$ac_link\"") >&5
20793   (eval $ac_link) 2>&5
20794   ac_status=$?
20795   echo "$as_me:20795: \$? = $ac_status" >&5
20796   (exit "$ac_status"); } &&
20797          { ac_try='test -s "conftest$ac_exeext"'
20798   { (eval echo "$as_me:20798: \"$ac_try\"") >&5
20799   (eval $ac_try) 2>&5
20800   ac_status=$?
20801   echo "$as_me:20801: \$? = $ac_status" >&5
20802   (exit "$ac_status"); }; }; then
20803   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20804 else
20805   echo "$as_me: failed program was:" >&5
20806 cat "conftest.$ac_ext" >&5
20807 ac_cv_lib_dnet_stub_dnet_ntoa=no
20808 fi
20809 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20810 LIBS=$ac_check_lib_save_LIBS
20811 fi
20812 echo "$as_me:20812: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20813 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20814 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
20815   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20816 fi
20817
20818     fi
20819 fi
20820 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20821     LIBS="$ac_xsave_LIBS"
20822
20823     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20824     # to get the SysV transport functions.
20825     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20826     # needs -lnsl.
20827     # The nsl library prevents programs from opening the X display
20828     # on Irix 5.2, according to T.E. Dickey.
20829     # The functions gethostbyname, getservbyname, and inet_addr are
20830     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20831     echo "$as_me:20831: checking for gethostbyname" >&5
20832 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20833 if test "${ac_cv_func_gethostbyname+set}" = set; then
20834   echo $ECHO_N "(cached) $ECHO_C" >&6
20835 else
20836   cat >"conftest.$ac_ext" <<_ACEOF
20837 #line 20837 "configure"
20838 #include "confdefs.h"
20839 #define gethostbyname autoconf_temporary
20840 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20841 #undef gethostbyname
20842
20843 #ifdef __cplusplus
20844 extern "C"
20845 #endif
20846
20847 /* We use char because int might match the return type of a gcc2
20848    builtin and then its argument prototype would still apply.  */
20849 char gethostbyname (void);
20850
20851 int
20852 main (void)
20853 {
20854
20855 /* The GNU C library defines stubs for functions which it implements
20856     to always fail with ENOSYS.  Some functions are actually named
20857     something starting with __ and the normal name is an alias.  */
20858 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
20859 #error found stub for gethostbyname
20860 #endif
20861
20862         return gethostbyname ();
20863   ;
20864   return 0;
20865 }
20866 _ACEOF
20867 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20868 if { (eval echo "$as_me:20868: \"$ac_link\"") >&5
20869   (eval $ac_link) 2>&5
20870   ac_status=$?
20871   echo "$as_me:20871: \$? = $ac_status" >&5
20872   (exit "$ac_status"); } &&
20873          { ac_try='test -s "conftest$ac_exeext"'
20874   { (eval echo "$as_me:20874: \"$ac_try\"") >&5
20875   (eval $ac_try) 2>&5
20876   ac_status=$?
20877   echo "$as_me:20877: \$? = $ac_status" >&5
20878   (exit "$ac_status"); }; }; then
20879   ac_cv_func_gethostbyname=yes
20880 else
20881   echo "$as_me: failed program was:" >&5
20882 cat "conftest.$ac_ext" >&5
20883 ac_cv_func_gethostbyname=no
20884 fi
20885 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20886 fi
20887 echo "$as_me:20887: result: $ac_cv_func_gethostbyname" >&5
20888 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
20889
20890     if test $ac_cv_func_gethostbyname = no; then
20891       echo "$as_me:20891: checking for gethostbyname in -lnsl" >&5
20892 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
20893 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
20894   echo $ECHO_N "(cached) $ECHO_C" >&6
20895 else
20896   ac_check_lib_save_LIBS=$LIBS
20897 LIBS="-lnsl  $LIBS"
20898 cat >"conftest.$ac_ext" <<_ACEOF
20899 #line 20899 "configure"
20900 #include "confdefs.h"
20901
20902 /* Override any gcc2 internal prototype to avoid an error.  */
20903 #ifdef __cplusplus
20904 extern "C"
20905 #endif
20906 /* We use char because int might match the return type of a gcc2
20907    builtin and then its argument prototype would still apply.  */
20908 char gethostbyname ();
20909 int
20910 main (void)
20911 {
20912 gethostbyname ();
20913   ;
20914   return 0;
20915 }
20916 _ACEOF
20917 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20918 if { (eval echo "$as_me:20918: \"$ac_link\"") >&5
20919   (eval $ac_link) 2>&5
20920   ac_status=$?
20921   echo "$as_me:20921: \$? = $ac_status" >&5
20922   (exit "$ac_status"); } &&
20923          { ac_try='test -s "conftest$ac_exeext"'
20924   { (eval echo "$as_me:20924: \"$ac_try\"") >&5
20925   (eval $ac_try) 2>&5
20926   ac_status=$?
20927   echo "$as_me:20927: \$? = $ac_status" >&5
20928   (exit "$ac_status"); }; }; then
20929   ac_cv_lib_nsl_gethostbyname=yes
20930 else
20931   echo "$as_me: failed program was:" >&5
20932 cat "conftest.$ac_ext" >&5
20933 ac_cv_lib_nsl_gethostbyname=no
20934 fi
20935 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20936 LIBS=$ac_check_lib_save_LIBS
20937 fi
20938 echo "$as_me:20938: result: $ac_cv_lib_nsl_gethostbyname" >&5
20939 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
20940 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
20941   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
20942 fi
20943
20944       if test $ac_cv_lib_nsl_gethostbyname = no; then
20945         echo "$as_me:20945: checking for gethostbyname in -lbsd" >&5
20946 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
20947 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
20948   echo $ECHO_N "(cached) $ECHO_C" >&6
20949 else
20950   ac_check_lib_save_LIBS=$LIBS
20951 LIBS="-lbsd  $LIBS"
20952 cat >"conftest.$ac_ext" <<_ACEOF
20953 #line 20953 "configure"
20954 #include "confdefs.h"
20955
20956 /* Override any gcc2 internal prototype to avoid an error.  */
20957 #ifdef __cplusplus
20958 extern "C"
20959 #endif
20960 /* We use char because int might match the return type of a gcc2
20961    builtin and then its argument prototype would still apply.  */
20962 char gethostbyname ();
20963 int
20964 main (void)
20965 {
20966 gethostbyname ();
20967   ;
20968   return 0;
20969 }
20970 _ACEOF
20971 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20972 if { (eval echo "$as_me:20972: \"$ac_link\"") >&5
20973   (eval $ac_link) 2>&5
20974   ac_status=$?
20975   echo "$as_me:20975: \$? = $ac_status" >&5
20976   (exit "$ac_status"); } &&
20977          { ac_try='test -s "conftest$ac_exeext"'
20978   { (eval echo "$as_me:20978: \"$ac_try\"") >&5
20979   (eval $ac_try) 2>&5
20980   ac_status=$?
20981   echo "$as_me:20981: \$? = $ac_status" >&5
20982   (exit "$ac_status"); }; }; then
20983   ac_cv_lib_bsd_gethostbyname=yes
20984 else
20985   echo "$as_me: failed program was:" >&5
20986 cat "conftest.$ac_ext" >&5
20987 ac_cv_lib_bsd_gethostbyname=no
20988 fi
20989 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20990 LIBS=$ac_check_lib_save_LIBS
20991 fi
20992 echo "$as_me:20992: result: $ac_cv_lib_bsd_gethostbyname" >&5
20993 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
20994 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
20995   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
20996 fi
20997
20998       fi
20999     fi
21000
21001     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21002     # socket/setsockopt and other routines are undefined under SCO ODT
21003     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21004     # on later versions), says Simon Leinen: it contains gethostby*
21005     # variants that don't use the nameserver (or something).  -lsocket
21006     # must be given before -lnsl if both are needed.  We assume that
21007     # if connect needs -lnsl, so does gethostbyname.
21008     echo "$as_me:21008: checking for connect" >&5
21009 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21010 if test "${ac_cv_func_connect+set}" = set; then
21011   echo $ECHO_N "(cached) $ECHO_C" >&6
21012 else
21013   cat >"conftest.$ac_ext" <<_ACEOF
21014 #line 21014 "configure"
21015 #include "confdefs.h"
21016 #define connect autoconf_temporary
21017 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21018 #undef connect
21019
21020 #ifdef __cplusplus
21021 extern "C"
21022 #endif
21023
21024 /* We use char because int might match the return type of a gcc2
21025    builtin and then its argument prototype would still apply.  */
21026 char connect (void);
21027
21028 int
21029 main (void)
21030 {
21031
21032 /* The GNU C library defines stubs for functions which it implements
21033     to always fail with ENOSYS.  Some functions are actually named
21034     something starting with __ and the normal name is an alias.  */
21035 #if defined (__stub_connect) || defined (__stub___connect)
21036 #error found stub for connect
21037 #endif
21038
21039         return connect ();
21040   ;
21041   return 0;
21042 }
21043 _ACEOF
21044 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21045 if { (eval echo "$as_me:21045: \"$ac_link\"") >&5
21046   (eval $ac_link) 2>&5
21047   ac_status=$?
21048   echo "$as_me:21048: \$? = $ac_status" >&5
21049   (exit "$ac_status"); } &&
21050          { ac_try='test -s "conftest$ac_exeext"'
21051   { (eval echo "$as_me:21051: \"$ac_try\"") >&5
21052   (eval $ac_try) 2>&5
21053   ac_status=$?
21054   echo "$as_me:21054: \$? = $ac_status" >&5
21055   (exit "$ac_status"); }; }; then
21056   ac_cv_func_connect=yes
21057 else
21058   echo "$as_me: failed program was:" >&5
21059 cat "conftest.$ac_ext" >&5
21060 ac_cv_func_connect=no
21061 fi
21062 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21063 fi
21064 echo "$as_me:21064: result: $ac_cv_func_connect" >&5
21065 echo "${ECHO_T}$ac_cv_func_connect" >&6
21066
21067     if test $ac_cv_func_connect = no; then
21068       echo "$as_me:21068: checking for connect in -lsocket" >&5
21069 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21070 if test "${ac_cv_lib_socket_connect+set}" = set; then
21071   echo $ECHO_N "(cached) $ECHO_C" >&6
21072 else
21073   ac_check_lib_save_LIBS=$LIBS
21074 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21075 cat >"conftest.$ac_ext" <<_ACEOF
21076 #line 21076 "configure"
21077 #include "confdefs.h"
21078
21079 /* Override any gcc2 internal prototype to avoid an error.  */
21080 #ifdef __cplusplus
21081 extern "C"
21082 #endif
21083 /* We use char because int might match the return type of a gcc2
21084    builtin and then its argument prototype would still apply.  */
21085 char connect ();
21086 int
21087 main (void)
21088 {
21089 connect ();
21090   ;
21091   return 0;
21092 }
21093 _ACEOF
21094 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21095 if { (eval echo "$as_me:21095: \"$ac_link\"") >&5
21096   (eval $ac_link) 2>&5
21097   ac_status=$?
21098   echo "$as_me:21098: \$? = $ac_status" >&5
21099   (exit "$ac_status"); } &&
21100          { ac_try='test -s "conftest$ac_exeext"'
21101   { (eval echo "$as_me:21101: \"$ac_try\"") >&5
21102   (eval $ac_try) 2>&5
21103   ac_status=$?
21104   echo "$as_me:21104: \$? = $ac_status" >&5
21105   (exit "$ac_status"); }; }; then
21106   ac_cv_lib_socket_connect=yes
21107 else
21108   echo "$as_me: failed program was:" >&5
21109 cat "conftest.$ac_ext" >&5
21110 ac_cv_lib_socket_connect=no
21111 fi
21112 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21113 LIBS=$ac_check_lib_save_LIBS
21114 fi
21115 echo "$as_me:21115: result: $ac_cv_lib_socket_connect" >&5
21116 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21117 if test "$ac_cv_lib_socket_connect" = yes; then
21118   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21119 fi
21120
21121     fi
21122
21123     # Guillermo Gomez says -lposix is necessary on A/UX.
21124     echo "$as_me:21124: checking for remove" >&5
21125 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21126 if test "${ac_cv_func_remove+set}" = set; then
21127   echo $ECHO_N "(cached) $ECHO_C" >&6
21128 else
21129   cat >"conftest.$ac_ext" <<_ACEOF
21130 #line 21130 "configure"
21131 #include "confdefs.h"
21132 #define remove autoconf_temporary
21133 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21134 #undef remove
21135
21136 #ifdef __cplusplus
21137 extern "C"
21138 #endif
21139
21140 /* We use char because int might match the return type of a gcc2
21141    builtin and then its argument prototype would still apply.  */
21142 char remove (void);
21143
21144 int
21145 main (void)
21146 {
21147
21148 /* The GNU C library defines stubs for functions which it implements
21149     to always fail with ENOSYS.  Some functions are actually named
21150     something starting with __ and the normal name is an alias.  */
21151 #if defined (__stub_remove) || defined (__stub___remove)
21152 #error found stub for remove
21153 #endif
21154
21155         return remove ();
21156   ;
21157   return 0;
21158 }
21159 _ACEOF
21160 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21161 if { (eval echo "$as_me:21161: \"$ac_link\"") >&5
21162   (eval $ac_link) 2>&5
21163   ac_status=$?
21164   echo "$as_me:21164: \$? = $ac_status" >&5
21165   (exit "$ac_status"); } &&
21166          { ac_try='test -s "conftest$ac_exeext"'
21167   { (eval echo "$as_me:21167: \"$ac_try\"") >&5
21168   (eval $ac_try) 2>&5
21169   ac_status=$?
21170   echo "$as_me:21170: \$? = $ac_status" >&5
21171   (exit "$ac_status"); }; }; then
21172   ac_cv_func_remove=yes
21173 else
21174   echo "$as_me: failed program was:" >&5
21175 cat "conftest.$ac_ext" >&5
21176 ac_cv_func_remove=no
21177 fi
21178 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21179 fi
21180 echo "$as_me:21180: result: $ac_cv_func_remove" >&5
21181 echo "${ECHO_T}$ac_cv_func_remove" >&6
21182
21183     if test $ac_cv_func_remove = no; then
21184       echo "$as_me:21184: checking for remove in -lposix" >&5
21185 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21186 if test "${ac_cv_lib_posix_remove+set}" = set; then
21187   echo $ECHO_N "(cached) $ECHO_C" >&6
21188 else
21189   ac_check_lib_save_LIBS=$LIBS
21190 LIBS="-lposix  $LIBS"
21191 cat >"conftest.$ac_ext" <<_ACEOF
21192 #line 21192 "configure"
21193 #include "confdefs.h"
21194
21195 /* Override any gcc2 internal prototype to avoid an error.  */
21196 #ifdef __cplusplus
21197 extern "C"
21198 #endif
21199 /* We use char because int might match the return type of a gcc2
21200    builtin and then its argument prototype would still apply.  */
21201 char remove ();
21202 int
21203 main (void)
21204 {
21205 remove ();
21206   ;
21207   return 0;
21208 }
21209 _ACEOF
21210 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21211 if { (eval echo "$as_me:21211: \"$ac_link\"") >&5
21212   (eval $ac_link) 2>&5
21213   ac_status=$?
21214   echo "$as_me:21214: \$? = $ac_status" >&5
21215   (exit "$ac_status"); } &&
21216          { ac_try='test -s "conftest$ac_exeext"'
21217   { (eval echo "$as_me:21217: \"$ac_try\"") >&5
21218   (eval $ac_try) 2>&5
21219   ac_status=$?
21220   echo "$as_me:21220: \$? = $ac_status" >&5
21221   (exit "$ac_status"); }; }; then
21222   ac_cv_lib_posix_remove=yes
21223 else
21224   echo "$as_me: failed program was:" >&5
21225 cat "conftest.$ac_ext" >&5
21226 ac_cv_lib_posix_remove=no
21227 fi
21228 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21229 LIBS=$ac_check_lib_save_LIBS
21230 fi
21231 echo "$as_me:21231: result: $ac_cv_lib_posix_remove" >&5
21232 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21233 if test "$ac_cv_lib_posix_remove" = yes; then
21234   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21235 fi
21236
21237     fi
21238
21239     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21240     echo "$as_me:21240: checking for shmat" >&5
21241 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21242 if test "${ac_cv_func_shmat+set}" = set; then
21243   echo $ECHO_N "(cached) $ECHO_C" >&6
21244 else
21245   cat >"conftest.$ac_ext" <<_ACEOF
21246 #line 21246 "configure"
21247 #include "confdefs.h"
21248 #define shmat autoconf_temporary
21249 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21250 #undef shmat
21251
21252 #ifdef __cplusplus
21253 extern "C"
21254 #endif
21255
21256 /* We use char because int might match the return type of a gcc2
21257    builtin and then its argument prototype would still apply.  */
21258 char shmat (void);
21259
21260 int
21261 main (void)
21262 {
21263
21264 /* The GNU C library defines stubs for functions which it implements
21265     to always fail with ENOSYS.  Some functions are actually named
21266     something starting with __ and the normal name is an alias.  */
21267 #if defined (__stub_shmat) || defined (__stub___shmat)
21268 #error found stub for shmat
21269 #endif
21270
21271         return shmat ();
21272   ;
21273   return 0;
21274 }
21275 _ACEOF
21276 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21277 if { (eval echo "$as_me:21277: \"$ac_link\"") >&5
21278   (eval $ac_link) 2>&5
21279   ac_status=$?
21280   echo "$as_me:21280: \$? = $ac_status" >&5
21281   (exit "$ac_status"); } &&
21282          { ac_try='test -s "conftest$ac_exeext"'
21283   { (eval echo "$as_me:21283: \"$ac_try\"") >&5
21284   (eval $ac_try) 2>&5
21285   ac_status=$?
21286   echo "$as_me:21286: \$? = $ac_status" >&5
21287   (exit "$ac_status"); }; }; then
21288   ac_cv_func_shmat=yes
21289 else
21290   echo "$as_me: failed program was:" >&5
21291 cat "conftest.$ac_ext" >&5
21292 ac_cv_func_shmat=no
21293 fi
21294 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21295 fi
21296 echo "$as_me:21296: result: $ac_cv_func_shmat" >&5
21297 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21298
21299     if test $ac_cv_func_shmat = no; then
21300       echo "$as_me:21300: checking for shmat in -lipc" >&5
21301 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21302 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21303   echo $ECHO_N "(cached) $ECHO_C" >&6
21304 else
21305   ac_check_lib_save_LIBS=$LIBS
21306 LIBS="-lipc  $LIBS"
21307 cat >"conftest.$ac_ext" <<_ACEOF
21308 #line 21308 "configure"
21309 #include "confdefs.h"
21310
21311 /* Override any gcc2 internal prototype to avoid an error.  */
21312 #ifdef __cplusplus
21313 extern "C"
21314 #endif
21315 /* We use char because int might match the return type of a gcc2
21316    builtin and then its argument prototype would still apply.  */
21317 char shmat ();
21318 int
21319 main (void)
21320 {
21321 shmat ();
21322   ;
21323   return 0;
21324 }
21325 _ACEOF
21326 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21327 if { (eval echo "$as_me:21327: \"$ac_link\"") >&5
21328   (eval $ac_link) 2>&5
21329   ac_status=$?
21330   echo "$as_me:21330: \$? = $ac_status" >&5
21331   (exit "$ac_status"); } &&
21332          { ac_try='test -s "conftest$ac_exeext"'
21333   { (eval echo "$as_me:21333: \"$ac_try\"") >&5
21334   (eval $ac_try) 2>&5
21335   ac_status=$?
21336   echo "$as_me:21336: \$? = $ac_status" >&5
21337   (exit "$ac_status"); }; }; then
21338   ac_cv_lib_ipc_shmat=yes
21339 else
21340   echo "$as_me: failed program was:" >&5
21341 cat "conftest.$ac_ext" >&5
21342 ac_cv_lib_ipc_shmat=no
21343 fi
21344 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21345 LIBS=$ac_check_lib_save_LIBS
21346 fi
21347 echo "$as_me:21347: result: $ac_cv_lib_ipc_shmat" >&5
21348 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21349 if test "$ac_cv_lib_ipc_shmat" = yes; then
21350   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21351 fi
21352
21353     fi
21354   fi
21355
21356   # Check for libraries that X11R6 Xt/Xaw programs need.
21357   ac_save_LDFLAGS=$LDFLAGS
21358   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21359   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21360   # check for ICE first), but we must link in the order -lSM -lICE or
21361   # we get undefined symbols.  So assume we have SM if we have ICE.
21362   # These have to be linked with before -lX11, unlike the other
21363   # libraries we check for below, so use a different variable.
21364   # John Interrante, Karl Berry
21365   echo "$as_me:21365: checking for IceConnectionNumber in -lICE" >&5
21366 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21367 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21368   echo $ECHO_N "(cached) $ECHO_C" >&6
21369 else
21370   ac_check_lib_save_LIBS=$LIBS
21371 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21372 cat >"conftest.$ac_ext" <<_ACEOF
21373 #line 21373 "configure"
21374 #include "confdefs.h"
21375
21376 /* Override any gcc2 internal prototype to avoid an error.  */
21377 #ifdef __cplusplus
21378 extern "C"
21379 #endif
21380 /* We use char because int might match the return type of a gcc2
21381    builtin and then its argument prototype would still apply.  */
21382 char IceConnectionNumber ();
21383 int
21384 main (void)
21385 {
21386 IceConnectionNumber ();
21387   ;
21388   return 0;
21389 }
21390 _ACEOF
21391 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21392 if { (eval echo "$as_me:21392: \"$ac_link\"") >&5
21393   (eval $ac_link) 2>&5
21394   ac_status=$?
21395   echo "$as_me:21395: \$? = $ac_status" >&5
21396   (exit "$ac_status"); } &&
21397          { ac_try='test -s "conftest$ac_exeext"'
21398   { (eval echo "$as_me:21398: \"$ac_try\"") >&5
21399   (eval $ac_try) 2>&5
21400   ac_status=$?
21401   echo "$as_me:21401: \$? = $ac_status" >&5
21402   (exit "$ac_status"); }; }; then
21403   ac_cv_lib_ICE_IceConnectionNumber=yes
21404 else
21405   echo "$as_me: failed program was:" >&5
21406 cat "conftest.$ac_ext" >&5
21407 ac_cv_lib_ICE_IceConnectionNumber=no
21408 fi
21409 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21410 LIBS=$ac_check_lib_save_LIBS
21411 fi
21412 echo "$as_me:21412: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21413 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21414 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21415   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21416 fi
21417
21418   LDFLAGS=$ac_save_LDFLAGS
21419
21420 fi
21421
21422 fi
21423
21424 if test "$GCC" = yes || test "$GXX" = yes
21425 then
21426
21427 if test "$GCC" = yes || test "$GXX" = yes
21428 then
21429         case $CFLAGS in
21430         (*-Werror=*)
21431                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21432
21433 echo "${as_me:-configure}:21433: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21434
21435                 cf_temp_flags=
21436                 for cf_temp_scan in $CFLAGS
21437                 do
21438                         case "x$cf_temp_scan" in
21439                         (x-Werror=*)
21440
21441         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21442         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21443
21444                                 ;;
21445                         (*)
21446
21447         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21448         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21449
21450                                 ;;
21451                         esac
21452                 done
21453                 CFLAGS="$cf_temp_flags"
21454                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21455
21456 echo "${as_me:-configure}:21456: testing ... fixed $CFLAGS ..." 1>&5
21457
21458                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21459
21460 echo "${as_me:-configure}:21460: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21461
21462                 ;;
21463         esac
21464 fi
21465
21466 if test "$GCC" = yes || test "$GXX" = yes
21467 then
21468         case $CPPFLAGS in
21469         (*-Werror=*)
21470                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21471
21472 echo "${as_me:-configure}:21472: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21473
21474                 cf_temp_flags=
21475                 for cf_temp_scan in $CPPFLAGS
21476                 do
21477                         case "x$cf_temp_scan" in
21478                         (x-Werror=*)
21479
21480         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21481         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21482
21483                                 ;;
21484                         (*)
21485
21486         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21487         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21488
21489                                 ;;
21490                         esac
21491                 done
21492                 CPPFLAGS="$cf_temp_flags"
21493                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21494
21495 echo "${as_me:-configure}:21495: testing ... fixed $CPPFLAGS ..." 1>&5
21496
21497                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21498
21499 echo "${as_me:-configure}:21499: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21500
21501                 ;;
21502         esac
21503 fi
21504
21505 if test "$GCC" = yes || test "$GXX" = yes
21506 then
21507         case $LDFLAGS in
21508         (*-Werror=*)
21509                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21510
21511 echo "${as_me:-configure}:21511: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21512
21513                 cf_temp_flags=
21514                 for cf_temp_scan in $LDFLAGS
21515                 do
21516                         case "x$cf_temp_scan" in
21517                         (x-Werror=*)
21518
21519         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21520         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21521
21522                                 ;;
21523                         (*)
21524
21525         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21526         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21527
21528                                 ;;
21529                         esac
21530                 done
21531                 LDFLAGS="$cf_temp_flags"
21532                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21533
21534 echo "${as_me:-configure}:21534: testing ... fixed $LDFLAGS ..." 1>&5
21535
21536                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21537
21538 echo "${as_me:-configure}:21538: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21539
21540                 ;;
21541         esac
21542 fi
21543
21544 echo "$as_me:21544: checking if you want to turn on gcc warnings" >&5
21545 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21546
21547 # Check whether --enable-warnings or --disable-warnings was given.
21548 if test "${enable_warnings+set}" = set; then
21549   enableval="$enable_warnings"
21550   test "$enableval" != yes && enableval=no
21551         if test "$enableval" != "no" ; then
21552     enable_warnings=yes
21553         else
21554                 enable_warnings=no
21555         fi
21556 else
21557   enableval=no
21558         enable_warnings=no
21559
21560 fi;
21561 echo "$as_me:21561: result: $enable_warnings" >&5
21562 echo "${ECHO_T}$enable_warnings" >&6
21563 if test "$enable_warnings" = "yes"
21564 then
21565
21566 if test "$GCC" = yes || test "$GXX" = yes
21567 then
21568 cat > conftest.i <<EOF
21569 #ifndef GCC_PRINTF
21570 #define GCC_PRINTF 0
21571 #endif
21572 #ifndef GCC_SCANF
21573 #define GCC_SCANF 0
21574 #endif
21575 #ifndef GCC_NORETURN
21576 #define GCC_NORETURN /* nothing */
21577 #endif
21578 #ifndef GCC_UNUSED
21579 #define GCC_UNUSED /* nothing */
21580 #endif
21581 EOF
21582 if test "$GCC" = yes
21583 then
21584         { echo "$as_me:21584: checking for $CC __attribute__ directives..." >&5
21585 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21586 cat > "conftest.$ac_ext" <<EOF
21587 #line 21587 "${as_me:-configure}"
21588 #include "confdefs.h"
21589 #include "conftest.h"
21590 #include "conftest.i"
21591 #if     GCC_PRINTF
21592 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21593 #else
21594 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21595 #endif
21596 #if     GCC_SCANF
21597 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21598 #else
21599 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21600 #endif
21601 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21602 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
21603 extern GCC_NORETURN void foo(void);
21604 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21605 EOF
21606         cf_printf_attribute=no
21607         cf_scanf_attribute=no
21608         for cf_attribute in scanf printf unused noreturn
21609         do
21610
21611 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21612
21613                 cf_directive="__attribute__(($cf_attribute))"
21614                 echo "checking for $CC $cf_directive" 1>&5
21615
21616                 case "$cf_attribute" in
21617                 (printf)
21618                         cf_printf_attribute=yes
21619                         cat >conftest.h <<EOF
21620 #define GCC_$cf_ATTRIBUTE 1
21621 EOF
21622                         ;;
21623                 (scanf)
21624                         cf_scanf_attribute=yes
21625                         cat >conftest.h <<EOF
21626 #define GCC_$cf_ATTRIBUTE 1
21627 EOF
21628                         ;;
21629                 (*)
21630                         cat >conftest.h <<EOF
21631 #define GCC_$cf_ATTRIBUTE $cf_directive
21632 EOF
21633                         ;;
21634                 esac
21635
21636                 if { (eval echo "$as_me:21636: \"$ac_compile\"") >&5
21637   (eval $ac_compile) 2>&5
21638   ac_status=$?
21639   echo "$as_me:21639: \$? = $ac_status" >&5
21640   (exit "$ac_status"); }; then
21641                         test -n "$verbose" && echo "$as_me:21641: result: ... $cf_attribute" >&5
21642 echo "${ECHO_T}... $cf_attribute" >&6
21643                         cat conftest.h >>confdefs.h
21644                         case "$cf_attribute" in
21645                         (noreturn)
21646
21647 cat >>confdefs.h <<EOF
21648 #define GCC_NORETURN $cf_directive
21649 EOF
21650
21651                                 ;;
21652                         (printf)
21653                                 cf_value='/* nothing */'
21654                                 if test "$cf_printf_attribute" != no ; then
21655                                         cf_value='__attribute__((format(printf,fmt,var)))'
21656
21657 cat >>confdefs.h <<\EOF
21658 #define GCC_PRINTF 1
21659 EOF
21660
21661                                 fi
21662
21663 cat >>confdefs.h <<EOF
21664 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21665 EOF
21666
21667                                 ;;
21668                         (scanf)
21669                                 cf_value='/* nothing */'
21670                                 if test "$cf_scanf_attribute" != no ; then
21671                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21672
21673 cat >>confdefs.h <<\EOF
21674 #define GCC_SCANF 1
21675 EOF
21676
21677                                 fi
21678
21679 cat >>confdefs.h <<EOF
21680 #define GCC_SCANFLIKE(fmt,var) $cf_value
21681 EOF
21682
21683                                 ;;
21684                         (unused)
21685
21686 cat >>confdefs.h <<EOF
21687 #define GCC_UNUSED $cf_directive
21688 EOF
21689
21690                                 ;;
21691                         esac
21692                 fi
21693         done
21694 else
21695         ${FGREP-fgrep} define conftest.i >>confdefs.h
21696 fi
21697 rm -rf ./conftest*
21698 fi
21699
21700 if test "x$have_x" = xyes; then
21701
21702 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21703 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21704 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21705 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21706 for cf_X_CFLAGS in $X_CFLAGS
21707 do
21708         case "x$cf_X_CFLAGS" in
21709         x-[IUD]*)
21710                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21711                 ;;
21712         *)
21713                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21714                 ;;
21715         esac
21716 done
21717
21718 cat >"conftest.$ac_ext" <<_ACEOF
21719 #line 21719 "configure"
21720 #include "confdefs.h"
21721
21722 #include <stdlib.h>
21723 #include <X11/Intrinsic.h>
21724
21725 int
21726 main (void)
21727 {
21728 String foo = malloc(1); (void)foo
21729   ;
21730   return 0;
21731 }
21732 _ACEOF
21733 rm -f "conftest.$ac_objext"
21734 if { (eval echo "$as_me:21734: \"$ac_compile\"") >&5
21735   (eval $ac_compile) 2>&5
21736   ac_status=$?
21737   echo "$as_me:21737: \$? = $ac_status" >&5
21738   (exit "$ac_status"); } &&
21739          { ac_try='test -s "conftest.$ac_objext"'
21740   { (eval echo "$as_me:21740: \"$ac_try\"") >&5
21741   (eval $ac_try) 2>&5
21742   ac_status=$?
21743   echo "$as_me:21743: \$? = $ac_status" >&5
21744   (exit "$ac_status"); }; }; then
21745
21746 echo "$as_me:21746: checking for X11/Xt const-feature" >&5
21747 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21748 if test "${cf_cv_const_x_string+set}" = set; then
21749   echo $ECHO_N "(cached) $ECHO_C" >&6
21750 else
21751
21752         cat >"conftest.$ac_ext" <<_ACEOF
21753 #line 21753 "configure"
21754 #include "confdefs.h"
21755
21756 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21757 #undef  XTSTRINGDEFINES /* X11R5 and later */
21758 #include <stdlib.h>
21759 #include <X11/Intrinsic.h>
21760
21761 int
21762 main (void)
21763 {
21764 String foo = malloc(1); *foo = 0
21765   ;
21766   return 0;
21767 }
21768 _ACEOF
21769 rm -f "conftest.$ac_objext"
21770 if { (eval echo "$as_me:21770: \"$ac_compile\"") >&5
21771   (eval $ac_compile) 2>&5
21772   ac_status=$?
21773   echo "$as_me:21773: \$? = $ac_status" >&5
21774   (exit "$ac_status"); } &&
21775          { ac_try='test -s "conftest.$ac_objext"'
21776   { (eval echo "$as_me:21776: \"$ac_try\"") >&5
21777   (eval $ac_try) 2>&5
21778   ac_status=$?
21779   echo "$as_me:21779: \$? = $ac_status" >&5
21780   (exit "$ac_status"); }; }; then
21781
21782                         cf_cv_const_x_string=no
21783
21784 else
21785   echo "$as_me: failed program was:" >&5
21786 cat "conftest.$ac_ext" >&5
21787
21788                         cf_cv_const_x_string=yes
21789
21790 fi
21791 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21792
21793 fi
21794 echo "$as_me:21794: result: $cf_cv_const_x_string" >&5
21795 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21796
21797 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21798 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21799 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21800
21801 case "$cf_cv_const_x_string" in
21802 (no)
21803
21804         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21805         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21806
21807         ;;
21808 (*)
21809
21810         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21811         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21812
21813         ;;
21814 esac
21815
21816 else
21817   echo "$as_me: failed program was:" >&5
21818 cat "conftest.$ac_ext" >&5
21819 fi
21820 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21821  fi
21822 cat > "conftest.$ac_ext" <<EOF
21823 #line 21823 "${as_me:-configure}"
21824 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21825 EOF
21826 if test "$INTEL_COMPILER" = yes
21827 then
21828 # The "-wdXXX" options suppress warnings:
21829 # remark #1419: external declaration in primary source file
21830 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21831 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21832 # remark #193: zero used for undefined preprocessing identifier
21833 # remark #593: variable "curs_sb_left_arrow" was set but never used
21834 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21835 # remark #869: parameter "tw" was never referenced
21836 # remark #981: operands are evaluated in unspecified order
21837 # warning #279: controlling expression is constant
21838
21839         { echo "$as_me:21839: checking for $CC warning options..." >&5
21840 echo "$as_me: checking for $CC warning options..." >&6;}
21841         cf_save_CFLAGS="$CFLAGS"
21842         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21843         for cf_opt in \
21844                 wd1419 \
21845                 wd1683 \
21846                 wd1684 \
21847                 wd193 \
21848                 wd593 \
21849                 wd279 \
21850                 wd810 \
21851                 wd869 \
21852                 wd981
21853         do
21854                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21855                 if { (eval echo "$as_me:21855: \"$ac_compile\"") >&5
21856   (eval $ac_compile) 2>&5
21857   ac_status=$?
21858   echo "$as_me:21858: \$? = $ac_status" >&5
21859   (exit "$ac_status"); }; then
21860                         test -n "$verbose" && echo "$as_me:21860: result: ... -$cf_opt" >&5
21861 echo "${ECHO_T}... -$cf_opt" >&6
21862                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21863                 fi
21864         done
21865         CFLAGS="$cf_save_CFLAGS"
21866 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
21867 then
21868         { echo "$as_me:21868: checking for $CC warning options..." >&5
21869 echo "$as_me: checking for $CC warning options..." >&6;}
21870         cf_save_CFLAGS="$CFLAGS"
21871         cf_warn_CONST=""
21872         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
21873         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
21874         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
21875         for cf_opt in W Wall \
21876                 Wbad-function-cast \
21877                 Wcast-align \
21878                 Wcast-qual \
21879                 Wdeclaration-after-statement \
21880                 Wextra \
21881                 Winline \
21882                 Wmissing-declarations \
21883                 Wmissing-prototypes \
21884                 Wnested-externs \
21885                 Wpointer-arith \
21886                 Wshadow \
21887                 Wstrict-prototypes \
21888                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
21889         do
21890                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21891                 if { (eval echo "$as_me:21891: \"$ac_compile\"") >&5
21892   (eval $ac_compile) 2>&5
21893   ac_status=$?
21894   echo "$as_me:21894: \$? = $ac_status" >&5
21895   (exit "$ac_status"); }; then
21896                         test -n "$verbose" && echo "$as_me:21896: result: ... -$cf_opt" >&5
21897 echo "${ECHO_T}... -$cf_opt" >&6
21898                         case "$cf_opt" in
21899                         (Winline)
21900                                 case "$GCC_VERSION" in
21901                                 ([34].*)
21902                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21903
21904 echo "${as_me:-configure}:21904: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21905
21906                                         continue;;
21907                                 esac
21908                                 ;;
21909                         (Wpointer-arith)
21910                                 case "$GCC_VERSION" in
21911                                 ([12].*)
21912                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21913
21914 echo "${as_me:-configure}:21914: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21915
21916                                         continue;;
21917                                 esac
21918                                 ;;
21919                         esac
21920                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21921                 fi
21922         done
21923         CFLAGS="$cf_save_CFLAGS"
21924 fi
21925 rm -rf ./conftest*
21926
21927 fi
21928
21929 fi
21930
21931 echo "$as_me:21931: checking if you want to use dmalloc for testing" >&5
21932 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
21933
21934 # Check whether --with-dmalloc or --without-dmalloc was given.
21935 if test "${with_dmalloc+set}" = set; then
21936   withval="$with_dmalloc"
21937
21938 cat >>confdefs.h <<EOF
21939 #define USE_DMALLOC 1
21940 EOF
21941
21942         : "${with_cflags:=-g}"
21943         : "${enable_leaks:=no}"
21944          with_dmalloc=yes
21945 else
21946   with_dmalloc=
21947 fi;
21948 echo "$as_me:21948: result: ${with_dmalloc:-no}" >&5
21949 echo "${ECHO_T}${with_dmalloc:-no}" >&6
21950
21951 case ".$with_cflags" in
21952 (.*-g*)
21953         case .$CFLAGS in
21954         (.*-g*)
21955                 ;;
21956         (*)
21957
21958 cf_fix_cppflags=no
21959 cf_new_cflags=
21960 cf_new_cppflags=
21961 cf_new_extra_cppflags=
21962
21963 for cf_add_cflags in -g
21964 do
21965 case "$cf_fix_cppflags" in
21966 (no)
21967         case "$cf_add_cflags" in
21968         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21969                 case "$cf_add_cflags" in
21970                 (-D*)
21971                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21972
21973                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21974                                 && test -z "${cf_tst_cflags}" \
21975                                 && cf_fix_cppflags=yes
21976
21977                         if test "$cf_fix_cppflags" = yes ; then
21978
21979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21981
21982                                 continue
21983                         elif test "${cf_tst_cflags}" = "\"'" ; then
21984
21985         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21986         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21987
21988                                 continue
21989                         fi
21990                         ;;
21991                 esac
21992                 case "$CPPFLAGS" in
21993                 (*$cf_add_cflags)
21994                         ;;
21995                 (*)
21996                         case "$cf_add_cflags" in
21997                         (-D*)
21998                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21999
22000 CPPFLAGS=`echo "$CPPFLAGS" | \
22001         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22002                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22003
22004                                 ;;
22005                         esac
22006
22007         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22008         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22009
22010                         ;;
22011                 esac
22012                 ;;
22013         (*)
22014
22015         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22016         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22017
22018                 ;;
22019         esac
22020         ;;
22021 (yes)
22022
22023         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22024         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22025
22026         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22027
22028         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22029                 && test -z "${cf_tst_cflags}" \
22030                 && cf_fix_cppflags=no
22031         ;;
22032 esac
22033 done
22034
22035 if test -n "$cf_new_cflags" ; then
22036
22037         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22038         CFLAGS="${CFLAGS}$cf_new_cflags"
22039
22040 fi
22041
22042 if test -n "$cf_new_cppflags" ; then
22043
22044         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22045         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22046
22047 fi
22048
22049 if test -n "$cf_new_extra_cppflags" ; then
22050
22051         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22052         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22053
22054 fi
22055
22056                 ;;
22057         esac
22058         ;;
22059 esac
22060
22061 if test "$with_dmalloc" = yes ; then
22062         echo "$as_me:22062: checking for dmalloc.h" >&5
22063 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22064 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22065   echo $ECHO_N "(cached) $ECHO_C" >&6
22066 else
22067   cat >"conftest.$ac_ext" <<_ACEOF
22068 #line 22068 "configure"
22069 #include "confdefs.h"
22070 #include <dmalloc.h>
22071 _ACEOF
22072 if { (eval echo "$as_me:22072: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22073   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22074   ac_status=$?
22075   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22076   rm -f conftest.er1
22077   cat conftest.err >&5
22078   echo "$as_me:22078: \$? = $ac_status" >&5
22079   (exit "$ac_status"); } >/dev/null; then
22080   if test -s conftest.err; then
22081     ac_cpp_err=$ac_c_preproc_warn_flag
22082   else
22083     ac_cpp_err=
22084   fi
22085 else
22086   ac_cpp_err=yes
22087 fi
22088 if test -z "$ac_cpp_err"; then
22089   ac_cv_header_dmalloc_h=yes
22090 else
22091   echo "$as_me: failed program was:" >&5
22092   cat "conftest.$ac_ext" >&5
22093   ac_cv_header_dmalloc_h=no
22094 fi
22095 rm -f conftest.err "conftest.$ac_ext"
22096 fi
22097 echo "$as_me:22097: result: $ac_cv_header_dmalloc_h" >&5
22098 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22099 if test "$ac_cv_header_dmalloc_h" = yes; then
22100
22101 echo "$as_me:22101: checking for dmalloc_debug in -ldmalloc" >&5
22102 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22103 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22104   echo $ECHO_N "(cached) $ECHO_C" >&6
22105 else
22106   ac_check_lib_save_LIBS=$LIBS
22107 LIBS="-ldmalloc  $LIBS"
22108 cat >"conftest.$ac_ext" <<_ACEOF
22109 #line 22109 "configure"
22110 #include "confdefs.h"
22111
22112 /* Override any gcc2 internal prototype to avoid an error.  */
22113 #ifdef __cplusplus
22114 extern "C"
22115 #endif
22116 /* We use char because int might match the return type of a gcc2
22117    builtin and then its argument prototype would still apply.  */
22118 char dmalloc_debug ();
22119 int
22120 main (void)
22121 {
22122 dmalloc_debug ();
22123   ;
22124   return 0;
22125 }
22126 _ACEOF
22127 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22128 if { (eval echo "$as_me:22128: \"$ac_link\"") >&5
22129   (eval $ac_link) 2>&5
22130   ac_status=$?
22131   echo "$as_me:22131: \$? = $ac_status" >&5
22132   (exit "$ac_status"); } &&
22133          { ac_try='test -s "conftest$ac_exeext"'
22134   { (eval echo "$as_me:22134: \"$ac_try\"") >&5
22135   (eval $ac_try) 2>&5
22136   ac_status=$?
22137   echo "$as_me:22137: \$? = $ac_status" >&5
22138   (exit "$ac_status"); }; }; then
22139   ac_cv_lib_dmalloc_dmalloc_debug=yes
22140 else
22141   echo "$as_me: failed program was:" >&5
22142 cat "conftest.$ac_ext" >&5
22143 ac_cv_lib_dmalloc_dmalloc_debug=no
22144 fi
22145 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22146 LIBS=$ac_check_lib_save_LIBS
22147 fi
22148 echo "$as_me:22148: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22149 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22150 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22151   cat >>confdefs.h <<EOF
22152 #define HAVE_LIBDMALLOC 1
22153 EOF
22154
22155   LIBS="-ldmalloc $LIBS"
22156
22157 fi
22158
22159 fi
22160
22161 fi
22162
22163 echo "$as_me:22163: checking if you want to use dbmalloc for testing" >&5
22164 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22165
22166 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22167 if test "${with_dbmalloc+set}" = set; then
22168   withval="$with_dbmalloc"
22169
22170 cat >>confdefs.h <<EOF
22171 #define USE_DBMALLOC 1
22172 EOF
22173
22174         : "${with_cflags:=-g}"
22175         : "${enable_leaks:=no}"
22176          with_dbmalloc=yes
22177 else
22178   with_dbmalloc=
22179 fi;
22180 echo "$as_me:22180: result: ${with_dbmalloc:-no}" >&5
22181 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22182
22183 case ".$with_cflags" in
22184 (.*-g*)
22185         case .$CFLAGS in
22186         (.*-g*)
22187                 ;;
22188         (*)
22189
22190 cf_fix_cppflags=no
22191 cf_new_cflags=
22192 cf_new_cppflags=
22193 cf_new_extra_cppflags=
22194
22195 for cf_add_cflags in -g
22196 do
22197 case "$cf_fix_cppflags" in
22198 (no)
22199         case "$cf_add_cflags" in
22200         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22201                 case "$cf_add_cflags" in
22202                 (-D*)
22203                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22204
22205                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22206                                 && test -z "${cf_tst_cflags}" \
22207                                 && cf_fix_cppflags=yes
22208
22209                         if test "$cf_fix_cppflags" = yes ; then
22210
22211         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22212         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22213
22214                                 continue
22215                         elif test "${cf_tst_cflags}" = "\"'" ; then
22216
22217         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22218         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22219
22220                                 continue
22221                         fi
22222                         ;;
22223                 esac
22224                 case "$CPPFLAGS" in
22225                 (*$cf_add_cflags)
22226                         ;;
22227                 (*)
22228                         case "$cf_add_cflags" in
22229                         (-D*)
22230                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22231
22232 CPPFLAGS=`echo "$CPPFLAGS" | \
22233         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22234                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22235
22236                                 ;;
22237                         esac
22238
22239         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22240         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22241
22242                         ;;
22243                 esac
22244                 ;;
22245         (*)
22246
22247         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22248         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22249
22250                 ;;
22251         esac
22252         ;;
22253 (yes)
22254
22255         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22256         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22257
22258         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22259
22260         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22261                 && test -z "${cf_tst_cflags}" \
22262                 && cf_fix_cppflags=no
22263         ;;
22264 esac
22265 done
22266
22267 if test -n "$cf_new_cflags" ; then
22268
22269         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22270         CFLAGS="${CFLAGS}$cf_new_cflags"
22271
22272 fi
22273
22274 if test -n "$cf_new_cppflags" ; then
22275
22276         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22277         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22278
22279 fi
22280
22281 if test -n "$cf_new_extra_cppflags" ; then
22282
22283         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22284         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22285
22286 fi
22287
22288                 ;;
22289         esac
22290         ;;
22291 esac
22292
22293 if test "$with_dbmalloc" = yes ; then
22294         echo "$as_me:22294: checking for dbmalloc.h" >&5
22295 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22296 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22297   echo $ECHO_N "(cached) $ECHO_C" >&6
22298 else
22299   cat >"conftest.$ac_ext" <<_ACEOF
22300 #line 22300 "configure"
22301 #include "confdefs.h"
22302 #include <dbmalloc.h>
22303 _ACEOF
22304 if { (eval echo "$as_me:22304: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22305   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22306   ac_status=$?
22307   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22308   rm -f conftest.er1
22309   cat conftest.err >&5
22310   echo "$as_me:22310: \$? = $ac_status" >&5
22311   (exit "$ac_status"); } >/dev/null; then
22312   if test -s conftest.err; then
22313     ac_cpp_err=$ac_c_preproc_warn_flag
22314   else
22315     ac_cpp_err=
22316   fi
22317 else
22318   ac_cpp_err=yes
22319 fi
22320 if test -z "$ac_cpp_err"; then
22321   ac_cv_header_dbmalloc_h=yes
22322 else
22323   echo "$as_me: failed program was:" >&5
22324   cat "conftest.$ac_ext" >&5
22325   ac_cv_header_dbmalloc_h=no
22326 fi
22327 rm -f conftest.err "conftest.$ac_ext"
22328 fi
22329 echo "$as_me:22329: result: $ac_cv_header_dbmalloc_h" >&5
22330 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22331 if test "$ac_cv_header_dbmalloc_h" = yes; then
22332
22333 echo "$as_me:22333: checking for debug_malloc in -ldbmalloc" >&5
22334 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22335 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22336   echo $ECHO_N "(cached) $ECHO_C" >&6
22337 else
22338   ac_check_lib_save_LIBS=$LIBS
22339 LIBS="-ldbmalloc  $LIBS"
22340 cat >"conftest.$ac_ext" <<_ACEOF
22341 #line 22341 "configure"
22342 #include "confdefs.h"
22343
22344 /* Override any gcc2 internal prototype to avoid an error.  */
22345 #ifdef __cplusplus
22346 extern "C"
22347 #endif
22348 /* We use char because int might match the return type of a gcc2
22349    builtin and then its argument prototype would still apply.  */
22350 char debug_malloc ();
22351 int
22352 main (void)
22353 {
22354 debug_malloc ();
22355   ;
22356   return 0;
22357 }
22358 _ACEOF
22359 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22360 if { (eval echo "$as_me:22360: \"$ac_link\"") >&5
22361   (eval $ac_link) 2>&5
22362   ac_status=$?
22363   echo "$as_me:22363: \$? = $ac_status" >&5
22364   (exit "$ac_status"); } &&
22365          { ac_try='test -s "conftest$ac_exeext"'
22366   { (eval echo "$as_me:22366: \"$ac_try\"") >&5
22367   (eval $ac_try) 2>&5
22368   ac_status=$?
22369   echo "$as_me:22369: \$? = $ac_status" >&5
22370   (exit "$ac_status"); }; }; then
22371   ac_cv_lib_dbmalloc_debug_malloc=yes
22372 else
22373   echo "$as_me: failed program was:" >&5
22374 cat "conftest.$ac_ext" >&5
22375 ac_cv_lib_dbmalloc_debug_malloc=no
22376 fi
22377 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22378 LIBS=$ac_check_lib_save_LIBS
22379 fi
22380 echo "$as_me:22380: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22381 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22382 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22383   cat >>confdefs.h <<EOF
22384 #define HAVE_LIBDBMALLOC 1
22385 EOF
22386
22387   LIBS="-ldbmalloc $LIBS"
22388
22389 fi
22390
22391 fi
22392
22393 fi
22394
22395 echo "$as_me:22395: checking if you want to use valgrind for testing" >&5
22396 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22397
22398 # Check whether --with-valgrind or --without-valgrind was given.
22399 if test "${with_valgrind+set}" = set; then
22400   withval="$with_valgrind"
22401
22402 cat >>confdefs.h <<EOF
22403 #define USE_VALGRIND 1
22404 EOF
22405
22406         : "${with_cflags:=-g}"
22407         : "${enable_leaks:=no}"
22408          with_valgrind=yes
22409 else
22410   with_valgrind=
22411 fi;
22412 echo "$as_me:22412: result: ${with_valgrind:-no}" >&5
22413 echo "${ECHO_T}${with_valgrind:-no}" >&6
22414
22415 case ".$with_cflags" in
22416 (.*-g*)
22417         case .$CFLAGS in
22418         (.*-g*)
22419                 ;;
22420         (*)
22421
22422 cf_fix_cppflags=no
22423 cf_new_cflags=
22424 cf_new_cppflags=
22425 cf_new_extra_cppflags=
22426
22427 for cf_add_cflags in -g
22428 do
22429 case "$cf_fix_cppflags" in
22430 (no)
22431         case "$cf_add_cflags" in
22432         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22433                 case "$cf_add_cflags" in
22434                 (-D*)
22435                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22436
22437                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22438                                 && test -z "${cf_tst_cflags}" \
22439                                 && cf_fix_cppflags=yes
22440
22441                         if test "$cf_fix_cppflags" = yes ; then
22442
22443         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22444         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22445
22446                                 continue
22447                         elif test "${cf_tst_cflags}" = "\"'" ; then
22448
22449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22451
22452                                 continue
22453                         fi
22454                         ;;
22455                 esac
22456                 case "$CPPFLAGS" in
22457                 (*$cf_add_cflags)
22458                         ;;
22459                 (*)
22460                         case "$cf_add_cflags" in
22461                         (-D*)
22462                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22463
22464 CPPFLAGS=`echo "$CPPFLAGS" | \
22465         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22466                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22467
22468                                 ;;
22469                         esac
22470
22471         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22472         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22473
22474                         ;;
22475                 esac
22476                 ;;
22477         (*)
22478
22479         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22480         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22481
22482                 ;;
22483         esac
22484         ;;
22485 (yes)
22486
22487         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22488         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22489
22490         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22491
22492         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22493                 && test -z "${cf_tst_cflags}" \
22494                 && cf_fix_cppflags=no
22495         ;;
22496 esac
22497 done
22498
22499 if test -n "$cf_new_cflags" ; then
22500
22501         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22502         CFLAGS="${CFLAGS}$cf_new_cflags"
22503
22504 fi
22505
22506 if test -n "$cf_new_cppflags" ; then
22507
22508         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22509         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22510
22511 fi
22512
22513 if test -n "$cf_new_extra_cppflags" ; then
22514
22515         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22516         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22517
22518 fi
22519
22520                 ;;
22521         esac
22522         ;;
22523 esac
22524
22525 echo "$as_me:22525: checking if you want to perform memory-leak testing" >&5
22526 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22527
22528 # Check whether --enable-leaks or --disable-leaks was given.
22529 if test "${enable_leaks+set}" = set; then
22530   enableval="$enable_leaks"
22531   enable_leaks=no
22532 else
22533   enable_leaks=yes
22534 fi;
22535 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22536 echo "$as_me:22536: result: $with_no_leaks" >&5
22537 echo "${ECHO_T}$with_no_leaks" >&6
22538
22539 if test "$enable_leaks" = no ; then
22540
22541 cat >>confdefs.h <<\EOF
22542 #define NO_LEAKS 1
22543 EOF
22544
22545 cat >>confdefs.h <<\EOF
22546 #define YY_NO_LEAKS 1
22547 EOF
22548
22549 fi
22550
22551 LD_RPATH_OPT=
22552 if test "x$cf_cv_enable_rpath" != xno
22553 then
22554         echo "$as_me:22554: checking for an rpath option" >&5
22555 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22556         case "$cf_cv_system_name" in
22557         (irix*)
22558                 if test "$GCC" = yes; then
22559                         LD_RPATH_OPT="-Wl,-rpath,"
22560                 else
22561                         LD_RPATH_OPT="-rpath "
22562                 fi
22563                 ;;
22564         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22565                 LD_RPATH_OPT="-Wl,-rpath,"
22566                 ;;
22567         (openbsd[2-9].*|mirbsd*)
22568                 LD_RPATH_OPT="-Wl,-rpath,"
22569                 ;;
22570         (dragonfly*)
22571                 LD_RPATH_OPT="-rpath "
22572                 ;;
22573         (netbsd*)
22574                 LD_RPATH_OPT="-Wl,-rpath,"
22575                 ;;
22576         (osf*|mls+*)
22577                 LD_RPATH_OPT="-rpath "
22578                 ;;
22579         (solaris2*)
22580                 LD_RPATH_OPT="-R"
22581                 ;;
22582         (*)
22583                 ;;
22584         esac
22585         echo "$as_me:22585: result: $LD_RPATH_OPT" >&5
22586 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22587
22588         case "x$LD_RPATH_OPT" in
22589         (x-R*)
22590                 echo "$as_me:22590: checking if we need a space after rpath option" >&5
22591 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22592                 cf_save_LIBS="$LIBS"
22593
22594 cf_add_libs="$LIBS"
22595 # reverse order
22596 cf_add_0lib=
22597 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22598 # filter duplicates
22599 for cf_add_1lib in $cf_add_0lib; do
22600         for cf_add_2lib in $cf_add_libs; do
22601                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22602                         cf_add_1lib=
22603                         break
22604                 fi
22605         done
22606         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22607 done
22608 LIBS="$cf_add_libs"
22609
22610                 cat >"conftest.$ac_ext" <<_ACEOF
22611 #line 22611 "configure"
22612 #include "confdefs.h"
22613
22614 int
22615 main (void)
22616 {
22617
22618   ;
22619   return 0;
22620 }
22621 _ACEOF
22622 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22623 if { (eval echo "$as_me:22623: \"$ac_link\"") >&5
22624   (eval $ac_link) 2>&5
22625   ac_status=$?
22626   echo "$as_me:22626: \$? = $ac_status" >&5
22627   (exit "$ac_status"); } &&
22628          { ac_try='test -s "conftest$ac_exeext"'
22629   { (eval echo "$as_me:22629: \"$ac_try\"") >&5
22630   (eval $ac_try) 2>&5
22631   ac_status=$?
22632   echo "$as_me:22632: \$? = $ac_status" >&5
22633   (exit "$ac_status"); }; }; then
22634   cf_rpath_space=no
22635 else
22636   echo "$as_me: failed program was:" >&5
22637 cat "conftest.$ac_ext" >&5
22638 cf_rpath_space=yes
22639 fi
22640 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22641                 LIBS="$cf_save_LIBS"
22642                 echo "$as_me:22642: result: $cf_rpath_space" >&5
22643 echo "${ECHO_T}$cf_rpath_space" >&6
22644                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22645                 ;;
22646         esac
22647 fi
22648
22649 echo "$as_me:22649: checking if rpath-hack should be disabled" >&5
22650 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22651
22652 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22653 if test "${enable_rpath_hack+set}" = set; then
22654   enableval="$enable_rpath_hack"
22655   test "$enableval" != no && enableval=yes
22656         if test "$enableval" != "yes" ; then
22657     enable_rpath_hack=no
22658         else
22659                 enable_rpath_hack=yes
22660         fi
22661 else
22662   enableval=yes
22663         enable_rpath_hack=yes
22664
22665 fi;
22666 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
22667 echo "$as_me:22667: result: $cf_disable_rpath_hack" >&5
22668 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22669
22670 if test "$enable_rpath_hack" = yes ; then
22671
22672 echo "$as_me:22672: checking for updated LDFLAGS" >&5
22673 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22674 if test -n "$LD_RPATH_OPT" ; then
22675         echo "$as_me:22675: result: maybe" >&5
22676 echo "${ECHO_T}maybe" >&6
22677
22678         for ac_prog in ldd
22679 do
22680   # Extract the first word of "$ac_prog", so it can be a program name with args.
22681 set dummy $ac_prog; ac_word=$2
22682 echo "$as_me:22682: checking for $ac_word" >&5
22683 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22684 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22685   echo $ECHO_N "(cached) $ECHO_C" >&6
22686 else
22687   if test -n "$cf_ldd_prog"; then
22688   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22689 else
22690   ac_save_IFS=$IFS; IFS=$ac_path_separator
22691 ac_dummy="$PATH"
22692 for ac_dir in $ac_dummy; do
22693   IFS=$ac_save_IFS
22694   test -z "$ac_dir" && ac_dir=.
22695   $as_executable_p "$ac_dir/$ac_word" || continue
22696 ac_cv_prog_cf_ldd_prog="$ac_prog"
22697 echo "$as_me:22697: found $ac_dir/$ac_word" >&5
22698 break
22699 done
22700
22701 fi
22702 fi
22703 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22704 if test -n "$cf_ldd_prog"; then
22705   echo "$as_me:22705: result: $cf_ldd_prog" >&5
22706 echo "${ECHO_T}$cf_ldd_prog" >&6
22707 else
22708   echo "$as_me:22708: result: no" >&5
22709 echo "${ECHO_T}no" >&6
22710 fi
22711
22712   test -n "$cf_ldd_prog" && break
22713 done
22714 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22715
22716         cf_rpath_list="/usr/lib /lib"
22717         if test "$cf_ldd_prog" != no
22718         then
22719                 cf_rpath_oops=
22720
22721 cat >"conftest.$ac_ext" <<_ACEOF
22722 #line 22722 "configure"
22723 #include "confdefs.h"
22724 #include <stdio.h>
22725 int
22726 main (void)
22727 {
22728 printf("Hello");
22729   ;
22730   return 0;
22731 }
22732 _ACEOF
22733 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22734 if { (eval echo "$as_me:22734: \"$ac_link\"") >&5
22735   (eval $ac_link) 2>&5
22736   ac_status=$?
22737   echo "$as_me:22737: \$? = $ac_status" >&5
22738   (exit "$ac_status"); } &&
22739          { ac_try='test -s "conftest$ac_exeext"'
22740   { (eval echo "$as_me:22740: \"$ac_try\"") >&5
22741   (eval $ac_try) 2>&5
22742   ac_status=$?
22743   echo "$as_me:22743: \$? = $ac_status" >&5
22744   (exit "$ac_status"); }; }; then
22745   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22746                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22747 else
22748   echo "$as_me: failed program was:" >&5
22749 cat "conftest.$ac_ext" >&5
22750 fi
22751 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22752
22753                 # If we passed the link-test, but get a "not found" on a given library,
22754                 # this could be due to inept reconfiguration of gcc to make it only
22755                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22756                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22757                 # /usr/local libraries.
22758                 if test -n "$cf_rpath_oops"
22759                 then
22760                         for cf_rpath_src in $cf_rpath_oops
22761                         do
22762                                 for cf_rpath_dir in \
22763                                         /usr/local \
22764                                         /usr/pkg \
22765                                         /opt/sfw
22766                                 do
22767                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
22768                                         then
22769                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22770
22771 echo "${as_me:-configure}:22771: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22772
22773                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22774                                                 break
22775                                         fi
22776                                 done
22777                         done
22778                 fi
22779         fi
22780
22781         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22782
22783 echo "${as_me:-configure}:22783: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22784
22785 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22786
22787 echo "${as_me:-configure}:22787: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22788
22789 cf_rpath_dst=
22790 for cf_rpath_src in $LDFLAGS
22791 do
22792         case "$cf_rpath_src" in
22793         (-L*)
22794
22795                 # check if this refers to a directory which we will ignore
22796                 cf_rpath_skip=no
22797                 if test -n "$cf_rpath_list"
22798                 then
22799                         for cf_rpath_item in $cf_rpath_list
22800                         do
22801                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22802                                 then
22803                                         cf_rpath_skip=yes
22804                                         break
22805                                 fi
22806                         done
22807                 fi
22808
22809                 if test "$cf_rpath_skip" = no
22810                 then
22811                         # transform the option
22812                         if test "$LD_RPATH_OPT" = "-R " ; then
22813                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22814                         else
22815                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22816                         fi
22817
22818                         # if we have not already added this, add it now
22819                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22820                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22821                         then
22822                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22823
22824 echo "${as_me:-configure}:22824: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22825
22826                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22827                         fi
22828                 fi
22829                 ;;
22830         esac
22831         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22832 done
22833 LDFLAGS=$cf_rpath_dst
22834
22835 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22836
22837 echo "${as_me:-configure}:22837: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22838
22839 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
22840
22841 echo "${as_me:-configure}:22841: testing ...checking LIBS $LIBS ..." 1>&5
22842
22843 cf_rpath_dst=
22844 for cf_rpath_src in $LIBS
22845 do
22846         case "$cf_rpath_src" in
22847         (-L*)
22848
22849                 # check if this refers to a directory which we will ignore
22850                 cf_rpath_skip=no
22851                 if test -n "$cf_rpath_list"
22852                 then
22853                         for cf_rpath_item in $cf_rpath_list
22854                         do
22855                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22856                                 then
22857                                         cf_rpath_skip=yes
22858                                         break
22859                                 fi
22860                         done
22861                 fi
22862
22863                 if test "$cf_rpath_skip" = no
22864                 then
22865                         # transform the option
22866                         if test "$LD_RPATH_OPT" = "-R " ; then
22867                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22868                         else
22869                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22870                         fi
22871
22872                         # if we have not already added this, add it now
22873                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22874                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22875                         then
22876                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22877
22878 echo "${as_me:-configure}:22878: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22879
22880                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22881                         fi
22882                 fi
22883                 ;;
22884         esac
22885         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22886 done
22887 LIBS=$cf_rpath_dst
22888
22889 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
22890
22891 echo "${as_me:-configure}:22891: testing ...checked LIBS $LIBS ..." 1>&5
22892
22893         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22894
22895 echo "${as_me:-configure}:22895: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22896
22897 else
22898         echo "$as_me:22898: result: no" >&5
22899 echo "${ECHO_T}no" >&6
22900 fi
22901
22902 fi
22903
22904 TEST_ARGS="$LIBS"
22905 LIBS=
22906
22907 ac_config_files="$ac_config_files Makefile"
22908 ac_config_commands="$ac_config_commands default"
22909 cat >confcache <<\_ACEOF
22910 # This file is a shell script that caches the results of configure
22911 # tests run on this system so they can be shared between configure
22912 # scripts and configure runs, see configure's option --config-cache.
22913 # It is not useful on other systems.  If it contains results you don't
22914 # want to keep, you may remove or edit it.
22915 #
22916 # config.status only pays attention to the cache file if you give it
22917 # the --recheck option to rerun configure.
22918 #
22919 # `ac_cv_env_foo' variables (set or unset) will be overriden when
22920 # loading this file, other *unset* `ac_cv_foo' will be assigned the
22921 # following values.
22922
22923 _ACEOF
22924
22925 # The following way of writing the cache mishandles newlines in values,
22926 # but we know of no workaround that is simple, portable, and efficient.
22927 # So, don't put newlines in cache variables' values.
22928 # Ultrix sh set writes to stderr and can't be redirected directly,
22929 # and sets the high bit in the cache file unless we assign to the vars.
22930 {
22931   (set) 2>&1 |
22932     case `(ac_space=' '; set | grep ac_space) 2>&1` in
22933     *ac_space=\ *)
22934       # `set' does not quote correctly, so add quotes (double-quote
22935       # substitution turns \\\\ into \\, and sed turns \\ into \).
22936       sed -n \
22937         "s/'/'\\\\''/g;
22938           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
22939       ;;
22940     *)
22941       # `set' quotes correctly as required by POSIX, so do not add quotes.
22942       sed -n \
22943         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
22944       ;;
22945     esac;
22946 } |
22947   sed '
22948      t clear
22949      : clear
22950      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
22951      t end
22952      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
22953      : end' >>confcache
22954 if cmp -s $cache_file confcache; then :; else
22955   if test -w $cache_file; then
22956     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
22957     cat confcache >$cache_file
22958   else
22959     echo "not updating unwritable cache $cache_file"
22960   fi
22961 fi
22962 rm -f confcache
22963
22964 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22965 # Let make expand exec_prefix.
22966 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22967
22968 # VPATH may cause trouble with some makes, so we remove $(srcdir),
22969 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
22970 # trailing colons and then remove the whole line if VPATH becomes empty
22971 # (actually we leave an empty line to preserve line numbers).
22972 if test "x$srcdir" = x.; then
22973   ac_vpsub='/^[         ]*VPATH[        ]*=/{
22974 s/:*\$(srcdir):*/:/;
22975 s/:*\${srcdir}:*/:/;
22976 s/:*@srcdir@:*/:/;
22977 s/^\([^=]*=[    ]*\):*/\1/;
22978 s/:*$//;
22979 s/^[^=]*=[      ]*$//;
22980 }'
22981 fi
22982
22983 DEFS=-DHAVE_CONFIG_H
22984
22985 : "${CONFIG_STATUS=./config.status}"
22986 ac_clean_files_save=$ac_clean_files
22987 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
22988 { echo "$as_me:22988: creating $CONFIG_STATUS" >&5
22989 echo "$as_me: creating $CONFIG_STATUS" >&6;}
22990 cat >"$CONFIG_STATUS" <<_ACEOF
22991 #! $SHELL
22992 # Generated automatically by configure.
22993 # Run this file to recreate the current configuration.
22994 # Compiler output produced by configure, useful for debugging
22995 # configure, is in config.log if it exists.
22996
22997 debug=false
22998 SHELL=\${CONFIG_SHELL-$SHELL}
22999 ac_cs_invocation="\$0 \$@"
23000
23001 CLICOLOR_FORCE= GREP_OPTIONS=
23002 unset CLICOLOR_FORCE GREP_OPTIONS
23003 _ACEOF
23004
23005 cat >>"$CONFIG_STATUS" <<\_ACEOF
23006 # Be Bourne compatible
23007 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23008   emulate sh
23009   NULLCMD=:
23010 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23011   set -o posix
23012 fi
23013
23014 # Name of the executable.
23015 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23016
23017 if expr a : '\(a\)' >/dev/null 2>&1; then
23018   as_expr=expr
23019 else
23020   as_expr=false
23021 fi
23022
23023 rm -f conf$$ conf$$.exe conf$$.file
23024 echo >conf$$.file
23025 if ln -s conf$$.file conf$$ 2>/dev/null; then
23026   # We could just check for DJGPP; but this test a) works b) is more generic
23027   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23028   if test -f conf$$.exe; then
23029     # Don't use ln at all; we don't have any links
23030     as_ln_s='cp -p'
23031   else
23032     as_ln_s='ln -s'
23033   fi
23034 elif ln conf$$.file conf$$ 2>/dev/null; then
23035   as_ln_s=ln
23036 else
23037   as_ln_s='cp -p'
23038 fi
23039 rm -f conf$$ conf$$.exe conf$$.file
23040
23041 as_executable_p="test -f"
23042
23043 # Support unset when possible.
23044 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23045   as_unset="unset"
23046 else
23047   as_unset="false"
23048 fi
23049
23050 # NLS nuisances.
23051 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23052 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23053 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23054 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23055 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23056 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23057 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23058 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23059
23060 # IFS
23061 # We need space, tab and new line, in precisely that order.
23062 as_nl='
23063 '
23064 IFS="   $as_nl"
23065
23066 # CDPATH.
23067 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23068
23069 exec 6>&1
23070
23071 _ACEOF
23072
23073 # Files that config.status was made for.
23074 if test -n "$ac_config_files"; then
23075   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23076 fi
23077
23078 if test -n "$ac_config_headers"; then
23079   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23080 fi
23081
23082 if test -n "$ac_config_links"; then
23083   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23084 fi
23085
23086 if test -n "$ac_config_commands"; then
23087   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23088 fi
23089
23090 cat >>"$CONFIG_STATUS" <<\EOF
23091
23092 ac_cs_usage="\
23093 \`$as_me' instantiates files from templates according to the
23094 current configuration.
23095
23096 Usage: $0 [OPTIONS] [FILE]...
23097
23098   -h, --help       print this help, then exit
23099   -V, --version    print version number, then exit
23100   -d, --debug      don't remove temporary files
23101       --recheck    update $as_me by reconfiguring in the same conditions
23102   --file=FILE[:TEMPLATE]
23103                    instantiate the configuration file FILE
23104   --header=FILE[:TEMPLATE]
23105                    instantiate the configuration header FILE
23106
23107 Configuration files:
23108 $config_files
23109
23110 Configuration headers:
23111 $config_headers
23112
23113 Configuration commands:
23114 $config_commands
23115
23116 Report bugs to <dickey@invisible-island.net>."
23117 EOF
23118
23119 cat >>"$CONFIG_STATUS" <<EOF
23120 ac_cs_version="\\
23121 config.status
23122 configured by $0, generated by GNU Autoconf 2.52.20210105,
23123   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23124
23125 Copyright 2003-2020,2021        Thomas E. Dickey
23126 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23127 Free Software Foundation, Inc.
23128 This config.status script is free software; the Free Software Foundation
23129 gives unlimited permission to copy, distribute and modify it."
23130 srcdir="$srcdir"
23131 INSTALL="$INSTALL"
23132 EOF
23133
23134 cat >>"$CONFIG_STATUS" <<\EOF
23135 # If no file are specified by the user, then we need to provide default
23136 # value.  By we need to know if files were specified by the user.
23137 ac_need_defaults=:
23138 while test $# != 0
23139 do
23140   case $1 in
23141   --*=*)
23142     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23143     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23144     shift
23145     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23146     shift
23147     ;;
23148   -*);;
23149   *) # This is not an option, so the user has probably given explicit
23150      # arguments.
23151      ac_need_defaults=false;;
23152   esac
23153
23154   case $1 in
23155   # Handling of the options.
23156 EOF
23157 cat >>"$CONFIG_STATUS" <<EOF
23158   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23159     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23160     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23161 EOF
23162 cat >>"$CONFIG_STATUS" <<\EOF
23163   --version | --vers* | -V )
23164     echo "$ac_cs_version"; exit 0 ;;
23165   --he | --h)
23166     # Conflict between --help and --header
23167     { { echo "$as_me:23167: error: ambiguous option: $1
23168 Try \`$0 --help' for more information." >&5
23169 echo "$as_me: error: ambiguous option: $1
23170 Try \`$0 --help' for more information." >&2;}
23171    { (exit 1); exit 1; }; };;
23172   --help | --hel | -h )
23173     echo "$ac_cs_usage"; exit 0 ;;
23174   --debug | --d* | -d )
23175     debug=: ;;
23176   --file | --fil | --fi | --f )
23177     shift
23178     CONFIG_FILES="$CONFIG_FILES $1"
23179     ac_need_defaults=false;;
23180   --header | --heade | --head | --hea )
23181     shift
23182     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23183     ac_need_defaults=false;;
23184
23185   # This is an error.
23186   -*) { { echo "$as_me:23186: error: unrecognized option: $1
23187 Try \`$0 --help' for more information." >&5
23188 echo "$as_me: error: unrecognized option: $1
23189 Try \`$0 --help' for more information." >&2;}
23190    { (exit 1); exit 1; }; } ;;
23191
23192   *) ac_config_targets="$ac_config_targets $1" ;;
23193
23194   esac
23195   shift
23196 done
23197
23198 exec 5>>config.log
23199 cat >&5 << _ACEOF
23200
23201 ## ----------------------- ##
23202 ## Running config.status.  ##
23203 ## ----------------------- ##
23204
23205 This file was extended by $as_me 2.52.20210105, executed with
23206   CONFIG_FILES    = $CONFIG_FILES
23207   CONFIG_HEADERS  = $CONFIG_HEADERS
23208   CONFIG_LINKS    = $CONFIG_LINKS
23209   CONFIG_COMMANDS = $CONFIG_COMMANDS
23210   > "$ac_cs_invocation"
23211 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23212
23213 _ACEOF
23214 EOF
23215
23216 cat >>"$CONFIG_STATUS" <<EOF
23217 #
23218 # INIT-COMMANDS section.
23219 #
23220
23221 AWK="$AWK"
23222 ECHO_CC="$ECHO_CC"
23223 ECHO_LD="$ECHO_LD"
23224 SHOW_CC="$SHOW_LD"
23225
23226 EOF
23227
23228 cat >>"$CONFIG_STATUS" <<\EOF
23229 for ac_config_target in $ac_config_targets
23230 do
23231   case "$ac_config_target" in
23232   # Handling of arguments.
23233   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23234   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23235   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23236   *) { { echo "$as_me:23236: error: invalid argument: $ac_config_target" >&5
23237 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23238    { (exit 1); exit 1; }; };;
23239   esac
23240 done
23241
23242 # If the user did not use the arguments to specify the items to instantiate,
23243 # then the envvar interface is used.  Set only those that are not.
23244 # We use the long form for the default assignment because of an extremely
23245 # bizarre bug on SunOS 4.1.3.
23246 if "$ac_need_defaults"; then
23247   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23248   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23249   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23250 fi
23251
23252 # Create a temporary directory, and hook for its removal unless debugging.
23253 $debug ||
23254 {
23255   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23256   trap '{ (exit 1); exit 1; }' 1 2 13 15
23257 }
23258
23259 # Create a (secure) tmp directory for tmp files.
23260 : ${TMPDIR=/tmp}
23261 {
23262   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23263   test -n "$tmp" && test -d "$tmp"
23264 }  ||
23265 {
23266   tmp=$TMPDIR/cs$$-$RANDOM
23267   (umask 077 && mkdir $tmp)
23268 } ||
23269 {
23270    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23271    { (exit 1); exit 1; }
23272 }
23273
23274 EOF
23275
23276 cat >>"$CONFIG_STATUS" <<EOF
23277
23278 #
23279 # CONFIG_FILES section.
23280 #
23281
23282 # No need to generate the scripts if there are no CONFIG_FILES.
23283 # This happens for instance when ./config.status config.h
23284 if test -n "\$CONFIG_FILES"; then
23285   # Protect against being on the right side of a sed subst in config.status.
23286   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23287    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23288 s,@SHELL@,$SHELL,;t t
23289 s,@exec_prefix@,$exec_prefix,;t t
23290 s,@prefix@,$prefix,;t t
23291 s,@program_transform_name@,$program_transform_name,;t t
23292 s,@bindir@,$bindir,;t t
23293 s,@sbindir@,$sbindir,;t t
23294 s,@libexecdir@,$libexecdir,;t t
23295 s,@datarootdir@,$datarootdir,;t t
23296 s,@datadir@,$datadir,;t t
23297 s,@sysconfdir@,$sysconfdir,;t t
23298 s,@sharedstatedir@,$sharedstatedir,;t t
23299 s,@localstatedir@,$localstatedir,;t t
23300 s,@runstatedir@,$runstatedir,;t t
23301 s,@libdir@,$libdir,;t t
23302 s,@includedir@,$includedir,;t t
23303 s,@oldincludedir@,$oldincludedir,;t t
23304 s,@infodir@,$infodir,;t t
23305 s,@mandir@,$mandir,;t t
23306 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23307 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23308 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23309 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23310 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23311 s,@build_alias@,$build_alias,;t t
23312 s,@host_alias@,$host_alias,;t t
23313 s,@target_alias@,$target_alias,;t t
23314 s,@ECHO_C@,$ECHO_C,;t t
23315 s,@ECHO_N@,$ECHO_N,;t t
23316 s,@ECHO_T@,$ECHO_T,;t t
23317 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23318 s,@DEFS@,$DEFS,;t t
23319 s,@LIBS@,$LIBS,;t t
23320 s,@build@,$build,;t t
23321 s,@build_cpu@,$build_cpu,;t t
23322 s,@build_vendor@,$build_vendor,;t t
23323 s,@build_os@,$build_os,;t t
23324 s,@host@,$host,;t t
23325 s,@host_cpu@,$host_cpu,;t t
23326 s,@host_vendor@,$host_vendor,;t t
23327 s,@host_os@,$host_os,;t t
23328 s,@SET_MAKE@,$SET_MAKE,;t t
23329 s,@CC@,$CC,;t t
23330 s,@CFLAGS@,$CFLAGS,;t t
23331 s,@LDFLAGS@,$LDFLAGS,;t t
23332 s,@CPPFLAGS@,$CPPFLAGS,;t t
23333 s,@ac_ct_CC@,$ac_ct_CC,;t t
23334 s,@EXEEXT@,$EXEEXT,;t t
23335 s,@OBJEXT@,$OBJEXT,;t t
23336 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23337 s,@CPP@,$CPP,;t t
23338 s,@GREP@,$GREP,;t t
23339 s,@EGREP@,$EGREP,;t t
23340 s,@AWK@,$AWK,;t t
23341 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23342 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23343 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23344 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23345 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23346 s,@LINT@,$LINT,;t t
23347 s,@LINT_OPTS@,$LINT_OPTS,;t t
23348 s,@CTAGS@,$CTAGS,;t t
23349 s,@ETAGS@,$ETAGS,;t t
23350 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23351 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23352 s,@MATH_LIB@,$MATH_LIB,;t t
23353 s,@top_builddir@,$top_builddir,;t t
23354 s,@CC_G_OPT@,$CC_G_OPT,;t t
23355 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23356 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23357 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23358 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23359 s,@LD@,$LD,;t t
23360 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23361 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23362 s,@LD_MODEL@,$LD_MODEL,;t t
23363 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23364 s,@LIBTOOL@,$LIBTOOL,;t t
23365 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23366 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23367 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23368 s,@LIB_LINK@,$LIB_LINK,;t t
23369 s,@LINK_TESTS@,$LINK_TESTS,;t t
23370 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23371 s,@PACKAGE@,$PACKAGE,;t t
23372 s,@PTHREAD@,$PTHREAD,;t t
23373 s,@TEST_ARGS@,$TEST_ARGS,;t t
23374 s,@TEST_DEPS@,$TEST_DEPS,;t t
23375 s,@TEST_LIBS@,$TEST_LIBS,;t t
23376 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23377 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23378 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23379 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23380 s,@includesubdir@,$includesubdir,;t t
23381 s,@FGREP@,$FGREP,;t t
23382 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23383 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23384 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23385 s,@ECHO_LT@,$ECHO_LT,;t t
23386 s,@ECHO_LD@,$ECHO_LD,;t t
23387 s,@RULE_CC@,$RULE_CC,;t t
23388 s,@SHOW_CC@,$SHOW_CC,;t t
23389 s,@ECHO_CC@,$ECHO_CC,;t t
23390 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23391 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23392 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23393 s,@X_CFLAGS@,$X_CFLAGS,;t t
23394 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23395 s,@X_LIBS@,$X_LIBS,;t t
23396 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23397 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23398 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23399 s,@RGB_PATH@,$RGB_PATH,;t t
23400 s,@no_x11_rgb@,$no_x11_rgb,;t t
23401 s,@FORM_NAME@,$FORM_NAME,;t t
23402 s,@MENU_NAME@,$MENU_NAME,;t t
23403 s,@PANEL_NAME@,$PANEL_NAME,;t t
23404 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23405 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23406 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23407 CEOF
23408
23409 EOF
23410
23411   cat >>"$CONFIG_STATUS" <<\EOF
23412   # Split the substitutions into bite-sized pieces for seds with
23413   # small command number limits, like on Digital OSF/1 and HP-UX.
23414   ac_max_sed_lines=48
23415   ac_sed_frag=1 # Number of current file.
23416   ac_beg=1 # First line for current file.
23417   ac_end=$ac_max_sed_lines # Line after last line for current file.
23418   ac_more_lines=:
23419   ac_sed_cmds=
23420   while "$ac_more_lines"; do
23421     if test "$ac_beg" -gt 1; then
23422       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23423     else
23424       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23425     fi
23426     if test ! -s $tmp/subs.frag; then
23427       ac_more_lines=false
23428     else
23429       # The purpose of the label and of the branching condition is to
23430       # speed up the sed processing (if there are no `@' at all, there
23431       # is no need to browse any of the substitutions).
23432       # These are the two extra sed commands mentioned above.
23433       (echo ':t
23434   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23435       # It is possible to make a multiline substitution using escaped newlines.
23436       # Ensure that we do not split the substitution between script fragments.
23437       ac_BEG=$ac_end
23438       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23439       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23440       if test -s $tmp/subs.next; then
23441         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23442         if test ! -s $tmp/subs.edit; then
23443           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23444           if test ! -s $tmp/subs.edit; then
23445             if test "$ac_beg" -gt 1; then
23446               ac_end=`expr "$ac_end" - 1`
23447               continue
23448             fi
23449           fi
23450         fi
23451       fi
23452
23453       if test -z "$ac_sed_cmds"; then
23454         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23455       else
23456         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23457       fi
23458       ac_sed_frag=`expr "$ac_sed_frag" + 1`
23459       ac_beg=$ac_end
23460       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
23461     fi
23462   done
23463   if test -z "$ac_sed_cmds"; then
23464     ac_sed_cmds=cat
23465   fi
23466 fi # test -n "$CONFIG_FILES"
23467
23468 EOF
23469 cat >>"$CONFIG_STATUS" <<\EOF
23470 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23471   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23472   case "$ac_file" in
23473   - | *:- | *:-:* ) # input from stdin
23474         cat >$tmp/stdin
23475         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23476         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23477   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23478         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23479   * )   ac_file_in=$ac_file.in ;;
23480   esac
23481
23482   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23483   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23484          X"$ac_file" : 'X\(//\)[^/]' \| \
23485          X"$ac_file" : 'X\(//\)$' \| \
23486          X"$ac_file" : 'X\(/\)' \| \
23487          .     : '\(.\)' 2>/dev/null ||
23488 echo X"$ac_file" |
23489     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23490           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23491           /^X\(\/\/\)$/{ s//\1/; q; }
23492           /^X\(\/\).*/{ s//\1/; q; }
23493           s/.*/./; q'`
23494   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23495     { case "$ac_dir" in
23496   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23497   *)                      as_incr_dir=.;;
23498 esac
23499 as_dummy="$ac_dir"
23500 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23501   case $as_mkdir_dir in
23502     # Skip DOS drivespec
23503     ?:) as_incr_dir=$as_mkdir_dir ;;
23504     *)
23505       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23506       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23507     ;;
23508   esac
23509 done; }
23510
23511     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23512     # A "../" for each directory in $ac_dir_suffix.
23513     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23514   else
23515     ac_dir_suffix= ac_dots=
23516   fi
23517
23518   case "$srcdir" in
23519   .)  ac_srcdir=.
23520       if test -z "$ac_dots"; then
23521          ac_top_srcdir=.
23522       else
23523          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
23524       fi ;;
23525   [\\/]* | ?:[\\/]* )
23526       ac_srcdir="$srcdir$ac_dir_suffix";
23527       ac_top_srcdir="$srcdir" ;;
23528   *) # Relative path.
23529     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
23530     ac_top_srcdir="$ac_dots$srcdir" ;;
23531   esac
23532
23533   case $INSTALL in
23534   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23535   *) ac_INSTALL=$ac_dots$INSTALL ;;
23536   esac
23537
23538   if test x"$ac_file" != x-; then
23539     { echo "$as_me:23539: creating $ac_file" >&5
23540 echo "$as_me: creating $ac_file" >&6;}
23541     rm -f "$ac_file"
23542   fi
23543   # Let's still pretend it is `configure' which instantiates (i.e., don't
23544   # use $as_me), people would be surprised to read:
23545   #    /* config.h.  Generated automatically by config.status.  */
23546   configure_input="Generated automatically from `echo $ac_file_in |
23547                                                  sed 's,.*/,,'` by configure."
23548
23549   # First look for the input files in the build tree, otherwise in the
23550   # src tree.
23551   ac_file_inputs=`IFS=:
23552     for f in $ac_file_in; do
23553       case $f in
23554       -) echo $tmp/stdin ;;
23555       [\\/$]*)
23556          # Absolute (can't be DOS-style, as IFS=:)
23557          test -f "$f" || { { echo "$as_me:23557: error: cannot find input file: $f" >&5
23558 echo "$as_me: error: cannot find input file: $f" >&2;}
23559    { (exit 1); exit 1; }; }
23560          echo $f;;
23561       *) # Relative
23562          if test -f "$f"; then
23563            # Build tree
23564            echo $f
23565          elif test -f "$srcdir/$f"; then
23566            # Source tree
23567            echo "$srcdir/$f"
23568          else
23569            # /dev/null tree
23570            { { echo "$as_me:23570: error: cannot find input file: $f" >&5
23571 echo "$as_me: error: cannot find input file: $f" >&2;}
23572    { (exit 1); exit 1; }; }
23573          fi;;
23574       esac
23575     done` || { (exit 1); exit 1; }
23576 EOF
23577 cat >>"$CONFIG_STATUS" <<\EOF
23578   ac_warn_datarootdir=no
23579   if test x"$ac_file" != x-; then
23580     for ac_item in $ac_file_inputs
23581     do
23582       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
23583       if test -n "$ac_seen"; then
23584         ac_used=`grep '@datarootdir@' "$ac_item"`
23585         if test -z "$ac_used"; then
23586           { echo "$as_me:23586: WARNING: datarootdir was used implicitly but not set:
23587 $ac_seen" >&5
23588 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23589 $ac_seen" >&2;}
23590           ac_warn_datarootdir=yes
23591         fi
23592       fi
23593       ac_seen=`grep '${datarootdir}' "$ac_item"`
23594       if test -n "$ac_seen"; then
23595         { echo "$as_me:23595: WARNING: datarootdir was used explicitly but not set:
23596 $ac_seen" >&5
23597 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23598 $ac_seen" >&2;}
23599         ac_warn_datarootdir=yes
23600       fi
23601     done
23602   fi
23603
23604 if test "x$ac_warn_datarootdir" = xyes; then
23605   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23606 fi
23607
23608 EOF
23609 cat >>"$CONFIG_STATUS" <<EOF
23610   sed "$ac_vpsub
23611 $extrasub
23612 EOF
23613 cat >>"$CONFIG_STATUS" <<\EOF
23614 :t
23615 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23616 s,@configure_input@,$configure_input,;t t
23617 s,@srcdir@,$ac_srcdir,;t t
23618 s,@top_srcdir@,$ac_top_srcdir,;t t
23619 s,@INSTALL@,$ac_INSTALL,;t t
23620 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23621   rm -f $tmp/stdin
23622   if test x"$ac_file" != x-; then
23623     cp "$tmp/out" "$ac_file"
23624
23625     for ac_name in prefix exec_prefix datarootdir
23626     do
23627         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
23628         if test -n "$ac_seen"; then
23629             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
23630             if test -z "$ac_init"; then
23631               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23632               { echo "$as_me:23632: WARNING: Variable $ac_name is used but was not set:
23633 $ac_seen" >&5
23634 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23635 $ac_seen" >&2;}
23636             fi
23637         fi
23638     done
23639     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
23640     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
23641     if test -s $tmp/out; then
23642       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23643       { echo "$as_me:23643: WARNING: Some variables may not be substituted:
23644 $ac_seen" >&5
23645 echo "$as_me: WARNING: Some variables may not be substituted:
23646 $ac_seen" >&2;}
23647     fi
23648   else
23649     cat $tmp/out
23650   fi
23651   rm -f $tmp/out
23652
23653 done
23654 EOF
23655 cat >>"$CONFIG_STATUS" <<\EOF
23656
23657 #
23658 # CONFIG_HEADER section.
23659 #
23660
23661 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23662 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23663 #
23664 # ac_d sets the value in "#define NAME VALUE" lines.
23665 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23666 ac_dB='[        ].*$,\1#\2'
23667 ac_dC=' '
23668 ac_dD=',;t'
23669 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23670 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23671 ac_iB='\([      ]\),\1#\2define\3'
23672 ac_iC=' '
23673 ac_iD='\4,;t'
23674 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23675 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23676 ac_uB='$,\1#\2define\3'
23677 ac_uC=' '
23678 ac_uD=',;t'
23679
23680 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23681   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23682   case "$ac_file" in
23683   - | *:- | *:-:* ) # input from stdin
23684         cat >$tmp/stdin
23685         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23686         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23687   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23688         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23689   * )   ac_file_in=$ac_file.in ;;
23690   esac
23691
23692   test x"$ac_file" != x- && { echo "$as_me:23692: creating $ac_file" >&5
23693 echo "$as_me: creating $ac_file" >&6;}
23694
23695   # First look for the input files in the build tree, otherwise in the
23696   # src tree.
23697   ac_file_inputs=`IFS=:
23698     for f in $ac_file_in; do
23699       case $f in
23700       -) echo $tmp/stdin ;;
23701       [\\/$]*)
23702          # Absolute (can't be DOS-style, as IFS=:)
23703          test -f "$f" || { { echo "$as_me:23703: error: cannot find input file: $f" >&5
23704 echo "$as_me: error: cannot find input file: $f" >&2;}
23705    { (exit 1); exit 1; }; }
23706          echo $f;;
23707       *) # Relative
23708          if test -f "$f"; then
23709            # Build tree
23710            echo $f
23711          elif test -f "$srcdir/$f"; then
23712            # Source tree
23713            echo "$srcdir/$f"
23714          else
23715            # /dev/null tree
23716            { { echo "$as_me:23716: error: cannot find input file: $f" >&5
23717 echo "$as_me: error: cannot find input file: $f" >&2;}
23718    { (exit 1); exit 1; }; }
23719          fi;;
23720       esac
23721     done` || { (exit 1); exit 1; }
23722   # Remove the trailing spaces.
23723   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23724
23725 EOF
23726
23727 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23728 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23729 # be either 'cat' or 'sort'.
23730 cat confdefs.h | uniq >conftest.vals
23731
23732 # Break up conftest.vals because some shells have a limit on
23733 # the size of here documents, and old seds have small limits too.
23734
23735 rm -f conftest.tail
23736 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
23737 while grep . conftest.vals >/dev/null
23738 do
23739   # Write chunks of a limited-size here document to conftest.frag.
23740   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
23741   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
23742   echo 'CEOF' >> "$CONFIG_STATUS"
23743   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
23744   rm -f conftest.vals
23745   mv conftest.tail conftest.vals
23746 done
23747 rm -f conftest.vals
23748
23749 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23750 # marker @DEFS@.
23751 echo '  cat >> conftest.edit <<CEOF
23752 /@DEFS@/r conftest.frag
23753 /@DEFS@/d
23754 CEOF
23755 sed -f conftest.edit $tmp/in > $tmp/out
23756 rm -f $tmp/in
23757 mv $tmp/out $tmp/in
23758 rm -f conftest.edit conftest.frag
23759 ' >> "$CONFIG_STATUS"
23760
23761 cat >>"$CONFIG_STATUS" <<\EOF
23762   # Let's still pretend it is `configure' which instantiates (i.e., don't
23763   # use $as_me), people would be surprised to read:
23764   #    /* config.h.  Generated automatically by config.status.  */
23765   if test x"$ac_file" = x-; then
23766     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23767   else
23768     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23769   fi
23770   cat $tmp/in >>$tmp/config.h
23771   rm -f $tmp/in
23772   if test x"$ac_file" != x-; then
23773     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
23774       { echo "$as_me:23774: $ac_file is unchanged" >&5
23775 echo "$as_me: $ac_file is unchanged" >&6;}
23776     else
23777       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23778          X"$ac_file" : 'X\(//\)[^/]' \| \
23779          X"$ac_file" : 'X\(//\)$' \| \
23780          X"$ac_file" : 'X\(/\)' \| \
23781          .     : '\(.\)' 2>/dev/null ||
23782 echo X"$ac_file" |
23783     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23784           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23785           /^X\(\/\/\)$/{ s//\1/; q; }
23786           /^X\(\/\).*/{ s//\1/; q; }
23787           s/.*/./; q'`
23788       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23789         { case "$ac_dir" in
23790   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23791   *)                      as_incr_dir=.;;
23792 esac
23793 as_dummy="$ac_dir"
23794 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23795   case $as_mkdir_dir in
23796     # Skip DOS drivespec
23797     ?:) as_incr_dir=$as_mkdir_dir ;;
23798     *)
23799       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23800       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23801     ;;
23802   esac
23803 done; }
23804
23805       fi
23806       rm -f "$ac_file"
23807       mv "$tmp/config.h" "$ac_file"
23808     fi
23809   else
23810     cat $tmp/config.h
23811     rm -f $tmp/config.h
23812   fi
23813 done
23814 EOF
23815 cat >>"$CONFIG_STATUS" <<\EOF
23816 #
23817 # CONFIG_COMMANDS section.
23818 #
23819 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23820   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23821   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23822
23823   case "$ac_dest" in
23824     default )
23825
23826 for cf_dir in .
23827 do
23828         if test ! -d "$srcdir/$cf_dir" ; then
23829                 continue
23830         elif test -f "$srcdir/$cf_dir/programs" ; then
23831                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
23832         fi
23833 done
23834
23835         cat >>Makefile <<TEST_EOF
23836
23837 # These rules are generated so we do not rely on suffix rules, which do not
23838 # work consistently for different make-programs (the '\$(MODEL)/' confuses
23839 # some, and the '\$x' confuses others).
23840 TEST_EOF
23841
23842 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
23843 for N in $LIST
23844 do
23845         cat >>Makefile <<TEST_EOF
23846
23847 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
23848         \$(srcdir)/test.priv.h \\
23849         ncurses_cfg.h
23850         $SHOW_CC
23851         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
23852 TEST_EOF
23853 done
23854
23855 if test -f ../config.guess && test -f ../config.sub
23856 then
23857         cat >>Makefile <<TEST_EOF
23858
23859 # if we used CF_INHERIT for getting these files, we can remove them
23860 distclean::
23861         rm -f config.guess config.sub
23862 TEST_EOF
23863 fi
23864  ;;
23865   esac
23866 done
23867 EOF
23868
23869 cat >>"$CONFIG_STATUS" <<\EOF
23870
23871 { (exit 0); exit 0; }
23872 EOF
23873 chmod +x "$CONFIG_STATUS"
23874 ac_clean_files=$ac_clean_files_save
23875
23876 # configure is writing to config.log, and then calls config.status.
23877 # config.status does its own redirection, appending to config.log.
23878 # Unfortunately, on DOS this fails, as config.log is still kept open
23879 # by configure, so config.status won't be able to write to it; its
23880 # output is simply discarded.  So we exec the FD to /dev/null,
23881 # effectively closing config.log, so it can be properly (re)opened and
23882 # appended to by config.status.  When coming back to configure, we
23883 # need to make the FD available again.
23884 if test "$no_create" != yes; then
23885   ac_cs_success=:
23886   exec 5>/dev/null
23887   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
23888   exec 5>>config.log
23889   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
23890   # would make configure fail if this is the last instruction.
23891   "$ac_cs_success" || { (exit 1); exit 1; }
23892 fi
23893