]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20210522
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20210509.
4 #
5 # Copyright 2003-2020,2021      Thomas E. Dickey
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset="unset"
64 else
65   as_unset="false"
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS=
101 MAKEFLAGS=
102 SHELL=${CONFIG_SHELL-/bin/sh}
103
104 # Maximum number of lines to put in a shell here document.
105 # This variable seems obsolete.  It should probably be removed, and
106 # only ac_max_sed_lines should be used.
107 : "${ac_max_here_lines=38}"
108
109 ac_unique_file="ncurses.c"
110
111 # Initialize some variables set by options.
112 ac_init_help=
113 ac_init_version=false
114 # The variables have the same names as the options, with
115 # dashes changed to underlines.
116 cache_file=/dev/null
117 exec_prefix=NONE
118 no_create=
119 no_recursion=
120 prefix=NONE
121 program_prefix=NONE
122 program_suffix=NONE
123 program_transform_name=s,x,x,
124 silent=
125 site=
126 srcdir=
127 verbose=
128 x_includes=NONE
129 x_libraries=NONE
130
131 # Installation directory options.
132 # These are left unexpanded so users can "make install exec_prefix=/foo"
133 # and all the variables that are supposed to be based on exec_prefix
134 # by default will actually change.
135 # Use braces instead of parens because sh, perl, etc. also accept them.
136 bindir='${exec_prefix}/bin'
137 sbindir='${exec_prefix}/sbin'
138 libexecdir='${exec_prefix}/libexec'
139 datarootdir='${prefix}/share'
140 datadir='${datarootdir}'
141 sysconfdir='${prefix}/etc'
142 sharedstatedir='${prefix}/com'
143 localstatedir='${prefix}/var'
144 runstatedir='${localstatedir}/run'
145 libdir='${exec_prefix}/lib'
146 includedir='${prefix}/include'
147 oldincludedir='/usr/include'
148 infodir='${datarootdir}/info'
149 mandir='${datarootdir}/man'
150
151 # Identity of this package.
152 PACKAGE_NAME=
153 PACKAGE_TARNAME=
154 PACKAGE_VERSION=
155 PACKAGE_STRING=
156 PACKAGE_BUGREPORT=
157
158 ac_prev=
159 for ac_option
160 do
161   # If the previous option needs an argument, assign it.
162   if test -n "$ac_prev"; then
163     eval "$ac_prev=\$ac_option"
164     ac_prev=
165     continue
166   fi
167
168   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
169
170   # Accept the important Cygnus configure options, so we can diagnose typos.
171
172   case "$ac_option" in
173
174   -bindir | --bindir | --bindi | --bind | --bin | --bi)
175     ac_prev=bindir ;;
176   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
177     bindir=$ac_optarg ;;
178
179   -build | --build | --buil | --bui | --bu)
180     ac_prev=build_alias ;;
181   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
182     build_alias=$ac_optarg ;;
183
184   -cache-file | --cache-file | --cache-fil | --cache-fi \
185   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
186     ac_prev=cache_file ;;
187   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
188   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
189     cache_file=$ac_optarg ;;
190
191   --config-cache | -C)
192     cache_file=config.cache ;;
193
194   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
195     ac_prev=datadir ;;
196   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
197   | --da=*)
198     datadir=$ac_optarg ;;
199
200   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
201   | --dataroo | --dataro | --datar)
202     ac_prev=datarootdir ;;
203   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
204   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
205     datarootdir=$ac_optarg ;;
206
207   -disable-* | --disable-*)
208     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
209     # Reject names that are not valid shell variable names.
210     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
211       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
212    { (exit 1); exit 1; }; }
213     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
214     eval "enable_$ac_feature=no" ;;
215
216   -enable-* | --enable-*)
217     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
218     # Reject names that are not valid shell variable names.
219     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
220       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
221    { (exit 1); exit 1; }; }
222     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
223     case "$ac_option" in
224       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
225       *) ac_optarg=yes ;;
226     esac
227     eval "enable_$ac_feature='$ac_optarg'" ;;
228
229   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
230   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
231   | --exec | --exe | --ex)
232     ac_prev=exec_prefix ;;
233   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
234   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
235   | --exec=* | --exe=* | --ex=*)
236     exec_prefix=$ac_optarg ;;
237
238   -gas | --gas | --ga | --g)
239     # Obsolete; use --with-gas.
240     with_gas=yes ;;
241
242   -help | --help | --hel | --he | -h)
243     ac_init_help=long ;;
244   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
245     ac_init_help=recursive ;;
246   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
247     ac_init_help=short ;;
248
249   -host | --host | --hos | --ho)
250     ac_prev=host_alias ;;
251   -host=* | --host=* | --hos=* | --ho=*)
252     host_alias=$ac_optarg ;;
253
254   -includedir | --includedir | --includedi | --included | --include \
255   | --includ | --inclu | --incl | --inc)
256     ac_prev=includedir ;;
257   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
258   | --includ=* | --inclu=* | --incl=* | --inc=*)
259     includedir=$ac_optarg ;;
260
261   -infodir | --infodir | --infodi | --infod | --info | --inf)
262     ac_prev=infodir ;;
263   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
264     infodir=$ac_optarg ;;
265
266   -libdir | --libdir | --libdi | --libd)
267     ac_prev=libdir ;;
268   -libdir=* | --libdir=* | --libdi=* | --libd=*)
269     libdir=$ac_optarg ;;
270
271   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
272   | --libexe | --libex | --libe)
273     ac_prev=libexecdir ;;
274   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
275   | --libexe=* | --libex=* | --libe=*)
276     libexecdir=$ac_optarg ;;
277
278   -localstatedir | --localstatedir | --localstatedi | --localstated \
279   | --localstate | --localstat | --localsta | --localst \
280   | --locals | --local | --loca | --loc | --lo)
281     ac_prev=localstatedir ;;
282   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
283   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
284   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
285     localstatedir=$ac_optarg ;;
286
287   -runstatedir | --runstatedir | --runstatedi | --runstated \
288   | --runstate | --runstat | --runsta | --runst \
289   | --runs | --run | --ru)
290     ac_prev=runstatedir ;;
291   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
292   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
293   | --runs=* | --run=* | --ru=*)
294     runstatedir=$ac_optarg ;;
295
296   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
297     ac_prev=mandir ;;
298   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
299     mandir=$ac_optarg ;;
300
301   -nfp | --nfp | --nf)
302     # Obsolete; use --without-fp.
303     with_fp=no ;;
304
305   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
306   | --no-cr | --no-c)
307     no_create=yes ;;
308
309   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
310   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
311     no_recursion=yes ;;
312
313   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
314   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
315   | --oldin | --oldi | --old | --ol | --o)
316     ac_prev=oldincludedir ;;
317   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
318   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
319   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
320     oldincludedir=$ac_optarg ;;
321
322   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
323     ac_prev=prefix ;;
324   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
325     prefix=$ac_optarg ;;
326
327   -program-prefix | --program-prefix | --program-prefi | --program-pref \
328   | --program-pre | --program-pr | --program-p)
329     ac_prev=program_prefix ;;
330   -program-prefix=* | --program-prefix=* | --program-prefi=* \
331   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
332     program_prefix=$ac_optarg ;;
333
334   -program-suffix | --program-suffix | --program-suffi | --program-suff \
335   | --program-suf | --program-su | --program-s)
336     ac_prev=program_suffix ;;
337   -program-suffix=* | --program-suffix=* | --program-suffi=* \
338   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
339     program_suffix=$ac_optarg ;;
340
341   -program-transform-name | --program-transform-name \
342   | --program-transform-nam | --program-transform-na \
343   | --program-transform-n | --program-transform- \
344   | --program-transform | --program-transfor \
345   | --program-transfo | --program-transf \
346   | --program-trans | --program-tran \
347   | --progr-tra | --program-tr | --program-t)
348     ac_prev=program_transform_name ;;
349   -program-transform-name=* | --program-transform-name=* \
350   | --program-transform-nam=* | --program-transform-na=* \
351   | --program-transform-n=* | --program-transform-=* \
352   | --program-transform=* | --program-transfor=* \
353   | --program-transfo=* | --program-transf=* \
354   | --program-trans=* | --program-tran=* \
355   | --progr-tra=* | --program-tr=* | --program-t=*)
356     program_transform_name=$ac_optarg ;;
357
358   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
359   | -silent | --silent | --silen | --sile | --sil)
360     silent=yes ;;
361
362   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
363     ac_prev=sbindir ;;
364   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
365   | --sbi=* | --sb=*)
366     sbindir=$ac_optarg ;;
367
368   -sharedstatedir | --sharedstatedir | --sharedstatedi \
369   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
370   | --sharedst | --shareds | --shared | --share | --shar \
371   | --sha | --sh)
372     ac_prev=sharedstatedir ;;
373   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
374   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
375   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
376   | --sha=* | --sh=*)
377     sharedstatedir=$ac_optarg ;;
378
379   -site | --site | --sit)
380     ac_prev=site ;;
381   -site=* | --site=* | --sit=*)
382     site=$ac_optarg ;;
383
384   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
385     ac_prev=srcdir ;;
386   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
387     srcdir=$ac_optarg ;;
388
389   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
390   | --syscon | --sysco | --sysc | --sys | --sy)
391     ac_prev=sysconfdir ;;
392   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
393   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
394     sysconfdir=$ac_optarg ;;
395
396   -target | --target | --targe | --targ | --tar | --ta | --t)
397     ac_prev=target_alias ;;
398   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
399     target_alias=$ac_optarg ;;
400
401   -v | -verbose | --verbose | --verbos | --verbo | --verb)
402     verbose=yes ;;
403
404   -version | --version | --versio | --versi | --vers | -V)
405     ac_init_version=: ;;
406
407   -with-* | --with-*)
408     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
409     # Reject names that are not valid shell variable names.
410     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
411       { echo "$as_me: error: invalid package name: $ac_package" >&2
412    { (exit 1); exit 1; }; }
413     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
414     case "$ac_option" in
415       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
416       *) ac_optarg=yes ;;
417     esac
418     eval "with_$ac_package='$ac_optarg'" ;;
419
420   -without-* | --without-*)
421     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
422     # Reject names that are not valid shell variable names.
423     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
424       { echo "$as_me: error: invalid package name: $ac_package" >&2
425    { (exit 1); exit 1; }; }
426     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
427     eval "with_$ac_package=no" ;;
428
429   --x)
430     # Obsolete; use --with-x.
431     with_x=yes ;;
432
433   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
434   | --x-incl | --x-inc | --x-in | --x-i)
435     ac_prev=x_includes ;;
436   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
437   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
438     x_includes=$ac_optarg ;;
439
440   -x-libraries | --x-libraries | --x-librarie | --x-librari \
441   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
442     ac_prev=x_libraries ;;
443   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
444   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
445     x_libraries=$ac_optarg ;;
446
447   -*) { echo "$as_me: error: unrecognized option: $ac_option
448 Try \`$0 --help' for more information." >&2
449    { (exit 1); exit 1; }; }
450     ;;
451
452   *=*)
453     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
454     # Reject names that are not valid shell variable names.
455     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
456       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
457    { (exit 1); exit 1; }; }
458     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
459     eval "$ac_envvar='$ac_optarg'"
460     export "$ac_envvar" ;;
461
462   *)
463     # FIXME: should be removed in autoconf 3.0.
464     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
465     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
466       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
467     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
468     ;;
469
470   esac
471 done
472
473 if test -n "$ac_prev"; then
474   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
475   { echo "$as_me: error: missing argument to $ac_option" >&2
476    { (exit 1); exit 1; }; }
477 fi
478
479 # Be sure to have absolute paths.
480 for ac_var in exec_prefix prefix
481 do
482   eval ac_val=$`echo "$ac_var"`
483   case "$ac_val" in
484     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # Be sure to have absolute paths.
491 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
492               localstatedir libdir includedir oldincludedir infodir mandir
493 do
494   eval ac_val=$`echo "$ac_var"`
495   case "$ac_val" in
496     [\\/$]* | ?:[\\/]* ) ;;
497     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
498    { (exit 1); exit 1; }; };;
499   esac
500 done
501
502 # There might be people who depend on the old broken behavior: `$host'
503 # used to hold the argument of --host etc.
504 build=$build_alias
505 host=$host_alias
506 target=$target_alias
507
508 # FIXME: should be removed in autoconf 3.0.
509 if test "x$host_alias" != x; then
510   if test "x$build_alias" = x; then
511     cross_compiling=maybe
512     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
513     If a cross compiler is detected then cross compile mode will be used." >&2
514   elif test "x$build_alias" != "x$host_alias"; then
515     cross_compiling=yes
516   fi
517 fi
518
519 ac_tool_prefix=
520 test -n "$host_alias" && ac_tool_prefix=$host_alias-
521
522 test "$silent" = yes && exec 6>/dev/null
523
524 # Find the source files, if location was not specified.
525 if test -z "$srcdir"; then
526   ac_srcdir_defaulted=yes
527   # Try the directory containing this script, then its parent.
528   ac_prog=$0
529   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
530   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
531   srcdir=$ac_confdir
532   if test ! -r "$srcdir/$ac_unique_file"; then
533     srcdir=..
534   fi
535 else
536   ac_srcdir_defaulted=no
537 fi
538 if test ! -r "$srcdir/$ac_unique_file"; then
539   if test "$ac_srcdir_defaulted" = yes; then
540     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
541    { (exit 1); exit 1; }; }
542   else
543     { echo "$as_me: error: cannot find sources in $srcdir" >&2
544    { (exit 1); exit 1; }; }
545   fi
546 fi
547 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
548 ac_env_build_alias_set=${build_alias+set}
549 ac_env_build_alias_value=$build_alias
550 ac_cv_env_build_alias_set=${build_alias+set}
551 ac_cv_env_build_alias_value=$build_alias
552 ac_env_host_alias_set=${host_alias+set}
553 ac_env_host_alias_value=$host_alias
554 ac_cv_env_host_alias_set=${host_alias+set}
555 ac_cv_env_host_alias_value=$host_alias
556 ac_env_target_alias_set=${target_alias+set}
557 ac_env_target_alias_value=$target_alias
558 ac_cv_env_target_alias_set=${target_alias+set}
559 ac_cv_env_target_alias_value=$target_alias
560 ac_env_CC_set=${CC+set}
561 ac_env_CC_value=$CC
562 ac_cv_env_CC_set=${CC+set}
563 ac_cv_env_CC_value=$CC
564 ac_env_CFLAGS_set=${CFLAGS+set}
565 ac_env_CFLAGS_value=$CFLAGS
566 ac_cv_env_CFLAGS_set=${CFLAGS+set}
567 ac_cv_env_CFLAGS_value=$CFLAGS
568 ac_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_env_LDFLAGS_value=$LDFLAGS
570 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
571 ac_cv_env_LDFLAGS_value=$LDFLAGS
572 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_env_CPPFLAGS_value=$CPPFLAGS
574 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
575 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
576 ac_env_CPP_set=${CPP+set}
577 ac_env_CPP_value=$CPP
578 ac_cv_env_CPP_set=${CPP+set}
579 ac_cv_env_CPP_value=$CPP
580
581 #
582 # Report the --help message.
583 #
584 if test "$ac_init_help" = "long"; then
585   # Omit some internal or obsolete options to make the list less imposing.
586   # This message is too long to be a string in the A/UX 3.1 sh.
587   cat <<EOF
588 \`configure' configures this package to adapt to many kinds of systems.
589
590 Usage: $0 [OPTION]... [VAR=VALUE]...
591
592 To assign environment variables (e.g., CC, CFLAGS...), specify them as
593 VAR=VALUE.  See below for descriptions of some of the useful variables.
594
595 Defaults for the options are specified in brackets.
596
597 Configuration:
598   -h, --help              display this help and exit
599       --help=short        display options specific to this package
600       --help=recursive    display the short help of all the included packages
601   -V, --version           display version information and exit
602   -q, --quiet, --silent   do not print \`checking...' messages
603       --cache-file=FILE   cache test results in FILE [disabled]
604   -C, --config-cache      alias for \`--cache-file=config.cache'
605   -n, --no-create         do not create output files
606       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
607
608 EOF
609
610   cat <<EOF
611 Installation directories:
612   --prefix=PREFIX         install architecture-independent files in PREFIX
613                           [$ac_default_prefix]
614   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
615                           [PREFIX]
616
617 By default, \`make install' will install all the files in
618 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
619 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
620 for instance \`--prefix=\$HOME'.
621
622 For better control, use the options below.
623
624 Fine tuning of the installation directories:
625   --bindir=DIR            user executables [EPREFIX/bin]
626   --sbindir=DIR           system admin executables [EPREFIX/sbin]
627   --libexecdir=DIR        program executables [EPREFIX/libexec]
628   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
629   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
630   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
631   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
632   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
633   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
634   --libdir=DIR            object code libraries [EPREFIX/lib]
635   --includedir=DIR        C header files [PREFIX/include]
636   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
637   --infodir=DIR           info documentation [DATAROOTDIR/info]
638   --mandir=DIR            man documentation [DATAROOTDIR/man]
639 EOF
640
641   cat <<\EOF
642
643 Program names:
644   --program-prefix=PREFIX            prepend PREFIX to installed program names
645   --program-suffix=SUFFIX            append SUFFIX to installed program names
646   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
647
648 X features:
649   --x-includes=DIR    X include files are in DIR
650   --x-libraries=DIR   X library files are in DIR
651
652 System types:
653   --build=BUILD           configure for building on BUILD [guessed]
654   --host=HOST       build programs to run on HOST [BUILD]
655 EOF
656 fi
657
658 if test -n "$ac_init_help"; then
659
660   cat <<\EOF
661
662 Optional Features:
663   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
664   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
665
666 Optional Packages:
667   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
668   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
669
670 General Options:
671   --disable-stripping     do not strip (debug info) installed executables
672   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
673   --enable-string-hacks   work around bogus compiler/loader warnings
674   --with-pkg-config{=path} enable/disable use of pkg-config
675   --disable-echo          do not display "compiling" commands
676 Curses Version-dependent Options:
677   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
678   --disable-widec         disable checks for wide-character functions
679   --with-curses-dir=DIR   directory in which (n)curses is installed
680   --with-screen=XXX       use specified curses-libraries
681   --with-ncursesw         use wide ncurses-libraries
682   --with-ncurses          use ncurses-libraries
683   --with-pdcurses         compile/link with pdcurses X11 library
684   --with-curses-colr      compile/link with HPUX 10.x color-curses
685   --with-curses-5lib      compile/link with SunOS 5lib curses
686   --with-Xaw3d            link with Xaw 3d library
687   --with-Xaw3dxft         link with Xaw 3d xft library
688   --with-neXtaw           link with neXT Athena library
689   --with-XawPlus          link with Athena-Plus library
690   --with-x                use the X Window System
691   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
692   --with-form-libname=XXX override form basename of library
693   --with-menu-libname=XXX override menu basename of library
694   --with-panel-libname=XXX override panel basename of library
695   --disable-panel         disable checks for panel functions
696   --disable-menu          disable checks for menu functions
697   --disable-form          disable checks for form functions
698 Testing/development Options:
699   --enable-warnings       test: turn on gcc compiler warnings
700   --with-dmalloc          test: use Gray Watson's dmalloc library
701   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
702   --with-valgrind         test: use valgrind
703   --disable-leaks         test: free permanent memory, analyze leaks
704   --disable-rpath-hack    don't add rpath options for additional libraries
705
706 Some influential environment variables:
707   CC          C compiler command
708   CFLAGS      C compiler flags
709   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
710               nonstandard directory <lib dir>
711   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
712               headers in a nonstandard directory <include dir>
713   CPP         C preprocessor
714
715 Use these variables to override the choices made by `configure' or to help
716 it to find libraries and programs with nonstandard names/locations.
717
718 EOF
719 fi
720
721 if test "$ac_init_help" = "recursive"; then
722   # If there are subdirs, report their specific --help.
723   ac_popdir=`pwd`
724   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
725     cd "$ac_subdir"
726     # A "../" for each directory in /$ac_subdir.
727     ac_dots=`echo "$ac_subdir" |
728              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
729
730     case "$srcdir" in
731     .) # No --srcdir option.  We are building in place.
732       ac_sub_srcdir="$srcdir" ;;
733     [\\/]* | ?:[\\/]* ) # Absolute path.
734       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
735     *) # Relative path.
736       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
737     esac
738
739     # Check for guested configure; otherwise get Cygnus style configure.
740     if test -f "$ac_sub_srcdir/configure.gnu"; then
741       echo
742       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
743     elif test -f "$ac_sub_srcdir/configure"; then
744       echo
745       $SHELL "$ac_sub_srcdir/configure" --help=recursive
746     elif test -f "$ac_sub_srcdir/configure.ac" ||
747            test -f "$ac_sub_srcdir/configure.in"; then
748       echo
749       "$ac_configure" --help
750     else
751       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
752     fi
753     cd "$ac_popdir"
754   done
755 fi
756
757 test -n "$ac_init_help" && exit 0
758 if "$ac_init_version"; then
759   cat <<\EOF
760
761 Copyright 2003-2020,2021        Thomas E. Dickey
762 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
763 Free Software Foundation, Inc.
764 This configure script is free software; the Free Software Foundation
765 gives unlimited permission to copy, distribute and modify it.
766 EOF
767   exit 0
768 fi
769 exec 5>config.log
770 cat >&5 <<EOF
771 This file contains any messages produced by compilers while
772 running configure, to aid debugging if configure makes a mistake.
773
774 It was created by $as_me, which was
775 generated by GNU Autoconf 2.52.20210509.  Invocation command line was
776
777   $ $0 $@
778
779 EOF
780 {
781 cat <<_ASUNAME
782 ## ---------- ##
783 ## Platform.  ##
784 ## ---------- ##
785
786 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
787 uname -m = `(uname -m) 2>/dev/null || echo unknown`
788 uname -r = `(uname -r) 2>/dev/null || echo unknown`
789 uname -s = `(uname -s) 2>/dev/null || echo unknown`
790 uname -v = `(uname -v) 2>/dev/null || echo unknown`
791
792 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
793 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
794
795 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
796 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
797 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
798 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
799 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
800 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
801 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
802
803 PATH = $PATH
804
805 _ASUNAME
806 } >&5
807
808 cat >&5 <<EOF
809 ## ------------ ##
810 ## Core tests.  ##
811 ## ------------ ##
812
813 EOF
814
815 # Keep a trace of the command line.
816 # Strip out --no-create and --no-recursion so they do not pile up.
817 # Also quote any args containing shell meta-characters.
818 ac_configure_args=
819 ac_sep=
820 for ac_arg
821 do
822   case "$ac_arg" in
823   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
824   | --no-cr | --no-c) ;;
825   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
826   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
827   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
828     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
829     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
830     ac_sep=" " ;;
831   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
832      ac_sep=" " ;;
833   esac
834   # Get rid of the leading space.
835 done
836
837 # When interrupted or exit'd, cleanup temporary files, and complete
838 # config.log.  We remove comments because anyway the quotes in there
839 # would cause problems or look ugly.
840 trap 'exit_status=$?
841   # Save into config.log some information that might help in debugging.
842   echo >&5
843   echo "## ----------------- ##" >&5
844   echo "## Cache variables.  ##" >&5
845   echo "## ----------------- ##" >&5
846   echo >&5
847   # The following way of writing the cache mishandles newlines in values,
848 {
849   (set) 2>&1 |
850     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
851     *ac_space=\ *)
852       sed -n \
853         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
854           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
855       ;;
856     *)
857       sed -n \
858         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
859       ;;
860     esac;
861 } >&5
862   sed "/^$/d" confdefs.h >conftest.log
863   if test -s conftest.log; then
864     echo >&5
865     echo "## ------------ ##" >&5
866     echo "## confdefs.h.  ##" >&5
867     echo "## ------------ ##" >&5
868     echo >&5
869     cat conftest.log >&5
870   fi
871   (echo; echo) >&5
872   test "$ac_signal" != 0 &&
873     echo "$as_me: caught signal $ac_signal" >&5
874   echo "$as_me: exit $exit_status" >&5
875   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
876     exit $exit_status
877      ' 0
878 for ac_signal in 1 2 13 15; do
879   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
880 done
881 ac_signal=0
882
883 # confdefs.h avoids OS command line length limits that DEFS can exceed.
884 rm -rf conftest* confdefs.h
885 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
886 echo >confdefs.h
887
888 # Let the site file select an alternate cache file if it wants to.
889 # Prefer explicitly selected file to automatically selected ones.
890 if test -z "$CONFIG_SITE"; then
891   if test "x$prefix" != xNONE; then
892     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
893   else
894     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
895   fi
896 fi
897 for ac_site_file in $CONFIG_SITE; do
898   if test -r "$ac_site_file"; then
899     { echo "$as_me:899: loading site script $ac_site_file" >&5
900 echo "$as_me: loading site script $ac_site_file" >&6;}
901     cat "$ac_site_file" >&5
902     . "$ac_site_file"
903   fi
904 done
905
906 if test -r "$cache_file"; then
907   # Some versions of bash will fail to source /dev/null (special
908   # files actually), so we avoid doing that.
909   if test -f "$cache_file"; then
910     { echo "$as_me:910: loading cache $cache_file" >&5
911 echo "$as_me: loading cache $cache_file" >&6;}
912     case $cache_file in
913       [\\/]* | ?:[\\/]* ) . $cache_file;;
914       *)                      . ./$cache_file;;
915     esac
916   fi
917 else
918   { echo "$as_me:918: creating cache $cache_file" >&5
919 echo "$as_me: creating cache $cache_file" >&6;}
920   >$cache_file
921 fi
922
923 # Check that the precious variables saved in the cache have kept the same
924 # value.
925 ac_cache_corrupted=false
926 for ac_var in `(set) 2>&1 |
927                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
928   eval ac_old_set=\$ac_cv_env_${ac_var}_set
929   eval ac_new_set=\$ac_env_${ac_var}_set
930   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
931   eval ac_new_val="\$ac_env_${ac_var}_value"
932   case "$ac_old_set,$ac_new_set" in
933     set,)
934       { echo "$as_me:934: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,set)
938       { echo "$as_me:938: error: \`$ac_var' was not set in the previous run" >&5
939 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
940       ac_cache_corrupted=: ;;
941     ,);;
942     *)
943       if test "x$ac_old_val" != "x$ac_new_val"; then
944         { echo "$as_me:944: error: \`$ac_var' has changed since the previous run:" >&5
945 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
946         { echo "$as_me:946:   former value:  $ac_old_val" >&5
947 echo "$as_me:   former value:  $ac_old_val" >&2;}
948         { echo "$as_me:948:   current value: $ac_new_val" >&5
949 echo "$as_me:   current value: $ac_new_val" >&2;}
950         ac_cache_corrupted=:
951       fi;;
952   esac
953   # Pass precious variables to config.status.  It doesn't matter if
954   # we pass some twice (in addition to the command line arguments).
955   if test "$ac_new_set" = set; then
956     case "$ac_new_val" in
957     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
958       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
959       ac_configure_args="$ac_configure_args '$ac_arg'"
960       ;;
961     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
962        ;;
963     esac
964   fi
965 done
966 if "$ac_cache_corrupted"; then
967   { echo "$as_me:967: error: changes in the environment can compromise the build" >&5
968 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
969   { { echo "$as_me:969: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
970 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
971    { (exit 1); exit 1; }; }
972 fi
973
974 ac_ext=c
975 ac_cpp='$CPP $CPPFLAGS'
976 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
977 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
978 ac_compiler_gnu=$ac_cv_c_compiler_gnu
979 ac_main_return="return"
980
981 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
982   *c*,-n*) ECHO_N=
983            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
984            ECHO_T='     '
985            ;;
986   *c*,*  ) ECHO_N=-n
987            ECHO_C=
988            ECHO_T=
989            ;;
990   *)       ECHO_N=
991            ECHO_C='\c'
992            ECHO_T=
993            ;;
994 esac
995 echo "#! $SHELL" >conftest.sh
996 echo  "exit 0"   >>conftest.sh
997 chmod +x conftest.sh
998 if { (echo "$as_me:998: PATH=\".;.\"; conftest.sh") >&5
999   (PATH=".;."; conftest.sh) 2>&5
1000   ac_status=$?
1001   echo "$as_me:1001: \$? = $ac_status" >&5
1002   (exit "$ac_status"); }; then
1003   ac_path_separator=';'
1004 else
1005   ac_path_separator=:
1006 fi
1007 PATH_SEPARATOR="$ac_path_separator"
1008 rm -f conftest.sh
1009
1010 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
1011
1012 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1013
1014 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1015
1016 ac_aux_dir=
1017 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1018   if test -f "$ac_dir/install-sh"; then
1019     ac_aux_dir=$ac_dir
1020     ac_install_sh="$ac_aux_dir/install-sh -c"
1021     break
1022   elif test -f "$ac_dir/install.sh"; then
1023     ac_aux_dir=$ac_dir
1024     ac_install_sh="$ac_aux_dir/install.sh -c"
1025     break
1026   elif test -f "$ac_dir/shtool"; then
1027     ac_aux_dir=$ac_dir
1028     ac_install_sh="$ac_aux_dir/shtool install -c"
1029     break
1030   fi
1031 done
1032 if test -z "$ac_aux_dir"; then
1033   { { echo "$as_me:1033: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1034 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1035    { (exit 1); exit 1; }; }
1036 fi
1037 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1038 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1039 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1040
1041 # Make sure we can run config.sub.
1042 $ac_config_sub sun4 >/dev/null 2>&1 ||
1043   { { echo "$as_me:1043: error: cannot run $ac_config_sub" >&5
1044 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1045    { (exit 1); exit 1; }; }
1046
1047 echo "$as_me:1047: checking build system type" >&5
1048 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1049 if test "${ac_cv_build+set}" = set; then
1050   echo $ECHO_N "(cached) $ECHO_C" >&6
1051 else
1052   ac_cv_build_alias=$build_alias
1053 test -z "$ac_cv_build_alias" &&
1054   ac_cv_build_alias=`$ac_config_guess`
1055 test -z "$ac_cv_build_alias" &&
1056   { { echo "$as_me:1056: error: cannot guess build type; you must specify one" >&5
1057 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1058    { (exit 1); exit 1; }; }
1059 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1060   { { echo "$as_me:1060: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1061 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1062    { (exit 1); exit 1; }; }
1063
1064 fi
1065 echo "$as_me:1065: result: $ac_cv_build" >&5
1066 echo "${ECHO_T}$ac_cv_build" >&6
1067 build=$ac_cv_build
1068 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1069 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1070 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1071
1072 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1073         echo "$as_me:1073: checking host system type" >&5
1074 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1075 if test "${ac_cv_host+set}" = set; then
1076   echo $ECHO_N "(cached) $ECHO_C" >&6
1077 else
1078   ac_cv_host_alias=$host_alias
1079 test -z "$ac_cv_host_alias" &&
1080   ac_cv_host_alias=$ac_cv_build_alias
1081 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1082   { { echo "$as_me:1082: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1083 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1084    { (exit 1); exit 1; }; }
1085
1086 fi
1087 echo "$as_me:1087: result: $ac_cv_host" >&5
1088 echo "${ECHO_T}$ac_cv_host" >&6
1089 host=$ac_cv_host
1090 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1091 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1092 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1093
1094         system_name="$host_os"
1095 else
1096         system_name="`(uname -s -r) 2>/dev/null`"
1097         if test -z "$system_name" ; then
1098                 system_name="`(hostname) 2>/dev/null`"
1099         fi
1100 fi
1101 test -n "$system_name" &&
1102 cat >>confdefs.h <<EOF
1103 #define SYSTEM_NAME "$system_name"
1104 EOF
1105
1106 if test "${cf_cv_system_name+set}" = set; then
1107   echo $ECHO_N "(cached) $ECHO_C" >&6
1108 else
1109   cf_cv_system_name="$system_name"
1110 fi
1111
1112 test -z "$system_name" && system_name="$cf_cv_system_name"
1113 test -n "$cf_cv_system_name" && echo "$as_me:1113: result: Configuring for $cf_cv_system_name" >&5
1114 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1115
1116 if test ".$system_name" != ".$cf_cv_system_name" ; then
1117         echo "$as_me:1117: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1118 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1119         { { echo "$as_me:1119: error: \"Please remove config.cache and try again.\"" >&5
1120 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1121    { (exit 1); exit 1; }; }
1122 fi
1123
1124 test "$program_prefix" != NONE &&
1125   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1126 # Use a double $ so make ignores it.
1127 test "$program_suffix" != NONE &&
1128   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1129 # Double any \ or $.  echo might interpret backslashes.
1130 # By default was `s,x,x', remove it if useless.
1131 cat <<\_ACEOF >conftest.sed
1132 s/[\\$]/&&/g;s/;s,x,x,$//
1133 _ACEOF
1134 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1135 rm conftest.sed
1136
1137 echo "$as_me:1137: checking whether ${MAKE-make} sets \${MAKE}" >&5
1138 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1139 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1140 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1141   echo $ECHO_N "(cached) $ECHO_C" >&6
1142 else
1143   cat >conftest.make <<\EOF
1144 all:
1145         @echo 'ac_maketemp="${MAKE}"'
1146 EOF
1147 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1148 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1149 if test -n "$ac_maketemp"; then
1150   eval ac_cv_prog_make_${ac_make}_set=yes
1151 else
1152   eval ac_cv_prog_make_${ac_make}_set=no
1153 fi
1154 rm -f conftest.make
1155 fi
1156 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1157   echo "$as_me:1157: result: yes" >&5
1158 echo "${ECHO_T}yes" >&6
1159   SET_MAKE=
1160 else
1161   echo "$as_me:1161: result: no" >&5
1162 echo "${ECHO_T}no" >&6
1163   SET_MAKE="MAKE=${MAKE-make}"
1164 fi
1165
1166 ac_ext=c
1167 ac_cpp='$CPP $CPPFLAGS'
1168 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1169 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1170 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1171 ac_main_return="return"
1172 if test -n "$ac_tool_prefix"; then
1173   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1174 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1175 echo "$as_me:1175: checking for $ac_word" >&5
1176 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1177 if test "${ac_cv_prog_CC+set}" = set; then
1178   echo $ECHO_N "(cached) $ECHO_C" >&6
1179 else
1180   if test -n "$CC"; then
1181   ac_cv_prog_CC="$CC" # Let the user override the test.
1182 else
1183   ac_save_IFS=$IFS; IFS=$ac_path_separator
1184 ac_dummy="$PATH"
1185 for ac_dir in $ac_dummy; do
1186   IFS=$ac_save_IFS
1187   test -z "$ac_dir" && ac_dir=.
1188   $as_executable_p "$ac_dir/$ac_word" || continue
1189 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1190 echo "$as_me:1190: found $ac_dir/$ac_word" >&5
1191 break
1192 done
1193
1194 fi
1195 fi
1196 CC=$ac_cv_prog_CC
1197 if test -n "$CC"; then
1198   echo "$as_me:1198: result: $CC" >&5
1199 echo "${ECHO_T}$CC" >&6
1200 else
1201   echo "$as_me:1201: result: no" >&5
1202 echo "${ECHO_T}no" >&6
1203 fi
1204
1205 fi
1206 if test -z "$ac_cv_prog_CC"; then
1207   ac_ct_CC=$CC
1208   # Extract the first word of "gcc", so it can be a program name with args.
1209 set dummy gcc; ac_word=$2
1210 echo "$as_me:1210: checking for $ac_word" >&5
1211 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1212 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1213   echo $ECHO_N "(cached) $ECHO_C" >&6
1214 else
1215   if test -n "$ac_ct_CC"; then
1216   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1217 else
1218   ac_save_IFS=$IFS; IFS=$ac_path_separator
1219 ac_dummy="$PATH"
1220 for ac_dir in $ac_dummy; do
1221   IFS=$ac_save_IFS
1222   test -z "$ac_dir" && ac_dir=.
1223   $as_executable_p "$ac_dir/$ac_word" || continue
1224 ac_cv_prog_ac_ct_CC="gcc"
1225 echo "$as_me:1225: found $ac_dir/$ac_word" >&5
1226 break
1227 done
1228
1229 fi
1230 fi
1231 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1232 if test -n "$ac_ct_CC"; then
1233   echo "$as_me:1233: result: $ac_ct_CC" >&5
1234 echo "${ECHO_T}$ac_ct_CC" >&6
1235 else
1236   echo "$as_me:1236: result: no" >&5
1237 echo "${ECHO_T}no" >&6
1238 fi
1239
1240   CC=$ac_ct_CC
1241 else
1242   CC="$ac_cv_prog_CC"
1243 fi
1244
1245 if test -z "$CC"; then
1246   if test -n "$ac_tool_prefix"; then
1247   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1248 set dummy ${ac_tool_prefix}cc; ac_word=$2
1249 echo "$as_me:1249: checking for $ac_word" >&5
1250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1251 if test "${ac_cv_prog_CC+set}" = set; then
1252   echo $ECHO_N "(cached) $ECHO_C" >&6
1253 else
1254   if test -n "$CC"; then
1255   ac_cv_prog_CC="$CC" # Let the user override the test.
1256 else
1257   ac_save_IFS=$IFS; IFS=$ac_path_separator
1258 ac_dummy="$PATH"
1259 for ac_dir in $ac_dummy; do
1260   IFS=$ac_save_IFS
1261   test -z "$ac_dir" && ac_dir=.
1262   $as_executable_p "$ac_dir/$ac_word" || continue
1263 ac_cv_prog_CC="${ac_tool_prefix}cc"
1264 echo "$as_me:1264: found $ac_dir/$ac_word" >&5
1265 break
1266 done
1267
1268 fi
1269 fi
1270 CC=$ac_cv_prog_CC
1271 if test -n "$CC"; then
1272   echo "$as_me:1272: result: $CC" >&5
1273 echo "${ECHO_T}$CC" >&6
1274 else
1275   echo "$as_me:1275: result: no" >&5
1276 echo "${ECHO_T}no" >&6
1277 fi
1278
1279 fi
1280 if test -z "$ac_cv_prog_CC"; then
1281   ac_ct_CC=$CC
1282   # Extract the first word of "cc", so it can be a program name with args.
1283 set dummy cc; ac_word=$2
1284 echo "$as_me:1284: checking for $ac_word" >&5
1285 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1286 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1287   echo $ECHO_N "(cached) $ECHO_C" >&6
1288 else
1289   if test -n "$ac_ct_CC"; then
1290   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1291 else
1292   ac_save_IFS=$IFS; IFS=$ac_path_separator
1293 ac_dummy="$PATH"
1294 for ac_dir in $ac_dummy; do
1295   IFS=$ac_save_IFS
1296   test -z "$ac_dir" && ac_dir=.
1297   $as_executable_p "$ac_dir/$ac_word" || continue
1298 ac_cv_prog_ac_ct_CC="cc"
1299 echo "$as_me:1299: found $ac_dir/$ac_word" >&5
1300 break
1301 done
1302
1303 fi
1304 fi
1305 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1306 if test -n "$ac_ct_CC"; then
1307   echo "$as_me:1307: result: $ac_ct_CC" >&5
1308 echo "${ECHO_T}$ac_ct_CC" >&6
1309 else
1310   echo "$as_me:1310: result: no" >&5
1311 echo "${ECHO_T}no" >&6
1312 fi
1313
1314   CC=$ac_ct_CC
1315 else
1316   CC="$ac_cv_prog_CC"
1317 fi
1318
1319 fi
1320 if test -z "$CC"; then
1321   # Extract the first word of "cc", so it can be a program name with args.
1322 set dummy cc; ac_word=$2
1323 echo "$as_me:1323: checking for $ac_word" >&5
1324 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1325 if test "${ac_cv_prog_CC+set}" = set; then
1326   echo $ECHO_N "(cached) $ECHO_C" >&6
1327 else
1328   if test -n "$CC"; then
1329   ac_cv_prog_CC="$CC" # Let the user override the test.
1330 else
1331   ac_prog_rejected=no
1332   ac_save_IFS=$IFS; IFS=$ac_path_separator
1333 ac_dummy="$PATH"
1334 for ac_dir in $ac_dummy; do
1335   IFS=$ac_save_IFS
1336   test -z "$ac_dir" && ac_dir=.
1337   $as_executable_p "$ac_dir/$ac_word" || continue
1338 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1339   ac_prog_rejected=yes
1340   continue
1341 fi
1342 ac_cv_prog_CC="cc"
1343 echo "$as_me:1343: found $ac_dir/$ac_word" >&5
1344 break
1345 done
1346
1347 if test "$ac_prog_rejected" = yes; then
1348   # We found a bogon in the path, so make sure we never use it.
1349   set dummy $ac_cv_prog_CC
1350   shift
1351   if test $# != 0; then
1352     # We chose a different compiler from the bogus one.
1353     # However, it has the same basename, so the bogon will be chosen
1354     # first if we set CC to just the basename; use the full file name.
1355     shift
1356     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1357     shift
1358     ac_cv_prog_CC="$@"
1359   fi
1360 fi
1361 fi
1362 fi
1363 CC=$ac_cv_prog_CC
1364 if test -n "$CC"; then
1365   echo "$as_me:1365: result: $CC" >&5
1366 echo "${ECHO_T}$CC" >&6
1367 else
1368   echo "$as_me:1368: result: no" >&5
1369 echo "${ECHO_T}no" >&6
1370 fi
1371
1372 fi
1373 if test -z "$CC"; then
1374   if test -n "$ac_tool_prefix"; then
1375   for ac_prog in cl
1376   do
1377     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1378 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1379 echo "$as_me:1379: checking for $ac_word" >&5
1380 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1381 if test "${ac_cv_prog_CC+set}" = set; then
1382   echo $ECHO_N "(cached) $ECHO_C" >&6
1383 else
1384   if test -n "$CC"; then
1385   ac_cv_prog_CC="$CC" # Let the user override the test.
1386 else
1387   ac_save_IFS=$IFS; IFS=$ac_path_separator
1388 ac_dummy="$PATH"
1389 for ac_dir in $ac_dummy; do
1390   IFS=$ac_save_IFS
1391   test -z "$ac_dir" && ac_dir=.
1392   $as_executable_p "$ac_dir/$ac_word" || continue
1393 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1394 echo "$as_me:1394: found $ac_dir/$ac_word" >&5
1395 break
1396 done
1397
1398 fi
1399 fi
1400 CC=$ac_cv_prog_CC
1401 if test -n "$CC"; then
1402   echo "$as_me:1402: result: $CC" >&5
1403 echo "${ECHO_T}$CC" >&6
1404 else
1405   echo "$as_me:1405: result: no" >&5
1406 echo "${ECHO_T}no" >&6
1407 fi
1408
1409     test -n "$CC" && break
1410   done
1411 fi
1412 if test -z "$CC"; then
1413   ac_ct_CC=$CC
1414   for ac_prog in cl
1415 do
1416   # Extract the first word of "$ac_prog", so it can be a program name with args.
1417 set dummy $ac_prog; ac_word=$2
1418 echo "$as_me:1418: checking for $ac_word" >&5
1419 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1420 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1421   echo $ECHO_N "(cached) $ECHO_C" >&6
1422 else
1423   if test -n "$ac_ct_CC"; then
1424   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1425 else
1426   ac_save_IFS=$IFS; IFS=$ac_path_separator
1427 ac_dummy="$PATH"
1428 for ac_dir in $ac_dummy; do
1429   IFS=$ac_save_IFS
1430   test -z "$ac_dir" && ac_dir=.
1431   $as_executable_p "$ac_dir/$ac_word" || continue
1432 ac_cv_prog_ac_ct_CC="$ac_prog"
1433 echo "$as_me:1433: found $ac_dir/$ac_word" >&5
1434 break
1435 done
1436
1437 fi
1438 fi
1439 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1440 if test -n "$ac_ct_CC"; then
1441   echo "$as_me:1441: result: $ac_ct_CC" >&5
1442 echo "${ECHO_T}$ac_ct_CC" >&6
1443 else
1444   echo "$as_me:1444: result: no" >&5
1445 echo "${ECHO_T}no" >&6
1446 fi
1447
1448   test -n "$ac_ct_CC" && break
1449 done
1450
1451   CC=$ac_ct_CC
1452 fi
1453
1454 fi
1455
1456 test -z "$CC" && { { echo "$as_me:1456: error: no acceptable cc found in \$PATH" >&5
1457 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1458    { (exit 1); exit 1; }; }
1459
1460 # Provide some information about the compiler.
1461 echo "$as_me:1461:" \
1462      "checking for C compiler version" >&5
1463 ac_compiler=`set X $ac_compile; echo "$2"`
1464 { (eval echo "$as_me:1464: \"$ac_compiler --version </dev/null >&5\"") >&5
1465   (eval $ac_compiler --version </dev/null >&5) 2>&5
1466   ac_status=$?
1467   echo "$as_me:1467: \$? = $ac_status" >&5
1468   (exit "$ac_status"); }
1469 { (eval echo "$as_me:1469: \"$ac_compiler -v </dev/null >&5\"") >&5
1470   (eval $ac_compiler -v </dev/null >&5) 2>&5
1471   ac_status=$?
1472   echo "$as_me:1472: \$? = $ac_status" >&5
1473   (exit "$ac_status"); }
1474 { (eval echo "$as_me:1474: \"$ac_compiler -V </dev/null >&5\"") >&5
1475   (eval $ac_compiler -V </dev/null >&5) 2>&5
1476   ac_status=$?
1477   echo "$as_me:1477: \$? = $ac_status" >&5
1478   (exit "$ac_status"); }
1479
1480 cat >"conftest.$ac_ext" <<_ACEOF
1481 #line 1481 "configure"
1482 #include "confdefs.h"
1483
1484 int
1485 main (void)
1486 {
1487
1488   ;
1489   return 0;
1490 }
1491 _ACEOF
1492 ac_clean_files_save=$ac_clean_files
1493 ac_clean_files="$ac_clean_files a.out a.exe"
1494 # Try to create an executable without -o first, disregard a.out.
1495 # It will help us diagnose broken compilers, and finding out an intuition
1496 # of exeext.
1497 echo "$as_me:1497: checking for C compiler default output" >&5
1498 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1499 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1500 if { (eval echo "$as_me:1500: \"$ac_link_default\"") >&5
1501   (eval $ac_link_default) 2>&5
1502   ac_status=$?
1503   echo "$as_me:1503: \$? = $ac_status" >&5
1504   (exit "$ac_status"); }; then
1505   # Find the output, starting from the most likely.  This scheme is
1506 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1507 # resort.
1508 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1509                 ls a.out conftest 2>/dev/null;
1510                 ls a.* conftest.* 2>/dev/null`; do
1511   case $ac_file in
1512     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1513     a.out ) # We found the default executable, but exeext='' is most
1514             # certainly right.
1515             break;;
1516     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1517           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1518           export ac_cv_exeext
1519           break;;
1520     * ) break;;
1521   esac
1522 done
1523 else
1524   echo "$as_me: failed program was:" >&5
1525 cat "conftest.$ac_ext" >&5
1526 { { echo "$as_me:1526: error: C compiler cannot create executables" >&5
1527 echo "$as_me: error: C compiler cannot create executables" >&2;}
1528    { (exit 77); exit 77; }; }
1529 fi
1530
1531 ac_exeext=$ac_cv_exeext
1532 echo "$as_me:1532: result: $ac_file" >&5
1533 echo "${ECHO_T}$ac_file" >&6
1534
1535 # Check the compiler produces executables we can run.  If not, either
1536 # the compiler is broken, or we cross compile.
1537 echo "$as_me:1537: checking whether the C compiler works" >&5
1538 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1539 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1540 # If not cross compiling, check that we can run a simple program.
1541 if test "$cross_compiling" != yes; then
1542   if { ac_try='./$ac_file'
1543   { (eval echo "$as_me:1543: \"$ac_try\"") >&5
1544   (eval $ac_try) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit "$ac_status"); }; }; then
1548     cross_compiling=no
1549   else
1550     if test "$cross_compiling" = maybe; then
1551         cross_compiling=yes
1552     else
1553         { { echo "$as_me:1553: error: cannot run C compiled programs.
1554 If you meant to cross compile, use \`--host'." >&5
1555 echo "$as_me: error: cannot run C compiled programs.
1556 If you meant to cross compile, use \`--host'." >&2;}
1557    { (exit 1); exit 1; }; }
1558     fi
1559   fi
1560 fi
1561 echo "$as_me:1561: result: yes" >&5
1562 echo "${ECHO_T}yes" >&6
1563
1564 rm -f a.out a.exe "conftest$ac_cv_exeext"
1565 ac_clean_files=$ac_clean_files_save
1566 # Check the compiler produces executables we can run.  If not, either
1567 # the compiler is broken, or we cross compile.
1568 echo "$as_me:1568: checking whether we are cross compiling" >&5
1569 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1570 echo "$as_me:1570: result: $cross_compiling" >&5
1571 echo "${ECHO_T}$cross_compiling" >&6
1572
1573 echo "$as_me:1573: checking for executable suffix" >&5
1574 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1575 if { (eval echo "$as_me:1575: \"$ac_link\"") >&5
1576   (eval $ac_link) 2>&5
1577   ac_status=$?
1578   echo "$as_me:1578: \$? = $ac_status" >&5
1579   (exit "$ac_status"); }; then
1580   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1581 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1582 # work properly (i.e., refer to `conftest.exe'), while it won't with
1583 # `rm'.
1584 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1585   case $ac_file in
1586     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1587     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1588           export ac_cv_exeext
1589           break;;
1590     * ) break;;
1591   esac
1592 done
1593 else
1594   { { echo "$as_me:1594: error: cannot compute EXEEXT: cannot compile and link" >&5
1595 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1596    { (exit 1); exit 1; }; }
1597 fi
1598
1599 rm -f "conftest$ac_cv_exeext"
1600 echo "$as_me:1600: result: $ac_cv_exeext" >&5
1601 echo "${ECHO_T}$ac_cv_exeext" >&6
1602
1603 rm -f "conftest.$ac_ext"
1604 EXEEXT=$ac_cv_exeext
1605 ac_exeext=$EXEEXT
1606 echo "$as_me:1606: checking for object suffix" >&5
1607 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1608 if test "${ac_cv_objext+set}" = set; then
1609   echo $ECHO_N "(cached) $ECHO_C" >&6
1610 else
1611   cat >"conftest.$ac_ext" <<_ACEOF
1612 #line 1612 "configure"
1613 #include "confdefs.h"
1614
1615 int
1616 main (void)
1617 {
1618
1619   ;
1620   return 0;
1621 }
1622 _ACEOF
1623 rm -f conftest.o conftest.obj
1624 if { (eval echo "$as_me:1624: \"$ac_compile\"") >&5
1625   (eval $ac_compile) 2>&5
1626   ac_status=$?
1627   echo "$as_me:1627: \$? = $ac_status" >&5
1628   (exit "$ac_status"); }; then
1629   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1630   case $ac_file in
1631     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1632     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1633        break;;
1634   esac
1635 done
1636 else
1637   echo "$as_me: failed program was:" >&5
1638 cat "conftest.$ac_ext" >&5
1639 { { echo "$as_me:1639: error: cannot compute OBJEXT: cannot compile" >&5
1640 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1641    { (exit 1); exit 1; }; }
1642 fi
1643
1644 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1645 fi
1646 echo "$as_me:1646: result: $ac_cv_objext" >&5
1647 echo "${ECHO_T}$ac_cv_objext" >&6
1648 OBJEXT=$ac_cv_objext
1649 ac_objext=$OBJEXT
1650 echo "$as_me:1650: checking whether we are using the GNU C compiler" >&5
1651 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1652 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1653   echo $ECHO_N "(cached) $ECHO_C" >&6
1654 else
1655   cat >"conftest.$ac_ext" <<_ACEOF
1656 #line 1656 "configure"
1657 #include "confdefs.h"
1658
1659 int
1660 main (void)
1661 {
1662 #ifndef __GNUC__
1663        choke me
1664 #endif
1665
1666   ;
1667   return 0;
1668 }
1669 _ACEOF
1670 rm -f "conftest.$ac_objext"
1671 if { (eval echo "$as_me:1671: \"$ac_compile\"") >&5
1672   (eval $ac_compile) 2>&5
1673   ac_status=$?
1674   echo "$as_me:1674: \$? = $ac_status" >&5
1675   (exit "$ac_status"); } &&
1676          { ac_try='test -s "conftest.$ac_objext"'
1677   { (eval echo "$as_me:1677: \"$ac_try\"") >&5
1678   (eval $ac_try) 2>&5
1679   ac_status=$?
1680   echo "$as_me:1680: \$? = $ac_status" >&5
1681   (exit "$ac_status"); }; }; then
1682   ac_compiler_gnu=yes
1683 else
1684   echo "$as_me: failed program was:" >&5
1685 cat "conftest.$ac_ext" >&5
1686 ac_compiler_gnu=no
1687 fi
1688 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1689 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1690
1691 fi
1692 echo "$as_me:1692: result: $ac_cv_c_compiler_gnu" >&5
1693 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1694 GCC=`test $ac_compiler_gnu = yes && echo yes`
1695 ac_test_CFLAGS=${CFLAGS+set}
1696 ac_save_CFLAGS=$CFLAGS
1697 CFLAGS="-g"
1698 echo "$as_me:1698: checking whether $CC accepts -g" >&5
1699 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1700 if test "${ac_cv_prog_cc_g+set}" = set; then
1701   echo $ECHO_N "(cached) $ECHO_C" >&6
1702 else
1703   cat >"conftest.$ac_ext" <<_ACEOF
1704 #line 1704 "configure"
1705 #include "confdefs.h"
1706
1707 int
1708 main (void)
1709 {
1710
1711   ;
1712   return 0;
1713 }
1714 _ACEOF
1715 rm -f "conftest.$ac_objext"
1716 if { (eval echo "$as_me:1716: \"$ac_compile\"") >&5
1717   (eval $ac_compile) 2>&5
1718   ac_status=$?
1719   echo "$as_me:1719: \$? = $ac_status" >&5
1720   (exit "$ac_status"); } &&
1721          { ac_try='test -s "conftest.$ac_objext"'
1722   { (eval echo "$as_me:1722: \"$ac_try\"") >&5
1723   (eval $ac_try) 2>&5
1724   ac_status=$?
1725   echo "$as_me:1725: \$? = $ac_status" >&5
1726   (exit "$ac_status"); }; }; then
1727   ac_cv_prog_cc_g=yes
1728 else
1729   echo "$as_me: failed program was:" >&5
1730 cat "conftest.$ac_ext" >&5
1731 ac_cv_prog_cc_g=no
1732 fi
1733 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1734 fi
1735 echo "$as_me:1735: result: $ac_cv_prog_cc_g" >&5
1736 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1737 if test "$ac_test_CFLAGS" = set; then
1738   CFLAGS=$ac_save_CFLAGS
1739 elif test $ac_cv_prog_cc_g = yes; then
1740   if test "$GCC" = yes; then
1741     CFLAGS="-g -O2"
1742   else
1743     CFLAGS="-g"
1744   fi
1745 else
1746   if test "$GCC" = yes; then
1747     CFLAGS="-O2"
1748   else
1749     CFLAGS=
1750   fi
1751 fi
1752 # Some people use a C++ compiler to compile C.  Since we use `exit',
1753 # in C++ we need to declare it.  In case someone uses the same compiler
1754 # for both compiling C and C++ we need to have the C++ compiler decide
1755 # the declaration of exit, since it's the most demanding environment.
1756 cat >"conftest.$ac_ext" <<_ACEOF
1757 #ifndef __cplusplus
1758   choke me
1759 #endif
1760 _ACEOF
1761 rm -f "conftest.$ac_objext"
1762 if { (eval echo "$as_me:1762: \"$ac_compile\"") >&5
1763   (eval $ac_compile) 2>&5
1764   ac_status=$?
1765   echo "$as_me:1765: \$? = $ac_status" >&5
1766   (exit "$ac_status"); } &&
1767          { ac_try='test -s "conftest.$ac_objext"'
1768   { (eval echo "$as_me:1768: \"$ac_try\"") >&5
1769   (eval $ac_try) 2>&5
1770   ac_status=$?
1771   echo "$as_me:1771: \$? = $ac_status" >&5
1772   (exit "$ac_status"); }; }; then
1773   for ac_declaration in \
1774    ''\
1775    '#include <stdlib.h>' \
1776    'extern "C" void std::exit (int) throw (); using std::exit;' \
1777    'extern "C" void std::exit (int); using std::exit;' \
1778    'extern "C" void exit (int) throw ();' \
1779    'extern "C" void exit (int);' \
1780    'void exit (int);'
1781 do
1782   cat >"conftest.$ac_ext" <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 #include <stdlib.h>
1786 $ac_declaration
1787 int
1788 main (void)
1789 {
1790 exit (42);
1791   ;
1792   return 0;
1793 }
1794 _ACEOF
1795 rm -f "conftest.$ac_objext"
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit "$ac_status"); } &&
1801          { ac_try='test -s "conftest.$ac_objext"'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit "$ac_status"); }; }; then
1807   :
1808 else
1809   echo "$as_me: failed program was:" >&5
1810 cat "conftest.$ac_ext" >&5
1811 continue
1812 fi
1813 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1814   cat >"conftest.$ac_ext" <<_ACEOF
1815 #line 1815 "configure"
1816 #include "confdefs.h"
1817 $ac_declaration
1818 int
1819 main (void)
1820 {
1821 exit (42);
1822   ;
1823   return 0;
1824 }
1825 _ACEOF
1826 rm -f "conftest.$ac_objext"
1827 if { (eval echo "$as_me:1827: \"$ac_compile\"") >&5
1828   (eval $ac_compile) 2>&5
1829   ac_status=$?
1830   echo "$as_me:1830: \$? = $ac_status" >&5
1831   (exit "$ac_status"); } &&
1832          { ac_try='test -s "conftest.$ac_objext"'
1833   { (eval echo "$as_me:1833: \"$ac_try\"") >&5
1834   (eval $ac_try) 2>&5
1835   ac_status=$?
1836   echo "$as_me:1836: \$? = $ac_status" >&5
1837   (exit "$ac_status"); }; }; then
1838   break
1839 else
1840   echo "$as_me: failed program was:" >&5
1841 cat "conftest.$ac_ext" >&5
1842 fi
1843 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1844 done
1845 rm -rf conftest*
1846 if test -n "$ac_declaration"; then
1847   echo '#ifdef __cplusplus' >>confdefs.h
1848   echo "$ac_declaration"    >>confdefs.h
1849   echo '#endif'             >>confdefs.h
1850 fi
1851
1852 else
1853   echo "$as_me: failed program was:" >&5
1854 cat "conftest.$ac_ext" >&5
1855 fi
1856 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1857 ac_ext=c
1858 ac_cpp='$CPP $CPPFLAGS'
1859 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1860 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1861 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1862 ac_main_return="return"
1863
1864 GCC_VERSION=none
1865 if test "$GCC" = yes ; then
1866         echo "$as_me:1866: checking version of $CC" >&5
1867 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1868         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1869         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1870         echo "$as_me:1870: result: $GCC_VERSION" >&5
1871 echo "${ECHO_T}$GCC_VERSION" >&6
1872 fi
1873
1874 INTEL_COMPILER=no
1875
1876 if test "$GCC" = yes ; then
1877         case "$host_os" in
1878         (linux*|gnu*)
1879                 echo "$as_me:1879: checking if this is really Intel C compiler" >&5
1880 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1881                 cf_save_CFLAGS="$CFLAGS"
1882                 CFLAGS="$CFLAGS -no-gcc"
1883                 cat >"conftest.$ac_ext" <<_ACEOF
1884 #line 1884 "configure"
1885 #include "confdefs.h"
1886
1887 int
1888 main (void)
1889 {
1890
1891 #ifdef __INTEL_COMPILER
1892 #else
1893 make an error
1894 #endif
1895
1896   ;
1897   return 0;
1898 }
1899 _ACEOF
1900 rm -f "conftest.$ac_objext"
1901 if { (eval echo "$as_me:1901: \"$ac_compile\"") >&5
1902   (eval $ac_compile) 2>&5
1903   ac_status=$?
1904   echo "$as_me:1904: \$? = $ac_status" >&5
1905   (exit "$ac_status"); } &&
1906          { ac_try='test -s "conftest.$ac_objext"'
1907   { (eval echo "$as_me:1907: \"$ac_try\"") >&5
1908   (eval $ac_try) 2>&5
1909   ac_status=$?
1910   echo "$as_me:1910: \$? = $ac_status" >&5
1911   (exit "$ac_status"); }; }; then
1912   INTEL_COMPILER=yes
1913 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1914
1915 else
1916   echo "$as_me: failed program was:" >&5
1917 cat "conftest.$ac_ext" >&5
1918 fi
1919 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1920                 CFLAGS="$cf_save_CFLAGS"
1921                 echo "$as_me:1921: result: $INTEL_COMPILER" >&5
1922 echo "${ECHO_T}$INTEL_COMPILER" >&6
1923                 ;;
1924         esac
1925 fi
1926
1927 CLANG_COMPILER=no
1928
1929 if test "$GCC" = yes ; then
1930         echo "$as_me:1930: checking if this is really Clang C compiler" >&5
1931 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1932         cf_save_CFLAGS="$CFLAGS"
1933         cat >"conftest.$ac_ext" <<_ACEOF
1934 #line 1934 "configure"
1935 #include "confdefs.h"
1936
1937 int
1938 main (void)
1939 {
1940
1941 #ifdef __clang__
1942 #else
1943 make an error
1944 #endif
1945
1946   ;
1947   return 0;
1948 }
1949 _ACEOF
1950 rm -f "conftest.$ac_objext"
1951 if { (eval echo "$as_me:1951: \"$ac_compile\"") >&5
1952   (eval $ac_compile) 2>&5
1953   ac_status=$?
1954   echo "$as_me:1954: \$? = $ac_status" >&5
1955   (exit "$ac_status"); } &&
1956          { ac_try='test -s "conftest.$ac_objext"'
1957   { (eval echo "$as_me:1957: \"$ac_try\"") >&5
1958   (eval $ac_try) 2>&5
1959   ac_status=$?
1960   echo "$as_me:1960: \$? = $ac_status" >&5
1961   (exit "$ac_status"); }; }; then
1962   CLANG_COMPILER=yes
1963
1964 else
1965   echo "$as_me: failed program was:" >&5
1966 cat "conftest.$ac_ext" >&5
1967 fi
1968 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1969         CFLAGS="$cf_save_CFLAGS"
1970         echo "$as_me:1970: result: $CLANG_COMPILER" >&5
1971 echo "${ECHO_T}$CLANG_COMPILER" >&6
1972 fi
1973
1974 CLANG_VERSION=none
1975
1976 if test "x$CLANG_COMPILER" = "xyes" ; then
1977         case "$CC" in
1978         (c[1-9][0-9]|*/c[1-9][0-9])
1979                 { echo "$as_me:1979: WARNING: replacing broken compiler alias $CC" >&5
1980 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1981                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1982                 CC=clang
1983                 ;;
1984         esac
1985
1986         echo "$as_me:1986: checking version of $CC" >&5
1987 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1988         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1989         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1990         echo "$as_me:1990: result: $CLANG_VERSION" >&5
1991 echo "${ECHO_T}$CLANG_VERSION" >&6
1992
1993         for cf_clang_opt in \
1994                 -Qunused-arguments \
1995                 -Wno-error=implicit-function-declaration
1996         do
1997                 echo "$as_me:1997: checking if option $cf_clang_opt works" >&5
1998 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1999                 cf_save_CFLAGS="$CFLAGS"
2000                 CFLAGS="$CFLAGS $cf_clang_opt"
2001                 cat >"conftest.$ac_ext" <<_ACEOF
2002 #line 2002 "configure"
2003 #include "confdefs.h"
2004
2005                         #include <stdio.h>
2006 int
2007 main (void)
2008 {
2009
2010                         printf("hello!\\n");
2011   ;
2012   return 0;
2013 }
2014 _ACEOF
2015 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2016 if { (eval echo "$as_me:2016: \"$ac_link\"") >&5
2017   (eval $ac_link) 2>&5
2018   ac_status=$?
2019   echo "$as_me:2019: \$? = $ac_status" >&5
2020   (exit "$ac_status"); } &&
2021          { ac_try='test -s "conftest$ac_exeext"'
2022   { (eval echo "$as_me:2022: \"$ac_try\"") >&5
2023   (eval $ac_try) 2>&5
2024   ac_status=$?
2025   echo "$as_me:2025: \$? = $ac_status" >&5
2026   (exit "$ac_status"); }; }; then
2027
2028                         cf_clang_optok=yes
2029 else
2030   echo "$as_me: failed program was:" >&5
2031 cat "conftest.$ac_ext" >&5
2032
2033                         cf_clang_optok=no
2034 fi
2035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2036                 echo "$as_me:2036: result: $cf_clang_optok" >&5
2037 echo "${ECHO_T}$cf_clang_optok" >&6
2038                 CFLAGS="$cf_save_CFLAGS"
2039                 if test "$cf_clang_optok" = yes; then
2040                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2041
2042 echo "${as_me:-configure}:2042: testing adding option $cf_clang_opt ..." 1>&5
2043
2044         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2045         CFLAGS="${CFLAGS}$cf_clang_opt"
2046
2047                 fi
2048         done
2049 fi
2050
2051 echo "$as_me:2051: checking for $CC option to accept ANSI C" >&5
2052 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2053 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2054   echo $ECHO_N "(cached) $ECHO_C" >&6
2055 else
2056   ac_cv_prog_cc_stdc=no
2057 ac_save_CC=$CC
2058 cat >"conftest.$ac_ext" <<_ACEOF
2059 #line 2059 "configure"
2060 #include "confdefs.h"
2061 #include <stdarg.h>
2062 #include <stdio.h>
2063 #include <sys/types.h>
2064 #include <sys/stat.h>
2065 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2066 struct buf { int x; };
2067 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2068 static char *e (p, i)
2069      char **p;
2070      int i;
2071 {
2072   return p[i];
2073 }
2074 static char *f (char * (*g) (char **, int), char **p, ...)
2075 {
2076   char *s;
2077   va_list v;
2078   va_start (v,p);
2079   s = g (p, va_arg (v,int));
2080   va_end (v);
2081   return s;
2082 }
2083 int test (int i, double x);
2084 struct s1 {int (*f) (int a);};
2085 struct s2 {int (*f) (double a);};
2086 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2087 int argc;
2088 char **argv;
2089 int
2090 main (void)
2091 {
2092 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2093   ;
2094   return 0;
2095 }
2096 _ACEOF
2097 # Don't try gcc -ansi; that turns off useful extensions and
2098 # breaks some systems' header files.
2099 # AIX                   -qlanglvl=ansi
2100 # Ultrix and OSF/1      -std1
2101 # HP-UX 10.20 and later -Ae
2102 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2103 # SVR4                  -Xc -D__EXTENSIONS__
2104 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2105 do
2106   CC="$ac_save_CC $ac_arg"
2107   rm -f "conftest.$ac_objext"
2108 if { (eval echo "$as_me:2108: \"$ac_compile\"") >&5
2109   (eval $ac_compile) 2>&5
2110   ac_status=$?
2111   echo "$as_me:2111: \$? = $ac_status" >&5
2112   (exit "$ac_status"); } &&
2113          { ac_try='test -s "conftest.$ac_objext"'
2114   { (eval echo "$as_me:2114: \"$ac_try\"") >&5
2115   (eval $ac_try) 2>&5
2116   ac_status=$?
2117   echo "$as_me:2117: \$? = $ac_status" >&5
2118   (exit "$ac_status"); }; }; then
2119   ac_cv_prog_cc_stdc=$ac_arg
2120 break
2121 else
2122   echo "$as_me: failed program was:" >&5
2123 cat "conftest.$ac_ext" >&5
2124 fi
2125 rm -f "conftest.$ac_objext"
2126 done
2127 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2128 CC=$ac_save_CC
2129
2130 fi
2131
2132 case "x$ac_cv_prog_cc_stdc" in
2133   x|xno)
2134     echo "$as_me:2134: result: none needed" >&5
2135 echo "${ECHO_T}none needed" >&6 ;;
2136   *)
2137     echo "$as_me:2137: result: $ac_cv_prog_cc_stdc" >&5
2138 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2139     CC="$CC $ac_cv_prog_cc_stdc" ;;
2140 esac
2141
2142 # This should have been defined by AC_PROG_CC
2143 : "${CC:=cc}"
2144
2145 echo "$as_me:2145: checking \$CFLAGS variable" >&5
2146 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2147 case "x$CFLAGS" in
2148 (*-[IUD]*)
2149         echo "$as_me:2149: result: broken" >&5
2150 echo "${ECHO_T}broken" >&6
2151         { echo "$as_me:2151: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2152 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2153         cf_flags="$CFLAGS"
2154         CFLAGS=
2155         for cf_arg in $cf_flags
2156         do
2157
2158 cf_fix_cppflags=no
2159 cf_new_cflags=
2160 cf_new_cppflags=
2161 cf_new_extra_cppflags=
2162
2163 for cf_add_cflags in $cf_arg
2164 do
2165 case "$cf_fix_cppflags" in
2166 (no)
2167         case "$cf_add_cflags" in
2168         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2169                 case "$cf_add_cflags" in
2170                 (-D*)
2171                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2172
2173                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2174                                 && test -z "${cf_tst_cflags}" \
2175                                 && cf_fix_cppflags=yes
2176
2177                         if test "$cf_fix_cppflags" = yes ; then
2178
2179         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2180         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2181
2182                                 continue
2183                         elif test "${cf_tst_cflags}" = "\"'" ; then
2184
2185         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2186         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2187
2188                                 continue
2189                         fi
2190                         ;;
2191                 esac
2192                 case "$CPPFLAGS" in
2193                 (*$cf_add_cflags)
2194                         ;;
2195                 (*)
2196                         case "$cf_add_cflags" in
2197                         (-D*)
2198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2199
2200 CPPFLAGS=`echo "$CPPFLAGS" | \
2201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2203
2204                                 ;;
2205                         esac
2206
2207         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2208         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2209
2210                         ;;
2211                 esac
2212                 ;;
2213         (*)
2214
2215         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2216         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2217
2218                 ;;
2219         esac
2220         ;;
2221 (yes)
2222
2223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2225
2226         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2227
2228         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2229                 && test -z "${cf_tst_cflags}" \
2230                 && cf_fix_cppflags=no
2231         ;;
2232 esac
2233 done
2234
2235 if test -n "$cf_new_cflags" ; then
2236
2237         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2238         CFLAGS="${CFLAGS}$cf_new_cflags"
2239
2240 fi
2241
2242 if test -n "$cf_new_cppflags" ; then
2243
2244         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2245         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2246
2247 fi
2248
2249 if test -n "$cf_new_extra_cppflags" ; then
2250
2251         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2252         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2253
2254 fi
2255
2256         done
2257         ;;
2258 (*)
2259         echo "$as_me:2259: result: ok" >&5
2260 echo "${ECHO_T}ok" >&6
2261         ;;
2262 esac
2263
2264 echo "$as_me:2264: checking \$CC variable" >&5
2265 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2266 case "$CC" in
2267 (*[\ \  ]-*)
2268         echo "$as_me:2268: result: broken" >&5
2269 echo "${ECHO_T}broken" >&6
2270         { echo "$as_me:2270: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2271 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2272         # humor him...
2273         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2274         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2275         CC="$cf_prog"
2276         for cf_arg in $cf_flags
2277         do
2278                 case "x$cf_arg" in
2279                 (x-[IUDfgOW]*)
2280
2281 cf_fix_cppflags=no
2282 cf_new_cflags=
2283 cf_new_cppflags=
2284 cf_new_extra_cppflags=
2285
2286 for cf_add_cflags in $cf_arg
2287 do
2288 case "$cf_fix_cppflags" in
2289 (no)
2290         case "$cf_add_cflags" in
2291         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2292                 case "$cf_add_cflags" in
2293                 (-D*)
2294                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2295
2296                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2297                                 && test -z "${cf_tst_cflags}" \
2298                                 && cf_fix_cppflags=yes
2299
2300                         if test "$cf_fix_cppflags" = yes ; then
2301
2302         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2303         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2304
2305                                 continue
2306                         elif test "${cf_tst_cflags}" = "\"'" ; then
2307
2308         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2309         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2310
2311                                 continue
2312                         fi
2313                         ;;
2314                 esac
2315                 case "$CPPFLAGS" in
2316                 (*$cf_add_cflags)
2317                         ;;
2318                 (*)
2319                         case "$cf_add_cflags" in
2320                         (-D*)
2321                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2322
2323 CPPFLAGS=`echo "$CPPFLAGS" | \
2324         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2325                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2326
2327                                 ;;
2328                         esac
2329
2330         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2331         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2332
2333                         ;;
2334                 esac
2335                 ;;
2336         (*)
2337
2338         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2339         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2340
2341                 ;;
2342         esac
2343         ;;
2344 (yes)
2345
2346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2348
2349         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2350
2351         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2352                 && test -z "${cf_tst_cflags}" \
2353                 && cf_fix_cppflags=no
2354         ;;
2355 esac
2356 done
2357
2358 if test -n "$cf_new_cflags" ; then
2359
2360         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2361         CFLAGS="${CFLAGS}$cf_new_cflags"
2362
2363 fi
2364
2365 if test -n "$cf_new_cppflags" ; then
2366
2367         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2368         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2369
2370 fi
2371
2372 if test -n "$cf_new_extra_cppflags" ; then
2373
2374         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2375         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2376
2377 fi
2378
2379                         ;;
2380                 (*)
2381                         CC="$CC $cf_arg"
2382                         ;;
2383                 esac
2384         done
2385         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2386
2387 echo "${as_me:-configure}:2387: testing resulting CC: '$CC' ..." 1>&5
2388
2389         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2390
2391 echo "${as_me:-configure}:2391: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2392
2393         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2394
2395 echo "${as_me:-configure}:2395: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2396
2397         ;;
2398 (*)
2399         echo "$as_me:2399: result: ok" >&5
2400 echo "${ECHO_T}ok" >&6
2401         ;;
2402 esac
2403
2404 echo "$as_me:2404: checking for inline" >&5
2405 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2406 if test "${ac_cv_c_inline+set}" = set; then
2407   echo $ECHO_N "(cached) $ECHO_C" >&6
2408 else
2409   ac_cv_c_inline=no
2410 for ac_kw in inline __inline__ __inline; do
2411   cat >"conftest.$ac_ext" <<_ACEOF
2412 #line 2412 "configure"
2413 #include "confdefs.h"
2414 #ifndef __cplusplus
2415 static $ac_kw int static_foo () {return 0; }
2416 $ac_kw int foo () {return 0; }
2417 #endif
2418
2419 _ACEOF
2420 rm -f "conftest.$ac_objext"
2421 if { (eval echo "$as_me:2421: \"$ac_compile\"") >&5
2422   (eval $ac_compile) 2>&5
2423   ac_status=$?
2424   echo "$as_me:2424: \$? = $ac_status" >&5
2425   (exit "$ac_status"); } &&
2426          { ac_try='test -s "conftest.$ac_objext"'
2427   { (eval echo "$as_me:2427: \"$ac_try\"") >&5
2428   (eval $ac_try) 2>&5
2429   ac_status=$?
2430   echo "$as_me:2430: \$? = $ac_status" >&5
2431   (exit "$ac_status"); }; }; then
2432   ac_cv_c_inline=$ac_kw; break
2433 else
2434   echo "$as_me: failed program was:" >&5
2435 cat "conftest.$ac_ext" >&5
2436 fi
2437 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2438 done
2439
2440 fi
2441 echo "$as_me:2441: result: $ac_cv_c_inline" >&5
2442 echo "${ECHO_T}$ac_cv_c_inline" >&6
2443 case $ac_cv_c_inline in
2444   inline | yes) ;;
2445   no)
2446 cat >>confdefs.h <<\EOF
2447 #define inline
2448 EOF
2449  ;;
2450   *)  cat >>confdefs.h <<EOF
2451 #define inline $ac_cv_c_inline
2452 EOF
2453  ;;
2454 esac
2455
2456 for ac_prog in ggrep grep
2457 do
2458   # Extract the first word of "$ac_prog", so it can be a program name with args.
2459 set dummy $ac_prog; ac_word=$2
2460 echo "$as_me:2460: checking for $ac_word" >&5
2461 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2462 if test "${ac_cv_prog_GREP+set}" = set; then
2463   echo $ECHO_N "(cached) $ECHO_C" >&6
2464 else
2465   if test -n "$GREP"; then
2466   ac_cv_prog_GREP="$GREP" # Let the user override the test.
2467 else
2468   ac_save_IFS=$IFS; IFS=$ac_path_separator
2469 ac_dummy="$PATH"
2470 for ac_dir in $ac_dummy; do
2471   IFS=$ac_save_IFS
2472   test -z "$ac_dir" && ac_dir=.
2473   $as_executable_p "$ac_dir/$ac_word" || continue
2474 ac_cv_prog_GREP="$ac_prog"
2475 echo "$as_me:2475: found $ac_dir/$ac_word" >&5
2476 break
2477 done
2478
2479 fi
2480 fi
2481 GREP=$ac_cv_prog_GREP
2482 if test -n "$GREP"; then
2483   echo "$as_me:2483: result: $GREP" >&5
2484 echo "${ECHO_T}$GREP" >&6
2485 else
2486   echo "$as_me:2486: result: no" >&5
2487 echo "${ECHO_T}no" >&6
2488 fi
2489
2490   test -n "$GREP" && break
2491 done
2492 test -n "$GREP" || GREP=": "
2493
2494 echo "$as_me:2494: checking for egrep" >&5
2495 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2496 if test "${ac_cv_path_EGREP+set}" = set; then
2497   echo $ECHO_N "(cached) $ECHO_C" >&6
2498 else
2499   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2500    then ac_cv_path_EGREP="$GREP -E"
2501    else
2502      for ac_prog in gegrep egrep
2503 do
2504   # Extract the first word of "$ac_prog", so it can be a program name with args.
2505 set dummy $ac_prog; ac_word=$2
2506 echo "$as_me:2506: checking for $ac_word" >&5
2507 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2508 if test "${ac_cv_path_EGREP+set}" = set; then
2509   echo $ECHO_N "(cached) $ECHO_C" >&6
2510 else
2511   case $EGREP in
2512   [\\/]* | ?:[\\/]*)
2513   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2514   ;;
2515   *)
2516   ac_save_IFS=$IFS; IFS=$ac_path_separator
2517 ac_dummy="$PATH"
2518 for ac_dir in $ac_dummy; do
2519   IFS=$ac_save_IFS
2520   test -z "$ac_dir" && ac_dir=.
2521   if $as_executable_p "$ac_dir/$ac_word"; then
2522    ac_cv_path_EGREP="$ac_dir/$ac_word"
2523    echo "$as_me:2523: found $ac_dir/$ac_word" >&5
2524    break
2525 fi
2526 done
2527
2528   ;;
2529 esac
2530 fi
2531 EGREP=$ac_cv_path_EGREP
2532
2533 if test -n "$EGREP"; then
2534   echo "$as_me:2534: result: $EGREP" >&5
2535 echo "${ECHO_T}$EGREP" >&6
2536 else
2537   echo "$as_me:2537: result: no" >&5
2538 echo "${ECHO_T}no" >&6
2539 fi
2540
2541   test -n "$EGREP" && break
2542 done
2543 test -n "$EGREP" || EGREP=": "
2544
2545      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2545: error: cannot find workable egrep" >&5
2546 echo "$as_me: error: cannot find workable egrep" >&2;}
2547    { (exit 1); exit 1; }; }
2548    fi
2549 fi
2550 echo "$as_me:2550: result: $ac_cv_path_EGREP" >&5
2551 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2552  EGREP="$ac_cv_path_EGREP"
2553
2554 ac_ext=c
2555 ac_cpp='$CPP $CPPFLAGS'
2556 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2557 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2558 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2559 ac_main_return="return"
2560 echo "$as_me:2560: checking how to run the C preprocessor" >&5
2561 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2562 # On Suns, sometimes $CPP names a directory.
2563 if test -n "$CPP" && test -d "$CPP"; then
2564   CPP=
2565 fi
2566 if test -z "$CPP"; then
2567   if test "${ac_cv_prog_CPP+set}" = set; then
2568   echo $ECHO_N "(cached) $ECHO_C" >&6
2569 else
2570       # Double quotes because CPP needs to be expanded
2571     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2572     do
2573       ac_preproc_ok=false
2574 for ac_c_preproc_warn_flag in '' yes
2575 do
2576   # Use a header file that comes with gcc, so configuring glibc
2577   # with a fresh cross-compiler works.
2578   # On the NeXT, cc -E runs the code through the compiler's parser,
2579   # not just through cpp. "Syntax error" is here to catch this case.
2580   cat >"conftest.$ac_ext" <<_ACEOF
2581 #line 2581 "configure"
2582 #include "confdefs.h"
2583 #include <assert.h>
2584                      Syntax error
2585 _ACEOF
2586 if { (eval echo "$as_me:2586: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2587   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2588   ac_status=$?
2589   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2590   rm -f conftest.er1
2591   cat conftest.err >&5
2592   echo "$as_me:2592: \$? = $ac_status" >&5
2593   (exit "$ac_status"); } >/dev/null; then
2594   if test -s conftest.err; then
2595     ac_cpp_err=$ac_c_preproc_warn_flag
2596   else
2597     ac_cpp_err=
2598   fi
2599 else
2600   ac_cpp_err=yes
2601 fi
2602 if test -z "$ac_cpp_err"; then
2603   :
2604 else
2605   echo "$as_me: failed program was:" >&5
2606   cat "conftest.$ac_ext" >&5
2607   # Broken: fails on valid input.
2608 continue
2609 fi
2610 rm -f conftest.err "conftest.$ac_ext"
2611
2612   # OK, works on sane cases.  Now check whether non-existent headers
2613   # can be detected and how.
2614   cat >"conftest.$ac_ext" <<_ACEOF
2615 #line 2615 "configure"
2616 #include "confdefs.h"
2617 #include <ac_nonexistent.h>
2618 _ACEOF
2619 if { (eval echo "$as_me:2619: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2620   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2621   ac_status=$?
2622   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2623   rm -f conftest.er1
2624   cat conftest.err >&5
2625   echo "$as_me:2625: \$? = $ac_status" >&5
2626   (exit "$ac_status"); } >/dev/null; then
2627   if test -s conftest.err; then
2628     ac_cpp_err=$ac_c_preproc_warn_flag
2629   else
2630     ac_cpp_err=
2631   fi
2632 else
2633   ac_cpp_err=yes
2634 fi
2635 if test -z "$ac_cpp_err"; then
2636   # Broken: success on invalid input.
2637 continue
2638 else
2639   echo "$as_me: failed program was:" >&5
2640   cat "conftest.$ac_ext" >&5
2641   # Passes both tests.
2642 ac_preproc_ok=:
2643 break
2644 fi
2645 rm -f conftest.err "conftest.$ac_ext"
2646
2647 done
2648 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2649 rm -f conftest.err "conftest.$ac_ext"
2650 if $ac_preproc_ok; then
2651   break
2652 fi
2653
2654     done
2655     ac_cv_prog_CPP=$CPP
2656
2657 fi
2658   CPP=$ac_cv_prog_CPP
2659 else
2660   ac_cv_prog_CPP=$CPP
2661 fi
2662 echo "$as_me:2662: result: $CPP" >&5
2663 echo "${ECHO_T}$CPP" >&6
2664 ac_preproc_ok=false
2665 for ac_c_preproc_warn_flag in '' yes
2666 do
2667   # Use a header file that comes with gcc, so configuring glibc
2668   # with a fresh cross-compiler works.
2669   # On the NeXT, cc -E runs the code through the compiler's parser,
2670   # not just through cpp. "Syntax error" is here to catch this case.
2671   cat >"conftest.$ac_ext" <<_ACEOF
2672 #line 2672 "configure"
2673 #include "confdefs.h"
2674 #include <assert.h>
2675                      Syntax error
2676 _ACEOF
2677 if { (eval echo "$as_me:2677: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2678   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2679   ac_status=$?
2680   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2681   rm -f conftest.er1
2682   cat conftest.err >&5
2683   echo "$as_me:2683: \$? = $ac_status" >&5
2684   (exit "$ac_status"); } >/dev/null; then
2685   if test -s conftest.err; then
2686     ac_cpp_err=$ac_c_preproc_warn_flag
2687   else
2688     ac_cpp_err=
2689   fi
2690 else
2691   ac_cpp_err=yes
2692 fi
2693 if test -z "$ac_cpp_err"; then
2694   :
2695 else
2696   echo "$as_me: failed program was:" >&5
2697   cat "conftest.$ac_ext" >&5
2698   # Broken: fails on valid input.
2699 continue
2700 fi
2701 rm -f conftest.err "conftest.$ac_ext"
2702
2703   # OK, works on sane cases.  Now check whether non-existent headers
2704   # can be detected and how.
2705   cat >"conftest.$ac_ext" <<_ACEOF
2706 #line 2706 "configure"
2707 #include "confdefs.h"
2708 #include <ac_nonexistent.h>
2709 _ACEOF
2710 if { (eval echo "$as_me:2710: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2711   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2712   ac_status=$?
2713   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2714   rm -f conftest.er1
2715   cat conftest.err >&5
2716   echo "$as_me:2716: \$? = $ac_status" >&5
2717   (exit "$ac_status"); } >/dev/null; then
2718   if test -s conftest.err; then
2719     ac_cpp_err=$ac_c_preproc_warn_flag
2720   else
2721     ac_cpp_err=
2722   fi
2723 else
2724   ac_cpp_err=yes
2725 fi
2726 if test -z "$ac_cpp_err"; then
2727   # Broken: success on invalid input.
2728 continue
2729 else
2730   echo "$as_me: failed program was:" >&5
2731   cat "conftest.$ac_ext" >&5
2732   # Passes both tests.
2733 ac_preproc_ok=:
2734 break
2735 fi
2736 rm -f conftest.err "conftest.$ac_ext"
2737
2738 done
2739 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2740 rm -f conftest.err "conftest.$ac_ext"
2741 if $ac_preproc_ok; then
2742   :
2743 else
2744   { { echo "$as_me:2744: error: C preprocessor \"$CPP\" fails sanity check" >&5
2745 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2746    { (exit 1); exit 1; }; }
2747 fi
2748
2749 ac_ext=c
2750 ac_cpp='$CPP $CPPFLAGS'
2751 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2752 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2753 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2754 ac_main_return="return"
2755
2756 for ac_prog in mawk gawk nawk awk
2757 do
2758   # Extract the first word of "$ac_prog", so it can be a program name with args.
2759 set dummy $ac_prog; ac_word=$2
2760 echo "$as_me:2760: checking for $ac_word" >&5
2761 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2762 if test "${ac_cv_prog_AWK+set}" = set; then
2763   echo $ECHO_N "(cached) $ECHO_C" >&6
2764 else
2765   if test -n "$AWK"; then
2766   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2767 else
2768   ac_save_IFS=$IFS; IFS=$ac_path_separator
2769 ac_dummy="$PATH"
2770 for ac_dir in $ac_dummy; do
2771   IFS=$ac_save_IFS
2772   test -z "$ac_dir" && ac_dir=.
2773   $as_executable_p "$ac_dir/$ac_word" || continue
2774 ac_cv_prog_AWK="$ac_prog"
2775 echo "$as_me:2775: found $ac_dir/$ac_word" >&5
2776 break
2777 done
2778
2779 fi
2780 fi
2781 AWK=$ac_cv_prog_AWK
2782 if test -n "$AWK"; then
2783   echo "$as_me:2783: result: $AWK" >&5
2784 echo "${ECHO_T}$AWK" >&6
2785 else
2786   echo "$as_me:2786: result: no" >&5
2787 echo "${ECHO_T}no" >&6
2788 fi
2789
2790   test -n "$AWK" && break
2791 done
2792
2793 # Find a good install program.  We prefer a C program (faster),
2794 # so one script is as good as another.  But avoid the broken or
2795 # incompatible versions:
2796 # SysV /etc/install, /usr/sbin/install
2797 # SunOS /usr/etc/install
2798 # IRIX /sbin/install
2799 # AIX /bin/install
2800 # AmigaOS /C/install, which installs bootblocks on floppy discs
2801 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2802 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2803 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2804 # ./install, which can be erroneously created by make from ./install.sh.
2805 echo "$as_me:2805: checking for a BSD compatible install" >&5
2806 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2807 if test -z "$INSTALL"; then
2808 if test "${ac_cv_path_install+set}" = set; then
2809   echo $ECHO_N "(cached) $ECHO_C" >&6
2810 else
2811     ac_save_IFS=$IFS; IFS=$ac_path_separator
2812   for ac_dir in $PATH; do
2813     IFS=$ac_save_IFS
2814     # Account for people who put trailing slashes in PATH elements.
2815     case $ac_dir/ in
2816     / | ./ | .// | /cC/* \
2817     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2818     | /usr/ucb/* ) ;;
2819     *)
2820       # OSF1 and SCO ODT 3.0 have their own names for install.
2821       # Don't use installbsd from OSF since it installs stuff as root
2822       # by default.
2823       for ac_prog in ginstall scoinst install; do
2824         if $as_executable_p "$ac_dir/$ac_prog"; then
2825           if test $ac_prog = install &&
2826             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2827             # AIX install.  It has an incompatible calling convention.
2828             :
2829           elif test $ac_prog = install &&
2830             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2831             # program-specific install script used by HP pwplus--don't use.
2832             :
2833           else
2834             ac_cv_path_install="$ac_dir/$ac_prog -c"
2835             break 2
2836           fi
2837         fi
2838       done
2839       ;;
2840     esac
2841   done
2842
2843 fi
2844   if test "${ac_cv_path_install+set}" = set; then
2845     INSTALL=$ac_cv_path_install
2846   else
2847     # As a last resort, use the slow shell script.  We don't cache a
2848     # path for INSTALL within a source directory, because that will
2849     # break other packages using the cache if that directory is
2850     # removed, or if the path is relative.
2851     INSTALL=$ac_install_sh
2852   fi
2853 fi
2854 echo "$as_me:2854: result: $INSTALL" >&5
2855 echo "${ECHO_T}$INSTALL" >&6
2856
2857 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2858 # It thinks the first close brace ends the variable substitution.
2859 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2860
2861 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2862
2863 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2864
2865 case $INSTALL in
2866 (/*)
2867         ;;
2868 (*)
2869         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2870         test -z "$cf_dir" && cf_dir=.
2871         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2872         ;;
2873 esac
2874
2875 echo "$as_me:2875: checking if you want to install stripped executables" >&5
2876 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2877
2878 # Check whether --enable-stripping or --disable-stripping was given.
2879 if test "${enable_stripping+set}" = set; then
2880   enableval="$enable_stripping"
2881   test "$enableval" != no && enableval=yes
2882         if test "$enableval" != "yes" ; then
2883     enable_stripping=no
2884         else
2885                 enable_stripping=yes
2886         fi
2887 else
2888   enableval=yes
2889         enable_stripping=yes
2890
2891 fi;
2892 echo "$as_me:2892: result: $enable_stripping" >&5
2893 echo "${ECHO_T}$enable_stripping" >&6
2894
2895 if test "$enable_stripping" = yes
2896 then
2897         INSTALL_OPT_S="-s"
2898 else
2899         INSTALL_OPT_S=
2900 fi
2901
2902 : "${INSTALL:=install}"
2903 echo "$as_me:2903: checking if install accepts -p option" >&5
2904 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2905 if test "${cf_cv_install_p+set}" = set; then
2906   echo $ECHO_N "(cached) $ECHO_C" >&6
2907 else
2908
2909         rm -rf ./conftest*
2910         date >conftest.in
2911         mkdir conftest.out
2912         sleep 3
2913         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2914         then
2915                 if test -f conftest.out/conftest.in
2916                 then
2917                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2918                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2919                         if test -s conftest.err
2920                         then
2921                                 cf_cv_install_p=no
2922                         else
2923                                 cf_cv_install_p=yes
2924                         fi
2925                 else
2926                         cf_cv_install_p=no
2927                 fi
2928         else
2929                 cf_cv_install_p=no
2930         fi
2931         rm -rf ./conftest*
2932
2933 fi
2934 echo "$as_me:2934: result: $cf_cv_install_p" >&5
2935 echo "${ECHO_T}$cf_cv_install_p" >&6
2936
2937 echo "$as_me:2937: checking if install needs to be told about ownership" >&5
2938 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2939 case `$ac_config_guess` in
2940 (*minix)
2941         with_install_o=yes
2942         ;;
2943 (*)
2944         with_install_o=no
2945         ;;
2946 esac
2947
2948 echo "$as_me:2948: result: $with_install_o" >&5
2949 echo "${ECHO_T}$with_install_o" >&6
2950 if test "x$with_install_o" = xyes
2951 then
2952         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
2953 else
2954         INSTALL_OPT_O=
2955 fi
2956
2957 for ac_prog in lint cppcheck splint
2958 do
2959   # Extract the first word of "$ac_prog", so it can be a program name with args.
2960 set dummy $ac_prog; ac_word=$2
2961 echo "$as_me:2961: checking for $ac_word" >&5
2962 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2963 if test "${ac_cv_prog_LINT+set}" = set; then
2964   echo $ECHO_N "(cached) $ECHO_C" >&6
2965 else
2966   if test -n "$LINT"; then
2967   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2968 else
2969   ac_save_IFS=$IFS; IFS=$ac_path_separator
2970 ac_dummy="$PATH"
2971 for ac_dir in $ac_dummy; do
2972   IFS=$ac_save_IFS
2973   test -z "$ac_dir" && ac_dir=.
2974   $as_executable_p "$ac_dir/$ac_word" || continue
2975 ac_cv_prog_LINT="$ac_prog"
2976 echo "$as_me:2976: found $ac_dir/$ac_word" >&5
2977 break
2978 done
2979
2980 fi
2981 fi
2982 LINT=$ac_cv_prog_LINT
2983 if test -n "$LINT"; then
2984   echo "$as_me:2984: result: $LINT" >&5
2985 echo "${ECHO_T}$LINT" >&6
2986 else
2987   echo "$as_me:2987: result: no" >&5
2988 echo "${ECHO_T}no" >&6
2989 fi
2990
2991   test -n "$LINT" && break
2992 done
2993
2994 case "x$LINT" in
2995 (xcppcheck|x*/cppcheck)
2996         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2997         ;;
2998 esac
2999
3000 echo "$as_me:3000: checking if filesystem supports mixed-case filenames" >&5
3001 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3002 if test "${cf_cv_mixedcase+set}" = set; then
3003   echo $ECHO_N "(cached) $ECHO_C" >&6
3004 else
3005
3006 if test "$cross_compiling" = yes ; then
3007         case "$target_alias" in
3008         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3009                 cf_cv_mixedcase=no
3010                 ;;
3011         (*)
3012                 cf_cv_mixedcase=yes
3013                 ;;
3014         esac
3015 else
3016         rm -f conftest CONFTEST
3017         echo test >conftest
3018         if test -f CONFTEST ; then
3019                 cf_cv_mixedcase=no
3020         else
3021                 cf_cv_mixedcase=yes
3022         fi
3023         rm -f conftest CONFTEST
3024 fi
3025
3026 fi
3027 echo "$as_me:3027: result: $cf_cv_mixedcase" >&5
3028 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3029 test "$cf_cv_mixedcase" = yes &&
3030 cat >>confdefs.h <<\EOF
3031 #define MIXEDCASE_FILENAMES 1
3032 EOF
3033
3034 for ac_prog in exctags ctags
3035 do
3036   # Extract the first word of "$ac_prog", so it can be a program name with args.
3037 set dummy $ac_prog; ac_word=$2
3038 echo "$as_me:3038: checking for $ac_word" >&5
3039 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3040 if test "${ac_cv_prog_CTAGS+set}" = set; then
3041   echo $ECHO_N "(cached) $ECHO_C" >&6
3042 else
3043   if test -n "$CTAGS"; then
3044   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3045 else
3046   ac_save_IFS=$IFS; IFS=$ac_path_separator
3047 ac_dummy="$PATH"
3048 for ac_dir in $ac_dummy; do
3049   IFS=$ac_save_IFS
3050   test -z "$ac_dir" && ac_dir=.
3051   $as_executable_p "$ac_dir/$ac_word" || continue
3052 ac_cv_prog_CTAGS="$ac_prog"
3053 echo "$as_me:3053: found $ac_dir/$ac_word" >&5
3054 break
3055 done
3056
3057 fi
3058 fi
3059 CTAGS=$ac_cv_prog_CTAGS
3060 if test -n "$CTAGS"; then
3061   echo "$as_me:3061: result: $CTAGS" >&5
3062 echo "${ECHO_T}$CTAGS" >&6
3063 else
3064   echo "$as_me:3064: result: no" >&5
3065 echo "${ECHO_T}no" >&6
3066 fi
3067
3068   test -n "$CTAGS" && break
3069 done
3070
3071 for ac_prog in exetags etags
3072 do
3073   # Extract the first word of "$ac_prog", so it can be a program name with args.
3074 set dummy $ac_prog; ac_word=$2
3075 echo "$as_me:3075: checking for $ac_word" >&5
3076 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3077 if test "${ac_cv_prog_ETAGS+set}" = set; then
3078   echo $ECHO_N "(cached) $ECHO_C" >&6
3079 else
3080   if test -n "$ETAGS"; then
3081   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3082 else
3083   ac_save_IFS=$IFS; IFS=$ac_path_separator
3084 ac_dummy="$PATH"
3085 for ac_dir in $ac_dummy; do
3086   IFS=$ac_save_IFS
3087   test -z "$ac_dir" && ac_dir=.
3088   $as_executable_p "$ac_dir/$ac_word" || continue
3089 ac_cv_prog_ETAGS="$ac_prog"
3090 echo "$as_me:3090: found $ac_dir/$ac_word" >&5
3091 break
3092 done
3093
3094 fi
3095 fi
3096 ETAGS=$ac_cv_prog_ETAGS
3097 if test -n "$ETAGS"; then
3098   echo "$as_me:3098: result: $ETAGS" >&5
3099 echo "${ECHO_T}$ETAGS" >&6
3100 else
3101   echo "$as_me:3101: result: no" >&5
3102 echo "${ECHO_T}no" >&6
3103 fi
3104
3105   test -n "$ETAGS" && break
3106 done
3107
3108 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3109 set dummy ${CTAGS:-ctags}; ac_word=$2
3110 echo "$as_me:3110: checking for $ac_word" >&5
3111 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3112 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3113   echo $ECHO_N "(cached) $ECHO_C" >&6
3114 else
3115   if test -n "$MAKE_LOWER_TAGS"; then
3116   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3117 else
3118   ac_save_IFS=$IFS; IFS=$ac_path_separator
3119 ac_dummy="$PATH"
3120 for ac_dir in $ac_dummy; do
3121   IFS=$ac_save_IFS
3122   test -z "$ac_dir" && ac_dir=.
3123   $as_executable_p "$ac_dir/$ac_word" || continue
3124 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3125 echo "$as_me:3125: found $ac_dir/$ac_word" >&5
3126 break
3127 done
3128
3129   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3130 fi
3131 fi
3132 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3133 if test -n "$MAKE_LOWER_TAGS"; then
3134   echo "$as_me:3134: result: $MAKE_LOWER_TAGS" >&5
3135 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3136 else
3137   echo "$as_me:3137: result: no" >&5
3138 echo "${ECHO_T}no" >&6
3139 fi
3140
3141 if test "$cf_cv_mixedcase" = yes ; then
3142         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3143 set dummy ${ETAGS:-etags}; ac_word=$2
3144 echo "$as_me:3144: checking for $ac_word" >&5
3145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3146 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3147   echo $ECHO_N "(cached) $ECHO_C" >&6
3148 else
3149   if test -n "$MAKE_UPPER_TAGS"; then
3150   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3151 else
3152   ac_save_IFS=$IFS; IFS=$ac_path_separator
3153 ac_dummy="$PATH"
3154 for ac_dir in $ac_dummy; do
3155   IFS=$ac_save_IFS
3156   test -z "$ac_dir" && ac_dir=.
3157   $as_executable_p "$ac_dir/$ac_word" || continue
3158 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3159 echo "$as_me:3159: found $ac_dir/$ac_word" >&5
3160 break
3161 done
3162
3163   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3164 fi
3165 fi
3166 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3167 if test -n "$MAKE_UPPER_TAGS"; then
3168   echo "$as_me:3168: result: $MAKE_UPPER_TAGS" >&5
3169 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3170 else
3171   echo "$as_me:3171: result: no" >&5
3172 echo "${ECHO_T}no" >&6
3173 fi
3174
3175 else
3176         MAKE_UPPER_TAGS=no
3177 fi
3178
3179 if test "$MAKE_UPPER_TAGS" = yes ; then
3180         MAKE_UPPER_TAGS=
3181 else
3182         MAKE_UPPER_TAGS="#"
3183 fi
3184
3185 if test "$MAKE_LOWER_TAGS" = yes ; then
3186         MAKE_LOWER_TAGS=
3187 else
3188         MAKE_LOWER_TAGS="#"
3189 fi
3190
3191 echo "$as_me:3191: checking if -lm needed for math functions" >&5
3192 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3193 if test "${cf_cv_need_libm+set}" = set; then
3194   echo $ECHO_N "(cached) $ECHO_C" >&6
3195 else
3196
3197         cat >"conftest.$ac_ext" <<_ACEOF
3198 #line 3198 "configure"
3199 #include "confdefs.h"
3200
3201         #include <stdio.h>
3202         #include <stdlib.h>
3203         #include <math.h>
3204
3205 int
3206 main (void)
3207 {
3208 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3209   ;
3210   return 0;
3211 }
3212 _ACEOF
3213 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3214 if { (eval echo "$as_me:3214: \"$ac_link\"") >&5
3215   (eval $ac_link) 2>&5
3216   ac_status=$?
3217   echo "$as_me:3217: \$? = $ac_status" >&5
3218   (exit "$ac_status"); } &&
3219          { ac_try='test -s "conftest$ac_exeext"'
3220   { (eval echo "$as_me:3220: \"$ac_try\"") >&5
3221   (eval $ac_try) 2>&5
3222   ac_status=$?
3223   echo "$as_me:3223: \$? = $ac_status" >&5
3224   (exit "$ac_status"); }; }; then
3225   cf_cv_need_libm=no
3226 else
3227   echo "$as_me: failed program was:" >&5
3228 cat "conftest.$ac_ext" >&5
3229 cf_cv_need_libm=yes
3230 fi
3231 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3232 fi
3233 echo "$as_me:3233: result: $cf_cv_need_libm" >&5
3234 echo "${ECHO_T}$cf_cv_need_libm" >&6
3235 if test "$cf_cv_need_libm" = yes
3236 then
3237 MATH_LIB=-lm
3238 fi
3239
3240 top_builddir=`pwd`
3241
3242 CC_G_OPT="-g"
3243 CC_SHARED_OPTS=unknown
3244 CPPFLAGS="$CPPFLAGS"
3245 DFT_DEP_SUFFIX=""
3246 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3247 DFT_UPR_MODEL="NORMAL"
3248 LD="ld"
3249 LDFLAGS_SHARED=""
3250 LDFLAGS_STATIC=""
3251 LD_MODEL=""
3252 LD_SHARED_OPTS=""
3253 LIBTOOL=""
3254 LIBTOOL_OPTS=""
3255 LIB_CLEAN=""
3256 LIB_COMPILE=""
3257 LIB_LINK='${CC}'
3258 LINK_TESTS=""
3259 LOCAL_LDFLAGS=""
3260 PACKAGE="ncurses-examples"
3261 PTHREAD="-lm"
3262 TEST_ARGS=""
3263 TEST_DEPS=""
3264 TEST_LIBS=""
3265 TINFO_LDFLAGS=''
3266 TINFO_LIBS='$(LIBS_CURSES)'
3267 cf_cv_abi_version=""
3268 cf_cv_rel_version=""
3269 includesubdir=""
3270
3271 cf_cv_screen=curses
3272 cf_cv_libtype=
3273
3274 echo "$as_me:3274: checking for fgrep" >&5
3275 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3276 if test "${ac_cv_path_FGREP+set}" = set; then
3277   echo $ECHO_N "(cached) $ECHO_C" >&6
3278 else
3279   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3280    then ac_cv_path_FGREP="$GREP -F"
3281    else
3282      for ac_prog in gfgrep fgrep
3283 do
3284   # Extract the first word of "$ac_prog", so it can be a program name with args.
3285 set dummy $ac_prog; ac_word=$2
3286 echo "$as_me:3286: checking for $ac_word" >&5
3287 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3288 if test "${ac_cv_path_FGREP+set}" = set; then
3289   echo $ECHO_N "(cached) $ECHO_C" >&6
3290 else
3291   case $FGREP in
3292   [\\/]* | ?:[\\/]*)
3293   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3294   ;;
3295   *)
3296   ac_save_IFS=$IFS; IFS=$ac_path_separator
3297 ac_dummy="$PATH"
3298 for ac_dir in $ac_dummy; do
3299   IFS=$ac_save_IFS
3300   test -z "$ac_dir" && ac_dir=.
3301   if $as_executable_p "$ac_dir/$ac_word"; then
3302    ac_cv_path_FGREP="$ac_dir/$ac_word"
3303    echo "$as_me:3303: found $ac_dir/$ac_word" >&5
3304    break
3305 fi
3306 done
3307
3308   ;;
3309 esac
3310 fi
3311 FGREP=$ac_cv_path_FGREP
3312
3313 if test -n "$FGREP"; then
3314   echo "$as_me:3314: result: $FGREP" >&5
3315 echo "${ECHO_T}$FGREP" >&6
3316 else
3317   echo "$as_me:3317: result: no" >&5
3318 echo "${ECHO_T}no" >&6
3319 fi
3320
3321   test -n "$FGREP" && break
3322 done
3323 test -n "$FGREP" || FGREP=": "
3324
3325      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3325: error: cannot find workable fgrep" >&5
3326 echo "$as_me: error: cannot find workable fgrep" >&2;}
3327    { (exit 1); exit 1; }; }
3328    fi
3329 fi
3330 echo "$as_me:3330: result: $ac_cv_path_FGREP" >&5
3331 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3332  FGREP="$ac_cv_path_FGREP"
3333
3334 echo "$as_me:3334: checking if you want to use C11 _Noreturn feature" >&5
3335 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
3336
3337 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
3338 if test "${enable_stdnoreturn+set}" = set; then
3339   enableval="$enable_stdnoreturn"
3340   test "$enableval" != yes && enableval=no
3341         if test "$enableval" != "no" ; then
3342     enable_stdnoreturn=yes
3343         else
3344                 enable_stdnoreturn=no
3345         fi
3346 else
3347   enableval=no
3348         enable_stdnoreturn=no
3349
3350 fi;
3351 echo "$as_me:3351: result: $enable_stdnoreturn" >&5
3352 echo "${ECHO_T}$enable_stdnoreturn" >&6
3353
3354 if test $enable_stdnoreturn = yes; then
3355 echo "$as_me:3355: checking for C11 _Noreturn feature" >&5
3356 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3357 if test "${cf_cv_c11_noreturn+set}" = set; then
3358   echo $ECHO_N "(cached) $ECHO_C" >&6
3359 else
3360   cat >"conftest.$ac_ext" <<_ACEOF
3361 #line 3361 "configure"
3362 #include "confdefs.h"
3363
3364 #include <stdio.h>
3365 #include <stdlib.h>
3366 #include <stdnoreturn.h>
3367 static _Noreturn void giveup(void) { exit(0); }
3368
3369 int
3370 main (void)
3371 {
3372 if (feof(stdin)) giveup()
3373   ;
3374   return 0;
3375 }
3376 _ACEOF
3377 rm -f "conftest.$ac_objext"
3378 if { (eval echo "$as_me:3378: \"$ac_compile\"") >&5
3379   (eval $ac_compile) 2>&5
3380   ac_status=$?
3381   echo "$as_me:3381: \$? = $ac_status" >&5
3382   (exit "$ac_status"); } &&
3383          { ac_try='test -s "conftest.$ac_objext"'
3384   { (eval echo "$as_me:3384: \"$ac_try\"") >&5
3385   (eval $ac_try) 2>&5
3386   ac_status=$?
3387   echo "$as_me:3387: \$? = $ac_status" >&5
3388   (exit "$ac_status"); }; }; then
3389   cf_cv_c11_noreturn=yes
3390 else
3391   echo "$as_me: failed program was:" >&5
3392 cat "conftest.$ac_ext" >&5
3393 cf_cv_c11_noreturn=no
3394 fi
3395 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3396
3397 fi
3398 echo "$as_me:3398: result: $cf_cv_c11_noreturn" >&5
3399 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3400 else
3401         cf_cv_c11_noreturn=no,
3402 fi
3403
3404 if test "$cf_cv_c11_noreturn" = yes; then
3405
3406 cat >>confdefs.h <<\EOF
3407 #define HAVE_STDNORETURN_H 1
3408 EOF
3409
3410 cat >>confdefs.h <<EOF
3411 #define STDC_NORETURN _Noreturn
3412 EOF
3413
3414         HAVE_STDNORETURN_H=1
3415 else
3416         HAVE_STDNORETURN_H=0
3417 fi
3418
3419 if test "$GCC" = yes || test "$GXX" = yes
3420 then
3421 cat > conftest.i <<EOF
3422 #ifndef GCC_PRINTF
3423 #define GCC_PRINTF 0
3424 #endif
3425 #ifndef GCC_SCANF
3426 #define GCC_SCANF 0
3427 #endif
3428 #ifndef GCC_NORETURN
3429 #define GCC_NORETURN /* nothing */
3430 #endif
3431 #ifndef GCC_UNUSED
3432 #define GCC_UNUSED /* nothing */
3433 #endif
3434 EOF
3435 if test "$GCC" = yes
3436 then
3437         { echo "$as_me:3437: checking for $CC __attribute__ directives..." >&5
3438 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3439 cat > "conftest.$ac_ext" <<EOF
3440 #line 3440 "${as_me:-configure}"
3441 #include "confdefs.h"
3442 #include "conftest.h"
3443 #include "conftest.i"
3444 #if     GCC_PRINTF
3445 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3446 #else
3447 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3448 #endif
3449 #if     GCC_SCANF
3450 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3451 #else
3452 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3453 #endif
3454 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3455 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3456 extern GCC_NORETURN void foo(void);
3457 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3458 EOF
3459         cf_printf_attribute=no
3460         cf_scanf_attribute=no
3461         for cf_attribute in scanf printf unused noreturn
3462         do
3463
3464 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3465
3466                 cf_directive="__attribute__(($cf_attribute))"
3467                 echo "checking for $CC $cf_directive" 1>&5
3468
3469                 case "$cf_attribute" in
3470                 (printf)
3471                         cf_printf_attribute=yes
3472                         cat >conftest.h <<EOF
3473 #define GCC_$cf_ATTRIBUTE 1
3474 EOF
3475                         ;;
3476                 (scanf)
3477                         cf_scanf_attribute=yes
3478                         cat >conftest.h <<EOF
3479 #define GCC_$cf_ATTRIBUTE 1
3480 EOF
3481                         ;;
3482                 (*)
3483                         cat >conftest.h <<EOF
3484 #define GCC_$cf_ATTRIBUTE $cf_directive
3485 EOF
3486                         ;;
3487                 esac
3488
3489                 if { (eval echo "$as_me:3489: \"$ac_compile\"") >&5
3490   (eval $ac_compile) 2>&5
3491   ac_status=$?
3492   echo "$as_me:3492: \$? = $ac_status" >&5
3493   (exit "$ac_status"); }; then
3494                         test -n "$verbose" && echo "$as_me:3494: result: ... $cf_attribute" >&5
3495 echo "${ECHO_T}... $cf_attribute" >&6
3496                         cat conftest.h >>confdefs.h
3497                         case "$cf_attribute" in
3498                         (noreturn)
3499
3500 cat >>confdefs.h <<EOF
3501 #define GCC_NORETURN $cf_directive
3502 EOF
3503
3504                                 ;;
3505                         (printf)
3506                                 cf_value='/* nothing */'
3507                                 if test "$cf_printf_attribute" != no ; then
3508                                         cf_value='__attribute__((format(printf,fmt,var)))'
3509
3510 cat >>confdefs.h <<\EOF
3511 #define GCC_PRINTF 1
3512 EOF
3513
3514                                 fi
3515
3516 cat >>confdefs.h <<EOF
3517 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3518 EOF
3519
3520                                 ;;
3521                         (scanf)
3522                                 cf_value='/* nothing */'
3523                                 if test "$cf_scanf_attribute" != no ; then
3524                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3525
3526 cat >>confdefs.h <<\EOF
3527 #define GCC_SCANF 1
3528 EOF
3529
3530                                 fi
3531
3532 cat >>confdefs.h <<EOF
3533 #define GCC_SCANFLIKE(fmt,var) $cf_value
3534 EOF
3535
3536                                 ;;
3537                         (unused)
3538
3539 cat >>confdefs.h <<EOF
3540 #define GCC_UNUSED $cf_directive
3541 EOF
3542
3543                                 ;;
3544                         esac
3545                 fi
3546         done
3547 else
3548         ${FGREP-fgrep} define conftest.i >>confdefs.h
3549 fi
3550 rm -rf ./conftest*
3551 fi
3552
3553 echo "$as_me:3553: checking if you want to work around bogus compiler/loader warnings" >&5
3554 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3555
3556 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3557 if test "${enable_string_hacks+set}" = set; then
3558   enableval="$enable_string_hacks"
3559   enable_string_hacks=$enableval
3560 else
3561   enable_string_hacks=no
3562 fi;
3563 echo "$as_me:3563: result: $enable_string_hacks" >&5
3564 echo "${ECHO_T}$enable_string_hacks" >&6
3565
3566 if test "x$enable_string_hacks" = "xyes"; then
3567
3568 cat >>confdefs.h <<\EOF
3569 #define USE_STRING_HACKS 1
3570 EOF
3571
3572         { echo "$as_me:3572: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3573 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3574         echo "$as_me:3574: checking for strlcat" >&5
3575 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3576 if test "${ac_cv_func_strlcat+set}" = set; then
3577   echo $ECHO_N "(cached) $ECHO_C" >&6
3578 else
3579   cat >"conftest.$ac_ext" <<_ACEOF
3580 #line 3580 "configure"
3581 #include "confdefs.h"
3582 #define strlcat autoconf_temporary
3583 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3584 #undef strlcat
3585
3586 #ifdef __cplusplus
3587 extern "C"
3588 #endif
3589
3590 /* We use char because int might match the return type of a gcc2
3591    builtin and then its argument prototype would still apply.  */
3592 char strlcat (void);
3593
3594 int
3595 main (void)
3596 {
3597
3598 /* The GNU C library defines stubs for functions which it implements
3599     to always fail with ENOSYS.  Some functions are actually named
3600     something starting with __ and the normal name is an alias.  */
3601 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3602 #error found stub for strlcat
3603 #endif
3604
3605         return strlcat ();
3606   ;
3607   return 0;
3608 }
3609 _ACEOF
3610 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3611 if { (eval echo "$as_me:3611: \"$ac_link\"") >&5
3612   (eval $ac_link) 2>&5
3613   ac_status=$?
3614   echo "$as_me:3614: \$? = $ac_status" >&5
3615   (exit "$ac_status"); } &&
3616          { ac_try='test -s "conftest$ac_exeext"'
3617   { (eval echo "$as_me:3617: \"$ac_try\"") >&5
3618   (eval $ac_try) 2>&5
3619   ac_status=$?
3620   echo "$as_me:3620: \$? = $ac_status" >&5
3621   (exit "$ac_status"); }; }; then
3622   ac_cv_func_strlcat=yes
3623 else
3624   echo "$as_me: failed program was:" >&5
3625 cat "conftest.$ac_ext" >&5
3626 ac_cv_func_strlcat=no
3627 fi
3628 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3629 fi
3630 echo "$as_me:3630: result: $ac_cv_func_strlcat" >&5
3631 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3632 if test "$ac_cv_func_strlcat" = yes; then
3633
3634 cat >>confdefs.h <<\EOF
3635 #define HAVE_STRLCAT 1
3636 EOF
3637
3638 else
3639
3640                 echo "$as_me:3640: checking for strlcat in -lbsd" >&5
3641 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3642 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3643   echo $ECHO_N "(cached) $ECHO_C" >&6
3644 else
3645   ac_check_lib_save_LIBS=$LIBS
3646 LIBS="-lbsd  $LIBS"
3647 cat >"conftest.$ac_ext" <<_ACEOF
3648 #line 3648 "configure"
3649 #include "confdefs.h"
3650
3651 /* Override any gcc2 internal prototype to avoid an error.  */
3652 #ifdef __cplusplus
3653 extern "C"
3654 #endif
3655 /* We use char because int might match the return type of a gcc2
3656    builtin and then its argument prototype would still apply.  */
3657 char strlcat ();
3658 int
3659 main (void)
3660 {
3661 strlcat ();
3662   ;
3663   return 0;
3664 }
3665 _ACEOF
3666 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3667 if { (eval echo "$as_me:3667: \"$ac_link\"") >&5
3668   (eval $ac_link) 2>&5
3669   ac_status=$?
3670   echo "$as_me:3670: \$? = $ac_status" >&5
3671   (exit "$ac_status"); } &&
3672          { ac_try='test -s "conftest$ac_exeext"'
3673   { (eval echo "$as_me:3673: \"$ac_try\"") >&5
3674   (eval $ac_try) 2>&5
3675   ac_status=$?
3676   echo "$as_me:3676: \$? = $ac_status" >&5
3677   (exit "$ac_status"); }; }; then
3678   ac_cv_lib_bsd_strlcat=yes
3679 else
3680   echo "$as_me: failed program was:" >&5
3681 cat "conftest.$ac_ext" >&5
3682 ac_cv_lib_bsd_strlcat=no
3683 fi
3684 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3685 LIBS=$ac_check_lib_save_LIBS
3686 fi
3687 echo "$as_me:3687: result: $ac_cv_lib_bsd_strlcat" >&5
3688 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3689 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3690
3691 cf_add_libs="$LIBS"
3692 # reverse order
3693 cf_add_0lib=
3694 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3695 # filter duplicates
3696 for cf_add_1lib in $cf_add_0lib; do
3697         for cf_add_2lib in $cf_add_libs; do
3698                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3699                         cf_add_1lib=
3700                         break
3701                 fi
3702         done
3703         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3704 done
3705 LIBS="$cf_add_libs"
3706
3707 for ac_header in bsd/string.h
3708 do
3709 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3710 echo "$as_me:3710: checking for $ac_header" >&5
3711 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3712 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3713   echo $ECHO_N "(cached) $ECHO_C" >&6
3714 else
3715   cat >"conftest.$ac_ext" <<_ACEOF
3716 #line 3716 "configure"
3717 #include "confdefs.h"
3718 #include <$ac_header>
3719 _ACEOF
3720 if { (eval echo "$as_me:3720: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3721   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3722   ac_status=$?
3723   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3724   rm -f conftest.er1
3725   cat conftest.err >&5
3726   echo "$as_me:3726: \$? = $ac_status" >&5
3727   (exit "$ac_status"); } >/dev/null; then
3728   if test -s conftest.err; then
3729     ac_cpp_err=$ac_c_preproc_warn_flag
3730   else
3731     ac_cpp_err=
3732   fi
3733 else
3734   ac_cpp_err=yes
3735 fi
3736 if test -z "$ac_cpp_err"; then
3737   eval "$as_ac_Header=yes"
3738 else
3739   echo "$as_me: failed program was:" >&5
3740   cat "conftest.$ac_ext" >&5
3741   eval "$as_ac_Header=no"
3742 fi
3743 rm -f conftest.err "conftest.$ac_ext"
3744 fi
3745 echo "$as_me:3745: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3746 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3747 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3748   cat >>confdefs.h <<EOF
3749 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3750 EOF
3751
3752 fi
3753 done
3754
3755 cat >>confdefs.h <<\EOF
3756 #define HAVE_STRLCAT 1
3757 EOF
3758
3759 fi
3760
3761 fi
3762
3763 for ac_func in strlcpy snprintf
3764 do
3765 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3766 echo "$as_me:3766: checking for $ac_func" >&5
3767 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3768 if eval "test \"\${$as_ac_var+set}\" = set"; then
3769   echo $ECHO_N "(cached) $ECHO_C" >&6
3770 else
3771   cat >"conftest.$ac_ext" <<_ACEOF
3772 #line 3772 "configure"
3773 #include "confdefs.h"
3774 #define $ac_func autoconf_temporary
3775 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3776 #undef $ac_func
3777
3778 #ifdef __cplusplus
3779 extern "C"
3780 #endif
3781
3782 /* We use char because int might match the return type of a gcc2
3783    builtin and then its argument prototype would still apply.  */
3784 char $ac_func (void);
3785
3786 int
3787 main (void)
3788 {
3789
3790 /* The GNU C library defines stubs for functions which it implements
3791     to always fail with ENOSYS.  Some functions are actually named
3792     something starting with __ and the normal name is an alias.  */
3793 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3794 #error found stub for $ac_func
3795 #endif
3796
3797         return $ac_func ();
3798   ;
3799   return 0;
3800 }
3801 _ACEOF
3802 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3803 if { (eval echo "$as_me:3803: \"$ac_link\"") >&5
3804   (eval $ac_link) 2>&5
3805   ac_status=$?
3806   echo "$as_me:3806: \$? = $ac_status" >&5
3807   (exit "$ac_status"); } &&
3808          { ac_try='test -s "conftest$ac_exeext"'
3809   { (eval echo "$as_me:3809: \"$ac_try\"") >&5
3810   (eval $ac_try) 2>&5
3811   ac_status=$?
3812   echo "$as_me:3812: \$? = $ac_status" >&5
3813   (exit "$ac_status"); }; }; then
3814   eval "$as_ac_var=yes"
3815 else
3816   echo "$as_me: failed program was:" >&5
3817 cat "conftest.$ac_ext" >&5
3818 eval "$as_ac_var=no"
3819 fi
3820 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3821 fi
3822 echo "$as_me:3822: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3823 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3824 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3825   cat >>confdefs.h <<EOF
3826 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3827 EOF
3828
3829 fi
3830 done
3831
3832 fi
3833
3834 echo "$as_me:3834: checking if the POSIX test-macros are already defined" >&5
3835 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3836 if test "${cf_cv_posix_visible+set}" = set; then
3837   echo $ECHO_N "(cached) $ECHO_C" >&6
3838 else
3839
3840 cat >"conftest.$ac_ext" <<_ACEOF
3841 #line 3841 "configure"
3842 #include "confdefs.h"
3843 #include <stdio.h>
3844 int
3845 main (void)
3846 {
3847
3848 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3849         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3850         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3851         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3852 #error conflicting symbols found
3853 #endif
3854
3855   ;
3856   return 0;
3857 }
3858 _ACEOF
3859 rm -f "conftest.$ac_objext"
3860 if { (eval echo "$as_me:3860: \"$ac_compile\"") >&5
3861   (eval $ac_compile) 2>&5
3862   ac_status=$?
3863   echo "$as_me:3863: \$? = $ac_status" >&5
3864   (exit "$ac_status"); } &&
3865          { ac_try='test -s "conftest.$ac_objext"'
3866   { (eval echo "$as_me:3866: \"$ac_try\"") >&5
3867   (eval $ac_try) 2>&5
3868   ac_status=$?
3869   echo "$as_me:3869: \$? = $ac_status" >&5
3870   (exit "$ac_status"); }; }; then
3871   cf_cv_posix_visible=no
3872 else
3873   echo "$as_me: failed program was:" >&5
3874 cat "conftest.$ac_ext" >&5
3875 cf_cv_posix_visible=yes
3876 fi
3877 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3878
3879 fi
3880 echo "$as_me:3880: result: $cf_cv_posix_visible" >&5
3881 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3882
3883 if test "$cf_cv_posix_visible" = no; then
3884
3885 cf_XOPEN_SOURCE=600
3886 cf_POSIX_C_SOURCE=199506L
3887 cf_xopen_source=
3888
3889 case "$host_os" in
3890 (aix[4-7]*)
3891         cf_xopen_source="-D_ALL_SOURCE"
3892         ;;
3893 (msys)
3894         cf_XOPEN_SOURCE=600
3895         ;;
3896 (darwin[0-8].*)
3897         cf_xopen_source="-D_APPLE_C_SOURCE"
3898         ;;
3899 (darwin*)
3900         cf_xopen_source="-D_DARWIN_C_SOURCE"
3901         cf_XOPEN_SOURCE=
3902         ;;
3903 (freebsd*|dragonfly*|midnightbsd*)
3904         # 5.x headers associate
3905         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3906         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3907         cf_POSIX_C_SOURCE=200112L
3908         cf_XOPEN_SOURCE=600
3909         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3910         ;;
3911 (hpux11*)
3912         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3913         ;;
3914 (hpux*)
3915         cf_xopen_source="-D_HPUX_SOURCE"
3916         ;;
3917 (irix[56].*)
3918         cf_xopen_source="-D_SGI_SOURCE"
3919         cf_XOPEN_SOURCE=
3920         ;;
3921 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3922
3923 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3924
3925 echo "$as_me:3925: checking if this is the GNU C library" >&5
3926 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3927 if test "${cf_cv_gnu_library+set}" = set; then
3928   echo $ECHO_N "(cached) $ECHO_C" >&6
3929 else
3930
3931 cat >"conftest.$ac_ext" <<_ACEOF
3932 #line 3932 "configure"
3933 #include "confdefs.h"
3934 #include <sys/types.h>
3935 int
3936 main (void)
3937 {
3938
3939         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3940                 return 0;
3941         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3942                 return 0;
3943         #else
3944         #       error not GNU C library
3945         #endif
3946   ;
3947   return 0;
3948 }
3949 _ACEOF
3950 rm -f "conftest.$ac_objext"
3951 if { (eval echo "$as_me:3951: \"$ac_compile\"") >&5
3952   (eval $ac_compile) 2>&5
3953   ac_status=$?
3954   echo "$as_me:3954: \$? = $ac_status" >&5
3955   (exit "$ac_status"); } &&
3956          { ac_try='test -s "conftest.$ac_objext"'
3957   { (eval echo "$as_me:3957: \"$ac_try\"") >&5
3958   (eval $ac_try) 2>&5
3959   ac_status=$?
3960   echo "$as_me:3960: \$? = $ac_status" >&5
3961   (exit "$ac_status"); }; }; then
3962   cf_cv_gnu_library=yes
3963 else
3964   echo "$as_me: failed program was:" >&5
3965 cat "conftest.$ac_ext" >&5
3966 cf_cv_gnu_library=no
3967 fi
3968 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3969
3970 fi
3971 echo "$as_me:3971: result: $cf_cv_gnu_library" >&5
3972 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3973
3974 if test x$cf_cv_gnu_library = xyes; then
3975
3976         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3977         # was changed to help a little.  newlib incorporated the change about 4
3978         # years later.
3979         echo "$as_me:3979: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3980 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3981 if test "${cf_cv_gnu_library_219+set}" = set; then
3982   echo $ECHO_N "(cached) $ECHO_C" >&6
3983 else
3984
3985                 cf_save="$CPPFLAGS"
3986
3987         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3988         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3989
3990                 cat >"conftest.$ac_ext" <<_ACEOF
3991 #line 3991 "configure"
3992 #include "confdefs.h"
3993 #include <sys/types.h>
3994 int
3995 main (void)
3996 {
3997
3998                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3999                                 return 0;
4000                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4001                                 return 0;
4002                         #else
4003                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4004                         #endif
4005   ;
4006   return 0;
4007 }
4008 _ACEOF
4009 rm -f "conftest.$ac_objext"
4010 if { (eval echo "$as_me:4010: \"$ac_compile\"") >&5
4011   (eval $ac_compile) 2>&5
4012   ac_status=$?
4013   echo "$as_me:4013: \$? = $ac_status" >&5
4014   (exit "$ac_status"); } &&
4015          { ac_try='test -s "conftest.$ac_objext"'
4016   { (eval echo "$as_me:4016: \"$ac_try\"") >&5
4017   (eval $ac_try) 2>&5
4018   ac_status=$?
4019   echo "$as_me:4019: \$? = $ac_status" >&5
4020   (exit "$ac_status"); }; }; then
4021   cf_cv_gnu_library_219=yes
4022 else
4023   echo "$as_me: failed program was:" >&5
4024 cat "conftest.$ac_ext" >&5
4025 cf_cv_gnu_library_219=no
4026 fi
4027 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4028                 CPPFLAGS="$cf_save"
4029
4030 fi
4031 echo "$as_me:4031: result: $cf_cv_gnu_library_219" >&5
4032 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4033
4034         if test "x$cf_cv_gnu_library_219" = xyes; then
4035                 cf_save="$CPPFLAGS"
4036                 echo "$as_me:4036: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4037 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4038 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4039   echo $ECHO_N "(cached) $ECHO_C" >&6
4040 else
4041
4042 cf_fix_cppflags=no
4043 cf_new_cflags=
4044 cf_new_cppflags=
4045 cf_new_extra_cppflags=
4046
4047 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4048 do
4049 case "$cf_fix_cppflags" in
4050 (no)
4051         case "$cf_add_cflags" in
4052         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4053                 case "$cf_add_cflags" in
4054                 (-D*)
4055                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4056
4057                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4058                                 && test -z "${cf_tst_cflags}" \
4059                                 && cf_fix_cppflags=yes
4060
4061                         if test "$cf_fix_cppflags" = yes ; then
4062
4063         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4064         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4065
4066                                 continue
4067                         elif test "${cf_tst_cflags}" = "\"'" ; then
4068
4069         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4070         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4071
4072                                 continue
4073                         fi
4074                         ;;
4075                 esac
4076                 case "$CPPFLAGS" in
4077                 (*$cf_add_cflags)
4078                         ;;
4079                 (*)
4080                         case "$cf_add_cflags" in
4081                         (-D*)
4082                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4083
4084 CPPFLAGS=`echo "$CPPFLAGS" | \
4085         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4086                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4087
4088                                 ;;
4089                         esac
4090
4091         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4092         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4093
4094                         ;;
4095                 esac
4096                 ;;
4097         (*)
4098
4099         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4100         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4101
4102                 ;;
4103         esac
4104         ;;
4105 (yes)
4106
4107         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4108         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4109
4110         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4111
4112         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4113                 && test -z "${cf_tst_cflags}" \
4114                 && cf_fix_cppflags=no
4115         ;;
4116 esac
4117 done
4118
4119 if test -n "$cf_new_cflags" ; then
4120
4121         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4122         CFLAGS="${CFLAGS}$cf_new_cflags"
4123
4124 fi
4125
4126 if test -n "$cf_new_cppflags" ; then
4127
4128         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4129         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4130
4131 fi
4132
4133 if test -n "$cf_new_extra_cppflags" ; then
4134
4135         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4136         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4137
4138 fi
4139
4140                         cat >"conftest.$ac_ext" <<_ACEOF
4141 #line 4141 "configure"
4142 #include "confdefs.h"
4143
4144                                 #include <limits.h>
4145                                 #include <sys/types.h>
4146
4147 int
4148 main (void)
4149 {
4150
4151                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4152                                         return 0;
4153                                 #else
4154                                 #       error GNU C library is too old
4155                                 #endif
4156   ;
4157   return 0;
4158 }
4159 _ACEOF
4160 rm -f "conftest.$ac_objext"
4161 if { (eval echo "$as_me:4161: \"$ac_compile\"") >&5
4162   (eval $ac_compile) 2>&5
4163   ac_status=$?
4164   echo "$as_me:4164: \$? = $ac_status" >&5
4165   (exit "$ac_status"); } &&
4166          { ac_try='test -s "conftest.$ac_objext"'
4167   { (eval echo "$as_me:4167: \"$ac_try\"") >&5
4168   (eval $ac_try) 2>&5
4169   ac_status=$?
4170   echo "$as_me:4170: \$? = $ac_status" >&5
4171   (exit "$ac_status"); }; }; then
4172   cf_cv_gnu_dftsrc_219=yes
4173 else
4174   echo "$as_me: failed program was:" >&5
4175 cat "conftest.$ac_ext" >&5
4176 cf_cv_gnu_dftsrc_219=no
4177 fi
4178 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4179
4180 fi
4181 echo "$as_me:4181: result: $cf_cv_gnu_dftsrc_219" >&5
4182 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4183                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4184         else
4185                 cf_cv_gnu_dftsrc_219=maybe
4186         fi
4187
4188         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4189
4190                 echo "$as_me:4190: checking if we must define _GNU_SOURCE" >&5
4191 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4192 if test "${cf_cv_gnu_source+set}" = set; then
4193   echo $ECHO_N "(cached) $ECHO_C" >&6
4194 else
4195
4196                 cat >"conftest.$ac_ext" <<_ACEOF
4197 #line 4197 "configure"
4198 #include "confdefs.h"
4199 #include <sys/types.h>
4200 int
4201 main (void)
4202 {
4203
4204                         #ifndef _XOPEN_SOURCE
4205                         #error  expected _XOPEN_SOURCE to be defined
4206                         #endif
4207   ;
4208   return 0;
4209 }
4210 _ACEOF
4211 rm -f "conftest.$ac_objext"
4212 if { (eval echo "$as_me:4212: \"$ac_compile\"") >&5
4213   (eval $ac_compile) 2>&5
4214   ac_status=$?
4215   echo "$as_me:4215: \$? = $ac_status" >&5
4216   (exit "$ac_status"); } &&
4217          { ac_try='test -s "conftest.$ac_objext"'
4218   { (eval echo "$as_me:4218: \"$ac_try\"") >&5
4219   (eval $ac_try) 2>&5
4220   ac_status=$?
4221   echo "$as_me:4221: \$? = $ac_status" >&5
4222   (exit "$ac_status"); }; }; then
4223   cf_cv_gnu_source=no
4224 else
4225   echo "$as_me: failed program was:" >&5
4226 cat "conftest.$ac_ext" >&5
4227 cf_save="$CPPFLAGS"
4228
4229 cf_fix_cppflags=no
4230 cf_new_cflags=
4231 cf_new_cppflags=
4232 cf_new_extra_cppflags=
4233
4234 for cf_add_cflags in -D_GNU_SOURCE
4235 do
4236 case "$cf_fix_cppflags" in
4237 (no)
4238         case "$cf_add_cflags" in
4239         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4240                 case "$cf_add_cflags" in
4241                 (-D*)
4242                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4243
4244                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4245                                 && test -z "${cf_tst_cflags}" \
4246                                 && cf_fix_cppflags=yes
4247
4248                         if test "$cf_fix_cppflags" = yes ; then
4249
4250         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4251         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4252
4253                                 continue
4254                         elif test "${cf_tst_cflags}" = "\"'" ; then
4255
4256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4258
4259                                 continue
4260                         fi
4261                         ;;
4262                 esac
4263                 case "$CPPFLAGS" in
4264                 (*$cf_add_cflags)
4265                         ;;
4266                 (*)
4267                         case "$cf_add_cflags" in
4268                         (-D*)
4269                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4270
4271 CPPFLAGS=`echo "$CPPFLAGS" | \
4272         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4273                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4274
4275                                 ;;
4276                         esac
4277
4278         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4279         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4280
4281                         ;;
4282                 esac
4283                 ;;
4284         (*)
4285
4286         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4287         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4288
4289                 ;;
4290         esac
4291         ;;
4292 (yes)
4293
4294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4296
4297         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4298
4299         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4300                 && test -z "${cf_tst_cflags}" \
4301                 && cf_fix_cppflags=no
4302         ;;
4303 esac
4304 done
4305
4306 if test -n "$cf_new_cflags" ; then
4307
4308         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4309         CFLAGS="${CFLAGS}$cf_new_cflags"
4310
4311 fi
4312
4313 if test -n "$cf_new_cppflags" ; then
4314
4315         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4316         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4317
4318 fi
4319
4320 if test -n "$cf_new_extra_cppflags" ; then
4321
4322         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4323         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4324
4325 fi
4326
4327                          cat >"conftest.$ac_ext" <<_ACEOF
4328 #line 4328 "configure"
4329 #include "confdefs.h"
4330 #include <sys/types.h>
4331 int
4332 main (void)
4333 {
4334
4335                                 #ifdef _XOPEN_SOURCE
4336                                 #error  expected _XOPEN_SOURCE to be undefined
4337                                 #endif
4338   ;
4339   return 0;
4340 }
4341 _ACEOF
4342 rm -f "conftest.$ac_objext"
4343 if { (eval echo "$as_me:4343: \"$ac_compile\"") >&5
4344   (eval $ac_compile) 2>&5
4345   ac_status=$?
4346   echo "$as_me:4346: \$? = $ac_status" >&5
4347   (exit "$ac_status"); } &&
4348          { ac_try='test -s "conftest.$ac_objext"'
4349   { (eval echo "$as_me:4349: \"$ac_try\"") >&5
4350   (eval $ac_try) 2>&5
4351   ac_status=$?
4352   echo "$as_me:4352: \$? = $ac_status" >&5
4353   (exit "$ac_status"); }; }; then
4354   cf_cv_gnu_source=no
4355 else
4356   echo "$as_me: failed program was:" >&5
4357 cat "conftest.$ac_ext" >&5
4358 cf_cv_gnu_source=yes
4359 fi
4360 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4361                         CPPFLAGS="$cf_save"
4362
4363 fi
4364 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4365
4366 fi
4367 echo "$as_me:4367: result: $cf_cv_gnu_source" >&5
4368 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4369
4370                 if test "$cf_cv_gnu_source" = yes
4371                 then
4372                 echo "$as_me:4372: checking if we should also define _DEFAULT_SOURCE" >&5
4373 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4374 if test "${cf_cv_default_source+set}" = set; then
4375   echo $ECHO_N "(cached) $ECHO_C" >&6
4376 else
4377
4378         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4379         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4380
4381                         cat >"conftest.$ac_ext" <<_ACEOF
4382 #line 4382 "configure"
4383 #include "confdefs.h"
4384 #include <sys/types.h>
4385 int
4386 main (void)
4387 {
4388
4389                                 #ifdef _DEFAULT_SOURCE
4390                                 #error  expected _DEFAULT_SOURCE to be undefined
4391                                 #endif
4392   ;
4393   return 0;
4394 }
4395 _ACEOF
4396 rm -f "conftest.$ac_objext"
4397 if { (eval echo "$as_me:4397: \"$ac_compile\"") >&5
4398   (eval $ac_compile) 2>&5
4399   ac_status=$?
4400   echo "$as_me:4400: \$? = $ac_status" >&5
4401   (exit "$ac_status"); } &&
4402          { ac_try='test -s "conftest.$ac_objext"'
4403   { (eval echo "$as_me:4403: \"$ac_try\"") >&5
4404   (eval $ac_try) 2>&5
4405   ac_status=$?
4406   echo "$as_me:4406: \$? = $ac_status" >&5
4407   (exit "$ac_status"); }; }; then
4408   cf_cv_default_source=no
4409 else
4410   echo "$as_me: failed program was:" >&5
4411 cat "conftest.$ac_ext" >&5
4412 cf_cv_default_source=yes
4413 fi
4414 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4415
4416 fi
4417 echo "$as_me:4417: result: $cf_cv_default_source" >&5
4418 echo "${ECHO_T}$cf_cv_default_source" >&6
4419                         if test "$cf_cv_default_source" = yes
4420                         then
4421
4422         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4423         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4424
4425                         fi
4426                 fi
4427         fi
4428
4429 fi
4430
4431         ;;
4432 (minix*)
4433         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4434         ;;
4435 (mirbsd*)
4436         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4437         cf_XOPEN_SOURCE=
4438
4439 if test "$cf_cv_posix_visible" = no; then
4440
4441 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4442
4443 cf_save_CFLAGS="$CFLAGS"
4444 cf_save_CPPFLAGS="$CPPFLAGS"
4445
4446 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4447         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4448                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4449
4450 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4451         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4452                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4453
4454 echo "$as_me:4454: checking if we should define _POSIX_C_SOURCE" >&5
4455 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4456 if test "${cf_cv_posix_c_source+set}" = set; then
4457   echo $ECHO_N "(cached) $ECHO_C" >&6
4458 else
4459
4460 echo "${as_me:-configure}:4460: testing if the symbol is already defined go no further ..." 1>&5
4461
4462         cat >"conftest.$ac_ext" <<_ACEOF
4463 #line 4463 "configure"
4464 #include "confdefs.h"
4465 #include <sys/types.h>
4466 int
4467 main (void)
4468 {
4469
4470 #ifndef _POSIX_C_SOURCE
4471 make an error
4472 #endif
4473   ;
4474   return 0;
4475 }
4476 _ACEOF
4477 rm -f "conftest.$ac_objext"
4478 if { (eval echo "$as_me:4478: \"$ac_compile\"") >&5
4479   (eval $ac_compile) 2>&5
4480   ac_status=$?
4481   echo "$as_me:4481: \$? = $ac_status" >&5
4482   (exit "$ac_status"); } &&
4483          { ac_try='test -s "conftest.$ac_objext"'
4484   { (eval echo "$as_me:4484: \"$ac_try\"") >&5
4485   (eval $ac_try) 2>&5
4486   ac_status=$?
4487   echo "$as_me:4487: \$? = $ac_status" >&5
4488   (exit "$ac_status"); }; }; then
4489   cf_cv_posix_c_source=no
4490 else
4491   echo "$as_me: failed program was:" >&5
4492 cat "conftest.$ac_ext" >&5
4493 cf_want_posix_source=no
4494          case .$cf_POSIX_C_SOURCE in
4495          (.[12]??*)
4496                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4497                 ;;
4498          (.2)
4499                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4500                 cf_want_posix_source=yes
4501                 ;;
4502          (.*)
4503                 cf_want_posix_source=yes
4504                 ;;
4505          esac
4506          if test "$cf_want_posix_source" = yes ; then
4507                 cat >"conftest.$ac_ext" <<_ACEOF
4508 #line 4508 "configure"
4509 #include "confdefs.h"
4510 #include <sys/types.h>
4511 int
4512 main (void)
4513 {
4514
4515 #ifdef _POSIX_SOURCE
4516 make an error
4517 #endif
4518   ;
4519   return 0;
4520 }
4521 _ACEOF
4522 rm -f "conftest.$ac_objext"
4523 if { (eval echo "$as_me:4523: \"$ac_compile\"") >&5
4524   (eval $ac_compile) 2>&5
4525   ac_status=$?
4526   echo "$as_me:4526: \$? = $ac_status" >&5
4527   (exit "$ac_status"); } &&
4528          { ac_try='test -s "conftest.$ac_objext"'
4529   { (eval echo "$as_me:4529: \"$ac_try\"") >&5
4530   (eval $ac_try) 2>&5
4531   ac_status=$?
4532   echo "$as_me:4532: \$? = $ac_status" >&5
4533   (exit "$ac_status"); }; }; then
4534   :
4535 else
4536   echo "$as_me: failed program was:" >&5
4537 cat "conftest.$ac_ext" >&5
4538 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4539 fi
4540 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4541          fi
4542
4543 echo "${as_me:-configure}:4543: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4544
4545          CFLAGS="$cf_trim_CFLAGS"
4546          CPPFLAGS="$cf_trim_CPPFLAGS"
4547
4548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4549         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4550
4551 echo "${as_me:-configure}:4551: testing if the second compile does not leave our definition intact error ..." 1>&5
4552
4553          cat >"conftest.$ac_ext" <<_ACEOF
4554 #line 4554 "configure"
4555 #include "confdefs.h"
4556 #include <sys/types.h>
4557 int
4558 main (void)
4559 {
4560
4561 #ifndef _POSIX_C_SOURCE
4562 make an error
4563 #endif
4564   ;
4565   return 0;
4566 }
4567 _ACEOF
4568 rm -f "conftest.$ac_objext"
4569 if { (eval echo "$as_me:4569: \"$ac_compile\"") >&5
4570   (eval $ac_compile) 2>&5
4571   ac_status=$?
4572   echo "$as_me:4572: \$? = $ac_status" >&5
4573   (exit "$ac_status"); } &&
4574          { ac_try='test -s "conftest.$ac_objext"'
4575   { (eval echo "$as_me:4575: \"$ac_try\"") >&5
4576   (eval $ac_try) 2>&5
4577   ac_status=$?
4578   echo "$as_me:4578: \$? = $ac_status" >&5
4579   (exit "$ac_status"); }; }; then
4580   :
4581 else
4582   echo "$as_me: failed program was:" >&5
4583 cat "conftest.$ac_ext" >&5
4584 cf_cv_posix_c_source=no
4585 fi
4586 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4587          CFLAGS="$cf_save_CFLAGS"
4588          CPPFLAGS="$cf_save_CPPFLAGS"
4589
4590 fi
4591 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4592
4593 fi
4594 echo "$as_me:4594: result: $cf_cv_posix_c_source" >&5
4595 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4596
4597 if test "$cf_cv_posix_c_source" != no ; then
4598         CFLAGS="$cf_trim_CFLAGS"
4599         CPPFLAGS="$cf_trim_CPPFLAGS"
4600
4601 cf_fix_cppflags=no
4602 cf_new_cflags=
4603 cf_new_cppflags=
4604 cf_new_extra_cppflags=
4605
4606 for cf_add_cflags in $cf_cv_posix_c_source
4607 do
4608 case "$cf_fix_cppflags" in
4609 (no)
4610         case "$cf_add_cflags" in
4611         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4612                 case "$cf_add_cflags" in
4613                 (-D*)
4614                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4615
4616                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4617                                 && test -z "${cf_tst_cflags}" \
4618                                 && cf_fix_cppflags=yes
4619
4620                         if test "$cf_fix_cppflags" = yes ; then
4621
4622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4624
4625                                 continue
4626                         elif test "${cf_tst_cflags}" = "\"'" ; then
4627
4628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4630
4631                                 continue
4632                         fi
4633                         ;;
4634                 esac
4635                 case "$CPPFLAGS" in
4636                 (*$cf_add_cflags)
4637                         ;;
4638                 (*)
4639                         case "$cf_add_cflags" in
4640                         (-D*)
4641                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4642
4643 CPPFLAGS=`echo "$CPPFLAGS" | \
4644         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4645                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4646
4647                                 ;;
4648                         esac
4649
4650         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4651         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4652
4653                         ;;
4654                 esac
4655                 ;;
4656         (*)
4657
4658         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4659         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4660
4661                 ;;
4662         esac
4663         ;;
4664 (yes)
4665
4666         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4667         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4668
4669         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4670
4671         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4672                 && test -z "${cf_tst_cflags}" \
4673                 && cf_fix_cppflags=no
4674         ;;
4675 esac
4676 done
4677
4678 if test -n "$cf_new_cflags" ; then
4679
4680         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4681         CFLAGS="${CFLAGS}$cf_new_cflags"
4682
4683 fi
4684
4685 if test -n "$cf_new_cppflags" ; then
4686
4687         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4688         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4689
4690 fi
4691
4692 if test -n "$cf_new_extra_cppflags" ; then
4693
4694         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4695         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4696
4697 fi
4698
4699 fi
4700
4701 fi # cf_cv_posix_visible
4702
4703         ;;
4704 (netbsd*)
4705         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4706         ;;
4707 (openbsd[6-9]*)
4708         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
4709         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
4710         # Abusing the conformance level is a workaround.
4711         { echo "$as_me:4711: WARNING: this system does not provide usable locale support" >&5
4712 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
4713         cf_xopen_source="-D_BSD_SOURCE"
4714         cf_XOPEN_SOURCE=700
4715         ;;
4716 (openbsd[4-5]*)
4717         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4718         cf_xopen_source="-D_BSD_SOURCE"
4719         cf_XOPEN_SOURCE=600
4720         ;;
4721 (openbsd*)
4722         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4723         ;;
4724 (osf[45]*)
4725         cf_xopen_source="-D_OSF_SOURCE"
4726         ;;
4727 (nto-qnx*)
4728         cf_xopen_source="-D_QNX_SOURCE"
4729         ;;
4730 (sco*)
4731         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4732         ;;
4733 (solaris2.*)
4734         cf_xopen_source="-D__EXTENSIONS__"
4735         cf_cv_xopen_source=broken
4736         ;;
4737 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4738         cf_XOPEN_SOURCE=
4739         cf_POSIX_C_SOURCE=
4740         ;;
4741 (*)
4742
4743 echo "$as_me:4743: checking if we should define _XOPEN_SOURCE" >&5
4744 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4745 if test "${cf_cv_xopen_source+set}" = set; then
4746   echo $ECHO_N "(cached) $ECHO_C" >&6
4747 else
4748
4749         cat >"conftest.$ac_ext" <<_ACEOF
4750 #line 4750 "configure"
4751 #include "confdefs.h"
4752
4753 #include <stdlib.h>
4754 #include <string.h>
4755 #include <sys/types.h>
4756
4757 int
4758 main (void)
4759 {
4760
4761 #ifndef _XOPEN_SOURCE
4762 make an error
4763 #endif
4764   ;
4765   return 0;
4766 }
4767 _ACEOF
4768 rm -f "conftest.$ac_objext"
4769 if { (eval echo "$as_me:4769: \"$ac_compile\"") >&5
4770   (eval $ac_compile) 2>&5
4771   ac_status=$?
4772   echo "$as_me:4772: \$? = $ac_status" >&5
4773   (exit "$ac_status"); } &&
4774          { ac_try='test -s "conftest.$ac_objext"'
4775   { (eval echo "$as_me:4775: \"$ac_try\"") >&5
4776   (eval $ac_try) 2>&5
4777   ac_status=$?
4778   echo "$as_me:4778: \$? = $ac_status" >&5
4779   (exit "$ac_status"); }; }; then
4780   cf_cv_xopen_source=no
4781 else
4782   echo "$as_me: failed program was:" >&5
4783 cat "conftest.$ac_ext" >&5
4784 cf_save="$CPPFLAGS"
4785
4786         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4787         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4788
4789          cat >"conftest.$ac_ext" <<_ACEOF
4790 #line 4790 "configure"
4791 #include "confdefs.h"
4792
4793 #include <stdlib.h>
4794 #include <string.h>
4795 #include <sys/types.h>
4796
4797 int
4798 main (void)
4799 {
4800
4801 #ifdef _XOPEN_SOURCE
4802 make an error
4803 #endif
4804   ;
4805   return 0;
4806 }
4807 _ACEOF
4808 rm -f "conftest.$ac_objext"
4809 if { (eval echo "$as_me:4809: \"$ac_compile\"") >&5
4810   (eval $ac_compile) 2>&5
4811   ac_status=$?
4812   echo "$as_me:4812: \$? = $ac_status" >&5
4813   (exit "$ac_status"); } &&
4814          { ac_try='test -s "conftest.$ac_objext"'
4815   { (eval echo "$as_me:4815: \"$ac_try\"") >&5
4816   (eval $ac_try) 2>&5
4817   ac_status=$?
4818   echo "$as_me:4818: \$? = $ac_status" >&5
4819   (exit "$ac_status"); }; }; then
4820   cf_cv_xopen_source=no
4821 else
4822   echo "$as_me: failed program was:" >&5
4823 cat "conftest.$ac_ext" >&5
4824 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4825 fi
4826 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4827         CPPFLAGS="$cf_save"
4828
4829 fi
4830 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4831
4832 fi
4833 echo "$as_me:4833: result: $cf_cv_xopen_source" >&5
4834 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4835
4836 if test "$cf_cv_xopen_source" != no ; then
4837
4838 CFLAGS=`echo "$CFLAGS" | \
4839         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4840                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4841
4842 CPPFLAGS=`echo "$CPPFLAGS" | \
4843         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4844                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4845
4846         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4847
4848 cf_fix_cppflags=no
4849 cf_new_cflags=
4850 cf_new_cppflags=
4851 cf_new_extra_cppflags=
4852
4853 for cf_add_cflags in $cf_temp_xopen_source
4854 do
4855 case "$cf_fix_cppflags" in
4856 (no)
4857         case "$cf_add_cflags" in
4858         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4859                 case "$cf_add_cflags" in
4860                 (-D*)
4861                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4862
4863                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4864                                 && test -z "${cf_tst_cflags}" \
4865                                 && cf_fix_cppflags=yes
4866
4867                         if test "$cf_fix_cppflags" = yes ; then
4868
4869         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4870         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4871
4872                                 continue
4873                         elif test "${cf_tst_cflags}" = "\"'" ; then
4874
4875         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4876         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4877
4878                                 continue
4879                         fi
4880                         ;;
4881                 esac
4882                 case "$CPPFLAGS" in
4883                 (*$cf_add_cflags)
4884                         ;;
4885                 (*)
4886                         case "$cf_add_cflags" in
4887                         (-D*)
4888                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4889
4890 CPPFLAGS=`echo "$CPPFLAGS" | \
4891         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4892                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4893
4894                                 ;;
4895                         esac
4896
4897         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4898         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4899
4900                         ;;
4901                 esac
4902                 ;;
4903         (*)
4904
4905         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4906         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4907
4908                 ;;
4909         esac
4910         ;;
4911 (yes)
4912
4913         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4914         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4915
4916         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4917
4918         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4919                 && test -z "${cf_tst_cflags}" \
4920                 && cf_fix_cppflags=no
4921         ;;
4922 esac
4923 done
4924
4925 if test -n "$cf_new_cflags" ; then
4926
4927         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4928         CFLAGS="${CFLAGS}$cf_new_cflags"
4929
4930 fi
4931
4932 if test -n "$cf_new_cppflags" ; then
4933
4934         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4935         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4936
4937 fi
4938
4939 if test -n "$cf_new_extra_cppflags" ; then
4940
4941         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4942         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4943
4944 fi
4945
4946 fi
4947
4948 if test "$cf_cv_posix_visible" = no; then
4949
4950 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4951
4952 cf_save_CFLAGS="$CFLAGS"
4953 cf_save_CPPFLAGS="$CPPFLAGS"
4954
4955 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4956         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4957                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4958
4959 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4960         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4961                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4962
4963 echo "$as_me:4963: checking if we should define _POSIX_C_SOURCE" >&5
4964 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4965 if test "${cf_cv_posix_c_source+set}" = set; then
4966   echo $ECHO_N "(cached) $ECHO_C" >&6
4967 else
4968
4969 echo "${as_me:-configure}:4969: testing if the symbol is already defined go no further ..." 1>&5
4970
4971         cat >"conftest.$ac_ext" <<_ACEOF
4972 #line 4972 "configure"
4973 #include "confdefs.h"
4974 #include <sys/types.h>
4975 int
4976 main (void)
4977 {
4978
4979 #ifndef _POSIX_C_SOURCE
4980 make an error
4981 #endif
4982   ;
4983   return 0;
4984 }
4985 _ACEOF
4986 rm -f "conftest.$ac_objext"
4987 if { (eval echo "$as_me:4987: \"$ac_compile\"") >&5
4988   (eval $ac_compile) 2>&5
4989   ac_status=$?
4990   echo "$as_me:4990: \$? = $ac_status" >&5
4991   (exit "$ac_status"); } &&
4992          { ac_try='test -s "conftest.$ac_objext"'
4993   { (eval echo "$as_me:4993: \"$ac_try\"") >&5
4994   (eval $ac_try) 2>&5
4995   ac_status=$?
4996   echo "$as_me:4996: \$? = $ac_status" >&5
4997   (exit "$ac_status"); }; }; then
4998   cf_cv_posix_c_source=no
4999 else
5000   echo "$as_me: failed program was:" >&5
5001 cat "conftest.$ac_ext" >&5
5002 cf_want_posix_source=no
5003          case .$cf_POSIX_C_SOURCE in
5004          (.[12]??*)
5005                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5006                 ;;
5007          (.2)
5008                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5009                 cf_want_posix_source=yes
5010                 ;;
5011          (.*)
5012                 cf_want_posix_source=yes
5013                 ;;
5014          esac
5015          if test "$cf_want_posix_source" = yes ; then
5016                 cat >"conftest.$ac_ext" <<_ACEOF
5017 #line 5017 "configure"
5018 #include "confdefs.h"
5019 #include <sys/types.h>
5020 int
5021 main (void)
5022 {
5023
5024 #ifdef _POSIX_SOURCE
5025 make an error
5026 #endif
5027   ;
5028   return 0;
5029 }
5030 _ACEOF
5031 rm -f "conftest.$ac_objext"
5032 if { (eval echo "$as_me:5032: \"$ac_compile\"") >&5
5033   (eval $ac_compile) 2>&5
5034   ac_status=$?
5035   echo "$as_me:5035: \$? = $ac_status" >&5
5036   (exit "$ac_status"); } &&
5037          { ac_try='test -s "conftest.$ac_objext"'
5038   { (eval echo "$as_me:5038: \"$ac_try\"") >&5
5039   (eval $ac_try) 2>&5
5040   ac_status=$?
5041   echo "$as_me:5041: \$? = $ac_status" >&5
5042   (exit "$ac_status"); }; }; then
5043   :
5044 else
5045   echo "$as_me: failed program was:" >&5
5046 cat "conftest.$ac_ext" >&5
5047 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5048 fi
5049 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5050          fi
5051
5052 echo "${as_me:-configure}:5052: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5053
5054          CFLAGS="$cf_trim_CFLAGS"
5055          CPPFLAGS="$cf_trim_CPPFLAGS"
5056
5057         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5058         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5059
5060 echo "${as_me:-configure}:5060: testing if the second compile does not leave our definition intact error ..." 1>&5
5061
5062          cat >"conftest.$ac_ext" <<_ACEOF
5063 #line 5063 "configure"
5064 #include "confdefs.h"
5065 #include <sys/types.h>
5066 int
5067 main (void)
5068 {
5069
5070 #ifndef _POSIX_C_SOURCE
5071 make an error
5072 #endif
5073   ;
5074   return 0;
5075 }
5076 _ACEOF
5077 rm -f "conftest.$ac_objext"
5078 if { (eval echo "$as_me:5078: \"$ac_compile\"") >&5
5079   (eval $ac_compile) 2>&5
5080   ac_status=$?
5081   echo "$as_me:5081: \$? = $ac_status" >&5
5082   (exit "$ac_status"); } &&
5083          { ac_try='test -s "conftest.$ac_objext"'
5084   { (eval echo "$as_me:5084: \"$ac_try\"") >&5
5085   (eval $ac_try) 2>&5
5086   ac_status=$?
5087   echo "$as_me:5087: \$? = $ac_status" >&5
5088   (exit "$ac_status"); }; }; then
5089   :
5090 else
5091   echo "$as_me: failed program was:" >&5
5092 cat "conftest.$ac_ext" >&5
5093 cf_cv_posix_c_source=no
5094 fi
5095 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5096          CFLAGS="$cf_save_CFLAGS"
5097          CPPFLAGS="$cf_save_CPPFLAGS"
5098
5099 fi
5100 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5101
5102 fi
5103 echo "$as_me:5103: result: $cf_cv_posix_c_source" >&5
5104 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5105
5106 if test "$cf_cv_posix_c_source" != no ; then
5107         CFLAGS="$cf_trim_CFLAGS"
5108         CPPFLAGS="$cf_trim_CPPFLAGS"
5109
5110 cf_fix_cppflags=no
5111 cf_new_cflags=
5112 cf_new_cppflags=
5113 cf_new_extra_cppflags=
5114
5115 for cf_add_cflags in $cf_cv_posix_c_source
5116 do
5117 case "$cf_fix_cppflags" in
5118 (no)
5119         case "$cf_add_cflags" in
5120         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5121                 case "$cf_add_cflags" in
5122                 (-D*)
5123                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5124
5125                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5126                                 && test -z "${cf_tst_cflags}" \
5127                                 && cf_fix_cppflags=yes
5128
5129                         if test "$cf_fix_cppflags" = yes ; then
5130
5131         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5132         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5133
5134                                 continue
5135                         elif test "${cf_tst_cflags}" = "\"'" ; then
5136
5137         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5138         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5139
5140                                 continue
5141                         fi
5142                         ;;
5143                 esac
5144                 case "$CPPFLAGS" in
5145                 (*$cf_add_cflags)
5146                         ;;
5147                 (*)
5148                         case "$cf_add_cflags" in
5149                         (-D*)
5150                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5151
5152 CPPFLAGS=`echo "$CPPFLAGS" | \
5153         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5154                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5155
5156                                 ;;
5157                         esac
5158
5159         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5160         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5161
5162                         ;;
5163                 esac
5164                 ;;
5165         (*)
5166
5167         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5168         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5169
5170                 ;;
5171         esac
5172         ;;
5173 (yes)
5174
5175         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5176         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5177
5178         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5179
5180         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5181                 && test -z "${cf_tst_cflags}" \
5182                 && cf_fix_cppflags=no
5183         ;;
5184 esac
5185 done
5186
5187 if test -n "$cf_new_cflags" ; then
5188
5189         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5190         CFLAGS="${CFLAGS}$cf_new_cflags"
5191
5192 fi
5193
5194 if test -n "$cf_new_cppflags" ; then
5195
5196         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5197         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5198
5199 fi
5200
5201 if test -n "$cf_new_extra_cppflags" ; then
5202
5203         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5204         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5205
5206 fi
5207
5208 fi
5209
5210 fi # cf_cv_posix_visible
5211
5212         ;;
5213 esac
5214
5215 if test -n "$cf_xopen_source" ; then
5216
5217 cf_fix_cppflags=no
5218 cf_new_cflags=
5219 cf_new_cppflags=
5220 cf_new_extra_cppflags=
5221
5222 for cf_add_cflags in $cf_xopen_source
5223 do
5224 case "$cf_fix_cppflags" in
5225 (no)
5226         case "$cf_add_cflags" in
5227         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5228                 case "$cf_add_cflags" in
5229                 (-D*)
5230                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5231
5232                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5233                                 && test -z "${cf_tst_cflags}" \
5234                                 && cf_fix_cppflags=yes
5235
5236                         if test "$cf_fix_cppflags" = yes ; then
5237
5238         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5239         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5240
5241                                 continue
5242                         elif test "${cf_tst_cflags}" = "\"'" ; then
5243
5244         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5245         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5246
5247                                 continue
5248                         fi
5249                         ;;
5250                 esac
5251                 case "$CPPFLAGS" in
5252                 (*$cf_add_cflags)
5253                         ;;
5254                 (*)
5255                         case "$cf_add_cflags" in
5256                         (-D*)
5257                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5258
5259 CPPFLAGS=`echo "$CPPFLAGS" | \
5260         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5261                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5262
5263                                 ;;
5264                         esac
5265
5266         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5267         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5268
5269                         ;;
5270                 esac
5271                 ;;
5272         (*)
5273
5274         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5275         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5276
5277                 ;;
5278         esac
5279         ;;
5280 (yes)
5281
5282         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5283         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5284
5285         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5286
5287         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5288                 && test -z "${cf_tst_cflags}" \
5289                 && cf_fix_cppflags=no
5290         ;;
5291 esac
5292 done
5293
5294 if test -n "$cf_new_cflags" ; then
5295         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5296
5297 echo "${as_me:-configure}:5297: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5298
5299         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5300         CFLAGS="${CFLAGS}$cf_new_cflags"
5301
5302 fi
5303
5304 if test -n "$cf_new_cppflags" ; then
5305         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5306
5307 echo "${as_me:-configure}:5307: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5308
5309         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5310         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5311
5312 fi
5313
5314 if test -n "$cf_new_extra_cppflags" ; then
5315         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5316
5317 echo "${as_me:-configure}:5317: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5318
5319         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5320         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5321
5322 fi
5323
5324 fi
5325
5326 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5327         echo "$as_me:5327: checking if _XOPEN_SOURCE really is set" >&5
5328 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5329         cat >"conftest.$ac_ext" <<_ACEOF
5330 #line 5330 "configure"
5331 #include "confdefs.h"
5332 #include <stdlib.h>
5333 int
5334 main (void)
5335 {
5336
5337 #ifndef _XOPEN_SOURCE
5338 make an error
5339 #endif
5340   ;
5341   return 0;
5342 }
5343 _ACEOF
5344 rm -f "conftest.$ac_objext"
5345 if { (eval echo "$as_me:5345: \"$ac_compile\"") >&5
5346   (eval $ac_compile) 2>&5
5347   ac_status=$?
5348   echo "$as_me:5348: \$? = $ac_status" >&5
5349   (exit "$ac_status"); } &&
5350          { ac_try='test -s "conftest.$ac_objext"'
5351   { (eval echo "$as_me:5351: \"$ac_try\"") >&5
5352   (eval $ac_try) 2>&5
5353   ac_status=$?
5354   echo "$as_me:5354: \$? = $ac_status" >&5
5355   (exit "$ac_status"); }; }; then
5356   cf_XOPEN_SOURCE_set=yes
5357 else
5358   echo "$as_me: failed program was:" >&5
5359 cat "conftest.$ac_ext" >&5
5360 cf_XOPEN_SOURCE_set=no
5361 fi
5362 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5363         echo "$as_me:5363: result: $cf_XOPEN_SOURCE_set" >&5
5364 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5365         if test "$cf_XOPEN_SOURCE_set" = yes
5366         then
5367                 cat >"conftest.$ac_ext" <<_ACEOF
5368 #line 5368 "configure"
5369 #include "confdefs.h"
5370 #include <stdlib.h>
5371 int
5372 main (void)
5373 {
5374
5375 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5376 make an error
5377 #endif
5378   ;
5379   return 0;
5380 }
5381 _ACEOF
5382 rm -f "conftest.$ac_objext"
5383 if { (eval echo "$as_me:5383: \"$ac_compile\"") >&5
5384   (eval $ac_compile) 2>&5
5385   ac_status=$?
5386   echo "$as_me:5386: \$? = $ac_status" >&5
5387   (exit "$ac_status"); } &&
5388          { ac_try='test -s "conftest.$ac_objext"'
5389   { (eval echo "$as_me:5389: \"$ac_try\"") >&5
5390   (eval $ac_try) 2>&5
5391   ac_status=$?
5392   echo "$as_me:5392: \$? = $ac_status" >&5
5393   (exit "$ac_status"); }; }; then
5394   cf_XOPEN_SOURCE_set_ok=yes
5395 else
5396   echo "$as_me: failed program was:" >&5
5397 cat "conftest.$ac_ext" >&5
5398 cf_XOPEN_SOURCE_set_ok=no
5399 fi
5400 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5401                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5402                 then
5403                         { echo "$as_me:5403: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5404 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5405                 fi
5406         else
5407
5408 echo "$as_me:5408: checking if we should define _XOPEN_SOURCE" >&5
5409 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5410 if test "${cf_cv_xopen_source+set}" = set; then
5411   echo $ECHO_N "(cached) $ECHO_C" >&6
5412 else
5413
5414         cat >"conftest.$ac_ext" <<_ACEOF
5415 #line 5415 "configure"
5416 #include "confdefs.h"
5417
5418 #include <stdlib.h>
5419 #include <string.h>
5420 #include <sys/types.h>
5421
5422 int
5423 main (void)
5424 {
5425
5426 #ifndef _XOPEN_SOURCE
5427 make an error
5428 #endif
5429   ;
5430   return 0;
5431 }
5432 _ACEOF
5433 rm -f "conftest.$ac_objext"
5434 if { (eval echo "$as_me:5434: \"$ac_compile\"") >&5
5435   (eval $ac_compile) 2>&5
5436   ac_status=$?
5437   echo "$as_me:5437: \$? = $ac_status" >&5
5438   (exit "$ac_status"); } &&
5439          { ac_try='test -s "conftest.$ac_objext"'
5440   { (eval echo "$as_me:5440: \"$ac_try\"") >&5
5441   (eval $ac_try) 2>&5
5442   ac_status=$?
5443   echo "$as_me:5443: \$? = $ac_status" >&5
5444   (exit "$ac_status"); }; }; then
5445   cf_cv_xopen_source=no
5446 else
5447   echo "$as_me: failed program was:" >&5
5448 cat "conftest.$ac_ext" >&5
5449 cf_save="$CPPFLAGS"
5450
5451         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5452         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5453
5454          cat >"conftest.$ac_ext" <<_ACEOF
5455 #line 5455 "configure"
5456 #include "confdefs.h"
5457
5458 #include <stdlib.h>
5459 #include <string.h>
5460 #include <sys/types.h>
5461
5462 int
5463 main (void)
5464 {
5465
5466 #ifdef _XOPEN_SOURCE
5467 make an error
5468 #endif
5469   ;
5470   return 0;
5471 }
5472 _ACEOF
5473 rm -f "conftest.$ac_objext"
5474 if { (eval echo "$as_me:5474: \"$ac_compile\"") >&5
5475   (eval $ac_compile) 2>&5
5476   ac_status=$?
5477   echo "$as_me:5477: \$? = $ac_status" >&5
5478   (exit "$ac_status"); } &&
5479          { ac_try='test -s "conftest.$ac_objext"'
5480   { (eval echo "$as_me:5480: \"$ac_try\"") >&5
5481   (eval $ac_try) 2>&5
5482   ac_status=$?
5483   echo "$as_me:5483: \$? = $ac_status" >&5
5484   (exit "$ac_status"); }; }; then
5485   cf_cv_xopen_source=no
5486 else
5487   echo "$as_me: failed program was:" >&5
5488 cat "conftest.$ac_ext" >&5
5489 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5490 fi
5491 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5492         CPPFLAGS="$cf_save"
5493
5494 fi
5495 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5496
5497 fi
5498 echo "$as_me:5498: result: $cf_cv_xopen_source" >&5
5499 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5500
5501 if test "$cf_cv_xopen_source" != no ; then
5502
5503 CFLAGS=`echo "$CFLAGS" | \
5504         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5505                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5506
5507 CPPFLAGS=`echo "$CPPFLAGS" | \
5508         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5509                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5510
5511         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5512
5513 cf_fix_cppflags=no
5514 cf_new_cflags=
5515 cf_new_cppflags=
5516 cf_new_extra_cppflags=
5517
5518 for cf_add_cflags in $cf_temp_xopen_source
5519 do
5520 case "$cf_fix_cppflags" in
5521 (no)
5522         case "$cf_add_cflags" in
5523         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5524                 case "$cf_add_cflags" in
5525                 (-D*)
5526                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5527
5528                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5529                                 && test -z "${cf_tst_cflags}" \
5530                                 && cf_fix_cppflags=yes
5531
5532                         if test "$cf_fix_cppflags" = yes ; then
5533
5534         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5535         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5536
5537                                 continue
5538                         elif test "${cf_tst_cflags}" = "\"'" ; then
5539
5540         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5541         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5542
5543                                 continue
5544                         fi
5545                         ;;
5546                 esac
5547                 case "$CPPFLAGS" in
5548                 (*$cf_add_cflags)
5549                         ;;
5550                 (*)
5551                         case "$cf_add_cflags" in
5552                         (-D*)
5553                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5554
5555 CPPFLAGS=`echo "$CPPFLAGS" | \
5556         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5557                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5558
5559                                 ;;
5560                         esac
5561
5562         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5563         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5564
5565                         ;;
5566                 esac
5567                 ;;
5568         (*)
5569
5570         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5571         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5572
5573                 ;;
5574         esac
5575         ;;
5576 (yes)
5577
5578         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5579         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5580
5581         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5582
5583         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5584                 && test -z "${cf_tst_cflags}" \
5585                 && cf_fix_cppflags=no
5586         ;;
5587 esac
5588 done
5589
5590 if test -n "$cf_new_cflags" ; then
5591
5592         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5593         CFLAGS="${CFLAGS}$cf_new_cflags"
5594
5595 fi
5596
5597 if test -n "$cf_new_cppflags" ; then
5598
5599         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5600         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5601
5602 fi
5603
5604 if test -n "$cf_new_extra_cppflags" ; then
5605
5606         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5607         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5608
5609 fi
5610
5611 fi
5612
5613         fi
5614 fi
5615 fi # cf_cv_posix_visible
5616
5617 echo "$as_me:5617: checking for signal global datatype" >&5
5618 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5619 if test "${cf_cv_sig_atomic_t+set}" = set; then
5620   echo $ECHO_N "(cached) $ECHO_C" >&6
5621 else
5622
5623         for cf_type in \
5624                 "volatile sig_atomic_t" \
5625                 "sig_atomic_t" \
5626                 "int"
5627         do
5628         cat >"conftest.$ac_ext" <<_ACEOF
5629 #line 5629 "configure"
5630 #include "confdefs.h"
5631
5632 #include <sys/types.h>
5633 #include <signal.h>
5634 #include <stdio.h>
5635
5636 extern $cf_type x;
5637 $cf_type x;
5638 static void handler(int sig)
5639 {
5640         (void)sig;
5641         x = 5;
5642 }
5643 int
5644 main (void)
5645 {
5646 signal(SIGINT, handler);
5647                  x = 1
5648   ;
5649   return 0;
5650 }
5651 _ACEOF
5652 rm -f "conftest.$ac_objext"
5653 if { (eval echo "$as_me:5653: \"$ac_compile\"") >&5
5654   (eval $ac_compile) 2>&5
5655   ac_status=$?
5656   echo "$as_me:5656: \$? = $ac_status" >&5
5657   (exit "$ac_status"); } &&
5658          { ac_try='test -s "conftest.$ac_objext"'
5659   { (eval echo "$as_me:5659: \"$ac_try\"") >&5
5660   (eval $ac_try) 2>&5
5661   ac_status=$?
5662   echo "$as_me:5662: \$? = $ac_status" >&5
5663   (exit "$ac_status"); }; }; then
5664   cf_cv_sig_atomic_t=$cf_type
5665 else
5666   echo "$as_me: failed program was:" >&5
5667 cat "conftest.$ac_ext" >&5
5668 cf_cv_sig_atomic_t=no
5669 fi
5670 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5671                 test "$cf_cv_sig_atomic_t" != no && break
5672         done
5673
5674 fi
5675
5676 echo "$as_me:5676: result: $cf_cv_sig_atomic_t" >&5
5677 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5678 test "$cf_cv_sig_atomic_t" != no &&
5679 cat >>confdefs.h <<EOF
5680 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5681 EOF
5682
5683 # Work around breakage on OS X
5684
5685 echo "$as_me:5685: checking if SIGWINCH is defined" >&5
5686 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5687 if test "${cf_cv_define_sigwinch+set}" = set; then
5688   echo $ECHO_N "(cached) $ECHO_C" >&6
5689 else
5690
5691         cat >"conftest.$ac_ext" <<_ACEOF
5692 #line 5692 "configure"
5693 #include "confdefs.h"
5694
5695 #include <sys/types.h>
5696 #include <sys/signal.h>
5697
5698 int
5699 main (void)
5700 {
5701 int x = SIGWINCH; (void)x
5702   ;
5703   return 0;
5704 }
5705 _ACEOF
5706 rm -f "conftest.$ac_objext"
5707 if { (eval echo "$as_me:5707: \"$ac_compile\"") >&5
5708   (eval $ac_compile) 2>&5
5709   ac_status=$?
5710   echo "$as_me:5710: \$? = $ac_status" >&5
5711   (exit "$ac_status"); } &&
5712          { ac_try='test -s "conftest.$ac_objext"'
5713   { (eval echo "$as_me:5713: \"$ac_try\"") >&5
5714   (eval $ac_try) 2>&5
5715   ac_status=$?
5716   echo "$as_me:5716: \$? = $ac_status" >&5
5717   (exit "$ac_status"); }; }; then
5718   cf_cv_define_sigwinch=yes
5719 else
5720   echo "$as_me: failed program was:" >&5
5721 cat "conftest.$ac_ext" >&5
5722 cat >"conftest.$ac_ext" <<_ACEOF
5723 #line 5723 "configure"
5724 #include "confdefs.h"
5725
5726 #undef _XOPEN_SOURCE
5727 #undef _POSIX_SOURCE
5728 #undef _POSIX_C_SOURCE
5729 #include <sys/types.h>
5730 #include <sys/signal.h>
5731
5732 int
5733 main (void)
5734 {
5735 int x = SIGWINCH; (void)x
5736   ;
5737   return 0;
5738 }
5739 _ACEOF
5740 rm -f "conftest.$ac_objext"
5741 if { (eval echo "$as_me:5741: \"$ac_compile\"") >&5
5742   (eval $ac_compile) 2>&5
5743   ac_status=$?
5744   echo "$as_me:5744: \$? = $ac_status" >&5
5745   (exit "$ac_status"); } &&
5746          { ac_try='test -s "conftest.$ac_objext"'
5747   { (eval echo "$as_me:5747: \"$ac_try\"") >&5
5748   (eval $ac_try) 2>&5
5749   ac_status=$?
5750   echo "$as_me:5750: \$? = $ac_status" >&5
5751   (exit "$ac_status"); }; }; then
5752   cf_cv_define_sigwinch=maybe
5753 else
5754   echo "$as_me: failed program was:" >&5
5755 cat "conftest.$ac_ext" >&5
5756 cf_cv_define_sigwinch=no
5757 fi
5758 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5759
5760 fi
5761 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5762
5763 fi
5764 echo "$as_me:5764: result: $cf_cv_define_sigwinch" >&5
5765 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5766
5767 if test "$cf_cv_define_sigwinch" = maybe ; then
5768 echo "$as_me:5768: checking for actual SIGWINCH definition" >&5
5769 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5770 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5771   echo $ECHO_N "(cached) $ECHO_C" >&6
5772 else
5773
5774 cf_cv_fixup_sigwinch=unknown
5775 cf_sigwinch=32
5776 while test "$cf_sigwinch" != 1
5777 do
5778         cat >"conftest.$ac_ext" <<_ACEOF
5779 #line 5779 "configure"
5780 #include "confdefs.h"
5781
5782 #undef _XOPEN_SOURCE
5783 #undef _POSIX_SOURCE
5784 #undef _POSIX_C_SOURCE
5785 #include <sys/types.h>
5786 #include <sys/signal.h>
5787
5788 int
5789 main (void)
5790 {
5791
5792 #if SIGWINCH != $cf_sigwinch
5793 make an error
5794 #endif
5795 int x = SIGWINCH; (void)x
5796   ;
5797   return 0;
5798 }
5799 _ACEOF
5800 rm -f "conftest.$ac_objext"
5801 if { (eval echo "$as_me:5801: \"$ac_compile\"") >&5
5802   (eval $ac_compile) 2>&5
5803   ac_status=$?
5804   echo "$as_me:5804: \$? = $ac_status" >&5
5805   (exit "$ac_status"); } &&
5806          { ac_try='test -s "conftest.$ac_objext"'
5807   { (eval echo "$as_me:5807: \"$ac_try\"") >&5
5808   (eval $ac_try) 2>&5
5809   ac_status=$?
5810   echo "$as_me:5810: \$? = $ac_status" >&5
5811   (exit "$ac_status"); }; }; then
5812   cf_cv_fixup_sigwinch=$cf_sigwinch
5813          break
5814 else
5815   echo "$as_me: failed program was:" >&5
5816 cat "conftest.$ac_ext" >&5
5817 fi
5818 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5819
5820 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
5821 done
5822
5823 fi
5824 echo "$as_me:5824: result: $cf_cv_fixup_sigwinch" >&5
5825 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5826
5827         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5828                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5829         fi
5830 fi
5831
5832 # Checks for CODESET support.
5833
5834 echo "$as_me:5834: checking for nl_langinfo and CODESET" >&5
5835 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5836 if test "${am_cv_langinfo_codeset+set}" = set; then
5837   echo $ECHO_N "(cached) $ECHO_C" >&6
5838 else
5839   cat >"conftest.$ac_ext" <<_ACEOF
5840 #line 5840 "configure"
5841 #include "confdefs.h"
5842 #include <langinfo.h>
5843 int
5844 main (void)
5845 {
5846 char* cs = nl_langinfo(CODESET); (void)cs
5847   ;
5848   return 0;
5849 }
5850 _ACEOF
5851 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5852 if { (eval echo "$as_me:5852: \"$ac_link\"") >&5
5853   (eval $ac_link) 2>&5
5854   ac_status=$?
5855   echo "$as_me:5855: \$? = $ac_status" >&5
5856   (exit "$ac_status"); } &&
5857          { ac_try='test -s "conftest$ac_exeext"'
5858   { (eval echo "$as_me:5858: \"$ac_try\"") >&5
5859   (eval $ac_try) 2>&5
5860   ac_status=$?
5861   echo "$as_me:5861: \$? = $ac_status" >&5
5862   (exit "$ac_status"); }; }; then
5863   am_cv_langinfo_codeset=yes
5864 else
5865   echo "$as_me: failed program was:" >&5
5866 cat "conftest.$ac_ext" >&5
5867 am_cv_langinfo_codeset=no
5868 fi
5869 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5870
5871 fi
5872 echo "$as_me:5872: result: $am_cv_langinfo_codeset" >&5
5873 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5874         if test "$am_cv_langinfo_codeset" = yes; then
5875
5876 cat >>confdefs.h <<\EOF
5877 #define HAVE_LANGINFO_CODESET 1
5878 EOF
5879
5880         fi
5881
5882 echo "$as_me:5882: checking if you want to use pkg-config" >&5
5883 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5884
5885 # Check whether --with-pkg-config or --without-pkg-config was given.
5886 if test "${with_pkg_config+set}" = set; then
5887   withval="$with_pkg_config"
5888   cf_pkg_config=$withval
5889 else
5890   cf_pkg_config=yes
5891 fi;
5892 echo "$as_me:5892: result: $cf_pkg_config" >&5
5893 echo "${ECHO_T}$cf_pkg_config" >&6
5894
5895 case "$cf_pkg_config" in
5896 (no)
5897         PKG_CONFIG=none
5898         ;;
5899 (yes)
5900
5901 if test -n "$ac_tool_prefix"; then
5902   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5903 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5904 echo "$as_me:5904: checking for $ac_word" >&5
5905 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5906 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5907   echo $ECHO_N "(cached) $ECHO_C" >&6
5908 else
5909   case $PKG_CONFIG in
5910   [\\/]* | ?:[\\/]*)
5911   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5912   ;;
5913   *)
5914   ac_save_IFS=$IFS; IFS=$ac_path_separator
5915 ac_dummy="$PATH"
5916 for ac_dir in $ac_dummy; do
5917   IFS=$ac_save_IFS
5918   test -z "$ac_dir" && ac_dir=.
5919   if $as_executable_p "$ac_dir/$ac_word"; then
5920    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5921    echo "$as_me:5921: found $ac_dir/$ac_word" >&5
5922    break
5923 fi
5924 done
5925
5926   ;;
5927 esac
5928 fi
5929 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5930
5931 if test -n "$PKG_CONFIG"; then
5932   echo "$as_me:5932: result: $PKG_CONFIG" >&5
5933 echo "${ECHO_T}$PKG_CONFIG" >&6
5934 else
5935   echo "$as_me:5935: result: no" >&5
5936 echo "${ECHO_T}no" >&6
5937 fi
5938
5939 fi
5940 if test -z "$ac_cv_path_PKG_CONFIG"; then
5941   ac_pt_PKG_CONFIG=$PKG_CONFIG
5942   # Extract the first word of "pkg-config", so it can be a program name with args.
5943 set dummy pkg-config; ac_word=$2
5944 echo "$as_me:5944: checking for $ac_word" >&5
5945 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5946 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5947   echo $ECHO_N "(cached) $ECHO_C" >&6
5948 else
5949   case $ac_pt_PKG_CONFIG in
5950   [\\/]* | ?:[\\/]*)
5951   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5952   ;;
5953   *)
5954   ac_save_IFS=$IFS; IFS=$ac_path_separator
5955 ac_dummy="$PATH"
5956 for ac_dir in $ac_dummy; do
5957   IFS=$ac_save_IFS
5958   test -z "$ac_dir" && ac_dir=.
5959   if $as_executable_p "$ac_dir/$ac_word"; then
5960    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5961    echo "$as_me:5961: found $ac_dir/$ac_word" >&5
5962    break
5963 fi
5964 done
5965
5966   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5967   ;;
5968 esac
5969 fi
5970 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5971
5972 if test -n "$ac_pt_PKG_CONFIG"; then
5973   echo "$as_me:5973: result: $ac_pt_PKG_CONFIG" >&5
5974 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5975 else
5976   echo "$as_me:5976: result: no" >&5
5977 echo "${ECHO_T}no" >&6
5978 fi
5979
5980   PKG_CONFIG=$ac_pt_PKG_CONFIG
5981 else
5982   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5983 fi
5984
5985         ;;
5986 (*)
5987         PKG_CONFIG=$withval
5988         ;;
5989 esac
5990
5991 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5992 if test "$PKG_CONFIG" != none ; then
5993
5994 if test "x$prefix" != xNONE; then
5995         cf_path_syntax="$prefix"
5996 else
5997         cf_path_syntax="$ac_default_prefix"
5998 fi
5999
6000 case ".$PKG_CONFIG" in
6001 (.\$\(*\)*|.\'*\'*)
6002         ;;
6003 (..|./*|.\\*)
6004         ;;
6005 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6006         ;;
6007 (.\$\{*prefix\}*|.\$\{*dir\}*)
6008         eval PKG_CONFIG="$PKG_CONFIG"
6009         case ".$PKG_CONFIG" in
6010         (.NONE/*)
6011                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6012                 ;;
6013         esac
6014         ;;
6015 (.no|.NONE/*)
6016         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6017         ;;
6018 (*)
6019         { { echo "$as_me:6019: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6020 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6021    { (exit 1); exit 1; }; }
6022         ;;
6023 esac
6024
6025 elif test "x$cf_pkg_config" != xno ; then
6026         { echo "$as_me:6026: WARNING: pkg-config is not installed" >&5
6027 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6028 fi
6029
6030 echo "$as_me:6030: checking if you want to see long compiling messages" >&5
6031 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6032
6033 # Check whether --enable-echo or --disable-echo was given.
6034 if test "${enable_echo+set}" = set; then
6035   enableval="$enable_echo"
6036   test "$enableval" != no && enableval=yes
6037         if test "$enableval" != "yes" ; then
6038
6039         ECHO_LT='--silent'
6040         ECHO_LD='@echo linking $@;'
6041         RULE_CC='@echo compiling $<'
6042         SHOW_CC='@echo compiling $@'
6043         ECHO_CC='@'
6044
6045         else
6046
6047         ECHO_LT=''
6048         ECHO_LD=''
6049         RULE_CC=''
6050         SHOW_CC=''
6051         ECHO_CC=''
6052
6053         fi
6054 else
6055   enableval=yes
6056
6057         ECHO_LT=''
6058         ECHO_LD=''
6059         RULE_CC=''
6060         SHOW_CC=''
6061         ECHO_CC=''
6062
6063 fi;
6064 echo "$as_me:6064: result: $enableval" >&5
6065 echo "${ECHO_T}$enableval" >&6
6066
6067 echo "$as_me:6067: checking for ncurses wrap-prefix" >&5
6068 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6069
6070 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6071 if test "${with_ncurses_wrap_prefix+set}" = set; then
6072   withval="$with_ncurses_wrap_prefix"
6073   NCURSES_WRAP_PREFIX=$withval
6074 else
6075   NCURSES_WRAP_PREFIX=_nc_
6076 fi;
6077 echo "$as_me:6077: result: $NCURSES_WRAP_PREFIX" >&5
6078 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6079
6080 echo "$as_me:6080: checking if you want to check for wide-character functions" >&5
6081 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6082
6083 # Check whether --enable-widec or --disable-widec was given.
6084 if test "${enable_widec+set}" = set; then
6085   enableval="$enable_widec"
6086   test "$enableval" != no && enableval=yes
6087         if test "$enableval" != "yes" ; then
6088     cf_enable_widec=no
6089         else
6090                 cf_enable_widec=yes
6091         fi
6092 else
6093   enableval=yes
6094         cf_enable_widec=yes
6095
6096 fi;
6097 echo "$as_me:6097: result: $cf_enable_widec" >&5
6098 echo "${ECHO_T}$cf_enable_widec" >&6
6099
6100 echo "$as_me:6100: checking for specific curses-directory" >&5
6101 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6102
6103 # Check whether --with-curses-dir or --without-curses-dir was given.
6104 if test "${with_curses_dir+set}" = set; then
6105   withval="$with_curses_dir"
6106   cf_cv_curses_dir=$withval
6107 else
6108   cf_cv_curses_dir=no
6109 fi;
6110 echo "$as_me:6110: result: $cf_cv_curses_dir" >&5
6111 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6112
6113 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6114 then
6115
6116 if test "x$prefix" != xNONE; then
6117         cf_path_syntax="$prefix"
6118 else
6119         cf_path_syntax="$ac_default_prefix"
6120 fi
6121
6122 case ".$withval" in
6123 (.\$\(*\)*|.\'*\'*)
6124         ;;
6125 (..|./*|.\\*)
6126         ;;
6127 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6128         ;;
6129 (.\$\{*prefix\}*|.\$\{*dir\}*)
6130         eval withval="$withval"
6131         case ".$withval" in
6132         (.NONE/*)
6133                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6134                 ;;
6135         esac
6136         ;;
6137 (.no|.NONE/*)
6138         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6139         ;;
6140 (*)
6141         { { echo "$as_me:6141: error: expected a pathname, not \"$withval\"" >&5
6142 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6143    { (exit 1); exit 1; }; }
6144         ;;
6145 esac
6146
6147         if test -d "$cf_cv_curses_dir"
6148         then
6149
6150 if test -n "$cf_cv_curses_dir/include" ; then
6151   for cf_add_incdir in $cf_cv_curses_dir/include
6152   do
6153         while test "$cf_add_incdir" != /usr/include
6154         do
6155           if test -d "$cf_add_incdir"
6156           then
6157                 cf_have_incdir=no
6158                 if test -n "$CFLAGS$CPPFLAGS" ; then
6159                   # a loop is needed to ensure we can add subdirs of existing dirs
6160                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6161                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6162                           cf_have_incdir=yes; break
6163                         fi
6164                   done
6165                 fi
6166
6167                 if test "$cf_have_incdir" = no ; then
6168                   if test "$cf_add_incdir" = /usr/local/include ; then
6169                         if test "$GCC" = yes
6170                         then
6171                           cf_save_CPPFLAGS=$CPPFLAGS
6172
6173         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6174         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6175
6176                           cat >"conftest.$ac_ext" <<_ACEOF
6177 #line 6177 "configure"
6178 #include "confdefs.h"
6179 #include <stdio.h>
6180 int
6181 main (void)
6182 {
6183 printf("Hello")
6184   ;
6185   return 0;
6186 }
6187 _ACEOF
6188 rm -f "conftest.$ac_objext"
6189 if { (eval echo "$as_me:6189: \"$ac_compile\"") >&5
6190   (eval $ac_compile) 2>&5
6191   ac_status=$?
6192   echo "$as_me:6192: \$? = $ac_status" >&5
6193   (exit "$ac_status"); } &&
6194          { ac_try='test -s "conftest.$ac_objext"'
6195   { (eval echo "$as_me:6195: \"$ac_try\"") >&5
6196   (eval $ac_try) 2>&5
6197   ac_status=$?
6198   echo "$as_me:6198: \$? = $ac_status" >&5
6199   (exit "$ac_status"); }; }; then
6200   :
6201 else
6202   echo "$as_me: failed program was:" >&5
6203 cat "conftest.$ac_ext" >&5
6204 cf_have_incdir=yes
6205 fi
6206 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6207                           CPPFLAGS=$cf_save_CPPFLAGS
6208                         fi
6209                   fi
6210                 fi
6211
6212                 if test "$cf_have_incdir" = no ; then
6213                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6214
6215 echo "${as_me:-configure}:6215: testing adding $cf_add_incdir to include-path ..." 1>&5
6216
6217                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6218
6219                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6220                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6221                   cf_add_incdir="$cf_top_incdir"
6222                 else
6223                   break
6224                 fi
6225           else
6226                 break
6227           fi
6228         done
6229   done
6230 fi
6231
6232 if test -n "$cf_cv_curses_dir/lib" ; then
6233         for cf_add_libdir in $cf_cv_curses_dir/lib
6234         do
6235                 if test "$cf_add_libdir" = /usr/lib ; then
6236                         :
6237                 elif test -d "$cf_add_libdir"
6238                 then
6239                         cf_have_libdir=no
6240                         if test -n "$LDFLAGS$LIBS" ; then
6241                                 # a loop is needed to ensure we can add subdirs of existing dirs
6242                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6243                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6244                                                 cf_have_libdir=yes; break
6245                                         fi
6246                                 done
6247                         fi
6248                         if test "$cf_have_libdir" = no ; then
6249                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6250
6251 echo "${as_me:-configure}:6251: testing adding $cf_add_libdir to library-path ..." 1>&5
6252
6253                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6254                         fi
6255                 fi
6256         done
6257 fi
6258
6259         fi
6260 fi
6261
6262 cf_cv_screen=curses
6263
6264 echo "$as_me:6264: checking for specified curses library type" >&5
6265 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6266
6267 # Check whether --with-screen or --without-screen was given.
6268 if test "${with_screen+set}" = set; then
6269   withval="$with_screen"
6270   cf_cv_screen=$withval
6271 else
6272
6273 # Check whether --with-ncursesw or --without-ncursesw was given.
6274 if test "${with_ncursesw+set}" = set; then
6275   withval="$with_ncursesw"
6276   cf_cv_screen=ncursesw
6277 else
6278
6279 # Check whether --with-ncurses or --without-ncurses was given.
6280 if test "${with_ncurses+set}" = set; then
6281   withval="$with_ncurses"
6282   cf_cv_screen=ncurses
6283 else
6284
6285 # Check whether --with-pdcurses or --without-pdcurses was given.
6286 if test "${with_pdcurses+set}" = set; then
6287   withval="$with_pdcurses"
6288   cf_cv_screen=pdcurses
6289 else
6290
6291 # Check whether --with-curses-colr or --without-curses-colr was given.
6292 if test "${with_curses_colr+set}" = set; then
6293   withval="$with_curses_colr"
6294   cf_cv_screen=curses_colr
6295 else
6296
6297 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6298 if test "${with_curses_5lib+set}" = set; then
6299   withval="$with_curses_5lib"
6300   cf_cv_screen=curses_5lib
6301 fi;
6302 fi;
6303 fi;
6304 fi;
6305 fi;
6306 fi;
6307
6308 echo "$as_me:6308: result: $cf_cv_screen" >&5
6309 echo "${ECHO_T}$cf_cv_screen" >&6
6310
6311 case $cf_cv_screen in
6312 (curses|curses_*)
6313
6314 echo "$as_me:6314: checking for extra include directories" >&5
6315 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6316 if test "${cf_cv_curses_incdir+set}" = set; then
6317   echo $ECHO_N "(cached) $ECHO_C" >&6
6318 else
6319
6320 cf_cv_curses_incdir=no
6321 case "$host_os" in
6322 (hpux10.*)
6323         if test "x$cf_cv_screen" = "xcurses_colr"
6324         then
6325                 test -d /usr/include/curses_colr && \
6326                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6327         fi
6328         ;;
6329 (sunos3*|sunos4*)
6330         if test "x$cf_cv_screen" = "xcurses_5lib"
6331         then
6332                 test -d /usr/5lib && \
6333                 test -d /usr/5include && \
6334                 cf_cv_curses_incdir="-I/usr/5include"
6335         fi
6336         ;;
6337 esac
6338
6339 fi
6340 echo "$as_me:6340: result: $cf_cv_curses_incdir" >&5
6341 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6342 if test "$cf_cv_curses_incdir" != no
6343 then
6344
6345         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6346         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6347
6348 fi
6349
6350 echo "$as_me:6350: checking if we have identified curses headers" >&5
6351 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6352 if test "${cf_cv_ncurses_header+set}" = set; then
6353   echo $ECHO_N "(cached) $ECHO_C" >&6
6354 else
6355
6356 cf_cv_ncurses_header=none
6357 for cf_header in \
6358         ncurses.h  \
6359         curses.h  ncurses/ncurses.h ncurses/curses.h
6360 do
6361 cat >"conftest.$ac_ext" <<_ACEOF
6362 #line 6362 "configure"
6363 #include "confdefs.h"
6364 #include <${cf_header}>
6365 int
6366 main (void)
6367 {
6368 initscr(); tgoto("?", 0,0)
6369   ;
6370   return 0;
6371 }
6372 _ACEOF
6373 rm -f "conftest.$ac_objext"
6374 if { (eval echo "$as_me:6374: \"$ac_compile\"") >&5
6375   (eval $ac_compile) 2>&5
6376   ac_status=$?
6377   echo "$as_me:6377: \$? = $ac_status" >&5
6378   (exit "$ac_status"); } &&
6379          { ac_try='test -s "conftest.$ac_objext"'
6380   { (eval echo "$as_me:6380: \"$ac_try\"") >&5
6381   (eval $ac_try) 2>&5
6382   ac_status=$?
6383   echo "$as_me:6383: \$? = $ac_status" >&5
6384   (exit "$ac_status"); }; }; then
6385   cf_cv_ncurses_header=$cf_header; break
6386 else
6387   echo "$as_me: failed program was:" >&5
6388 cat "conftest.$ac_ext" >&5
6389 fi
6390 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6391 done
6392
6393 fi
6394 echo "$as_me:6394: result: $cf_cv_ncurses_header" >&5
6395 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6396
6397 if test "$cf_cv_ncurses_header" = none ; then
6398         { { echo "$as_me:6398: error: No curses header-files found" >&5
6399 echo "$as_me: error: No curses header-files found" >&2;}
6400    { (exit 1); exit 1; }; }
6401 fi
6402
6403 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6404
6405 for ac_header in $cf_cv_ncurses_header
6406 do
6407 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6408 echo "$as_me:6408: checking for $ac_header" >&5
6409 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6410 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6411   echo $ECHO_N "(cached) $ECHO_C" >&6
6412 else
6413   cat >"conftest.$ac_ext" <<_ACEOF
6414 #line 6414 "configure"
6415 #include "confdefs.h"
6416 #include <$ac_header>
6417 _ACEOF
6418 if { (eval echo "$as_me:6418: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6419   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6420   ac_status=$?
6421   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6422   rm -f conftest.er1
6423   cat conftest.err >&5
6424   echo "$as_me:6424: \$? = $ac_status" >&5
6425   (exit "$ac_status"); } >/dev/null; then
6426   if test -s conftest.err; then
6427     ac_cpp_err=$ac_c_preproc_warn_flag
6428   else
6429     ac_cpp_err=
6430   fi
6431 else
6432   ac_cpp_err=yes
6433 fi
6434 if test -z "$ac_cpp_err"; then
6435   eval "$as_ac_Header=yes"
6436 else
6437   echo "$as_me: failed program was:" >&5
6438   cat "conftest.$ac_ext" >&5
6439   eval "$as_ac_Header=no"
6440 fi
6441 rm -f conftest.err "conftest.$ac_ext"
6442 fi
6443 echo "$as_me:6443: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6444 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6445 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6446   cat >>confdefs.h <<EOF
6447 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6448 EOF
6449
6450 fi
6451 done
6452
6453 echo "$as_me:6453: checking for terminfo header" >&5
6454 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6455 if test "${cf_cv_term_header+set}" = set; then
6456   echo $ECHO_N "(cached) $ECHO_C" >&6
6457 else
6458
6459 case "${cf_cv_ncurses_header}" in
6460 (*/ncurses.h|*/ncursesw.h)
6461         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6462         ;;
6463 (*)
6464         cf_term_header=term.h
6465         ;;
6466 esac
6467
6468 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6469 do
6470 cat >"conftest.$ac_ext" <<_ACEOF
6471 #line 6471 "configure"
6472 #include "confdefs.h"
6473 #include <stdio.h>
6474 #include <${cf_cv_ncurses_header:-curses.h}>
6475 #include <$cf_test>
6476
6477 int
6478 main (void)
6479 {
6480 int x = auto_left_margin; (void)x
6481   ;
6482   return 0;
6483 }
6484 _ACEOF
6485 rm -f "conftest.$ac_objext"
6486 if { (eval echo "$as_me:6486: \"$ac_compile\"") >&5
6487   (eval $ac_compile) 2>&5
6488   ac_status=$?
6489   echo "$as_me:6489: \$? = $ac_status" >&5
6490   (exit "$ac_status"); } &&
6491          { ac_try='test -s "conftest.$ac_objext"'
6492   { (eval echo "$as_me:6492: \"$ac_try\"") >&5
6493   (eval $ac_try) 2>&5
6494   ac_status=$?
6495   echo "$as_me:6495: \$? = $ac_status" >&5
6496   (exit "$ac_status"); }; }; then
6497
6498         cf_cv_term_header="$cf_test"
6499 else
6500   echo "$as_me: failed program was:" >&5
6501 cat "conftest.$ac_ext" >&5
6502
6503         cf_cv_term_header=unknown
6504
6505 fi
6506 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6507         test "$cf_cv_term_header" != unknown && break
6508 done
6509
6510 fi
6511 echo "$as_me:6511: result: $cf_cv_term_header" >&5
6512 echo "${ECHO_T}$cf_cv_term_header" >&6
6513
6514 # Set definitions to allow ifdef'ing to accommodate subdirectories
6515
6516 case "$cf_cv_term_header" in
6517 (*term.h)
6518
6519 cat >>confdefs.h <<\EOF
6520 #define HAVE_TERM_H 1
6521 EOF
6522
6523         ;;
6524 esac
6525
6526 case "$cf_cv_term_header" in
6527 (ncurses/term.h)
6528
6529 cat >>confdefs.h <<\EOF
6530 #define HAVE_NCURSES_TERM_H 1
6531 EOF
6532
6533         ;;
6534 (ncursesw/term.h)
6535
6536 cat >>confdefs.h <<\EOF
6537 #define HAVE_NCURSESW_TERM_H 1
6538 EOF
6539
6540         ;;
6541 esac
6542
6543 echo "$as_me:6543: checking for ncurses version" >&5
6544 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6545 if test "${cf_cv_ncurses_version+set}" = set; then
6546   echo $ECHO_N "(cached) $ECHO_C" >&6
6547 else
6548
6549         cf_cv_ncurses_version=no
6550         cf_tempfile=out$$
6551         rm -f "$cf_tempfile"
6552         if test "$cross_compiling" = yes; then
6553
6554         # This will not work if the preprocessor splits the line after the
6555         # Autoconf token.  The 'unproto' program does that.
6556         cat > "conftest.$ac_ext" <<EOF
6557 #include <${cf_cv_ncurses_header:-curses.h}>
6558 #undef Autoconf
6559 #ifdef NCURSES_VERSION
6560 Autoconf NCURSES_VERSION
6561 #else
6562 #ifdef __NCURSES_H
6563 Autoconf "old"
6564 #endif
6565 ;
6566 #endif
6567 EOF
6568         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6569         { (eval echo "$as_me:6569: \"$cf_try\"") >&5
6570   (eval $cf_try) 2>&5
6571   ac_status=$?
6572   echo "$as_me:6572: \$? = $ac_status" >&5
6573   (exit "$ac_status"); }
6574         if test -f conftest.out ; then
6575                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6576                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6577                 rm -f conftest.out
6578         fi
6579
6580 else
6581   cat >"conftest.$ac_ext" <<_ACEOF
6582 #line 6582 "configure"
6583 #include "confdefs.h"
6584
6585 #include <${cf_cv_ncurses_header:-curses.h}>
6586 #include <stdio.h>
6587 int main(void)
6588 {
6589         FILE *fp = fopen("$cf_tempfile", "w");
6590 #ifdef NCURSES_VERSION
6591 # ifdef NCURSES_VERSION_PATCH
6592         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6593 # else
6594         fprintf(fp, "%s\\n", NCURSES_VERSION);
6595 # endif
6596 #else
6597 # ifdef __NCURSES_H
6598         fprintf(fp, "old\\n");
6599 # else
6600         make an error
6601 # endif
6602 #endif
6603         ${cf_cv_main_return:-return}(0);
6604 }
6605 _ACEOF
6606 rm -f "conftest$ac_exeext"
6607 if { (eval echo "$as_me:6607: \"$ac_link\"") >&5
6608   (eval $ac_link) 2>&5
6609   ac_status=$?
6610   echo "$as_me:6610: \$? = $ac_status" >&5
6611   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6612   { (eval echo "$as_me:6612: \"$ac_try\"") >&5
6613   (eval $ac_try) 2>&5
6614   ac_status=$?
6615   echo "$as_me:6615: \$? = $ac_status" >&5
6616   (exit "$ac_status"); }; }; then
6617
6618         cf_cv_ncurses_version=`cat $cf_tempfile`
6619 else
6620   echo "$as_me: program exited with status $ac_status" >&5
6621 echo "$as_me: failed program was:" >&5
6622 cat "conftest.$ac_ext" >&5
6623 fi
6624 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6625 fi
6626         rm -f "$cf_tempfile"
6627
6628 fi
6629 echo "$as_me:6629: result: $cf_cv_ncurses_version" >&5
6630 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6631 test "$cf_cv_ncurses_version" = no ||
6632 cat >>confdefs.h <<\EOF
6633 #define NCURSES 1
6634 EOF
6635
6636 echo "$as_me:6636: checking if we have identified curses libraries" >&5
6637 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6638 cat >"conftest.$ac_ext" <<_ACEOF
6639 #line 6639 "configure"
6640 #include "confdefs.h"
6641 #include <${cf_cv_ncurses_header:-curses.h}>
6642 int
6643 main (void)
6644 {
6645 initscr(); tgoto("?", 0,0)
6646   ;
6647   return 0;
6648 }
6649 _ACEOF
6650 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6651 if { (eval echo "$as_me:6651: \"$ac_link\"") >&5
6652   (eval $ac_link) 2>&5
6653   ac_status=$?
6654   echo "$as_me:6654: \$? = $ac_status" >&5
6655   (exit "$ac_status"); } &&
6656          { ac_try='test -s "conftest$ac_exeext"'
6657   { (eval echo "$as_me:6657: \"$ac_try\"") >&5
6658   (eval $ac_try) 2>&5
6659   ac_status=$?
6660   echo "$as_me:6660: \$? = $ac_status" >&5
6661   (exit "$ac_status"); }; }; then
6662   cf_result=yes
6663 else
6664   echo "$as_me: failed program was:" >&5
6665 cat "conftest.$ac_ext" >&5
6666 cf_result=no
6667 fi
6668 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6669 echo "$as_me:6669: result: $cf_result" >&5
6670 echo "${ECHO_T}$cf_result" >&6
6671
6672 if test "$cf_result" = no ; then
6673 case "$host_os" in
6674 (freebsd*)
6675         echo "$as_me:6675: checking for tgoto in -lmytinfo" >&5
6676 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6677 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6678   echo $ECHO_N "(cached) $ECHO_C" >&6
6679 else
6680   ac_check_lib_save_LIBS=$LIBS
6681 LIBS="-lmytinfo  $LIBS"
6682 cat >"conftest.$ac_ext" <<_ACEOF
6683 #line 6683 "configure"
6684 #include "confdefs.h"
6685
6686 /* Override any gcc2 internal prototype to avoid an error.  */
6687 #ifdef __cplusplus
6688 extern "C"
6689 #endif
6690 /* We use char because int might match the return type of a gcc2
6691    builtin and then its argument prototype would still apply.  */
6692 char tgoto ();
6693 int
6694 main (void)
6695 {
6696 tgoto ();
6697   ;
6698   return 0;
6699 }
6700 _ACEOF
6701 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6702 if { (eval echo "$as_me:6702: \"$ac_link\"") >&5
6703   (eval $ac_link) 2>&5
6704   ac_status=$?
6705   echo "$as_me:6705: \$? = $ac_status" >&5
6706   (exit "$ac_status"); } &&
6707          { ac_try='test -s "conftest$ac_exeext"'
6708   { (eval echo "$as_me:6708: \"$ac_try\"") >&5
6709   (eval $ac_try) 2>&5
6710   ac_status=$?
6711   echo "$as_me:6711: \$? = $ac_status" >&5
6712   (exit "$ac_status"); }; }; then
6713   ac_cv_lib_mytinfo_tgoto=yes
6714 else
6715   echo "$as_me: failed program was:" >&5
6716 cat "conftest.$ac_ext" >&5
6717 ac_cv_lib_mytinfo_tgoto=no
6718 fi
6719 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6720 LIBS=$ac_check_lib_save_LIBS
6721 fi
6722 echo "$as_me:6722: result: $ac_cv_lib_mytinfo_tgoto" >&5
6723 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6724 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6725
6726 cf_add_libs="$LIBS"
6727 # reverse order
6728 cf_add_0lib=
6729 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6730 # filter duplicates
6731 for cf_add_1lib in $cf_add_0lib; do
6732         for cf_add_2lib in $cf_add_libs; do
6733                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6734                         cf_add_1lib=
6735                         break
6736                 fi
6737         done
6738         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6739 done
6740 LIBS="$cf_add_libs"
6741
6742 fi
6743
6744         ;;
6745 (hpux10.*)
6746         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6747         # next (1998), and xcurses "newer" (2000).  There is no header file for
6748         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6749         # term.h) for cur_colr
6750         if test "x$cf_cv_screen" = "xcurses_colr"
6751         then
6752                 echo "$as_me:6752: checking for initscr in -lcur_colr" >&5
6753 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6754 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6755   echo $ECHO_N "(cached) $ECHO_C" >&6
6756 else
6757   ac_check_lib_save_LIBS=$LIBS
6758 LIBS="-lcur_colr  $LIBS"
6759 cat >"conftest.$ac_ext" <<_ACEOF
6760 #line 6760 "configure"
6761 #include "confdefs.h"
6762
6763 /* Override any gcc2 internal prototype to avoid an error.  */
6764 #ifdef __cplusplus
6765 extern "C"
6766 #endif
6767 /* We use char because int might match the return type of a gcc2
6768    builtin and then its argument prototype would still apply.  */
6769 char initscr ();
6770 int
6771 main (void)
6772 {
6773 initscr ();
6774   ;
6775   return 0;
6776 }
6777 _ACEOF
6778 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6779 if { (eval echo "$as_me:6779: \"$ac_link\"") >&5
6780   (eval $ac_link) 2>&5
6781   ac_status=$?
6782   echo "$as_me:6782: \$? = $ac_status" >&5
6783   (exit "$ac_status"); } &&
6784          { ac_try='test -s "conftest$ac_exeext"'
6785   { (eval echo "$as_me:6785: \"$ac_try\"") >&5
6786   (eval $ac_try) 2>&5
6787   ac_status=$?
6788   echo "$as_me:6788: \$? = $ac_status" >&5
6789   (exit "$ac_status"); }; }; then
6790   ac_cv_lib_cur_colr_initscr=yes
6791 else
6792   echo "$as_me: failed program was:" >&5
6793 cat "conftest.$ac_ext" >&5
6794 ac_cv_lib_cur_colr_initscr=no
6795 fi
6796 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6797 LIBS=$ac_check_lib_save_LIBS
6798 fi
6799 echo "$as_me:6799: result: $ac_cv_lib_cur_colr_initscr" >&5
6800 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6801 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
6802
6803 cf_add_libs="$LIBS"
6804 # reverse order
6805 cf_add_0lib=
6806 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6807 # filter duplicates
6808 for cf_add_1lib in $cf_add_0lib; do
6809         for cf_add_2lib in $cf_add_libs; do
6810                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6811                         cf_add_1lib=
6812                         break
6813                 fi
6814         done
6815         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6816 done
6817 LIBS="$cf_add_libs"
6818
6819                         ac_cv_func_initscr=yes
6820
6821 else
6822
6823                 echo "$as_me:6823: checking for initscr in -lHcurses" >&5
6824 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6825 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6826   echo $ECHO_N "(cached) $ECHO_C" >&6
6827 else
6828   ac_check_lib_save_LIBS=$LIBS
6829 LIBS="-lHcurses  $LIBS"
6830 cat >"conftest.$ac_ext" <<_ACEOF
6831 #line 6831 "configure"
6832 #include "confdefs.h"
6833
6834 /* Override any gcc2 internal prototype to avoid an error.  */
6835 #ifdef __cplusplus
6836 extern "C"
6837 #endif
6838 /* We use char because int might match the return type of a gcc2
6839    builtin and then its argument prototype would still apply.  */
6840 char initscr ();
6841 int
6842 main (void)
6843 {
6844 initscr ();
6845   ;
6846   return 0;
6847 }
6848 _ACEOF
6849 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6850 if { (eval echo "$as_me:6850: \"$ac_link\"") >&5
6851   (eval $ac_link) 2>&5
6852   ac_status=$?
6853   echo "$as_me:6853: \$? = $ac_status" >&5
6854   (exit "$ac_status"); } &&
6855          { ac_try='test -s "conftest$ac_exeext"'
6856   { (eval echo "$as_me:6856: \"$ac_try\"") >&5
6857   (eval $ac_try) 2>&5
6858   ac_status=$?
6859   echo "$as_me:6859: \$? = $ac_status" >&5
6860   (exit "$ac_status"); }; }; then
6861   ac_cv_lib_Hcurses_initscr=yes
6862 else
6863   echo "$as_me: failed program was:" >&5
6864 cat "conftest.$ac_ext" >&5
6865 ac_cv_lib_Hcurses_initscr=no
6866 fi
6867 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6868 LIBS=$ac_check_lib_save_LIBS
6869 fi
6870 echo "$as_me:6870: result: $ac_cv_lib_Hcurses_initscr" >&5
6871 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6872 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
6873
6874                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6875
6876 cf_add_libs="$LIBS"
6877 # reverse order
6878 cf_add_0lib=
6879 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6880 # filter duplicates
6881 for cf_add_1lib in $cf_add_0lib; do
6882         for cf_add_2lib in $cf_add_libs; do
6883                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6884                         cf_add_1lib=
6885                         break
6886                 fi
6887         done
6888         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6889 done
6890 LIBS="$cf_add_libs"
6891
6892         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6893         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6894
6895                         ac_cv_func_initscr=yes
6896
6897 fi
6898
6899 fi
6900
6901         fi
6902         ;;
6903 (linux*)
6904         case `arch 2>/dev/null` in
6905         (x86_64)
6906                 if test -d /lib64
6907                 then
6908
6909 if test -n "/lib64" ; then
6910         for cf_add_libdir in /lib64
6911         do
6912                 if test "$cf_add_libdir" = /usr/lib ; then
6913                         :
6914                 elif test -d "$cf_add_libdir"
6915                 then
6916                         cf_have_libdir=no
6917                         if test -n "$LDFLAGS$LIBS" ; then
6918                                 # a loop is needed to ensure we can add subdirs of existing dirs
6919                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6920                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6921                                                 cf_have_libdir=yes; break
6922                                         fi
6923                                 done
6924                         fi
6925                         if test "$cf_have_libdir" = no ; then
6926                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6927
6928 echo "${as_me:-configure}:6928: testing adding $cf_add_libdir to library-path ..." 1>&5
6929
6930                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6931                         fi
6932                 fi
6933         done
6934 fi
6935
6936                 else
6937
6938 if test -n "/lib" ; then
6939         for cf_add_libdir in /lib
6940         do
6941                 if test "$cf_add_libdir" = /usr/lib ; then
6942                         :
6943                 elif test -d "$cf_add_libdir"
6944                 then
6945                         cf_have_libdir=no
6946                         if test -n "$LDFLAGS$LIBS" ; then
6947                                 # a loop is needed to ensure we can add subdirs of existing dirs
6948                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6949                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6950                                                 cf_have_libdir=yes; break
6951                                         fi
6952                                 done
6953                         fi
6954                         if test "$cf_have_libdir" = no ; then
6955                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6956
6957 echo "${as_me:-configure}:6957: testing adding $cf_add_libdir to library-path ..." 1>&5
6958
6959                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6960                         fi
6961                 fi
6962         done
6963 fi
6964
6965                 fi
6966                 ;;
6967         (*)
6968
6969 if test -n "/lib" ; then
6970         for cf_add_libdir in /lib
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                 ;;
6997         esac
6998         ;;
6999 (sunos3*|sunos4*)
7000         if test "x$cf_cv_screen" = "xcurses_5lib"
7001         then
7002                 if test -d /usr/5lib ; then
7003
7004 if test -n "/usr/5lib" ; then
7005         for cf_add_libdir in /usr/5lib
7006         do
7007                 if test "$cf_add_libdir" = /usr/lib ; then
7008                         :
7009                 elif test -d "$cf_add_libdir"
7010                 then
7011                         cf_have_libdir=no
7012                         if test -n "$LDFLAGS$LIBS" ; then
7013                                 # a loop is needed to ensure we can add subdirs of existing dirs
7014                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7015                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7016                                                 cf_have_libdir=yes; break
7017                                         fi
7018                                 done
7019                         fi
7020                         if test "$cf_have_libdir" = no ; then
7021                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7022
7023 echo "${as_me:-configure}:7023: testing adding $cf_add_libdir to library-path ..." 1>&5
7024
7025                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7026                         fi
7027                 fi
7028         done
7029 fi
7030
7031 cf_add_libs="$LIBS"
7032 # reverse order
7033 cf_add_0lib=
7034 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7035 # filter duplicates
7036 for cf_add_1lib in $cf_add_0lib; do
7037         for cf_add_2lib in $cf_add_libs; do
7038                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7039                         cf_add_1lib=
7040                         break
7041                 fi
7042         done
7043         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7044 done
7045 LIBS="$cf_add_libs"
7046
7047                 fi
7048         fi
7049         ac_cv_func_initscr=yes
7050         ;;
7051 esac
7052
7053 if test ".$ac_cv_func_initscr" != .yes ; then
7054         cf_save_LIBS="$LIBS"
7055
7056         if test ".${cf_cv_ncurses_version:-no}" != .no
7057         then
7058                 cf_check_list="ncurses curses cursesX"
7059         else
7060                 cf_check_list="cursesX curses ncurses"
7061         fi
7062
7063         # Check for library containing tgoto.  Do this before curses library
7064         # because it may be needed to link the test-case for initscr.
7065         if test "x$cf_term_lib" = x
7066         then
7067                 echo "$as_me:7067: checking for tgoto" >&5
7068 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7069 if test "${ac_cv_func_tgoto+set}" = set; then
7070   echo $ECHO_N "(cached) $ECHO_C" >&6
7071 else
7072   cat >"conftest.$ac_ext" <<_ACEOF
7073 #line 7073 "configure"
7074 #include "confdefs.h"
7075 #define tgoto autoconf_temporary
7076 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7077 #undef tgoto
7078
7079 #ifdef __cplusplus
7080 extern "C"
7081 #endif
7082
7083 /* We use char because int might match the return type of a gcc2
7084    builtin and then its argument prototype would still apply.  */
7085 char tgoto (void);
7086
7087 int
7088 main (void)
7089 {
7090
7091 /* The GNU C library defines stubs for functions which it implements
7092     to always fail with ENOSYS.  Some functions are actually named
7093     something starting with __ and the normal name is an alias.  */
7094 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7095 #error found stub for tgoto
7096 #endif
7097
7098         return tgoto ();
7099   ;
7100   return 0;
7101 }
7102 _ACEOF
7103 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7104 if { (eval echo "$as_me:7104: \"$ac_link\"") >&5
7105   (eval $ac_link) 2>&5
7106   ac_status=$?
7107   echo "$as_me:7107: \$? = $ac_status" >&5
7108   (exit "$ac_status"); } &&
7109          { ac_try='test -s "conftest$ac_exeext"'
7110   { (eval echo "$as_me:7110: \"$ac_try\"") >&5
7111   (eval $ac_try) 2>&5
7112   ac_status=$?
7113   echo "$as_me:7113: \$? = $ac_status" >&5
7114   (exit "$ac_status"); }; }; then
7115   ac_cv_func_tgoto=yes
7116 else
7117   echo "$as_me: failed program was:" >&5
7118 cat "conftest.$ac_ext" >&5
7119 ac_cv_func_tgoto=no
7120 fi
7121 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7122 fi
7123 echo "$as_me:7123: result: $ac_cv_func_tgoto" >&5
7124 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7125 if test "$ac_cv_func_tgoto" = yes; then
7126   cf_term_lib=predefined
7127 else
7128
7129                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7130                         do
7131                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7132 echo "$as_me:7132: checking for tgoto in -l$cf_term_lib" >&5
7133 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7134 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7135   echo $ECHO_N "(cached) $ECHO_C" >&6
7136 else
7137   ac_check_lib_save_LIBS=$LIBS
7138 LIBS="-l$cf_term_lib  $LIBS"
7139 cat >"conftest.$ac_ext" <<_ACEOF
7140 #line 7140 "configure"
7141 #include "confdefs.h"
7142
7143 /* Override any gcc2 internal prototype to avoid an error.  */
7144 #ifdef __cplusplus
7145 extern "C"
7146 #endif
7147 /* We use char because int might match the return type of a gcc2
7148    builtin and then its argument prototype would still apply.  */
7149 char tgoto ();
7150 int
7151 main (void)
7152 {
7153 tgoto ();
7154   ;
7155   return 0;
7156 }
7157 _ACEOF
7158 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7159 if { (eval echo "$as_me:7159: \"$ac_link\"") >&5
7160   (eval $ac_link) 2>&5
7161   ac_status=$?
7162   echo "$as_me:7162: \$? = $ac_status" >&5
7163   (exit "$ac_status"); } &&
7164          { ac_try='test -s "conftest$ac_exeext"'
7165   { (eval echo "$as_me:7165: \"$ac_try\"") >&5
7166   (eval $ac_try) 2>&5
7167   ac_status=$?
7168   echo "$as_me:7168: \$? = $ac_status" >&5
7169   (exit "$ac_status"); }; }; then
7170   eval "$as_ac_Lib=yes"
7171 else
7172   echo "$as_me: failed program was:" >&5
7173 cat "conftest.$ac_ext" >&5
7174 eval "$as_ac_Lib=no"
7175 fi
7176 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7177 LIBS=$ac_check_lib_save_LIBS
7178 fi
7179 echo "$as_me:7179: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7180 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7181 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7182
7183                                         : "${cf_nculib_root:=$cf_term_lib}"
7184                                         break
7185
7186 fi
7187
7188                         done
7189
7190 fi
7191
7192         fi
7193
7194         # Check for library containing initscr
7195         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7196         if test "x$cf_curs_lib" = x
7197         then
7198                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7199                 do
7200                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7201                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7202                                 echo "$as_me:7202: checking if we can link with $cf_curs_lib library" >&5
7203 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7204                                 cat >"conftest.$ac_ext" <<_ACEOF
7205 #line 7205 "configure"
7206 #include "confdefs.h"
7207 #include <${cf_cv_ncurses_header:-curses.h}>
7208 int
7209 main (void)
7210 {
7211 initscr()
7212   ;
7213   return 0;
7214 }
7215 _ACEOF
7216 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7217 if { (eval echo "$as_me:7217: \"$ac_link\"") >&5
7218   (eval $ac_link) 2>&5
7219   ac_status=$?
7220   echo "$as_me:7220: \$? = $ac_status" >&5
7221   (exit "$ac_status"); } &&
7222          { ac_try='test -s "conftest$ac_exeext"'
7223   { (eval echo "$as_me:7223: \"$ac_try\"") >&5
7224   (eval $ac_try) 2>&5
7225   ac_status=$?
7226   echo "$as_me:7226: \$? = $ac_status" >&5
7227   (exit "$ac_status"); }; }; then
7228   cf_result=yes
7229 else
7230   echo "$as_me: failed program was:" >&5
7231 cat "conftest.$ac_ext" >&5
7232 cf_result=no
7233 fi
7234 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7235                                 echo "$as_me:7235: result: $cf_result" >&5
7236 echo "${ECHO_T}$cf_result" >&6
7237                                 test "$cf_result" = yes && break
7238                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7239                                 cf_result=no
7240                         elif test "$cf_term_lib" != predefined ; then
7241                                 echo "$as_me:7241: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7242 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7243                                 cat >"conftest.$ac_ext" <<_ACEOF
7244 #line 7244 "configure"
7245 #include "confdefs.h"
7246 #include <${cf_cv_ncurses_header:-curses.h}>
7247 int
7248 main (void)
7249 {
7250 initscr(); tgoto((char *)0, 0, 0);
7251   ;
7252   return 0;
7253 }
7254 _ACEOF
7255 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7256 if { (eval echo "$as_me:7256: \"$ac_link\"") >&5
7257   (eval $ac_link) 2>&5
7258   ac_status=$?
7259   echo "$as_me:7259: \$? = $ac_status" >&5
7260   (exit "$ac_status"); } &&
7261          { ac_try='test -s "conftest$ac_exeext"'
7262   { (eval echo "$as_me:7262: \"$ac_try\"") >&5
7263   (eval $ac_try) 2>&5
7264   ac_status=$?
7265   echo "$as_me:7265: \$? = $ac_status" >&5
7266   (exit "$ac_status"); }; }; then
7267   cf_result=no
7268 else
7269   echo "$as_me: failed program was:" >&5
7270 cat "conftest.$ac_ext" >&5
7271
7272                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7273                                         cat >"conftest.$ac_ext" <<_ACEOF
7274 #line 7274 "configure"
7275 #include "confdefs.h"
7276 #include <${cf_cv_ncurses_header:-curses.h}>
7277 int
7278 main (void)
7279 {
7280 initscr()
7281   ;
7282   return 0;
7283 }
7284 _ACEOF
7285 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7286 if { (eval echo "$as_me:7286: \"$ac_link\"") >&5
7287   (eval $ac_link) 2>&5
7288   ac_status=$?
7289   echo "$as_me:7289: \$? = $ac_status" >&5
7290   (exit "$ac_status"); } &&
7291          { ac_try='test -s "conftest$ac_exeext"'
7292   { (eval echo "$as_me:7292: \"$ac_try\"") >&5
7293   (eval $ac_try) 2>&5
7294   ac_status=$?
7295   echo "$as_me:7295: \$? = $ac_status" >&5
7296   (exit "$ac_status"); }; }; then
7297   cf_result=yes
7298 else
7299   echo "$as_me: failed program was:" >&5
7300 cat "conftest.$ac_ext" >&5
7301 cf_result=error
7302 fi
7303 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7304
7305 fi
7306 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7307                                 echo "$as_me:7307: result: $cf_result" >&5
7308 echo "${ECHO_T}$cf_result" >&6
7309                                 test "$cf_result" != error && break
7310                         fi
7311                 done
7312         fi
7313         test "$cf_curs_lib" = unknown && { { echo "$as_me:7313: error: no curses library found" >&5
7314 echo "$as_me: error: no curses library found" >&2;}
7315    { (exit 1); exit 1; }; }
7316 fi
7317 fi
7318
7319         ;;
7320 (ncursesw*)
7321
7322 for ac_header in wchar.h
7323 do
7324 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7325 echo "$as_me:7325: checking for $ac_header" >&5
7326 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7327 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7328   echo $ECHO_N "(cached) $ECHO_C" >&6
7329 else
7330   cat >"conftest.$ac_ext" <<_ACEOF
7331 #line 7331 "configure"
7332 #include "confdefs.h"
7333 #include <$ac_header>
7334 _ACEOF
7335 if { (eval echo "$as_me:7335: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7336   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7337   ac_status=$?
7338   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7339   rm -f conftest.er1
7340   cat conftest.err >&5
7341   echo "$as_me:7341: \$? = $ac_status" >&5
7342   (exit "$ac_status"); } >/dev/null; then
7343   if test -s conftest.err; then
7344     ac_cpp_err=$ac_c_preproc_warn_flag
7345   else
7346     ac_cpp_err=
7347   fi
7348 else
7349   ac_cpp_err=yes
7350 fi
7351 if test -z "$ac_cpp_err"; then
7352   eval "$as_ac_Header=yes"
7353 else
7354   echo "$as_me: failed program was:" >&5
7355   cat "conftest.$ac_ext" >&5
7356   eval "$as_ac_Header=no"
7357 fi
7358 rm -f conftest.err "conftest.$ac_ext"
7359 fi
7360 echo "$as_me:7360: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7361 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7362 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7363   cat >>confdefs.h <<EOF
7364 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7365 EOF
7366
7367 fi
7368 done
7369
7370 echo "$as_me:7370: checking for multibyte character support" >&5
7371 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7372 if test "${cf_cv_utf8_lib+set}" = set; then
7373   echo $ECHO_N "(cached) $ECHO_C" >&6
7374 else
7375
7376         cf_save_LIBS="$LIBS"
7377         cat >"conftest.$ac_ext" <<_ACEOF
7378 #line 7378 "configure"
7379 #include "confdefs.h"
7380
7381 #include <stdlib.h>
7382 #include <stdio.h>
7383 #ifdef HAVE_WCHAR_H
7384 #include <wchar.h>
7385 #endif
7386
7387 int
7388 main (void)
7389 {
7390 putwc(0,0);
7391   ;
7392   return 0;
7393 }
7394 _ACEOF
7395 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7396 if { (eval echo "$as_me:7396: \"$ac_link\"") >&5
7397   (eval $ac_link) 2>&5
7398   ac_status=$?
7399   echo "$as_me:7399: \$? = $ac_status" >&5
7400   (exit "$ac_status"); } &&
7401          { ac_try='test -s "conftest$ac_exeext"'
7402   { (eval echo "$as_me:7402: \"$ac_try\"") >&5
7403   (eval $ac_try) 2>&5
7404   ac_status=$?
7405   echo "$as_me:7405: \$? = $ac_status" >&5
7406   (exit "$ac_status"); }; }; then
7407   cf_cv_utf8_lib=yes
7408 else
7409   echo "$as_me: failed program was:" >&5
7410 cat "conftest.$ac_ext" >&5
7411
7412 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7413 # will be set on completion of the AC_TRY_LINK below.
7414 cf_cv_header_path_utf8=
7415 cf_cv_library_path_utf8=
7416
7417 echo "${as_me:-configure}:7417: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7418
7419 cf_save_LIBS="$LIBS"
7420
7421 cat >"conftest.$ac_ext" <<_ACEOF
7422 #line 7422 "configure"
7423 #include "confdefs.h"
7424
7425 #include <libutf8.h>
7426 int
7427 main (void)
7428 {
7429 putwc(0,0);
7430   ;
7431   return 0;
7432 }
7433 _ACEOF
7434 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7435 if { (eval echo "$as_me:7435: \"$ac_link\"") >&5
7436   (eval $ac_link) 2>&5
7437   ac_status=$?
7438   echo "$as_me:7438: \$? = $ac_status" >&5
7439   (exit "$ac_status"); } &&
7440          { ac_try='test -s "conftest$ac_exeext"'
7441   { (eval echo "$as_me:7441: \"$ac_try\"") >&5
7442   (eval $ac_try) 2>&5
7443   ac_status=$?
7444   echo "$as_me:7444: \$? = $ac_status" >&5
7445   (exit "$ac_status"); }; }; then
7446
7447         cf_cv_find_linkage_utf8=yes
7448         cf_cv_header_path_utf8=/usr/include
7449         cf_cv_library_path_utf8=/usr/lib
7450
7451 else
7452   echo "$as_me: failed program was:" >&5
7453 cat "conftest.$ac_ext" >&5
7454
7455 LIBS="-lutf8  $cf_save_LIBS"
7456
7457 cat >"conftest.$ac_ext" <<_ACEOF
7458 #line 7458 "configure"
7459 #include "confdefs.h"
7460
7461 #include <libutf8.h>
7462 int
7463 main (void)
7464 {
7465 putwc(0,0);
7466   ;
7467   return 0;
7468 }
7469 _ACEOF
7470 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7471 if { (eval echo "$as_me:7471: \"$ac_link\"") >&5
7472   (eval $ac_link) 2>&5
7473   ac_status=$?
7474   echo "$as_me:7474: \$? = $ac_status" >&5
7475   (exit "$ac_status"); } &&
7476          { ac_try='test -s "conftest$ac_exeext"'
7477   { (eval echo "$as_me:7477: \"$ac_try\"") >&5
7478   (eval $ac_try) 2>&5
7479   ac_status=$?
7480   echo "$as_me:7480: \$? = $ac_status" >&5
7481   (exit "$ac_status"); }; }; then
7482
7483         cf_cv_find_linkage_utf8=yes
7484         cf_cv_header_path_utf8=/usr/include
7485         cf_cv_library_path_utf8=/usr/lib
7486         cf_cv_library_file_utf8="-lutf8"
7487
7488 else
7489   echo "$as_me: failed program was:" >&5
7490 cat "conftest.$ac_ext" >&5
7491
7492         cf_cv_find_linkage_utf8=no
7493         LIBS="$cf_save_LIBS"
7494
7495         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7496
7497 echo "${as_me:-configure}:7497: testing find linkage for utf8 library ..." 1>&5
7498
7499 echo "${as_me:-configure}:7499: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7500
7501         cf_save_CPPFLAGS="$CPPFLAGS"
7502         cf_test_CPPFLAGS="$CPPFLAGS"
7503
7504 cf_search=
7505
7506 # collect the current set of include-directories from compiler flags
7507 cf_header_path_list=""
7508 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7509         for cf_header_path in $CPPFLAGS $CFLAGS
7510         do
7511                 case "$cf_header_path" in
7512                 (-I*)
7513                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7514
7515 test "x$cf_header_path" != "xNONE" && \
7516 test -d "$cf_header_path" && \
7517  {
7518         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7519         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7520         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7521         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7522         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7523         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7524 }
7525
7526                         cf_header_path_list="$cf_header_path_list $cf_search"
7527                         ;;
7528                 esac
7529         done
7530 fi
7531
7532 # add the variations for the package we are looking for
7533
7534 cf_search=
7535
7536 test "x$prefix" != "xNONE" && \
7537 test -d "$prefix" && \
7538  {
7539         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7540         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7541         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7542         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7543         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7544         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7545 }
7546
7547 for cf_subdir_prefix in \
7548         /usr \
7549         /usr/local \
7550         /usr/pkg \
7551         /opt \
7552         /opt/local \
7553         $HOME
7554 do
7555
7556 test "x$cf_subdir_prefix" != "x$prefix" && \
7557 test -d "$cf_subdir_prefix" && \
7558 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7559         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7560         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7561         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7562         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7563         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7564         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7565 }
7566
7567 done
7568
7569 test "$includedir" != NONE && \
7570 test "$includedir" != "/usr/include" && \
7571 test -d "$includedir" && {
7572         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7573         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7574 }
7575
7576 test "$oldincludedir" != NONE && \
7577 test "$oldincludedir" != "/usr/include" && \
7578 test -d "$oldincludedir" && {
7579         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7580         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7581 }
7582
7583 cf_search="$cf_search $cf_header_path_list"
7584
7585         for cf_cv_header_path_utf8 in $cf_search
7586         do
7587                 if test -d "$cf_cv_header_path_utf8" ; then
7588                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7589
7590 echo "${as_me:-configure}:7590: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7591
7592                         CPPFLAGS="$cf_save_CPPFLAGS"
7593
7594         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7595         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7596
7597                         cat >"conftest.$ac_ext" <<_ACEOF
7598 #line 7598 "configure"
7599 #include "confdefs.h"
7600
7601 #include <libutf8.h>
7602 int
7603 main (void)
7604 {
7605 putwc(0,0);
7606   ;
7607   return 0;
7608 }
7609 _ACEOF
7610 rm -f "conftest.$ac_objext"
7611 if { (eval echo "$as_me:7611: \"$ac_compile\"") >&5
7612   (eval $ac_compile) 2>&5
7613   ac_status=$?
7614   echo "$as_me:7614: \$? = $ac_status" >&5
7615   (exit "$ac_status"); } &&
7616          { ac_try='test -s "conftest.$ac_objext"'
7617   { (eval echo "$as_me:7617: \"$ac_try\"") >&5
7618   (eval $ac_try) 2>&5
7619   ac_status=$?
7620   echo "$as_me:7620: \$? = $ac_status" >&5
7621   (exit "$ac_status"); }; }; then
7622
7623                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7624
7625 echo "${as_me:-configure}:7625: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7626
7627                                 cf_cv_find_linkage_utf8=maybe
7628                                 cf_test_CPPFLAGS="$CPPFLAGS"
7629                                 break
7630 else
7631   echo "$as_me: failed program was:" >&5
7632 cat "conftest.$ac_ext" >&5
7633
7634                                 CPPFLAGS="$cf_save_CPPFLAGS"
7635
7636 fi
7637 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7638                 fi
7639         done
7640
7641         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7642
7643 echo "${as_me:-configure}:7643: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7644
7645                 cf_save_LIBS="$LIBS"
7646                 cf_save_LDFLAGS="$LDFLAGS"
7647
7648                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7649
7650 cf_search=
7651 cf_library_path_list=""
7652 if test -n "${LDFLAGS}${LIBS}" ; then
7653         for cf_library_path in $LDFLAGS $LIBS
7654         do
7655                 case "$cf_library_path" in
7656                 (-L*)
7657                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7658
7659 test "x$cf_library_path" != "xNONE" && \
7660 test -d "$cf_library_path" && \
7661  {
7662         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7663         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7664         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7665         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7666         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7667         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7668 }
7669
7670                         cf_library_path_list="$cf_library_path_list $cf_search"
7671                         ;;
7672                 esac
7673         done
7674 fi
7675
7676 cf_search=
7677
7678 test "x$prefix" != "xNONE" && \
7679 test -d "$prefix" && \
7680  {
7681         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7682         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7683         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7684         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7685         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7686         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7687 }
7688
7689 for cf_subdir_prefix in \
7690         /usr \
7691         /usr/local \
7692         /usr/pkg \
7693         /opt \
7694         /opt/local \
7695         $HOME
7696 do
7697
7698 test "x$cf_subdir_prefix" != "x$prefix" && \
7699 test -d "$cf_subdir_prefix" && \
7700 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7701         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7702         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7703         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7704         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7705         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7706         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7707 }
7708
7709 done
7710
7711 cf_search="$cf_library_path_list $cf_search"
7712
7713                         for cf_cv_library_path_utf8 in $cf_search
7714                         do
7715                                 if test -d "$cf_cv_library_path_utf8" ; then
7716                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7717
7718 echo "${as_me:-configure}:7718: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7719
7720                                         CPPFLAGS="$cf_test_CPPFLAGS"
7721                                         LIBS="-lutf8  $cf_save_LIBS"
7722                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7723                                         cat >"conftest.$ac_ext" <<_ACEOF
7724 #line 7724 "configure"
7725 #include "confdefs.h"
7726
7727 #include <libutf8.h>
7728 int
7729 main (void)
7730 {
7731 putwc(0,0);
7732   ;
7733   return 0;
7734 }
7735 _ACEOF
7736 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7737 if { (eval echo "$as_me:7737: \"$ac_link\"") >&5
7738   (eval $ac_link) 2>&5
7739   ac_status=$?
7740   echo "$as_me:7740: \$? = $ac_status" >&5
7741   (exit "$ac_status"); } &&
7742          { ac_try='test -s "conftest$ac_exeext"'
7743   { (eval echo "$as_me:7743: \"$ac_try\"") >&5
7744   (eval $ac_try) 2>&5
7745   ac_status=$?
7746   echo "$as_me:7746: \$? = $ac_status" >&5
7747   (exit "$ac_status"); }; }; then
7748
7749                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7750
7751 echo "${as_me:-configure}:7751: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7752
7753                                         cf_cv_find_linkage_utf8=yes
7754                                         cf_cv_library_file_utf8="-lutf8"
7755                                         break
7756 else
7757   echo "$as_me: failed program was:" >&5
7758 cat "conftest.$ac_ext" >&5
7759
7760                                         CPPFLAGS="$cf_save_CPPFLAGS"
7761                                         LIBS="$cf_save_LIBS"
7762                                         LDFLAGS="$cf_save_LDFLAGS"
7763
7764 fi
7765 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7766                                 fi
7767                         done
7768                         CPPFLAGS="$cf_save_CPPFLAGS"
7769                         LDFLAGS="$cf_save_LDFLAGS"
7770                 fi
7771
7772         else
7773                 cf_cv_find_linkage_utf8=no
7774         fi
7775
7776 fi
7777 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7778
7779 fi
7780 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7781
7782 LIBS="$cf_save_LIBS"
7783
7784 if test "$cf_cv_find_linkage_utf8" = yes ; then
7785 cf_cv_utf8_lib=add-on
7786 else
7787 cf_cv_utf8_lib=no
7788 fi
7789
7790 fi
7791 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7792 fi
7793 echo "$as_me:7793: result: $cf_cv_utf8_lib" >&5
7794 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7795
7796 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7797 # ncurses/ncursesw:
7798 if test "$cf_cv_utf8_lib" = "add-on" ; then
7799
7800 cat >>confdefs.h <<\EOF
7801 #define HAVE_LIBUTF8_H 1
7802 EOF
7803
7804 if test -n "$cf_cv_header_path_utf8" ; then
7805   for cf_add_incdir in $cf_cv_header_path_utf8
7806   do
7807         while test "$cf_add_incdir" != /usr/include
7808         do
7809           if test -d "$cf_add_incdir"
7810           then
7811                 cf_have_incdir=no
7812                 if test -n "$CFLAGS$CPPFLAGS" ; then
7813                   # a loop is needed to ensure we can add subdirs of existing dirs
7814                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7815                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7816                           cf_have_incdir=yes; break
7817                         fi
7818                   done
7819                 fi
7820
7821                 if test "$cf_have_incdir" = no ; then
7822                   if test "$cf_add_incdir" = /usr/local/include ; then
7823                         if test "$GCC" = yes
7824                         then
7825                           cf_save_CPPFLAGS=$CPPFLAGS
7826
7827         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7828         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7829
7830                           cat >"conftest.$ac_ext" <<_ACEOF
7831 #line 7831 "configure"
7832 #include "confdefs.h"
7833 #include <stdio.h>
7834 int
7835 main (void)
7836 {
7837 printf("Hello")
7838   ;
7839   return 0;
7840 }
7841 _ACEOF
7842 rm -f "conftest.$ac_objext"
7843 if { (eval echo "$as_me:7843: \"$ac_compile\"") >&5
7844   (eval $ac_compile) 2>&5
7845   ac_status=$?
7846   echo "$as_me:7846: \$? = $ac_status" >&5
7847   (exit "$ac_status"); } &&
7848          { ac_try='test -s "conftest.$ac_objext"'
7849   { (eval echo "$as_me:7849: \"$ac_try\"") >&5
7850   (eval $ac_try) 2>&5
7851   ac_status=$?
7852   echo "$as_me:7852: \$? = $ac_status" >&5
7853   (exit "$ac_status"); }; }; then
7854   :
7855 else
7856   echo "$as_me: failed program was:" >&5
7857 cat "conftest.$ac_ext" >&5
7858 cf_have_incdir=yes
7859 fi
7860 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7861                           CPPFLAGS=$cf_save_CPPFLAGS
7862                         fi
7863                   fi
7864                 fi
7865
7866                 if test "$cf_have_incdir" = no ; then
7867                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7868
7869 echo "${as_me:-configure}:7869: testing adding $cf_add_incdir to include-path ..." 1>&5
7870
7871                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7872
7873                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7874                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7875                   cf_add_incdir="$cf_top_incdir"
7876                 else
7877                   break
7878                 fi
7879           else
7880                 break
7881           fi
7882         done
7883   done
7884 fi
7885
7886 if test -n "$cf_cv_library_path_utf8" ; then
7887         for cf_add_libdir in $cf_cv_library_path_utf8
7888         do
7889                 if test "$cf_add_libdir" = /usr/lib ; then
7890                         :
7891                 elif test -d "$cf_add_libdir"
7892                 then
7893                         cf_have_libdir=no
7894                         if test -n "$LDFLAGS$LIBS" ; then
7895                                 # a loop is needed to ensure we can add subdirs of existing dirs
7896                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7897                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7898                                                 cf_have_libdir=yes; break
7899                                         fi
7900                                 done
7901                         fi
7902                         if test "$cf_have_libdir" = no ; then
7903                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7904
7905 echo "${as_me:-configure}:7905: testing adding $cf_add_libdir to library-path ..." 1>&5
7906
7907                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7908                         fi
7909                 fi
7910         done
7911 fi
7912
7913 cf_add_libs="$LIBS"
7914 # reverse order
7915 cf_add_0lib=
7916 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7917 # filter duplicates
7918 for cf_add_1lib in $cf_add_0lib; do
7919         for cf_add_2lib in $cf_add_libs; do
7920                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7921                         cf_add_1lib=
7922                         break
7923                 fi
7924         done
7925         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7926 done
7927 LIBS="$cf_add_libs"
7928
7929 fi
7930
7931 cf_ncuconfig_root=$cf_cv_screen
7932 cf_have_ncuconfig=no
7933
7934 if test "x${PKG_CONFIG:=none}" != xnone; then
7935         echo "$as_me:7935: checking pkg-config for $cf_ncuconfig_root" >&5
7936 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7937         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7938                 echo "$as_me:7938: result: yes" >&5
7939 echo "${ECHO_T}yes" >&6
7940
7941                 echo "$as_me:7941: checking if the $cf_ncuconfig_root package files work" >&5
7942 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7943                 cf_have_ncuconfig=unknown
7944
7945                 cf_save_CFLAGS="$CFLAGS"
7946                 cf_save_CPPFLAGS="$CPPFLAGS"
7947                 cf_save_LIBS="$LIBS"
7948
7949                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7950                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7951
7952                 # while -W for passing linker flags is prevalent, it is not "standard".
7953                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7954                 # incompatible _and_ non-standard -W option which gives an error.  Work
7955                 # around that pitfall.
7956                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7957                 (x*c[89]9@@*-W*)
7958
7959 cf_fix_cppflags=no
7960 cf_new_cflags=
7961 cf_new_cppflags=
7962 cf_new_extra_cppflags=
7963
7964 for cf_add_cflags in $cf_pkg_cflags
7965 do
7966 case "$cf_fix_cppflags" in
7967 (no)
7968         case "$cf_add_cflags" in
7969         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7970                 case "$cf_add_cflags" in
7971                 (-D*)
7972                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7973
7974                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7975                                 && test -z "${cf_tst_cflags}" \
7976                                 && cf_fix_cppflags=yes
7977
7978                         if test "$cf_fix_cppflags" = yes ; then
7979
7980         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7981         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7982
7983                                 continue
7984                         elif test "${cf_tst_cflags}" = "\"'" ; then
7985
7986         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7987         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7988
7989                                 continue
7990                         fi
7991                         ;;
7992                 esac
7993                 case "$CPPFLAGS" in
7994                 (*$cf_add_cflags)
7995                         ;;
7996                 (*)
7997                         case "$cf_add_cflags" in
7998                         (-D*)
7999                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8000
8001 CPPFLAGS=`echo "$CPPFLAGS" | \
8002         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8003                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8004
8005                                 ;;
8006                         esac
8007
8008         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8009         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8010
8011                         ;;
8012                 esac
8013                 ;;
8014         (*)
8015
8016         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8017         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8018
8019                 ;;
8020         esac
8021         ;;
8022 (yes)
8023
8024         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8025         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8026
8027         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8028
8029         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8030                 && test -z "${cf_tst_cflags}" \
8031                 && cf_fix_cppflags=no
8032         ;;
8033 esac
8034 done
8035
8036 if test -n "$cf_new_cflags" ; then
8037
8038         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8039         CFLAGS="${CFLAGS}$cf_new_cflags"
8040
8041 fi
8042
8043 if test -n "$cf_new_cppflags" ; then
8044
8045         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8046         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8047
8048 fi
8049
8050 if test -n "$cf_new_extra_cppflags" ; then
8051
8052         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8053         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8054
8055 fi
8056
8057 cf_add_libs="$LIBS"
8058 # reverse order
8059 cf_add_0lib=
8060 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8061 # filter duplicates
8062 for cf_add_1lib in $cf_add_0lib; do
8063         for cf_add_2lib in $cf_add_libs; do
8064                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8065                         cf_add_1lib=
8066                         break
8067                 fi
8068         done
8069         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8070 done
8071 LIBS="$cf_add_libs"
8072
8073                         cat >"conftest.$ac_ext" <<_ACEOF
8074 #line 8074 "configure"
8075 #include "confdefs.h"
8076 #include <${cf_cv_ncurses_header:-curses.h}>
8077 int
8078 main (void)
8079 {
8080 initscr(); mousemask(0,0); tigetstr((char *)0);
8081   ;
8082   return 0;
8083 }
8084 _ACEOF
8085 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8086 if { (eval echo "$as_me:8086: \"$ac_link\"") >&5
8087   (eval $ac_link) 2>&5
8088   ac_status=$?
8089   echo "$as_me:8089: \$? = $ac_status" >&5
8090   (exit "$ac_status"); } &&
8091          { ac_try='test -s "conftest$ac_exeext"'
8092   { (eval echo "$as_me:8092: \"$ac_try\"") >&5
8093   (eval $ac_try) 2>&5
8094   ac_status=$?
8095   echo "$as_me:8095: \$? = $ac_status" >&5
8096   (exit "$ac_status"); }; }; then
8097   if test "$cross_compiling" = yes; then
8098   cf_test_ncuconfig=maybe
8099 else
8100   cat >"conftest.$ac_ext" <<_ACEOF
8101 #line 8101 "configure"
8102 #include "confdefs.h"
8103 #include <${cf_cv_ncurses_header:-curses.h}>
8104                                         int main(void)
8105                                         { const char *xx = curses_version(); return (xx == 0); }
8106 _ACEOF
8107 rm -f "conftest$ac_exeext"
8108 if { (eval echo "$as_me:8108: \"$ac_link\"") >&5
8109   (eval $ac_link) 2>&5
8110   ac_status=$?
8111   echo "$as_me:8111: \$? = $ac_status" >&5
8112   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8113   { (eval echo "$as_me:8113: \"$ac_try\"") >&5
8114   (eval $ac_try) 2>&5
8115   ac_status=$?
8116   echo "$as_me:8116: \$? = $ac_status" >&5
8117   (exit "$ac_status"); }; }; then
8118   cf_test_ncuconfig=yes
8119 else
8120   echo "$as_me: program exited with status $ac_status" >&5
8121 echo "$as_me: failed program was:" >&5
8122 cat "conftest.$ac_ext" >&5
8123 cf_test_ncuconfig=no
8124 fi
8125 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8126 fi
8127 else
8128   echo "$as_me: failed program was:" >&5
8129 cat "conftest.$ac_ext" >&5
8130 cf_test_ncuconfig=no
8131 fi
8132 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8133
8134                         CFLAGS="$cf_save_CFLAGS"
8135                         CPPFLAGS="$cf_save_CPPFLAGS"
8136                         LIBS="$cf_save_LIBS"
8137
8138                         if test "x$cf_test_ncuconfig" != xyes; then
8139                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8140                                 cf_pkg_cflags="$cf_temp"
8141                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8142                                 cf_pkg_libs="$cf_temp"
8143                         fi
8144                         ;;
8145                 esac
8146
8147 cf_fix_cppflags=no
8148 cf_new_cflags=
8149 cf_new_cppflags=
8150 cf_new_extra_cppflags=
8151
8152 for cf_add_cflags in $cf_pkg_cflags
8153 do
8154 case "$cf_fix_cppflags" in
8155 (no)
8156         case "$cf_add_cflags" in
8157         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8158                 case "$cf_add_cflags" in
8159                 (-D*)
8160                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8161
8162                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8163                                 && test -z "${cf_tst_cflags}" \
8164                                 && cf_fix_cppflags=yes
8165
8166                         if test "$cf_fix_cppflags" = yes ; then
8167
8168         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8169         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8170
8171                                 continue
8172                         elif test "${cf_tst_cflags}" = "\"'" ; then
8173
8174         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8175         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8176
8177                                 continue
8178                         fi
8179                         ;;
8180                 esac
8181                 case "$CPPFLAGS" in
8182                 (*$cf_add_cflags)
8183                         ;;
8184                 (*)
8185                         case "$cf_add_cflags" in
8186                         (-D*)
8187                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8188
8189 CPPFLAGS=`echo "$CPPFLAGS" | \
8190         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8191                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8192
8193                                 ;;
8194                         esac
8195
8196         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8197         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8198
8199                         ;;
8200                 esac
8201                 ;;
8202         (*)
8203
8204         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8205         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8206
8207                 ;;
8208         esac
8209         ;;
8210 (yes)
8211
8212         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8213         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8214
8215         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8216
8217         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8218                 && test -z "${cf_tst_cflags}" \
8219                 && cf_fix_cppflags=no
8220         ;;
8221 esac
8222 done
8223
8224 if test -n "$cf_new_cflags" ; then
8225
8226         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8227         CFLAGS="${CFLAGS}$cf_new_cflags"
8228
8229 fi
8230
8231 if test -n "$cf_new_cppflags" ; then
8232
8233         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8234         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8235
8236 fi
8237
8238 if test -n "$cf_new_extra_cppflags" ; then
8239
8240         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8241         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8242
8243 fi
8244
8245 cf_add_libs="$LIBS"
8246 # reverse order
8247 cf_add_0lib=
8248 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8249 # filter duplicates
8250 for cf_add_1lib in $cf_add_0lib; do
8251         for cf_add_2lib in $cf_add_libs; do
8252                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8253                         cf_add_1lib=
8254                         break
8255                 fi
8256         done
8257         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8258 done
8259 LIBS="$cf_add_libs"
8260
8261                 cat >"conftest.$ac_ext" <<_ACEOF
8262 #line 8262 "configure"
8263 #include "confdefs.h"
8264 #include <${cf_cv_ncurses_header:-curses.h}>
8265 int
8266 main (void)
8267 {
8268 initscr(); mousemask(0,0); tigetstr((char *)0);
8269   ;
8270   return 0;
8271 }
8272 _ACEOF
8273 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8274 if { (eval echo "$as_me:8274: \"$ac_link\"") >&5
8275   (eval $ac_link) 2>&5
8276   ac_status=$?
8277   echo "$as_me:8277: \$? = $ac_status" >&5
8278   (exit "$ac_status"); } &&
8279          { ac_try='test -s "conftest$ac_exeext"'
8280   { (eval echo "$as_me:8280: \"$ac_try\"") >&5
8281   (eval $ac_try) 2>&5
8282   ac_status=$?
8283   echo "$as_me:8283: \$? = $ac_status" >&5
8284   (exit "$ac_status"); }; }; then
8285   if test "$cross_compiling" = yes; then
8286   cf_have_ncuconfig=maybe
8287 else
8288   cat >"conftest.$ac_ext" <<_ACEOF
8289 #line 8289 "configure"
8290 #include "confdefs.h"
8291 #include <${cf_cv_ncurses_header:-curses.h}>
8292                                 int main(void)
8293                                 { const char *xx = curses_version(); return (xx == 0); }
8294 _ACEOF
8295 rm -f "conftest$ac_exeext"
8296 if { (eval echo "$as_me:8296: \"$ac_link\"") >&5
8297   (eval $ac_link) 2>&5
8298   ac_status=$?
8299   echo "$as_me:8299: \$? = $ac_status" >&5
8300   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8301   { (eval echo "$as_me:8301: \"$ac_try\"") >&5
8302   (eval $ac_try) 2>&5
8303   ac_status=$?
8304   echo "$as_me:8304: \$? = $ac_status" >&5
8305   (exit "$ac_status"); }; }; then
8306   cf_have_ncuconfig=yes
8307 else
8308   echo "$as_me: program exited with status $ac_status" >&5
8309 echo "$as_me: failed program was:" >&5
8310 cat "conftest.$ac_ext" >&5
8311 cf_have_ncuconfig=no
8312 fi
8313 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8314 fi
8315 else
8316   echo "$as_me: failed program was:" >&5
8317 cat "conftest.$ac_ext" >&5
8318 cf_have_ncuconfig=no
8319 fi
8320 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8321                 echo "$as_me:8321: result: $cf_have_ncuconfig" >&5
8322 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8323                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8324                 if test "$cf_have_ncuconfig" != "yes"
8325                 then
8326                         CPPFLAGS="$cf_save_CPPFLAGS"
8327                         LIBS="$cf_save_LIBS"
8328                         NCURSES_CONFIG_PKG=none
8329                 else
8330
8331 cat >>confdefs.h <<\EOF
8332 #define NCURSES 1
8333 EOF
8334
8335                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8336
8337 echo "$as_me:8337: checking for terminfo header" >&5
8338 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8339 if test "${cf_cv_term_header+set}" = set; then
8340   echo $ECHO_N "(cached) $ECHO_C" >&6
8341 else
8342
8343 case "${cf_cv_ncurses_header}" in
8344 (*/ncurses.h|*/ncursesw.h)
8345         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8346         ;;
8347 (*)
8348         cf_term_header=term.h
8349         ;;
8350 esac
8351
8352 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8353 do
8354 cat >"conftest.$ac_ext" <<_ACEOF
8355 #line 8355 "configure"
8356 #include "confdefs.h"
8357 #include <stdio.h>
8358 #include <${cf_cv_ncurses_header:-curses.h}>
8359 #include <$cf_test>
8360
8361 int
8362 main (void)
8363 {
8364 int x = auto_left_margin; (void)x
8365   ;
8366   return 0;
8367 }
8368 _ACEOF
8369 rm -f "conftest.$ac_objext"
8370 if { (eval echo "$as_me:8370: \"$ac_compile\"") >&5
8371   (eval $ac_compile) 2>&5
8372   ac_status=$?
8373   echo "$as_me:8373: \$? = $ac_status" >&5
8374   (exit "$ac_status"); } &&
8375          { ac_try='test -s "conftest.$ac_objext"'
8376   { (eval echo "$as_me:8376: \"$ac_try\"") >&5
8377   (eval $ac_try) 2>&5
8378   ac_status=$?
8379   echo "$as_me:8379: \$? = $ac_status" >&5
8380   (exit "$ac_status"); }; }; then
8381
8382         cf_cv_term_header="$cf_test"
8383 else
8384   echo "$as_me: failed program was:" >&5
8385 cat "conftest.$ac_ext" >&5
8386
8387         cf_cv_term_header=unknown
8388
8389 fi
8390 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8391         test "$cf_cv_term_header" != unknown && break
8392 done
8393
8394 fi
8395 echo "$as_me:8395: result: $cf_cv_term_header" >&5
8396 echo "${ECHO_T}$cf_cv_term_header" >&6
8397
8398 # Set definitions to allow ifdef'ing to accommodate subdirectories
8399
8400 case "$cf_cv_term_header" in
8401 (*term.h)
8402
8403 cat >>confdefs.h <<\EOF
8404 #define HAVE_TERM_H 1
8405 EOF
8406
8407         ;;
8408 esac
8409
8410 case "$cf_cv_term_header" in
8411 (ncurses/term.h)
8412
8413 cat >>confdefs.h <<\EOF
8414 #define HAVE_NCURSES_TERM_H 1
8415 EOF
8416
8417         ;;
8418 (ncursesw/term.h)
8419
8420 cat >>confdefs.h <<\EOF
8421 #define HAVE_NCURSESW_TERM_H 1
8422 EOF
8423
8424         ;;
8425 esac
8426
8427                 fi
8428
8429         else
8430                 echo "$as_me:8430: result: no" >&5
8431 echo "${ECHO_T}no" >&6
8432                 NCURSES_CONFIG_PKG=none
8433         fi
8434 else
8435         NCURSES_CONFIG_PKG=none
8436 fi
8437
8438 if test "x$cf_have_ncuconfig" = "xno"; then
8439         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8440
8441 if test -n "$ac_tool_prefix"; then
8442   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8443   do
8444     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8445 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8446 echo "$as_me:8446: checking for $ac_word" >&5
8447 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8448 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8449   echo $ECHO_N "(cached) $ECHO_C" >&6
8450 else
8451   if test -n "$NCURSES_CONFIG"; then
8452   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8453 else
8454   ac_save_IFS=$IFS; IFS=$ac_path_separator
8455 ac_dummy="$PATH"
8456 for ac_dir in $ac_dummy; do
8457   IFS=$ac_save_IFS
8458   test -z "$ac_dir" && ac_dir=.
8459   $as_executable_p "$ac_dir/$ac_word" || continue
8460 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8461 echo "$as_me:8461: found $ac_dir/$ac_word" >&5
8462 break
8463 done
8464
8465 fi
8466 fi
8467 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8468 if test -n "$NCURSES_CONFIG"; then
8469   echo "$as_me:8469: result: $NCURSES_CONFIG" >&5
8470 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8471 else
8472   echo "$as_me:8472: result: no" >&5
8473 echo "${ECHO_T}no" >&6
8474 fi
8475
8476     test -n "$NCURSES_CONFIG" && break
8477   done
8478 fi
8479 if test -z "$NCURSES_CONFIG"; then
8480   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8481   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8482 do
8483   # Extract the first word of "$ac_prog", so it can be a program name with args.
8484 set dummy $ac_prog; ac_word=$2
8485 echo "$as_me:8485: checking for $ac_word" >&5
8486 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8487 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8488   echo $ECHO_N "(cached) $ECHO_C" >&6
8489 else
8490   if test -n "$ac_ct_NCURSES_CONFIG"; then
8491   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8492 else
8493   ac_save_IFS=$IFS; IFS=$ac_path_separator
8494 ac_dummy="$PATH"
8495 for ac_dir in $ac_dummy; do
8496   IFS=$ac_save_IFS
8497   test -z "$ac_dir" && ac_dir=.
8498   $as_executable_p "$ac_dir/$ac_word" || continue
8499 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8500 echo "$as_me:8500: found $ac_dir/$ac_word" >&5
8501 break
8502 done
8503
8504 fi
8505 fi
8506 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8507 if test -n "$ac_ct_NCURSES_CONFIG"; then
8508   echo "$as_me:8508: result: $ac_ct_NCURSES_CONFIG" >&5
8509 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8510 else
8511   echo "$as_me:8511: result: no" >&5
8512 echo "${ECHO_T}no" >&6
8513 fi
8514
8515   test -n "$ac_ct_NCURSES_CONFIG" && break
8516 done
8517 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8518
8519   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8520 fi
8521
8522         if test "$NCURSES_CONFIG" != none ; then
8523
8524 cf_fix_cppflags=no
8525 cf_new_cflags=
8526 cf_new_cppflags=
8527 cf_new_extra_cppflags=
8528
8529 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8530 do
8531 case "$cf_fix_cppflags" in
8532 (no)
8533         case "$cf_add_cflags" in
8534         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8535                 case "$cf_add_cflags" in
8536                 (-D*)
8537                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8538
8539                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8540                                 && test -z "${cf_tst_cflags}" \
8541                                 && cf_fix_cppflags=yes
8542
8543                         if test "$cf_fix_cppflags" = yes ; then
8544
8545         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8546         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8547
8548                                 continue
8549                         elif test "${cf_tst_cflags}" = "\"'" ; then
8550
8551         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8552         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8553
8554                                 continue
8555                         fi
8556                         ;;
8557                 esac
8558                 case "$CPPFLAGS" in
8559                 (*$cf_add_cflags)
8560                         ;;
8561                 (*)
8562                         case "$cf_add_cflags" in
8563                         (-D*)
8564                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8565
8566 CPPFLAGS=`echo "$CPPFLAGS" | \
8567         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8568                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8569
8570                                 ;;
8571                         esac
8572
8573         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8574         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8575
8576                         ;;
8577                 esac
8578                 ;;
8579         (*)
8580
8581         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8582         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8583
8584                 ;;
8585         esac
8586         ;;
8587 (yes)
8588
8589         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8590         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8591
8592         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8593
8594         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8595                 && test -z "${cf_tst_cflags}" \
8596                 && cf_fix_cppflags=no
8597         ;;
8598 esac
8599 done
8600
8601 if test -n "$cf_new_cflags" ; then
8602
8603         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8604         CFLAGS="${CFLAGS}$cf_new_cflags"
8605
8606 fi
8607
8608 if test -n "$cf_new_cppflags" ; then
8609
8610         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8611         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8612
8613 fi
8614
8615 if test -n "$cf_new_extra_cppflags" ; then
8616
8617         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8618         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8619
8620 fi
8621
8622 cf_add_libs="$LIBS"
8623 # reverse order
8624 cf_add_0lib=
8625 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8626 # filter duplicates
8627 for cf_add_1lib in $cf_add_0lib; do
8628         for cf_add_2lib in $cf_add_libs; do
8629                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8630                         cf_add_1lib=
8631                         break
8632                 fi
8633         done
8634         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8635 done
8636 LIBS="$cf_add_libs"
8637
8638                 # even with config script, some packages use no-override for curses.h
8639
8640 echo "$as_me:8640: checking if we have identified curses headers" >&5
8641 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8642 if test "${cf_cv_ncurses_header+set}" = set; then
8643   echo $ECHO_N "(cached) $ECHO_C" >&6
8644 else
8645
8646 cf_cv_ncurses_header=none
8647 for cf_header in \
8648         ncurses.h $cf_cv_screen/ncurses.h \
8649         curses.h $cf_cv_screen/curses.h
8650 do
8651 cat >"conftest.$ac_ext" <<_ACEOF
8652 #line 8652 "configure"
8653 #include "confdefs.h"
8654 #include <${cf_header}>
8655 int
8656 main (void)
8657 {
8658 initscr(); tgoto("?", 0,0)
8659   ;
8660   return 0;
8661 }
8662 _ACEOF
8663 rm -f "conftest.$ac_objext"
8664 if { (eval echo "$as_me:8664: \"$ac_compile\"") >&5
8665   (eval $ac_compile) 2>&5
8666   ac_status=$?
8667   echo "$as_me:8667: \$? = $ac_status" >&5
8668   (exit "$ac_status"); } &&
8669          { ac_try='test -s "conftest.$ac_objext"'
8670   { (eval echo "$as_me:8670: \"$ac_try\"") >&5
8671   (eval $ac_try) 2>&5
8672   ac_status=$?
8673   echo "$as_me:8673: \$? = $ac_status" >&5
8674   (exit "$ac_status"); }; }; then
8675   cf_cv_ncurses_header=$cf_header; break
8676 else
8677   echo "$as_me: failed program was:" >&5
8678 cat "conftest.$ac_ext" >&5
8679 fi
8680 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8681 done
8682
8683 fi
8684 echo "$as_me:8684: result: $cf_cv_ncurses_header" >&5
8685 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8686
8687 if test "$cf_cv_ncurses_header" = none ; then
8688         { { echo "$as_me:8688: error: No curses header-files found" >&5
8689 echo "$as_me: error: No curses header-files found" >&2;}
8690    { (exit 1); exit 1; }; }
8691 fi
8692
8693 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8694
8695 for ac_header in $cf_cv_ncurses_header
8696 do
8697 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8698 echo "$as_me:8698: checking for $ac_header" >&5
8699 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8700 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8701   echo $ECHO_N "(cached) $ECHO_C" >&6
8702 else
8703   cat >"conftest.$ac_ext" <<_ACEOF
8704 #line 8704 "configure"
8705 #include "confdefs.h"
8706 #include <$ac_header>
8707 _ACEOF
8708 if { (eval echo "$as_me:8708: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8709   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8710   ac_status=$?
8711   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8712   rm -f conftest.er1
8713   cat conftest.err >&5
8714   echo "$as_me:8714: \$? = $ac_status" >&5
8715   (exit "$ac_status"); } >/dev/null; then
8716   if test -s conftest.err; then
8717     ac_cpp_err=$ac_c_preproc_warn_flag
8718   else
8719     ac_cpp_err=
8720   fi
8721 else
8722   ac_cpp_err=yes
8723 fi
8724 if test -z "$ac_cpp_err"; then
8725   eval "$as_ac_Header=yes"
8726 else
8727   echo "$as_me: failed program was:" >&5
8728   cat "conftest.$ac_ext" >&5
8729   eval "$as_ac_Header=no"
8730 fi
8731 rm -f conftest.err "conftest.$ac_ext"
8732 fi
8733 echo "$as_me:8733: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8734 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8735 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8736   cat >>confdefs.h <<EOF
8737 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8738 EOF
8739
8740 fi
8741 done
8742
8743 cat >>confdefs.h <<\EOF
8744 #define NCURSES 1
8745 EOF
8746
8747 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8748
8749                 cat >>confdefs.h <<EOF
8750 #define $cf_nculib_ROOT 1
8751 EOF
8752
8753                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8754
8755         else
8756
8757 cf_ncuhdr_root=$cf_cv_screen
8758
8759 test -n "$cf_cv_curses_dir" && \
8760 test "$cf_cv_curses_dir" != "no" && { \
8761
8762 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8763   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8764   do
8765         while test "$cf_add_incdir" != /usr/include
8766         do
8767           if test -d "$cf_add_incdir"
8768           then
8769                 cf_have_incdir=no
8770                 if test -n "$CFLAGS$CPPFLAGS" ; then
8771                   # a loop is needed to ensure we can add subdirs of existing dirs
8772                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8773                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8774                           cf_have_incdir=yes; break
8775                         fi
8776                   done
8777                 fi
8778
8779                 if test "$cf_have_incdir" = no ; then
8780                   if test "$cf_add_incdir" = /usr/local/include ; then
8781                         if test "$GCC" = yes
8782                         then
8783                           cf_save_CPPFLAGS=$CPPFLAGS
8784
8785         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8786         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8787
8788                           cat >"conftest.$ac_ext" <<_ACEOF
8789 #line 8789 "configure"
8790 #include "confdefs.h"
8791 #include <stdio.h>
8792 int
8793 main (void)
8794 {
8795 printf("Hello")
8796   ;
8797   return 0;
8798 }
8799 _ACEOF
8800 rm -f "conftest.$ac_objext"
8801 if { (eval echo "$as_me:8801: \"$ac_compile\"") >&5
8802   (eval $ac_compile) 2>&5
8803   ac_status=$?
8804   echo "$as_me:8804: \$? = $ac_status" >&5
8805   (exit "$ac_status"); } &&
8806          { ac_try='test -s "conftest.$ac_objext"'
8807   { (eval echo "$as_me:8807: \"$ac_try\"") >&5
8808   (eval $ac_try) 2>&5
8809   ac_status=$?
8810   echo "$as_me:8810: \$? = $ac_status" >&5
8811   (exit "$ac_status"); }; }; then
8812   :
8813 else
8814   echo "$as_me: failed program was:" >&5
8815 cat "conftest.$ac_ext" >&5
8816 cf_have_incdir=yes
8817 fi
8818 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8819                           CPPFLAGS=$cf_save_CPPFLAGS
8820                         fi
8821                   fi
8822                 fi
8823
8824                 if test "$cf_have_incdir" = no ; then
8825                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8826
8827 echo "${as_me:-configure}:8827: testing adding $cf_add_incdir to include-path ..." 1>&5
8828
8829                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8830
8831                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8832                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8833                   cf_add_incdir="$cf_top_incdir"
8834                 else
8835                   break
8836                 fi
8837           else
8838                 break
8839           fi
8840         done
8841   done
8842 fi
8843
8844 }
8845
8846 echo "$as_me:8846: checking for $cf_ncuhdr_root header in include-path" >&5
8847 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8848 if test "${cf_cv_ncurses_h+set}" = set; then
8849   echo $ECHO_N "(cached) $ECHO_C" >&6
8850 else
8851
8852         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8853         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8854         for cf_header in $cf_header_list
8855         do
8856
8857         cat >"conftest.$ac_ext" <<_ACEOF
8858 #line 8858 "configure"
8859 #include "confdefs.h"
8860
8861 #include <$cf_header>
8862 int
8863 main (void)
8864 {
8865
8866 #ifdef NCURSES_VERSION
8867
8868 printf("%s\\n", NCURSES_VERSION);
8869 #else
8870 #ifdef __NCURSES_H
8871 printf("old\\n");
8872 #else
8873         make an error
8874 #endif
8875 #endif
8876
8877   ;
8878   return 0;
8879 }
8880 _ACEOF
8881 rm -f "conftest.$ac_objext"
8882 if { (eval echo "$as_me:8882: \"$ac_compile\"") >&5
8883   (eval $ac_compile) 2>&5
8884   ac_status=$?
8885   echo "$as_me:8885: \$? = $ac_status" >&5
8886   (exit "$ac_status"); } &&
8887          { ac_try='test -s "conftest.$ac_objext"'
8888   { (eval echo "$as_me:8888: \"$ac_try\"") >&5
8889   (eval $ac_try) 2>&5
8890   ac_status=$?
8891   echo "$as_me:8891: \$? = $ac_status" >&5
8892   (exit "$ac_status"); }; }; then
8893   cf_cv_ncurses_h=$cf_header
8894
8895 else
8896   echo "$as_me: failed program was:" >&5
8897 cat "conftest.$ac_ext" >&5
8898 cf_cv_ncurses_h=no
8899 fi
8900 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8901
8902                 test "$cf_cv_ncurses_h" != no && break
8903         done
8904
8905 fi
8906 echo "$as_me:8906: result: $cf_cv_ncurses_h" >&5
8907 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8908
8909 if test "$cf_cv_ncurses_h" != no ; then
8910         cf_cv_ncurses_header=$cf_cv_ncurses_h
8911 else
8912
8913 echo "$as_me:8913: checking for $cf_ncuhdr_root include-path" >&5
8914 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8915 if test "${cf_cv_ncurses_h2+set}" = set; then
8916   echo $ECHO_N "(cached) $ECHO_C" >&6
8917 else
8918
8919         test -n "$verbose" && echo
8920
8921 cf_search=
8922
8923 # collect the current set of include-directories from compiler flags
8924 cf_header_path_list=""
8925 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8926         for cf_header_path in $CPPFLAGS $CFLAGS
8927         do
8928                 case "$cf_header_path" in
8929                 (-I*)
8930                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8931
8932 test "x$cf_header_path" != "xNONE" && \
8933 test -d "$cf_header_path" && \
8934  {
8935         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8936         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8937         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8938         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8939         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8940         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"
8941 }
8942
8943                         cf_header_path_list="$cf_header_path_list $cf_search"
8944                         ;;
8945                 esac
8946         done
8947 fi
8948
8949 # add the variations for the package we are looking for
8950
8951 cf_search=
8952
8953 test "x$prefix" != "xNONE" && \
8954 test -d "$prefix" && \
8955  {
8956         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8957         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8958         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8959         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8960         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8961         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8962 }
8963
8964 for cf_subdir_prefix in \
8965         /usr \
8966         /usr/local \
8967         /usr/pkg \
8968         /opt \
8969         /opt/local \
8970         $HOME
8971 do
8972
8973 test "x$cf_subdir_prefix" != "x$prefix" && \
8974 test -d "$cf_subdir_prefix" && \
8975 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8976         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8977         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8978         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8979         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8980         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8981         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"
8982 }
8983
8984 done
8985
8986 test "$includedir" != NONE && \
8987 test "$includedir" != "/usr/include" && \
8988 test -d "$includedir" && {
8989         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8990         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8991 }
8992
8993 test "$oldincludedir" != NONE && \
8994 test "$oldincludedir" != "/usr/include" && \
8995 test -d "$oldincludedir" && {
8996         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8997         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8998 }
8999
9000 cf_search="$cf_search $cf_header_path_list"
9001
9002         test -n "$verbose" && echo "search path $cf_search"
9003         cf_save2_CPPFLAGS="$CPPFLAGS"
9004         for cf_incdir in $cf_search
9005         do
9006
9007 if test -n "$cf_incdir" ; then
9008   for cf_add_incdir in $cf_incdir
9009   do
9010         while test "$cf_add_incdir" != /usr/include
9011         do
9012           if test -d "$cf_add_incdir"
9013           then
9014                 cf_have_incdir=no
9015                 if test -n "$CFLAGS$CPPFLAGS" ; then
9016                   # a loop is needed to ensure we can add subdirs of existing dirs
9017                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9018                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9019                           cf_have_incdir=yes; break
9020                         fi
9021                   done
9022                 fi
9023
9024                 if test "$cf_have_incdir" = no ; then
9025                   if test "$cf_add_incdir" = /usr/local/include ; then
9026                         if test "$GCC" = yes
9027                         then
9028                           cf_save_CPPFLAGS=$CPPFLAGS
9029
9030         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9031         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9032
9033                           cat >"conftest.$ac_ext" <<_ACEOF
9034 #line 9034 "configure"
9035 #include "confdefs.h"
9036 #include <stdio.h>
9037 int
9038 main (void)
9039 {
9040 printf("Hello")
9041   ;
9042   return 0;
9043 }
9044 _ACEOF
9045 rm -f "conftest.$ac_objext"
9046 if { (eval echo "$as_me:9046: \"$ac_compile\"") >&5
9047   (eval $ac_compile) 2>&5
9048   ac_status=$?
9049   echo "$as_me:9049: \$? = $ac_status" >&5
9050   (exit "$ac_status"); } &&
9051          { ac_try='test -s "conftest.$ac_objext"'
9052   { (eval echo "$as_me:9052: \"$ac_try\"") >&5
9053   (eval $ac_try) 2>&5
9054   ac_status=$?
9055   echo "$as_me:9055: \$? = $ac_status" >&5
9056   (exit "$ac_status"); }; }; then
9057   :
9058 else
9059   echo "$as_me: failed program was:" >&5
9060 cat "conftest.$ac_ext" >&5
9061 cf_have_incdir=yes
9062 fi
9063 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9064                           CPPFLAGS=$cf_save_CPPFLAGS
9065                         fi
9066                   fi
9067                 fi
9068
9069                 if test "$cf_have_incdir" = no ; then
9070                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9071
9072 echo "${as_me:-configure}:9072: testing adding $cf_add_incdir to include-path ..." 1>&5
9073
9074                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9075
9076                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9077                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9078                   cf_add_incdir="$cf_top_incdir"
9079                 else
9080                   break
9081                 fi
9082           else
9083                 break
9084           fi
9085         done
9086   done
9087 fi
9088
9089                 for cf_header in \
9090                         ncurses.h \
9091                         curses.h
9092                 do
9093
9094         cat >"conftest.$ac_ext" <<_ACEOF
9095 #line 9095 "configure"
9096 #include "confdefs.h"
9097
9098 #include <$cf_header>
9099 int
9100 main (void)
9101 {
9102
9103 #ifdef NCURSES_VERSION
9104
9105 printf("%s\\n", NCURSES_VERSION);
9106 #else
9107 #ifdef __NCURSES_H
9108 printf("old\\n");
9109 #else
9110         make an error
9111 #endif
9112 #endif
9113
9114   ;
9115   return 0;
9116 }
9117 _ACEOF
9118 rm -f "conftest.$ac_objext"
9119 if { (eval echo "$as_me:9119: \"$ac_compile\"") >&5
9120   (eval $ac_compile) 2>&5
9121   ac_status=$?
9122   echo "$as_me:9122: \$? = $ac_status" >&5
9123   (exit "$ac_status"); } &&
9124          { ac_try='test -s "conftest.$ac_objext"'
9125   { (eval echo "$as_me:9125: \"$ac_try\"") >&5
9126   (eval $ac_try) 2>&5
9127   ac_status=$?
9128   echo "$as_me:9128: \$? = $ac_status" >&5
9129   (exit "$ac_status"); }; }; then
9130   cf_cv_ncurses_h2=$cf_header
9131
9132 else
9133   echo "$as_me: failed program was:" >&5
9134 cat "conftest.$ac_ext" >&5
9135 cf_cv_ncurses_h2=no
9136 fi
9137 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9138
9139                         if test "$cf_cv_ncurses_h2" != no ; then
9140                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9141                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9142                                 break
9143                         fi
9144                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9145                 done
9146                 CPPFLAGS="$cf_save2_CPPFLAGS"
9147                 test "$cf_cv_ncurses_h2" != no && break
9148         done
9149         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9149: error: not found" >&5
9150 echo "$as_me: error: not found" >&2;}
9151    { (exit 1); exit 1; }; }
9152
9153 fi
9154 echo "$as_me:9154: result: $cf_cv_ncurses_h2" >&5
9155 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9156
9157         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9158         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9159         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9160                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9161         fi
9162
9163 if test -n "$cf_1st_incdir" ; then
9164   for cf_add_incdir in $cf_1st_incdir
9165   do
9166         while test "$cf_add_incdir" != /usr/include
9167         do
9168           if test -d "$cf_add_incdir"
9169           then
9170                 cf_have_incdir=no
9171                 if test -n "$CFLAGS$CPPFLAGS" ; then
9172                   # a loop is needed to ensure we can add subdirs of existing dirs
9173                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9174                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9175                           cf_have_incdir=yes; break
9176                         fi
9177                   done
9178                 fi
9179
9180                 if test "$cf_have_incdir" = no ; then
9181                   if test "$cf_add_incdir" = /usr/local/include ; then
9182                         if test "$GCC" = yes
9183                         then
9184                           cf_save_CPPFLAGS=$CPPFLAGS
9185
9186         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9187         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9188
9189                           cat >"conftest.$ac_ext" <<_ACEOF
9190 #line 9190 "configure"
9191 #include "confdefs.h"
9192 #include <stdio.h>
9193 int
9194 main (void)
9195 {
9196 printf("Hello")
9197   ;
9198   return 0;
9199 }
9200 _ACEOF
9201 rm -f "conftest.$ac_objext"
9202 if { (eval echo "$as_me:9202: \"$ac_compile\"") >&5
9203   (eval $ac_compile) 2>&5
9204   ac_status=$?
9205   echo "$as_me:9205: \$? = $ac_status" >&5
9206   (exit "$ac_status"); } &&
9207          { ac_try='test -s "conftest.$ac_objext"'
9208   { (eval echo "$as_me:9208: \"$ac_try\"") >&5
9209   (eval $ac_try) 2>&5
9210   ac_status=$?
9211   echo "$as_me:9211: \$? = $ac_status" >&5
9212   (exit "$ac_status"); }; }; then
9213   :
9214 else
9215   echo "$as_me: failed program was:" >&5
9216 cat "conftest.$ac_ext" >&5
9217 cf_have_incdir=yes
9218 fi
9219 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9220                           CPPFLAGS=$cf_save_CPPFLAGS
9221                         fi
9222                   fi
9223                 fi
9224
9225                 if test "$cf_have_incdir" = no ; then
9226                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9227
9228 echo "${as_me:-configure}:9228: testing adding $cf_add_incdir to include-path ..." 1>&5
9229
9230                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9231
9232                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9233                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9234                   cf_add_incdir="$cf_top_incdir"
9235                 else
9236                   break
9237                 fi
9238           else
9239                 break
9240           fi
9241         done
9242   done
9243 fi
9244
9245 fi
9246
9247 # Set definitions to allow ifdef'ing for ncurses.h
9248
9249 case "$cf_cv_ncurses_header" in
9250 (*ncurses.h)
9251
9252 cat >>confdefs.h <<\EOF
9253 #define HAVE_NCURSES_H 1
9254 EOF
9255
9256         ;;
9257 esac
9258
9259 case "$cf_cv_ncurses_header" in
9260 (ncurses/curses.h|ncurses/ncurses.h)
9261
9262 cat >>confdefs.h <<\EOF
9263 #define HAVE_NCURSES_NCURSES_H 1
9264 EOF
9265
9266         ;;
9267 (ncursesw/curses.h|ncursesw/ncurses.h)
9268
9269 cat >>confdefs.h <<\EOF
9270 #define HAVE_NCURSESW_NCURSES_H 1
9271 EOF
9272
9273         ;;
9274 esac
9275
9276 echo "$as_me:9276: checking for terminfo header" >&5
9277 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9278 if test "${cf_cv_term_header+set}" = set; then
9279   echo $ECHO_N "(cached) $ECHO_C" >&6
9280 else
9281
9282 case "${cf_cv_ncurses_header}" in
9283 (*/ncurses.h|*/ncursesw.h)
9284         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9285         ;;
9286 (*)
9287         cf_term_header=term.h
9288         ;;
9289 esac
9290
9291 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9292 do
9293 cat >"conftest.$ac_ext" <<_ACEOF
9294 #line 9294 "configure"
9295 #include "confdefs.h"
9296 #include <stdio.h>
9297 #include <${cf_cv_ncurses_header:-curses.h}>
9298 #include <$cf_test>
9299
9300 int
9301 main (void)
9302 {
9303 int x = auto_left_margin; (void)x
9304   ;
9305   return 0;
9306 }
9307 _ACEOF
9308 rm -f "conftest.$ac_objext"
9309 if { (eval echo "$as_me:9309: \"$ac_compile\"") >&5
9310   (eval $ac_compile) 2>&5
9311   ac_status=$?
9312   echo "$as_me:9312: \$? = $ac_status" >&5
9313   (exit "$ac_status"); } &&
9314          { ac_try='test -s "conftest.$ac_objext"'
9315   { (eval echo "$as_me:9315: \"$ac_try\"") >&5
9316   (eval $ac_try) 2>&5
9317   ac_status=$?
9318   echo "$as_me:9318: \$? = $ac_status" >&5
9319   (exit "$ac_status"); }; }; then
9320
9321         cf_cv_term_header="$cf_test"
9322 else
9323   echo "$as_me: failed program was:" >&5
9324 cat "conftest.$ac_ext" >&5
9325
9326         cf_cv_term_header=unknown
9327
9328 fi
9329 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9330         test "$cf_cv_term_header" != unknown && break
9331 done
9332
9333 fi
9334 echo "$as_me:9334: result: $cf_cv_term_header" >&5
9335 echo "${ECHO_T}$cf_cv_term_header" >&6
9336
9337 # Set definitions to allow ifdef'ing to accommodate subdirectories
9338
9339 case "$cf_cv_term_header" in
9340 (*term.h)
9341
9342 cat >>confdefs.h <<\EOF
9343 #define HAVE_TERM_H 1
9344 EOF
9345
9346         ;;
9347 esac
9348
9349 case "$cf_cv_term_header" in
9350 (ncurses/term.h)
9351
9352 cat >>confdefs.h <<\EOF
9353 #define HAVE_NCURSES_TERM_H 1
9354 EOF
9355
9356         ;;
9357 (ncursesw/term.h)
9358
9359 cat >>confdefs.h <<\EOF
9360 #define HAVE_NCURSESW_TERM_H 1
9361 EOF
9362
9363         ;;
9364 esac
9365
9366 # some applications need this, but should check for NCURSES_VERSION
9367
9368 cat >>confdefs.h <<\EOF
9369 #define NCURSES 1
9370 EOF
9371
9372 echo "$as_me:9372: checking for ncurses version" >&5
9373 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9374 if test "${cf_cv_ncurses_version+set}" = set; then
9375   echo $ECHO_N "(cached) $ECHO_C" >&6
9376 else
9377
9378         cf_cv_ncurses_version=no
9379         cf_tempfile=out$$
9380         rm -f "$cf_tempfile"
9381         if test "$cross_compiling" = yes; then
9382
9383         # This will not work if the preprocessor splits the line after the
9384         # Autoconf token.  The 'unproto' program does that.
9385         cat > "conftest.$ac_ext" <<EOF
9386 #include <${cf_cv_ncurses_header:-curses.h}>
9387 #undef Autoconf
9388 #ifdef NCURSES_VERSION
9389 Autoconf NCURSES_VERSION
9390 #else
9391 #ifdef __NCURSES_H
9392 Autoconf "old"
9393 #endif
9394 ;
9395 #endif
9396 EOF
9397         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9398         { (eval echo "$as_me:9398: \"$cf_try\"") >&5
9399   (eval $cf_try) 2>&5
9400   ac_status=$?
9401   echo "$as_me:9401: \$? = $ac_status" >&5
9402   (exit "$ac_status"); }
9403         if test -f conftest.out ; then
9404                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9405                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9406                 rm -f conftest.out
9407         fi
9408
9409 else
9410   cat >"conftest.$ac_ext" <<_ACEOF
9411 #line 9411 "configure"
9412 #include "confdefs.h"
9413
9414 #include <${cf_cv_ncurses_header:-curses.h}>
9415 #include <stdio.h>
9416 int main(void)
9417 {
9418         FILE *fp = fopen("$cf_tempfile", "w");
9419 #ifdef NCURSES_VERSION
9420 # ifdef NCURSES_VERSION_PATCH
9421         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9422 # else
9423         fprintf(fp, "%s\\n", NCURSES_VERSION);
9424 # endif
9425 #else
9426 # ifdef __NCURSES_H
9427         fprintf(fp, "old\\n");
9428 # else
9429         make an error
9430 # endif
9431 #endif
9432         ${cf_cv_main_return:-return}(0);
9433 }
9434 _ACEOF
9435 rm -f "conftest$ac_exeext"
9436 if { (eval echo "$as_me:9436: \"$ac_link\"") >&5
9437   (eval $ac_link) 2>&5
9438   ac_status=$?
9439   echo "$as_me:9439: \$? = $ac_status" >&5
9440   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9441   { (eval echo "$as_me:9441: \"$ac_try\"") >&5
9442   (eval $ac_try) 2>&5
9443   ac_status=$?
9444   echo "$as_me:9444: \$? = $ac_status" >&5
9445   (exit "$ac_status"); }; }; then
9446
9447         cf_cv_ncurses_version=`cat $cf_tempfile`
9448 else
9449   echo "$as_me: program exited with status $ac_status" >&5
9450 echo "$as_me: failed program was:" >&5
9451 cat "conftest.$ac_ext" >&5
9452 fi
9453 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9454 fi
9455         rm -f "$cf_tempfile"
9456
9457 fi
9458 echo "$as_me:9458: result: $cf_cv_ncurses_version" >&5
9459 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9460 test "$cf_cv_ncurses_version" = no ||
9461 cat >>confdefs.h <<\EOF
9462 #define NCURSES 1
9463 EOF
9464
9465 cf_nculib_root=$cf_cv_screen
9466         # This works, except for the special case where we find gpm, but
9467         # ncurses is in a nonstandard location via $LIBS, and we really want
9468         # to link gpm.
9469 cf_ncurses_LIBS=""
9470 cf_ncurses_SAVE="$LIBS"
9471 echo "$as_me:9471: checking for Gpm_Open in -lgpm" >&5
9472 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9473 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9474   echo $ECHO_N "(cached) $ECHO_C" >&6
9475 else
9476   ac_check_lib_save_LIBS=$LIBS
9477 LIBS="-lgpm  $LIBS"
9478 cat >"conftest.$ac_ext" <<_ACEOF
9479 #line 9479 "configure"
9480 #include "confdefs.h"
9481
9482 /* Override any gcc2 internal prototype to avoid an error.  */
9483 #ifdef __cplusplus
9484 extern "C"
9485 #endif
9486 /* We use char because int might match the return type of a gcc2
9487    builtin and then its argument prototype would still apply.  */
9488 char Gpm_Open ();
9489 int
9490 main (void)
9491 {
9492 Gpm_Open ();
9493   ;
9494   return 0;
9495 }
9496 _ACEOF
9497 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9498 if { (eval echo "$as_me:9498: \"$ac_link\"") >&5
9499   (eval $ac_link) 2>&5
9500   ac_status=$?
9501   echo "$as_me:9501: \$? = $ac_status" >&5
9502   (exit "$ac_status"); } &&
9503          { ac_try='test -s "conftest$ac_exeext"'
9504   { (eval echo "$as_me:9504: \"$ac_try\"") >&5
9505   (eval $ac_try) 2>&5
9506   ac_status=$?
9507   echo "$as_me:9507: \$? = $ac_status" >&5
9508   (exit "$ac_status"); }; }; then
9509   ac_cv_lib_gpm_Gpm_Open=yes
9510 else
9511   echo "$as_me: failed program was:" >&5
9512 cat "conftest.$ac_ext" >&5
9513 ac_cv_lib_gpm_Gpm_Open=no
9514 fi
9515 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9516 LIBS=$ac_check_lib_save_LIBS
9517 fi
9518 echo "$as_me:9518: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9519 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9520 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9521   echo "$as_me:9521: checking for initscr in -lgpm" >&5
9522 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9523 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9524   echo $ECHO_N "(cached) $ECHO_C" >&6
9525 else
9526   ac_check_lib_save_LIBS=$LIBS
9527 LIBS="-lgpm  $LIBS"
9528 cat >"conftest.$ac_ext" <<_ACEOF
9529 #line 9529 "configure"
9530 #include "confdefs.h"
9531
9532 /* Override any gcc2 internal prototype to avoid an error.  */
9533 #ifdef __cplusplus
9534 extern "C"
9535 #endif
9536 /* We use char because int might match the return type of a gcc2
9537    builtin and then its argument prototype would still apply.  */
9538 char initscr ();
9539 int
9540 main (void)
9541 {
9542 initscr ();
9543   ;
9544   return 0;
9545 }
9546 _ACEOF
9547 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9548 if { (eval echo "$as_me:9548: \"$ac_link\"") >&5
9549   (eval $ac_link) 2>&5
9550   ac_status=$?
9551   echo "$as_me:9551: \$? = $ac_status" >&5
9552   (exit "$ac_status"); } &&
9553          { ac_try='test -s "conftest$ac_exeext"'
9554   { (eval echo "$as_me:9554: \"$ac_try\"") >&5
9555   (eval $ac_try) 2>&5
9556   ac_status=$?
9557   echo "$as_me:9557: \$? = $ac_status" >&5
9558   (exit "$ac_status"); }; }; then
9559   ac_cv_lib_gpm_initscr=yes
9560 else
9561   echo "$as_me: failed program was:" >&5
9562 cat "conftest.$ac_ext" >&5
9563 ac_cv_lib_gpm_initscr=no
9564 fi
9565 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9566 LIBS=$ac_check_lib_save_LIBS
9567 fi
9568 echo "$as_me:9568: result: $ac_cv_lib_gpm_initscr" >&5
9569 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9570 if test "$ac_cv_lib_gpm_initscr" = yes; then
9571   LIBS="$cf_ncurses_SAVE"
9572 else
9573   cf_ncurses_LIBS="-lgpm"
9574 fi
9575
9576 fi
9577
9578 case "$host_os" in
9579 (freebsd*)
9580         # This is only necessary if you are linking against an obsolete
9581         # version of ncurses (but it should do no harm, since it's static).
9582         if test "$cf_nculib_root" = ncurses ; then
9583                 echo "$as_me:9583: checking for tgoto in -lmytinfo" >&5
9584 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9585 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9586   echo $ECHO_N "(cached) $ECHO_C" >&6
9587 else
9588   ac_check_lib_save_LIBS=$LIBS
9589 LIBS="-lmytinfo  $LIBS"
9590 cat >"conftest.$ac_ext" <<_ACEOF
9591 #line 9591 "configure"
9592 #include "confdefs.h"
9593
9594 /* Override any gcc2 internal prototype to avoid an error.  */
9595 #ifdef __cplusplus
9596 extern "C"
9597 #endif
9598 /* We use char because int might match the return type of a gcc2
9599    builtin and then its argument prototype would still apply.  */
9600 char tgoto ();
9601 int
9602 main (void)
9603 {
9604 tgoto ();
9605   ;
9606   return 0;
9607 }
9608 _ACEOF
9609 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9610 if { (eval echo "$as_me:9610: \"$ac_link\"") >&5
9611   (eval $ac_link) 2>&5
9612   ac_status=$?
9613   echo "$as_me:9613: \$? = $ac_status" >&5
9614   (exit "$ac_status"); } &&
9615          { ac_try='test -s "conftest$ac_exeext"'
9616   { (eval echo "$as_me:9616: \"$ac_try\"") >&5
9617   (eval $ac_try) 2>&5
9618   ac_status=$?
9619   echo "$as_me:9619: \$? = $ac_status" >&5
9620   (exit "$ac_status"); }; }; then
9621   ac_cv_lib_mytinfo_tgoto=yes
9622 else
9623   echo "$as_me: failed program was:" >&5
9624 cat "conftest.$ac_ext" >&5
9625 ac_cv_lib_mytinfo_tgoto=no
9626 fi
9627 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9628 LIBS=$ac_check_lib_save_LIBS
9629 fi
9630 echo "$as_me:9630: result: $ac_cv_lib_mytinfo_tgoto" >&5
9631 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9632 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9633   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9634 fi
9635
9636         fi
9637         ;;
9638 esac
9639
9640 cf_add_libs="$LIBS"
9641 # reverse order
9642 cf_add_0lib=
9643 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9644 # filter duplicates
9645 for cf_add_1lib in $cf_add_0lib; do
9646         for cf_add_2lib in $cf_add_libs; do
9647                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9648                         cf_add_1lib=
9649                         break
9650                 fi
9651         done
9652         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9653 done
9654 LIBS="$cf_add_libs"
9655
9656 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9657 then
9658
9659 cf_add_libs="$LIBS"
9660 # reverse order
9661 cf_add_0lib=
9662 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9663 # filter duplicates
9664 for cf_add_1lib in $cf_add_0lib; do
9665         for cf_add_2lib in $cf_add_libs; do
9666                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9667                         cf_add_1lib=
9668                         break
9669                 fi
9670         done
9671         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9672 done
9673 LIBS="$cf_add_libs"
9674
9675 else
9676
9677         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9678         cf_libdir=""
9679         echo "$as_me:9679: checking for initscr" >&5
9680 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9681 if test "${ac_cv_func_initscr+set}" = set; then
9682   echo $ECHO_N "(cached) $ECHO_C" >&6
9683 else
9684   cat >"conftest.$ac_ext" <<_ACEOF
9685 #line 9685 "configure"
9686 #include "confdefs.h"
9687 #define initscr autoconf_temporary
9688 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9689 #undef initscr
9690
9691 #ifdef __cplusplus
9692 extern "C"
9693 #endif
9694
9695 /* We use char because int might match the return type of a gcc2
9696    builtin and then its argument prototype would still apply.  */
9697 char initscr (void);
9698
9699 int
9700 main (void)
9701 {
9702
9703 /* The GNU C library defines stubs for functions which it implements
9704     to always fail with ENOSYS.  Some functions are actually named
9705     something starting with __ and the normal name is an alias.  */
9706 #if defined (__stub_initscr) || defined (__stub___initscr)
9707 #error found stub for initscr
9708 #endif
9709
9710         return initscr ();
9711   ;
9712   return 0;
9713 }
9714 _ACEOF
9715 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9716 if { (eval echo "$as_me:9716: \"$ac_link\"") >&5
9717   (eval $ac_link) 2>&5
9718   ac_status=$?
9719   echo "$as_me:9719: \$? = $ac_status" >&5
9720   (exit "$ac_status"); } &&
9721          { ac_try='test -s "conftest$ac_exeext"'
9722   { (eval echo "$as_me:9722: \"$ac_try\"") >&5
9723   (eval $ac_try) 2>&5
9724   ac_status=$?
9725   echo "$as_me:9725: \$? = $ac_status" >&5
9726   (exit "$ac_status"); }; }; then
9727   ac_cv_func_initscr=yes
9728 else
9729   echo "$as_me: failed program was:" >&5
9730 cat "conftest.$ac_ext" >&5
9731 ac_cv_func_initscr=no
9732 fi
9733 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9734 fi
9735 echo "$as_me:9735: result: $ac_cv_func_initscr" >&5
9736 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9737 if test "$ac_cv_func_initscr" = yes; then
9738   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9739 else
9740
9741                 cf_save_LIBS="$LIBS"
9742                 echo "$as_me:9742: checking for initscr in -l$cf_nculib_root" >&5
9743 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9744                 LIBS="-l$cf_nculib_root $LIBS"
9745                 cat >"conftest.$ac_ext" <<_ACEOF
9746 #line 9746 "configure"
9747 #include "confdefs.h"
9748 #include <${cf_cv_ncurses_header:-curses.h}>
9749 int
9750 main (void)
9751 {
9752 initscr()
9753   ;
9754   return 0;
9755 }
9756 _ACEOF
9757 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9758 if { (eval echo "$as_me:9758: \"$ac_link\"") >&5
9759   (eval $ac_link) 2>&5
9760   ac_status=$?
9761   echo "$as_me:9761: \$? = $ac_status" >&5
9762   (exit "$ac_status"); } &&
9763          { ac_try='test -s "conftest$ac_exeext"'
9764   { (eval echo "$as_me:9764: \"$ac_try\"") >&5
9765   (eval $ac_try) 2>&5
9766   ac_status=$?
9767   echo "$as_me:9767: \$? = $ac_status" >&5
9768   (exit "$ac_status"); }; }; then
9769   echo "$as_me:9769: result: yes" >&5
9770 echo "${ECHO_T}yes" >&6
9771                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9772
9773 else
9774   echo "$as_me: failed program was:" >&5
9775 cat "conftest.$ac_ext" >&5
9776 echo "$as_me:9776: result: no" >&5
9777 echo "${ECHO_T}no" >&6
9778
9779 cf_search=
9780 cf_library_path_list=""
9781 if test -n "${LDFLAGS}${LIBS}" ; then
9782         for cf_library_path in $LDFLAGS $LIBS
9783         do
9784                 case "$cf_library_path" in
9785                 (-L*)
9786                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9787
9788 test "x$cf_library_path" != "xNONE" && \
9789 test -d "$cf_library_path" && \
9790  {
9791         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9792         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9793         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9794         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9795         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9796         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"
9797 }
9798
9799                         cf_library_path_list="$cf_library_path_list $cf_search"
9800                         ;;
9801                 esac
9802         done
9803 fi
9804
9805 cf_search=
9806
9807 test "x$prefix" != "xNONE" && \
9808 test -d "$prefix" && \
9809  {
9810         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9811         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9812         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9813         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9814         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9815         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9816 }
9817
9818 for cf_subdir_prefix in \
9819         /usr \
9820         /usr/local \
9821         /usr/pkg \
9822         /opt \
9823         /opt/local \
9824         $HOME
9825 do
9826
9827 test "x$cf_subdir_prefix" != "x$prefix" && \
9828 test -d "$cf_subdir_prefix" && \
9829 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9830         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9831         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9832         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9833         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9834         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9835         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"
9836 }
9837
9838 done
9839
9840 cf_search="$cf_library_path_list $cf_search"
9841
9842                         for cf_libdir in $cf_search
9843                         do
9844                                 echo "$as_me:9844: checking for -l$cf_nculib_root in $cf_libdir" >&5
9845 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9846                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9847                                 cat >"conftest.$ac_ext" <<_ACEOF
9848 #line 9848 "configure"
9849 #include "confdefs.h"
9850 #include <${cf_cv_ncurses_header:-curses.h}>
9851 int
9852 main (void)
9853 {
9854 initscr()
9855   ;
9856   return 0;
9857 }
9858 _ACEOF
9859 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9860 if { (eval echo "$as_me:9860: \"$ac_link\"") >&5
9861   (eval $ac_link) 2>&5
9862   ac_status=$?
9863   echo "$as_me:9863: \$? = $ac_status" >&5
9864   (exit "$ac_status"); } &&
9865          { ac_try='test -s "conftest$ac_exeext"'
9866   { (eval echo "$as_me:9866: \"$ac_try\"") >&5
9867   (eval $ac_try) 2>&5
9868   ac_status=$?
9869   echo "$as_me:9869: \$? = $ac_status" >&5
9870   (exit "$ac_status"); }; }; then
9871   echo "$as_me:9871: result: yes" >&5
9872 echo "${ECHO_T}yes" >&6
9873                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9874                                          break
9875 else
9876   echo "$as_me: failed program was:" >&5
9877 cat "conftest.$ac_ext" >&5
9878 echo "$as_me:9878: result: no" >&5
9879 echo "${ECHO_T}no" >&6
9880                                          LIBS="$cf_save_LIBS"
9881 fi
9882 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9883                         done
9884
9885 fi
9886 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9887
9888 fi
9889
9890 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9891
9892 if test "$cf_found_library" = no ; then
9893         { { echo "$as_me:9893: error: Cannot link $cf_nculib_root library" >&5
9894 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9895    { (exit 1); exit 1; }; }
9896 fi
9897
9898 fi
9899
9900 if test -n "$cf_ncurses_LIBS" ; then
9901         echo "$as_me:9901: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9902 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9903         cf_ncurses_SAVE="$LIBS"
9904         for p in $cf_ncurses_LIBS ; do
9905                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9906                 if test "$q" != "$LIBS" ; then
9907                         LIBS="$q"
9908                 fi
9909         done
9910         cat >"conftest.$ac_ext" <<_ACEOF
9911 #line 9911 "configure"
9912 #include "confdefs.h"
9913 #include <${cf_cv_ncurses_header:-curses.h}>
9914 int
9915 main (void)
9916 {
9917 initscr(); mousemask(0,0); tigetstr((char *)0);
9918   ;
9919   return 0;
9920 }
9921 _ACEOF
9922 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9923 if { (eval echo "$as_me:9923: \"$ac_link\"") >&5
9924   (eval $ac_link) 2>&5
9925   ac_status=$?
9926   echo "$as_me:9926: \$? = $ac_status" >&5
9927   (exit "$ac_status"); } &&
9928          { ac_try='test -s "conftest$ac_exeext"'
9929   { (eval echo "$as_me:9929: \"$ac_try\"") >&5
9930   (eval $ac_try) 2>&5
9931   ac_status=$?
9932   echo "$as_me:9932: \$? = $ac_status" >&5
9933   (exit "$ac_status"); }; }; then
9934   echo "$as_me:9934: result: yes" >&5
9935 echo "${ECHO_T}yes" >&6
9936 else
9937   echo "$as_me: failed program was:" >&5
9938 cat "conftest.$ac_ext" >&5
9939 echo "$as_me:9939: result: no" >&5
9940 echo "${ECHO_T}no" >&6
9941                  LIBS="$cf_ncurses_SAVE"
9942 fi
9943 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9944 fi
9945
9946 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9947
9948 cat >>confdefs.h <<EOF
9949 #define $cf_nculib_ROOT 1
9950 EOF
9951
9952         fi
9953 else
9954         NCURSES_CONFIG=none
9955 fi
9956
9957         ;;
9958 (ncurses*)
9959
9960 cf_ncuconfig_root=$cf_cv_screen
9961 cf_have_ncuconfig=no
9962
9963 if test "x${PKG_CONFIG:=none}" != xnone; then
9964         echo "$as_me:9964: checking pkg-config for $cf_ncuconfig_root" >&5
9965 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9966         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9967                 echo "$as_me:9967: result: yes" >&5
9968 echo "${ECHO_T}yes" >&6
9969
9970                 echo "$as_me:9970: checking if the $cf_ncuconfig_root package files work" >&5
9971 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9972                 cf_have_ncuconfig=unknown
9973
9974                 cf_save_CFLAGS="$CFLAGS"
9975                 cf_save_CPPFLAGS="$CPPFLAGS"
9976                 cf_save_LIBS="$LIBS"
9977
9978                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9979                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9980
9981                 # while -W for passing linker flags is prevalent, it is not "standard".
9982                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9983                 # incompatible _and_ non-standard -W option which gives an error.  Work
9984                 # around that pitfall.
9985                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9986                 (x*c[89]9@@*-W*)
9987
9988 cf_fix_cppflags=no
9989 cf_new_cflags=
9990 cf_new_cppflags=
9991 cf_new_extra_cppflags=
9992
9993 for cf_add_cflags in $cf_pkg_cflags
9994 do
9995 case "$cf_fix_cppflags" in
9996 (no)
9997         case "$cf_add_cflags" in
9998         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9999                 case "$cf_add_cflags" in
10000                 (-D*)
10001                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10002
10003                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10004                                 && test -z "${cf_tst_cflags}" \
10005                                 && cf_fix_cppflags=yes
10006
10007                         if test "$cf_fix_cppflags" = yes ; then
10008
10009         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10010         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10011
10012                                 continue
10013                         elif test "${cf_tst_cflags}" = "\"'" ; then
10014
10015         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10016         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10017
10018                                 continue
10019                         fi
10020                         ;;
10021                 esac
10022                 case "$CPPFLAGS" in
10023                 (*$cf_add_cflags)
10024                         ;;
10025                 (*)
10026                         case "$cf_add_cflags" in
10027                         (-D*)
10028                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10029
10030 CPPFLAGS=`echo "$CPPFLAGS" | \
10031         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10032                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10033
10034                                 ;;
10035                         esac
10036
10037         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10038         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10039
10040                         ;;
10041                 esac
10042                 ;;
10043         (*)
10044
10045         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10046         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10047
10048                 ;;
10049         esac
10050         ;;
10051 (yes)
10052
10053         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10054         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10055
10056         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10057
10058         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10059                 && test -z "${cf_tst_cflags}" \
10060                 && cf_fix_cppflags=no
10061         ;;
10062 esac
10063 done
10064
10065 if test -n "$cf_new_cflags" ; then
10066
10067         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10068         CFLAGS="${CFLAGS}$cf_new_cflags"
10069
10070 fi
10071
10072 if test -n "$cf_new_cppflags" ; then
10073
10074         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10075         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10076
10077 fi
10078
10079 if test -n "$cf_new_extra_cppflags" ; then
10080
10081         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10082         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10083
10084 fi
10085
10086 cf_add_libs="$LIBS"
10087 # reverse order
10088 cf_add_0lib=
10089 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10090 # filter duplicates
10091 for cf_add_1lib in $cf_add_0lib; do
10092         for cf_add_2lib in $cf_add_libs; do
10093                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10094                         cf_add_1lib=
10095                         break
10096                 fi
10097         done
10098         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10099 done
10100 LIBS="$cf_add_libs"
10101
10102                         cat >"conftest.$ac_ext" <<_ACEOF
10103 #line 10103 "configure"
10104 #include "confdefs.h"
10105 #include <${cf_cv_ncurses_header:-curses.h}>
10106 int
10107 main (void)
10108 {
10109 initscr(); mousemask(0,0); tigetstr((char *)0);
10110   ;
10111   return 0;
10112 }
10113 _ACEOF
10114 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10115 if { (eval echo "$as_me:10115: \"$ac_link\"") >&5
10116   (eval $ac_link) 2>&5
10117   ac_status=$?
10118   echo "$as_me:10118: \$? = $ac_status" >&5
10119   (exit "$ac_status"); } &&
10120          { ac_try='test -s "conftest$ac_exeext"'
10121   { (eval echo "$as_me:10121: \"$ac_try\"") >&5
10122   (eval $ac_try) 2>&5
10123   ac_status=$?
10124   echo "$as_me:10124: \$? = $ac_status" >&5
10125   (exit "$ac_status"); }; }; then
10126   if test "$cross_compiling" = yes; then
10127   cf_test_ncuconfig=maybe
10128 else
10129   cat >"conftest.$ac_ext" <<_ACEOF
10130 #line 10130 "configure"
10131 #include "confdefs.h"
10132 #include <${cf_cv_ncurses_header:-curses.h}>
10133                                         int main(void)
10134                                         { const char *xx = curses_version(); return (xx == 0); }
10135 _ACEOF
10136 rm -f "conftest$ac_exeext"
10137 if { (eval echo "$as_me:10137: \"$ac_link\"") >&5
10138   (eval $ac_link) 2>&5
10139   ac_status=$?
10140   echo "$as_me:10140: \$? = $ac_status" >&5
10141   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10142   { (eval echo "$as_me:10142: \"$ac_try\"") >&5
10143   (eval $ac_try) 2>&5
10144   ac_status=$?
10145   echo "$as_me:10145: \$? = $ac_status" >&5
10146   (exit "$ac_status"); }; }; then
10147   cf_test_ncuconfig=yes
10148 else
10149   echo "$as_me: program exited with status $ac_status" >&5
10150 echo "$as_me: failed program was:" >&5
10151 cat "conftest.$ac_ext" >&5
10152 cf_test_ncuconfig=no
10153 fi
10154 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10155 fi
10156 else
10157   echo "$as_me: failed program was:" >&5
10158 cat "conftest.$ac_ext" >&5
10159 cf_test_ncuconfig=no
10160 fi
10161 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10162
10163                         CFLAGS="$cf_save_CFLAGS"
10164                         CPPFLAGS="$cf_save_CPPFLAGS"
10165                         LIBS="$cf_save_LIBS"
10166
10167                         if test "x$cf_test_ncuconfig" != xyes; then
10168                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10169                                 cf_pkg_cflags="$cf_temp"
10170                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10171                                 cf_pkg_libs="$cf_temp"
10172                         fi
10173                         ;;
10174                 esac
10175
10176 cf_fix_cppflags=no
10177 cf_new_cflags=
10178 cf_new_cppflags=
10179 cf_new_extra_cppflags=
10180
10181 for cf_add_cflags in $cf_pkg_cflags
10182 do
10183 case "$cf_fix_cppflags" in
10184 (no)
10185         case "$cf_add_cflags" in
10186         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10187                 case "$cf_add_cflags" in
10188                 (-D*)
10189                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10190
10191                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10192                                 && test -z "${cf_tst_cflags}" \
10193                                 && cf_fix_cppflags=yes
10194
10195                         if test "$cf_fix_cppflags" = yes ; then
10196
10197         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10198         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10199
10200                                 continue
10201                         elif test "${cf_tst_cflags}" = "\"'" ; then
10202
10203         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10204         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10205
10206                                 continue
10207                         fi
10208                         ;;
10209                 esac
10210                 case "$CPPFLAGS" in
10211                 (*$cf_add_cflags)
10212                         ;;
10213                 (*)
10214                         case "$cf_add_cflags" in
10215                         (-D*)
10216                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10217
10218 CPPFLAGS=`echo "$CPPFLAGS" | \
10219         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10220                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10221
10222                                 ;;
10223                         esac
10224
10225         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10226         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10227
10228                         ;;
10229                 esac
10230                 ;;
10231         (*)
10232
10233         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10234         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10235
10236                 ;;
10237         esac
10238         ;;
10239 (yes)
10240
10241         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10242         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10243
10244         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10245
10246         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10247                 && test -z "${cf_tst_cflags}" \
10248                 && cf_fix_cppflags=no
10249         ;;
10250 esac
10251 done
10252
10253 if test -n "$cf_new_cflags" ; then
10254
10255         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10256         CFLAGS="${CFLAGS}$cf_new_cflags"
10257
10258 fi
10259
10260 if test -n "$cf_new_cppflags" ; then
10261
10262         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10263         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10264
10265 fi
10266
10267 if test -n "$cf_new_extra_cppflags" ; then
10268
10269         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10270         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10271
10272 fi
10273
10274 cf_add_libs="$LIBS"
10275 # reverse order
10276 cf_add_0lib=
10277 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10278 # filter duplicates
10279 for cf_add_1lib in $cf_add_0lib; do
10280         for cf_add_2lib in $cf_add_libs; do
10281                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10282                         cf_add_1lib=
10283                         break
10284                 fi
10285         done
10286         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10287 done
10288 LIBS="$cf_add_libs"
10289
10290                 cat >"conftest.$ac_ext" <<_ACEOF
10291 #line 10291 "configure"
10292 #include "confdefs.h"
10293 #include <${cf_cv_ncurses_header:-curses.h}>
10294 int
10295 main (void)
10296 {
10297 initscr(); mousemask(0,0); tigetstr((char *)0);
10298   ;
10299   return 0;
10300 }
10301 _ACEOF
10302 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10303 if { (eval echo "$as_me:10303: \"$ac_link\"") >&5
10304   (eval $ac_link) 2>&5
10305   ac_status=$?
10306   echo "$as_me:10306: \$? = $ac_status" >&5
10307   (exit "$ac_status"); } &&
10308          { ac_try='test -s "conftest$ac_exeext"'
10309   { (eval echo "$as_me:10309: \"$ac_try\"") >&5
10310   (eval $ac_try) 2>&5
10311   ac_status=$?
10312   echo "$as_me:10312: \$? = $ac_status" >&5
10313   (exit "$ac_status"); }; }; then
10314   if test "$cross_compiling" = yes; then
10315   cf_have_ncuconfig=maybe
10316 else
10317   cat >"conftest.$ac_ext" <<_ACEOF
10318 #line 10318 "configure"
10319 #include "confdefs.h"
10320 #include <${cf_cv_ncurses_header:-curses.h}>
10321                                 int main(void)
10322                                 { const char *xx = curses_version(); return (xx == 0); }
10323 _ACEOF
10324 rm -f "conftest$ac_exeext"
10325 if { (eval echo "$as_me:10325: \"$ac_link\"") >&5
10326   (eval $ac_link) 2>&5
10327   ac_status=$?
10328   echo "$as_me:10328: \$? = $ac_status" >&5
10329   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10330   { (eval echo "$as_me:10330: \"$ac_try\"") >&5
10331   (eval $ac_try) 2>&5
10332   ac_status=$?
10333   echo "$as_me:10333: \$? = $ac_status" >&5
10334   (exit "$ac_status"); }; }; then
10335   cf_have_ncuconfig=yes
10336 else
10337   echo "$as_me: program exited with status $ac_status" >&5
10338 echo "$as_me: failed program was:" >&5
10339 cat "conftest.$ac_ext" >&5
10340 cf_have_ncuconfig=no
10341 fi
10342 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10343 fi
10344 else
10345   echo "$as_me: failed program was:" >&5
10346 cat "conftest.$ac_ext" >&5
10347 cf_have_ncuconfig=no
10348 fi
10349 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10350                 echo "$as_me:10350: result: $cf_have_ncuconfig" >&5
10351 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10352                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10353                 if test "$cf_have_ncuconfig" != "yes"
10354                 then
10355                         CPPFLAGS="$cf_save_CPPFLAGS"
10356                         LIBS="$cf_save_LIBS"
10357                         NCURSES_CONFIG_PKG=none
10358                 else
10359
10360 cat >>confdefs.h <<\EOF
10361 #define NCURSES 1
10362 EOF
10363
10364                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10365
10366 echo "$as_me:10366: checking for terminfo header" >&5
10367 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10368 if test "${cf_cv_term_header+set}" = set; then
10369   echo $ECHO_N "(cached) $ECHO_C" >&6
10370 else
10371
10372 case "${cf_cv_ncurses_header}" in
10373 (*/ncurses.h|*/ncursesw.h)
10374         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10375         ;;
10376 (*)
10377         cf_term_header=term.h
10378         ;;
10379 esac
10380
10381 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10382 do
10383 cat >"conftest.$ac_ext" <<_ACEOF
10384 #line 10384 "configure"
10385 #include "confdefs.h"
10386 #include <stdio.h>
10387 #include <${cf_cv_ncurses_header:-curses.h}>
10388 #include <$cf_test>
10389
10390 int
10391 main (void)
10392 {
10393 int x = auto_left_margin; (void)x
10394   ;
10395   return 0;
10396 }
10397 _ACEOF
10398 rm -f "conftest.$ac_objext"
10399 if { (eval echo "$as_me:10399: \"$ac_compile\"") >&5
10400   (eval $ac_compile) 2>&5
10401   ac_status=$?
10402   echo "$as_me:10402: \$? = $ac_status" >&5
10403   (exit "$ac_status"); } &&
10404          { ac_try='test -s "conftest.$ac_objext"'
10405   { (eval echo "$as_me:10405: \"$ac_try\"") >&5
10406   (eval $ac_try) 2>&5
10407   ac_status=$?
10408   echo "$as_me:10408: \$? = $ac_status" >&5
10409   (exit "$ac_status"); }; }; then
10410
10411         cf_cv_term_header="$cf_test"
10412 else
10413   echo "$as_me: failed program was:" >&5
10414 cat "conftest.$ac_ext" >&5
10415
10416         cf_cv_term_header=unknown
10417
10418 fi
10419 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10420         test "$cf_cv_term_header" != unknown && break
10421 done
10422
10423 fi
10424 echo "$as_me:10424: result: $cf_cv_term_header" >&5
10425 echo "${ECHO_T}$cf_cv_term_header" >&6
10426
10427 # Set definitions to allow ifdef'ing to accommodate subdirectories
10428
10429 case "$cf_cv_term_header" in
10430 (*term.h)
10431
10432 cat >>confdefs.h <<\EOF
10433 #define HAVE_TERM_H 1
10434 EOF
10435
10436         ;;
10437 esac
10438
10439 case "$cf_cv_term_header" in
10440 (ncurses/term.h)
10441
10442 cat >>confdefs.h <<\EOF
10443 #define HAVE_NCURSES_TERM_H 1
10444 EOF
10445
10446         ;;
10447 (ncursesw/term.h)
10448
10449 cat >>confdefs.h <<\EOF
10450 #define HAVE_NCURSESW_TERM_H 1
10451 EOF
10452
10453         ;;
10454 esac
10455
10456                 fi
10457
10458         else
10459                 echo "$as_me:10459: result: no" >&5
10460 echo "${ECHO_T}no" >&6
10461                 NCURSES_CONFIG_PKG=none
10462         fi
10463 else
10464         NCURSES_CONFIG_PKG=none
10465 fi
10466
10467 if test "x$cf_have_ncuconfig" = "xno"; then
10468         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10469
10470 if test -n "$ac_tool_prefix"; then
10471   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10472   do
10473     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10474 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10475 echo "$as_me:10475: checking for $ac_word" >&5
10476 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10477 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10478   echo $ECHO_N "(cached) $ECHO_C" >&6
10479 else
10480   if test -n "$NCURSES_CONFIG"; then
10481   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10482 else
10483   ac_save_IFS=$IFS; IFS=$ac_path_separator
10484 ac_dummy="$PATH"
10485 for ac_dir in $ac_dummy; do
10486   IFS=$ac_save_IFS
10487   test -z "$ac_dir" && ac_dir=.
10488   $as_executable_p "$ac_dir/$ac_word" || continue
10489 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10490 echo "$as_me:10490: found $ac_dir/$ac_word" >&5
10491 break
10492 done
10493
10494 fi
10495 fi
10496 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10497 if test -n "$NCURSES_CONFIG"; then
10498   echo "$as_me:10498: result: $NCURSES_CONFIG" >&5
10499 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10500 else
10501   echo "$as_me:10501: result: no" >&5
10502 echo "${ECHO_T}no" >&6
10503 fi
10504
10505     test -n "$NCURSES_CONFIG" && break
10506   done
10507 fi
10508 if test -z "$NCURSES_CONFIG"; then
10509   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10510   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10511 do
10512   # Extract the first word of "$ac_prog", so it can be a program name with args.
10513 set dummy $ac_prog; ac_word=$2
10514 echo "$as_me:10514: checking for $ac_word" >&5
10515 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10516 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10517   echo $ECHO_N "(cached) $ECHO_C" >&6
10518 else
10519   if test -n "$ac_ct_NCURSES_CONFIG"; then
10520   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10521 else
10522   ac_save_IFS=$IFS; IFS=$ac_path_separator
10523 ac_dummy="$PATH"
10524 for ac_dir in $ac_dummy; do
10525   IFS=$ac_save_IFS
10526   test -z "$ac_dir" && ac_dir=.
10527   $as_executable_p "$ac_dir/$ac_word" || continue
10528 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10529 echo "$as_me:10529: found $ac_dir/$ac_word" >&5
10530 break
10531 done
10532
10533 fi
10534 fi
10535 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10536 if test -n "$ac_ct_NCURSES_CONFIG"; then
10537   echo "$as_me:10537: result: $ac_ct_NCURSES_CONFIG" >&5
10538 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10539 else
10540   echo "$as_me:10540: result: no" >&5
10541 echo "${ECHO_T}no" >&6
10542 fi
10543
10544   test -n "$ac_ct_NCURSES_CONFIG" && break
10545 done
10546 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10547
10548   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10549 fi
10550
10551         if test "$NCURSES_CONFIG" != none ; then
10552
10553 cf_fix_cppflags=no
10554 cf_new_cflags=
10555 cf_new_cppflags=
10556 cf_new_extra_cppflags=
10557
10558 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10559 do
10560 case "$cf_fix_cppflags" in
10561 (no)
10562         case "$cf_add_cflags" in
10563         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10564                 case "$cf_add_cflags" in
10565                 (-D*)
10566                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10567
10568                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10569                                 && test -z "${cf_tst_cflags}" \
10570                                 && cf_fix_cppflags=yes
10571
10572                         if test "$cf_fix_cppflags" = yes ; then
10573
10574         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10575         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10576
10577                                 continue
10578                         elif test "${cf_tst_cflags}" = "\"'" ; then
10579
10580         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10581         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10582
10583                                 continue
10584                         fi
10585                         ;;
10586                 esac
10587                 case "$CPPFLAGS" in
10588                 (*$cf_add_cflags)
10589                         ;;
10590                 (*)
10591                         case "$cf_add_cflags" in
10592                         (-D*)
10593                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10594
10595 CPPFLAGS=`echo "$CPPFLAGS" | \
10596         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10597                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10598
10599                                 ;;
10600                         esac
10601
10602         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10603         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10604
10605                         ;;
10606                 esac
10607                 ;;
10608         (*)
10609
10610         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10611         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10612
10613                 ;;
10614         esac
10615         ;;
10616 (yes)
10617
10618         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10619         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10620
10621         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10622
10623         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10624                 && test -z "${cf_tst_cflags}" \
10625                 && cf_fix_cppflags=no
10626         ;;
10627 esac
10628 done
10629
10630 if test -n "$cf_new_cflags" ; then
10631
10632         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10633         CFLAGS="${CFLAGS}$cf_new_cflags"
10634
10635 fi
10636
10637 if test -n "$cf_new_cppflags" ; then
10638
10639         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10640         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10641
10642 fi
10643
10644 if test -n "$cf_new_extra_cppflags" ; then
10645
10646         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10647         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10648
10649 fi
10650
10651 cf_add_libs="$LIBS"
10652 # reverse order
10653 cf_add_0lib=
10654 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10655 # filter duplicates
10656 for cf_add_1lib in $cf_add_0lib; do
10657         for cf_add_2lib in $cf_add_libs; do
10658                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10659                         cf_add_1lib=
10660                         break
10661                 fi
10662         done
10663         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10664 done
10665 LIBS="$cf_add_libs"
10666
10667                 # even with config script, some packages use no-override for curses.h
10668
10669 echo "$as_me:10669: checking if we have identified curses headers" >&5
10670 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10671 if test "${cf_cv_ncurses_header+set}" = set; then
10672   echo $ECHO_N "(cached) $ECHO_C" >&6
10673 else
10674
10675 cf_cv_ncurses_header=none
10676 for cf_header in \
10677         ncurses.h $cf_cv_screen/ncurses.h \
10678         curses.h $cf_cv_screen/curses.h
10679 do
10680 cat >"conftest.$ac_ext" <<_ACEOF
10681 #line 10681 "configure"
10682 #include "confdefs.h"
10683 #include <${cf_header}>
10684 int
10685 main (void)
10686 {
10687 initscr(); tgoto("?", 0,0)
10688   ;
10689   return 0;
10690 }
10691 _ACEOF
10692 rm -f "conftest.$ac_objext"
10693 if { (eval echo "$as_me:10693: \"$ac_compile\"") >&5
10694   (eval $ac_compile) 2>&5
10695   ac_status=$?
10696   echo "$as_me:10696: \$? = $ac_status" >&5
10697   (exit "$ac_status"); } &&
10698          { ac_try='test -s "conftest.$ac_objext"'
10699   { (eval echo "$as_me:10699: \"$ac_try\"") >&5
10700   (eval $ac_try) 2>&5
10701   ac_status=$?
10702   echo "$as_me:10702: \$? = $ac_status" >&5
10703   (exit "$ac_status"); }; }; then
10704   cf_cv_ncurses_header=$cf_header; break
10705 else
10706   echo "$as_me: failed program was:" >&5
10707 cat "conftest.$ac_ext" >&5
10708 fi
10709 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10710 done
10711
10712 fi
10713 echo "$as_me:10713: result: $cf_cv_ncurses_header" >&5
10714 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10715
10716 if test "$cf_cv_ncurses_header" = none ; then
10717         { { echo "$as_me:10717: error: No curses header-files found" >&5
10718 echo "$as_me: error: No curses header-files found" >&2;}
10719    { (exit 1); exit 1; }; }
10720 fi
10721
10722 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10723
10724 for ac_header in $cf_cv_ncurses_header
10725 do
10726 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10727 echo "$as_me:10727: checking for $ac_header" >&5
10728 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10729 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10730   echo $ECHO_N "(cached) $ECHO_C" >&6
10731 else
10732   cat >"conftest.$ac_ext" <<_ACEOF
10733 #line 10733 "configure"
10734 #include "confdefs.h"
10735 #include <$ac_header>
10736 _ACEOF
10737 if { (eval echo "$as_me:10737: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10738   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10739   ac_status=$?
10740   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10741   rm -f conftest.er1
10742   cat conftest.err >&5
10743   echo "$as_me:10743: \$? = $ac_status" >&5
10744   (exit "$ac_status"); } >/dev/null; then
10745   if test -s conftest.err; then
10746     ac_cpp_err=$ac_c_preproc_warn_flag
10747   else
10748     ac_cpp_err=
10749   fi
10750 else
10751   ac_cpp_err=yes
10752 fi
10753 if test -z "$ac_cpp_err"; then
10754   eval "$as_ac_Header=yes"
10755 else
10756   echo "$as_me: failed program was:" >&5
10757   cat "conftest.$ac_ext" >&5
10758   eval "$as_ac_Header=no"
10759 fi
10760 rm -f conftest.err "conftest.$ac_ext"
10761 fi
10762 echo "$as_me:10762: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10763 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10764 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10765   cat >>confdefs.h <<EOF
10766 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10767 EOF
10768
10769 fi
10770 done
10771
10772 cat >>confdefs.h <<\EOF
10773 #define NCURSES 1
10774 EOF
10775
10776 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10777
10778                 cat >>confdefs.h <<EOF
10779 #define $cf_nculib_ROOT 1
10780 EOF
10781
10782                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10783
10784         else
10785
10786 cf_ncuhdr_root=$cf_cv_screen
10787
10788 test -n "$cf_cv_curses_dir" && \
10789 test "$cf_cv_curses_dir" != "no" && { \
10790
10791 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10792   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10793   do
10794         while test "$cf_add_incdir" != /usr/include
10795         do
10796           if test -d "$cf_add_incdir"
10797           then
10798                 cf_have_incdir=no
10799                 if test -n "$CFLAGS$CPPFLAGS" ; then
10800                   # a loop is needed to ensure we can add subdirs of existing dirs
10801                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10802                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10803                           cf_have_incdir=yes; break
10804                         fi
10805                   done
10806                 fi
10807
10808                 if test "$cf_have_incdir" = no ; then
10809                   if test "$cf_add_incdir" = /usr/local/include ; then
10810                         if test "$GCC" = yes
10811                         then
10812                           cf_save_CPPFLAGS=$CPPFLAGS
10813
10814         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10815         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10816
10817                           cat >"conftest.$ac_ext" <<_ACEOF
10818 #line 10818 "configure"
10819 #include "confdefs.h"
10820 #include <stdio.h>
10821 int
10822 main (void)
10823 {
10824 printf("Hello")
10825   ;
10826   return 0;
10827 }
10828 _ACEOF
10829 rm -f "conftest.$ac_objext"
10830 if { (eval echo "$as_me:10830: \"$ac_compile\"") >&5
10831   (eval $ac_compile) 2>&5
10832   ac_status=$?
10833   echo "$as_me:10833: \$? = $ac_status" >&5
10834   (exit "$ac_status"); } &&
10835          { ac_try='test -s "conftest.$ac_objext"'
10836   { (eval echo "$as_me:10836: \"$ac_try\"") >&5
10837   (eval $ac_try) 2>&5
10838   ac_status=$?
10839   echo "$as_me:10839: \$? = $ac_status" >&5
10840   (exit "$ac_status"); }; }; then
10841   :
10842 else
10843   echo "$as_me: failed program was:" >&5
10844 cat "conftest.$ac_ext" >&5
10845 cf_have_incdir=yes
10846 fi
10847 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10848                           CPPFLAGS=$cf_save_CPPFLAGS
10849                         fi
10850                   fi
10851                 fi
10852
10853                 if test "$cf_have_incdir" = no ; then
10854                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10855
10856 echo "${as_me:-configure}:10856: testing adding $cf_add_incdir to include-path ..." 1>&5
10857
10858                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10859
10860                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10861                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10862                   cf_add_incdir="$cf_top_incdir"
10863                 else
10864                   break
10865                 fi
10866           else
10867                 break
10868           fi
10869         done
10870   done
10871 fi
10872
10873 }
10874
10875 echo "$as_me:10875: checking for $cf_ncuhdr_root header in include-path" >&5
10876 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10877 if test "${cf_cv_ncurses_h+set}" = set; then
10878   echo $ECHO_N "(cached) $ECHO_C" >&6
10879 else
10880
10881         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10882         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10883         for cf_header in $cf_header_list
10884         do
10885
10886         cat >"conftest.$ac_ext" <<_ACEOF
10887 #line 10887 "configure"
10888 #include "confdefs.h"
10889
10890 #include <$cf_header>
10891 int
10892 main (void)
10893 {
10894
10895 #ifdef NCURSES_VERSION
10896
10897 printf("%s\\n", NCURSES_VERSION);
10898 #else
10899 #ifdef __NCURSES_H
10900 printf("old\\n");
10901 #else
10902         make an error
10903 #endif
10904 #endif
10905
10906   ;
10907   return 0;
10908 }
10909 _ACEOF
10910 rm -f "conftest.$ac_objext"
10911 if { (eval echo "$as_me:10911: \"$ac_compile\"") >&5
10912   (eval $ac_compile) 2>&5
10913   ac_status=$?
10914   echo "$as_me:10914: \$? = $ac_status" >&5
10915   (exit "$ac_status"); } &&
10916          { ac_try='test -s "conftest.$ac_objext"'
10917   { (eval echo "$as_me:10917: \"$ac_try\"") >&5
10918   (eval $ac_try) 2>&5
10919   ac_status=$?
10920   echo "$as_me:10920: \$? = $ac_status" >&5
10921   (exit "$ac_status"); }; }; then
10922   cf_cv_ncurses_h=$cf_header
10923
10924 else
10925   echo "$as_me: failed program was:" >&5
10926 cat "conftest.$ac_ext" >&5
10927 cf_cv_ncurses_h=no
10928 fi
10929 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10930
10931                 test "$cf_cv_ncurses_h" != no && break
10932         done
10933
10934 fi
10935 echo "$as_me:10935: result: $cf_cv_ncurses_h" >&5
10936 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10937
10938 if test "$cf_cv_ncurses_h" != no ; then
10939         cf_cv_ncurses_header=$cf_cv_ncurses_h
10940 else
10941
10942 echo "$as_me:10942: checking for $cf_ncuhdr_root include-path" >&5
10943 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10944 if test "${cf_cv_ncurses_h2+set}" = set; then
10945   echo $ECHO_N "(cached) $ECHO_C" >&6
10946 else
10947
10948         test -n "$verbose" && echo
10949
10950 cf_search=
10951
10952 # collect the current set of include-directories from compiler flags
10953 cf_header_path_list=""
10954 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10955         for cf_header_path in $CPPFLAGS $CFLAGS
10956         do
10957                 case "$cf_header_path" in
10958                 (-I*)
10959                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10960
10961 test "x$cf_header_path" != "xNONE" && \
10962 test -d "$cf_header_path" && \
10963  {
10964         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10965         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10966         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10967         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10968         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10969         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"
10970 }
10971
10972                         cf_header_path_list="$cf_header_path_list $cf_search"
10973                         ;;
10974                 esac
10975         done
10976 fi
10977
10978 # add the variations for the package we are looking for
10979
10980 cf_search=
10981
10982 test "x$prefix" != "xNONE" && \
10983 test -d "$prefix" && \
10984  {
10985         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10986         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10987         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10988         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10989         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10990         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10991 }
10992
10993 for cf_subdir_prefix in \
10994         /usr \
10995         /usr/local \
10996         /usr/pkg \
10997         /opt \
10998         /opt/local \
10999         $HOME
11000 do
11001
11002 test "x$cf_subdir_prefix" != "x$prefix" && \
11003 test -d "$cf_subdir_prefix" && \
11004 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11005         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
11006         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
11007         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11008         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11009         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11010         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"
11011 }
11012
11013 done
11014
11015 test "$includedir" != NONE && \
11016 test "$includedir" != "/usr/include" && \
11017 test -d "$includedir" && {
11018         test -d "$includedir" &&    cf_search="$cf_search $includedir"
11019         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
11020 }
11021
11022 test "$oldincludedir" != NONE && \
11023 test "$oldincludedir" != "/usr/include" && \
11024 test -d "$oldincludedir" && {
11025         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
11026         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
11027 }
11028
11029 cf_search="$cf_search $cf_header_path_list"
11030
11031         test -n "$verbose" && echo "search path $cf_search"
11032         cf_save2_CPPFLAGS="$CPPFLAGS"
11033         for cf_incdir in $cf_search
11034         do
11035
11036 if test -n "$cf_incdir" ; then
11037   for cf_add_incdir in $cf_incdir
11038   do
11039         while test "$cf_add_incdir" != /usr/include
11040         do
11041           if test -d "$cf_add_incdir"
11042           then
11043                 cf_have_incdir=no
11044                 if test -n "$CFLAGS$CPPFLAGS" ; then
11045                   # a loop is needed to ensure we can add subdirs of existing dirs
11046                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11047                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11048                           cf_have_incdir=yes; break
11049                         fi
11050                   done
11051                 fi
11052
11053                 if test "$cf_have_incdir" = no ; then
11054                   if test "$cf_add_incdir" = /usr/local/include ; then
11055                         if test "$GCC" = yes
11056                         then
11057                           cf_save_CPPFLAGS=$CPPFLAGS
11058
11059         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11060         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11061
11062                           cat >"conftest.$ac_ext" <<_ACEOF
11063 #line 11063 "configure"
11064 #include "confdefs.h"
11065 #include <stdio.h>
11066 int
11067 main (void)
11068 {
11069 printf("Hello")
11070   ;
11071   return 0;
11072 }
11073 _ACEOF
11074 rm -f "conftest.$ac_objext"
11075 if { (eval echo "$as_me:11075: \"$ac_compile\"") >&5
11076   (eval $ac_compile) 2>&5
11077   ac_status=$?
11078   echo "$as_me:11078: \$? = $ac_status" >&5
11079   (exit "$ac_status"); } &&
11080          { ac_try='test -s "conftest.$ac_objext"'
11081   { (eval echo "$as_me:11081: \"$ac_try\"") >&5
11082   (eval $ac_try) 2>&5
11083   ac_status=$?
11084   echo "$as_me:11084: \$? = $ac_status" >&5
11085   (exit "$ac_status"); }; }; then
11086   :
11087 else
11088   echo "$as_me: failed program was:" >&5
11089 cat "conftest.$ac_ext" >&5
11090 cf_have_incdir=yes
11091 fi
11092 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11093                           CPPFLAGS=$cf_save_CPPFLAGS
11094                         fi
11095                   fi
11096                 fi
11097
11098                 if test "$cf_have_incdir" = no ; then
11099                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11100
11101 echo "${as_me:-configure}:11101: testing adding $cf_add_incdir to include-path ..." 1>&5
11102
11103                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11104
11105                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11106                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11107                   cf_add_incdir="$cf_top_incdir"
11108                 else
11109                   break
11110                 fi
11111           else
11112                 break
11113           fi
11114         done
11115   done
11116 fi
11117
11118                 for cf_header in \
11119                         ncurses.h \
11120                         curses.h
11121                 do
11122
11123         cat >"conftest.$ac_ext" <<_ACEOF
11124 #line 11124 "configure"
11125 #include "confdefs.h"
11126
11127 #include <$cf_header>
11128 int
11129 main (void)
11130 {
11131
11132 #ifdef NCURSES_VERSION
11133
11134 printf("%s\\n", NCURSES_VERSION);
11135 #else
11136 #ifdef __NCURSES_H
11137 printf("old\\n");
11138 #else
11139         make an error
11140 #endif
11141 #endif
11142
11143   ;
11144   return 0;
11145 }
11146 _ACEOF
11147 rm -f "conftest.$ac_objext"
11148 if { (eval echo "$as_me:11148: \"$ac_compile\"") >&5
11149   (eval $ac_compile) 2>&5
11150   ac_status=$?
11151   echo "$as_me:11151: \$? = $ac_status" >&5
11152   (exit "$ac_status"); } &&
11153          { ac_try='test -s "conftest.$ac_objext"'
11154   { (eval echo "$as_me:11154: \"$ac_try\"") >&5
11155   (eval $ac_try) 2>&5
11156   ac_status=$?
11157   echo "$as_me:11157: \$? = $ac_status" >&5
11158   (exit "$ac_status"); }; }; then
11159   cf_cv_ncurses_h2=$cf_header
11160
11161 else
11162   echo "$as_me: failed program was:" >&5
11163 cat "conftest.$ac_ext" >&5
11164 cf_cv_ncurses_h2=no
11165 fi
11166 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11167
11168                         if test "$cf_cv_ncurses_h2" != no ; then
11169                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11170                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11171                                 break
11172                         fi
11173                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11174                 done
11175                 CPPFLAGS="$cf_save2_CPPFLAGS"
11176                 test "$cf_cv_ncurses_h2" != no && break
11177         done
11178         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11178: error: not found" >&5
11179 echo "$as_me: error: not found" >&2;}
11180    { (exit 1); exit 1; }; }
11181
11182 fi
11183 echo "$as_me:11183: result: $cf_cv_ncurses_h2" >&5
11184 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11185
11186         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11187         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11188         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11189                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11190         fi
11191
11192 if test -n "$cf_1st_incdir" ; then
11193   for cf_add_incdir in $cf_1st_incdir
11194   do
11195         while test "$cf_add_incdir" != /usr/include
11196         do
11197           if test -d "$cf_add_incdir"
11198           then
11199                 cf_have_incdir=no
11200                 if test -n "$CFLAGS$CPPFLAGS" ; then
11201                   # a loop is needed to ensure we can add subdirs of existing dirs
11202                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11203                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11204                           cf_have_incdir=yes; break
11205                         fi
11206                   done
11207                 fi
11208
11209                 if test "$cf_have_incdir" = no ; then
11210                   if test "$cf_add_incdir" = /usr/local/include ; then
11211                         if test "$GCC" = yes
11212                         then
11213                           cf_save_CPPFLAGS=$CPPFLAGS
11214
11215         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11216         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11217
11218                           cat >"conftest.$ac_ext" <<_ACEOF
11219 #line 11219 "configure"
11220 #include "confdefs.h"
11221 #include <stdio.h>
11222 int
11223 main (void)
11224 {
11225 printf("Hello")
11226   ;
11227   return 0;
11228 }
11229 _ACEOF
11230 rm -f "conftest.$ac_objext"
11231 if { (eval echo "$as_me:11231: \"$ac_compile\"") >&5
11232   (eval $ac_compile) 2>&5
11233   ac_status=$?
11234   echo "$as_me:11234: \$? = $ac_status" >&5
11235   (exit "$ac_status"); } &&
11236          { ac_try='test -s "conftest.$ac_objext"'
11237   { (eval echo "$as_me:11237: \"$ac_try\"") >&5
11238   (eval $ac_try) 2>&5
11239   ac_status=$?
11240   echo "$as_me:11240: \$? = $ac_status" >&5
11241   (exit "$ac_status"); }; }; then
11242   :
11243 else
11244   echo "$as_me: failed program was:" >&5
11245 cat "conftest.$ac_ext" >&5
11246 cf_have_incdir=yes
11247 fi
11248 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11249                           CPPFLAGS=$cf_save_CPPFLAGS
11250                         fi
11251                   fi
11252                 fi
11253
11254                 if test "$cf_have_incdir" = no ; then
11255                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11256
11257 echo "${as_me:-configure}:11257: testing adding $cf_add_incdir to include-path ..." 1>&5
11258
11259                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11260
11261                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11262                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11263                   cf_add_incdir="$cf_top_incdir"
11264                 else
11265                   break
11266                 fi
11267           else
11268                 break
11269           fi
11270         done
11271   done
11272 fi
11273
11274 fi
11275
11276 # Set definitions to allow ifdef'ing for ncurses.h
11277
11278 case "$cf_cv_ncurses_header" in
11279 (*ncurses.h)
11280
11281 cat >>confdefs.h <<\EOF
11282 #define HAVE_NCURSES_H 1
11283 EOF
11284
11285         ;;
11286 esac
11287
11288 case "$cf_cv_ncurses_header" in
11289 (ncurses/curses.h|ncurses/ncurses.h)
11290
11291 cat >>confdefs.h <<\EOF
11292 #define HAVE_NCURSES_NCURSES_H 1
11293 EOF
11294
11295         ;;
11296 (ncursesw/curses.h|ncursesw/ncurses.h)
11297
11298 cat >>confdefs.h <<\EOF
11299 #define HAVE_NCURSESW_NCURSES_H 1
11300 EOF
11301
11302         ;;
11303 esac
11304
11305 echo "$as_me:11305: checking for terminfo header" >&5
11306 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11307 if test "${cf_cv_term_header+set}" = set; then
11308   echo $ECHO_N "(cached) $ECHO_C" >&6
11309 else
11310
11311 case "${cf_cv_ncurses_header}" in
11312 (*/ncurses.h|*/ncursesw.h)
11313         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11314         ;;
11315 (*)
11316         cf_term_header=term.h
11317         ;;
11318 esac
11319
11320 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11321 do
11322 cat >"conftest.$ac_ext" <<_ACEOF
11323 #line 11323 "configure"
11324 #include "confdefs.h"
11325 #include <stdio.h>
11326 #include <${cf_cv_ncurses_header:-curses.h}>
11327 #include <$cf_test>
11328
11329 int
11330 main (void)
11331 {
11332 int x = auto_left_margin; (void)x
11333   ;
11334   return 0;
11335 }
11336 _ACEOF
11337 rm -f "conftest.$ac_objext"
11338 if { (eval echo "$as_me:11338: \"$ac_compile\"") >&5
11339   (eval $ac_compile) 2>&5
11340   ac_status=$?
11341   echo "$as_me:11341: \$? = $ac_status" >&5
11342   (exit "$ac_status"); } &&
11343          { ac_try='test -s "conftest.$ac_objext"'
11344   { (eval echo "$as_me:11344: \"$ac_try\"") >&5
11345   (eval $ac_try) 2>&5
11346   ac_status=$?
11347   echo "$as_me:11347: \$? = $ac_status" >&5
11348   (exit "$ac_status"); }; }; then
11349
11350         cf_cv_term_header="$cf_test"
11351 else
11352   echo "$as_me: failed program was:" >&5
11353 cat "conftest.$ac_ext" >&5
11354
11355         cf_cv_term_header=unknown
11356
11357 fi
11358 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11359         test "$cf_cv_term_header" != unknown && break
11360 done
11361
11362 fi
11363 echo "$as_me:11363: result: $cf_cv_term_header" >&5
11364 echo "${ECHO_T}$cf_cv_term_header" >&6
11365
11366 # Set definitions to allow ifdef'ing to accommodate subdirectories
11367
11368 case "$cf_cv_term_header" in
11369 (*term.h)
11370
11371 cat >>confdefs.h <<\EOF
11372 #define HAVE_TERM_H 1
11373 EOF
11374
11375         ;;
11376 esac
11377
11378 case "$cf_cv_term_header" in
11379 (ncurses/term.h)
11380
11381 cat >>confdefs.h <<\EOF
11382 #define HAVE_NCURSES_TERM_H 1
11383 EOF
11384
11385         ;;
11386 (ncursesw/term.h)
11387
11388 cat >>confdefs.h <<\EOF
11389 #define HAVE_NCURSESW_TERM_H 1
11390 EOF
11391
11392         ;;
11393 esac
11394
11395 # some applications need this, but should check for NCURSES_VERSION
11396
11397 cat >>confdefs.h <<\EOF
11398 #define NCURSES 1
11399 EOF
11400
11401 echo "$as_me:11401: checking for ncurses version" >&5
11402 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11403 if test "${cf_cv_ncurses_version+set}" = set; then
11404   echo $ECHO_N "(cached) $ECHO_C" >&6
11405 else
11406
11407         cf_cv_ncurses_version=no
11408         cf_tempfile=out$$
11409         rm -f "$cf_tempfile"
11410         if test "$cross_compiling" = yes; then
11411
11412         # This will not work if the preprocessor splits the line after the
11413         # Autoconf token.  The 'unproto' program does that.
11414         cat > "conftest.$ac_ext" <<EOF
11415 #include <${cf_cv_ncurses_header:-curses.h}>
11416 #undef Autoconf
11417 #ifdef NCURSES_VERSION
11418 Autoconf NCURSES_VERSION
11419 #else
11420 #ifdef __NCURSES_H
11421 Autoconf "old"
11422 #endif
11423 ;
11424 #endif
11425 EOF
11426         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11427         { (eval echo "$as_me:11427: \"$cf_try\"") >&5
11428   (eval $cf_try) 2>&5
11429   ac_status=$?
11430   echo "$as_me:11430: \$? = $ac_status" >&5
11431   (exit "$ac_status"); }
11432         if test -f conftest.out ; then
11433                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11434                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11435                 rm -f conftest.out
11436         fi
11437
11438 else
11439   cat >"conftest.$ac_ext" <<_ACEOF
11440 #line 11440 "configure"
11441 #include "confdefs.h"
11442
11443 #include <${cf_cv_ncurses_header:-curses.h}>
11444 #include <stdio.h>
11445 int main(void)
11446 {
11447         FILE *fp = fopen("$cf_tempfile", "w");
11448 #ifdef NCURSES_VERSION
11449 # ifdef NCURSES_VERSION_PATCH
11450         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11451 # else
11452         fprintf(fp, "%s\\n", NCURSES_VERSION);
11453 # endif
11454 #else
11455 # ifdef __NCURSES_H
11456         fprintf(fp, "old\\n");
11457 # else
11458         make an error
11459 # endif
11460 #endif
11461         ${cf_cv_main_return:-return}(0);
11462 }
11463 _ACEOF
11464 rm -f "conftest$ac_exeext"
11465 if { (eval echo "$as_me:11465: \"$ac_link\"") >&5
11466   (eval $ac_link) 2>&5
11467   ac_status=$?
11468   echo "$as_me:11468: \$? = $ac_status" >&5
11469   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11470   { (eval echo "$as_me:11470: \"$ac_try\"") >&5
11471   (eval $ac_try) 2>&5
11472   ac_status=$?
11473   echo "$as_me:11473: \$? = $ac_status" >&5
11474   (exit "$ac_status"); }; }; then
11475
11476         cf_cv_ncurses_version=`cat $cf_tempfile`
11477 else
11478   echo "$as_me: program exited with status $ac_status" >&5
11479 echo "$as_me: failed program was:" >&5
11480 cat "conftest.$ac_ext" >&5
11481 fi
11482 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11483 fi
11484         rm -f "$cf_tempfile"
11485
11486 fi
11487 echo "$as_me:11487: result: $cf_cv_ncurses_version" >&5
11488 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11489 test "$cf_cv_ncurses_version" = no ||
11490 cat >>confdefs.h <<\EOF
11491 #define NCURSES 1
11492 EOF
11493
11494 cf_nculib_root=$cf_cv_screen
11495         # This works, except for the special case where we find gpm, but
11496         # ncurses is in a nonstandard location via $LIBS, and we really want
11497         # to link gpm.
11498 cf_ncurses_LIBS=""
11499 cf_ncurses_SAVE="$LIBS"
11500 echo "$as_me:11500: checking for Gpm_Open in -lgpm" >&5
11501 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11502 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11503   echo $ECHO_N "(cached) $ECHO_C" >&6
11504 else
11505   ac_check_lib_save_LIBS=$LIBS
11506 LIBS="-lgpm  $LIBS"
11507 cat >"conftest.$ac_ext" <<_ACEOF
11508 #line 11508 "configure"
11509 #include "confdefs.h"
11510
11511 /* Override any gcc2 internal prototype to avoid an error.  */
11512 #ifdef __cplusplus
11513 extern "C"
11514 #endif
11515 /* We use char because int might match the return type of a gcc2
11516    builtin and then its argument prototype would still apply.  */
11517 char Gpm_Open ();
11518 int
11519 main (void)
11520 {
11521 Gpm_Open ();
11522   ;
11523   return 0;
11524 }
11525 _ACEOF
11526 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11527 if { (eval echo "$as_me:11527: \"$ac_link\"") >&5
11528   (eval $ac_link) 2>&5
11529   ac_status=$?
11530   echo "$as_me:11530: \$? = $ac_status" >&5
11531   (exit "$ac_status"); } &&
11532          { ac_try='test -s "conftest$ac_exeext"'
11533   { (eval echo "$as_me:11533: \"$ac_try\"") >&5
11534   (eval $ac_try) 2>&5
11535   ac_status=$?
11536   echo "$as_me:11536: \$? = $ac_status" >&5
11537   (exit "$ac_status"); }; }; then
11538   ac_cv_lib_gpm_Gpm_Open=yes
11539 else
11540   echo "$as_me: failed program was:" >&5
11541 cat "conftest.$ac_ext" >&5
11542 ac_cv_lib_gpm_Gpm_Open=no
11543 fi
11544 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11545 LIBS=$ac_check_lib_save_LIBS
11546 fi
11547 echo "$as_me:11547: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11548 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11549 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11550   echo "$as_me:11550: checking for initscr in -lgpm" >&5
11551 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11552 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11553   echo $ECHO_N "(cached) $ECHO_C" >&6
11554 else
11555   ac_check_lib_save_LIBS=$LIBS
11556 LIBS="-lgpm  $LIBS"
11557 cat >"conftest.$ac_ext" <<_ACEOF
11558 #line 11558 "configure"
11559 #include "confdefs.h"
11560
11561 /* Override any gcc2 internal prototype to avoid an error.  */
11562 #ifdef __cplusplus
11563 extern "C"
11564 #endif
11565 /* We use char because int might match the return type of a gcc2
11566    builtin and then its argument prototype would still apply.  */
11567 char initscr ();
11568 int
11569 main (void)
11570 {
11571 initscr ();
11572   ;
11573   return 0;
11574 }
11575 _ACEOF
11576 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11577 if { (eval echo "$as_me:11577: \"$ac_link\"") >&5
11578   (eval $ac_link) 2>&5
11579   ac_status=$?
11580   echo "$as_me:11580: \$? = $ac_status" >&5
11581   (exit "$ac_status"); } &&
11582          { ac_try='test -s "conftest$ac_exeext"'
11583   { (eval echo "$as_me:11583: \"$ac_try\"") >&5
11584   (eval $ac_try) 2>&5
11585   ac_status=$?
11586   echo "$as_me:11586: \$? = $ac_status" >&5
11587   (exit "$ac_status"); }; }; then
11588   ac_cv_lib_gpm_initscr=yes
11589 else
11590   echo "$as_me: failed program was:" >&5
11591 cat "conftest.$ac_ext" >&5
11592 ac_cv_lib_gpm_initscr=no
11593 fi
11594 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11595 LIBS=$ac_check_lib_save_LIBS
11596 fi
11597 echo "$as_me:11597: result: $ac_cv_lib_gpm_initscr" >&5
11598 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11599 if test "$ac_cv_lib_gpm_initscr" = yes; then
11600   LIBS="$cf_ncurses_SAVE"
11601 else
11602   cf_ncurses_LIBS="-lgpm"
11603 fi
11604
11605 fi
11606
11607 case "$host_os" in
11608 (freebsd*)
11609         # This is only necessary if you are linking against an obsolete
11610         # version of ncurses (but it should do no harm, since it's static).
11611         if test "$cf_nculib_root" = ncurses ; then
11612                 echo "$as_me:11612: checking for tgoto in -lmytinfo" >&5
11613 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11614 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11615   echo $ECHO_N "(cached) $ECHO_C" >&6
11616 else
11617   ac_check_lib_save_LIBS=$LIBS
11618 LIBS="-lmytinfo  $LIBS"
11619 cat >"conftest.$ac_ext" <<_ACEOF
11620 #line 11620 "configure"
11621 #include "confdefs.h"
11622
11623 /* Override any gcc2 internal prototype to avoid an error.  */
11624 #ifdef __cplusplus
11625 extern "C"
11626 #endif
11627 /* We use char because int might match the return type of a gcc2
11628    builtin and then its argument prototype would still apply.  */
11629 char tgoto ();
11630 int
11631 main (void)
11632 {
11633 tgoto ();
11634   ;
11635   return 0;
11636 }
11637 _ACEOF
11638 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11639 if { (eval echo "$as_me:11639: \"$ac_link\"") >&5
11640   (eval $ac_link) 2>&5
11641   ac_status=$?
11642   echo "$as_me:11642: \$? = $ac_status" >&5
11643   (exit "$ac_status"); } &&
11644          { ac_try='test -s "conftest$ac_exeext"'
11645   { (eval echo "$as_me:11645: \"$ac_try\"") >&5
11646   (eval $ac_try) 2>&5
11647   ac_status=$?
11648   echo "$as_me:11648: \$? = $ac_status" >&5
11649   (exit "$ac_status"); }; }; then
11650   ac_cv_lib_mytinfo_tgoto=yes
11651 else
11652   echo "$as_me: failed program was:" >&5
11653 cat "conftest.$ac_ext" >&5
11654 ac_cv_lib_mytinfo_tgoto=no
11655 fi
11656 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11657 LIBS=$ac_check_lib_save_LIBS
11658 fi
11659 echo "$as_me:11659: result: $ac_cv_lib_mytinfo_tgoto" >&5
11660 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11661 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11662   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11663 fi
11664
11665         fi
11666         ;;
11667 esac
11668
11669 cf_add_libs="$LIBS"
11670 # reverse order
11671 cf_add_0lib=
11672 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11673 # filter duplicates
11674 for cf_add_1lib in $cf_add_0lib; do
11675         for cf_add_2lib in $cf_add_libs; do
11676                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11677                         cf_add_1lib=
11678                         break
11679                 fi
11680         done
11681         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11682 done
11683 LIBS="$cf_add_libs"
11684
11685 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11686 then
11687
11688 cf_add_libs="$LIBS"
11689 # reverse order
11690 cf_add_0lib=
11691 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11692 # filter duplicates
11693 for cf_add_1lib in $cf_add_0lib; do
11694         for cf_add_2lib in $cf_add_libs; do
11695                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11696                         cf_add_1lib=
11697                         break
11698                 fi
11699         done
11700         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11701 done
11702 LIBS="$cf_add_libs"
11703
11704 else
11705
11706         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11707         cf_libdir=""
11708         echo "$as_me:11708: checking for initscr" >&5
11709 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11710 if test "${ac_cv_func_initscr+set}" = set; then
11711   echo $ECHO_N "(cached) $ECHO_C" >&6
11712 else
11713   cat >"conftest.$ac_ext" <<_ACEOF
11714 #line 11714 "configure"
11715 #include "confdefs.h"
11716 #define initscr autoconf_temporary
11717 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11718 #undef initscr
11719
11720 #ifdef __cplusplus
11721 extern "C"
11722 #endif
11723
11724 /* We use char because int might match the return type of a gcc2
11725    builtin and then its argument prototype would still apply.  */
11726 char initscr (void);
11727
11728 int
11729 main (void)
11730 {
11731
11732 /* The GNU C library defines stubs for functions which it implements
11733     to always fail with ENOSYS.  Some functions are actually named
11734     something starting with __ and the normal name is an alias.  */
11735 #if defined (__stub_initscr) || defined (__stub___initscr)
11736 #error found stub for initscr
11737 #endif
11738
11739         return initscr ();
11740   ;
11741   return 0;
11742 }
11743 _ACEOF
11744 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11745 if { (eval echo "$as_me:11745: \"$ac_link\"") >&5
11746   (eval $ac_link) 2>&5
11747   ac_status=$?
11748   echo "$as_me:11748: \$? = $ac_status" >&5
11749   (exit "$ac_status"); } &&
11750          { ac_try='test -s "conftest$ac_exeext"'
11751   { (eval echo "$as_me:11751: \"$ac_try\"") >&5
11752   (eval $ac_try) 2>&5
11753   ac_status=$?
11754   echo "$as_me:11754: \$? = $ac_status" >&5
11755   (exit "$ac_status"); }; }; then
11756   ac_cv_func_initscr=yes
11757 else
11758   echo "$as_me: failed program was:" >&5
11759 cat "conftest.$ac_ext" >&5
11760 ac_cv_func_initscr=no
11761 fi
11762 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11763 fi
11764 echo "$as_me:11764: result: $ac_cv_func_initscr" >&5
11765 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11766 if test "$ac_cv_func_initscr" = yes; then
11767   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11768 else
11769
11770                 cf_save_LIBS="$LIBS"
11771                 echo "$as_me:11771: checking for initscr in -l$cf_nculib_root" >&5
11772 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11773                 LIBS="-l$cf_nculib_root $LIBS"
11774                 cat >"conftest.$ac_ext" <<_ACEOF
11775 #line 11775 "configure"
11776 #include "confdefs.h"
11777 #include <${cf_cv_ncurses_header:-curses.h}>
11778 int
11779 main (void)
11780 {
11781 initscr()
11782   ;
11783   return 0;
11784 }
11785 _ACEOF
11786 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11787 if { (eval echo "$as_me:11787: \"$ac_link\"") >&5
11788   (eval $ac_link) 2>&5
11789   ac_status=$?
11790   echo "$as_me:11790: \$? = $ac_status" >&5
11791   (exit "$ac_status"); } &&
11792          { ac_try='test -s "conftest$ac_exeext"'
11793   { (eval echo "$as_me:11793: \"$ac_try\"") >&5
11794   (eval $ac_try) 2>&5
11795   ac_status=$?
11796   echo "$as_me:11796: \$? = $ac_status" >&5
11797   (exit "$ac_status"); }; }; then
11798   echo "$as_me:11798: result: yes" >&5
11799 echo "${ECHO_T}yes" >&6
11800                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11801
11802 else
11803   echo "$as_me: failed program was:" >&5
11804 cat "conftest.$ac_ext" >&5
11805 echo "$as_me:11805: result: no" >&5
11806 echo "${ECHO_T}no" >&6
11807
11808 cf_search=
11809 cf_library_path_list=""
11810 if test -n "${LDFLAGS}${LIBS}" ; then
11811         for cf_library_path in $LDFLAGS $LIBS
11812         do
11813                 case "$cf_library_path" in
11814                 (-L*)
11815                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11816
11817 test "x$cf_library_path" != "xNONE" && \
11818 test -d "$cf_library_path" && \
11819  {
11820         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11821         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11822         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11823         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11824         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11825         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"
11826 }
11827
11828                         cf_library_path_list="$cf_library_path_list $cf_search"
11829                         ;;
11830                 esac
11831         done
11832 fi
11833
11834 cf_search=
11835
11836 test "x$prefix" != "xNONE" && \
11837 test -d "$prefix" && \
11838  {
11839         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11840         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11841         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11842         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11843         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11844         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11845 }
11846
11847 for cf_subdir_prefix in \
11848         /usr \
11849         /usr/local \
11850         /usr/pkg \
11851         /opt \
11852         /opt/local \
11853         $HOME
11854 do
11855
11856 test "x$cf_subdir_prefix" != "x$prefix" && \
11857 test -d "$cf_subdir_prefix" && \
11858 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11859         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11860         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11861         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11862         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11863         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11864         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"
11865 }
11866
11867 done
11868
11869 cf_search="$cf_library_path_list $cf_search"
11870
11871                         for cf_libdir in $cf_search
11872                         do
11873                                 echo "$as_me:11873: checking for -l$cf_nculib_root in $cf_libdir" >&5
11874 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11875                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11876                                 cat >"conftest.$ac_ext" <<_ACEOF
11877 #line 11877 "configure"
11878 #include "confdefs.h"
11879 #include <${cf_cv_ncurses_header:-curses.h}>
11880 int
11881 main (void)
11882 {
11883 initscr()
11884   ;
11885   return 0;
11886 }
11887 _ACEOF
11888 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11889 if { (eval echo "$as_me:11889: \"$ac_link\"") >&5
11890   (eval $ac_link) 2>&5
11891   ac_status=$?
11892   echo "$as_me:11892: \$? = $ac_status" >&5
11893   (exit "$ac_status"); } &&
11894          { ac_try='test -s "conftest$ac_exeext"'
11895   { (eval echo "$as_me:11895: \"$ac_try\"") >&5
11896   (eval $ac_try) 2>&5
11897   ac_status=$?
11898   echo "$as_me:11898: \$? = $ac_status" >&5
11899   (exit "$ac_status"); }; }; then
11900   echo "$as_me:11900: result: yes" >&5
11901 echo "${ECHO_T}yes" >&6
11902                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11903                                          break
11904 else
11905   echo "$as_me: failed program was:" >&5
11906 cat "conftest.$ac_ext" >&5
11907 echo "$as_me:11907: result: no" >&5
11908 echo "${ECHO_T}no" >&6
11909                                          LIBS="$cf_save_LIBS"
11910 fi
11911 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11912                         done
11913
11914 fi
11915 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11916
11917 fi
11918
11919 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11920
11921 if test "$cf_found_library" = no ; then
11922         { { echo "$as_me:11922: error: Cannot link $cf_nculib_root library" >&5
11923 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11924    { (exit 1); exit 1; }; }
11925 fi
11926
11927 fi
11928
11929 if test -n "$cf_ncurses_LIBS" ; then
11930         echo "$as_me:11930: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11931 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11932         cf_ncurses_SAVE="$LIBS"
11933         for p in $cf_ncurses_LIBS ; do
11934                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11935                 if test "$q" != "$LIBS" ; then
11936                         LIBS="$q"
11937                 fi
11938         done
11939         cat >"conftest.$ac_ext" <<_ACEOF
11940 #line 11940 "configure"
11941 #include "confdefs.h"
11942 #include <${cf_cv_ncurses_header:-curses.h}>
11943 int
11944 main (void)
11945 {
11946 initscr(); mousemask(0,0); tigetstr((char *)0);
11947   ;
11948   return 0;
11949 }
11950 _ACEOF
11951 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11952 if { (eval echo "$as_me:11952: \"$ac_link\"") >&5
11953   (eval $ac_link) 2>&5
11954   ac_status=$?
11955   echo "$as_me:11955: \$? = $ac_status" >&5
11956   (exit "$ac_status"); } &&
11957          { ac_try='test -s "conftest$ac_exeext"'
11958   { (eval echo "$as_me:11958: \"$ac_try\"") >&5
11959   (eval $ac_try) 2>&5
11960   ac_status=$?
11961   echo "$as_me:11961: \$? = $ac_status" >&5
11962   (exit "$ac_status"); }; }; then
11963   echo "$as_me:11963: result: yes" >&5
11964 echo "${ECHO_T}yes" >&6
11965 else
11966   echo "$as_me: failed program was:" >&5
11967 cat "conftest.$ac_ext" >&5
11968 echo "$as_me:11968: result: no" >&5
11969 echo "${ECHO_T}no" >&6
11970                  LIBS="$cf_ncurses_SAVE"
11971 fi
11972 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11973 fi
11974
11975 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11976
11977 cat >>confdefs.h <<EOF
11978 #define $cf_nculib_ROOT 1
11979 EOF
11980
11981         fi
11982 else
11983         NCURSES_CONFIG=none
11984 fi
11985
11986         ;;
11987 (pdcurses)
11988         echo "$as_me:11988: checking for X" >&5
11989 echo $ECHO_N "checking for X... $ECHO_C" >&6
11990
11991 # Check whether --with-x or --without-x was given.
11992 if test "${with_x+set}" = set; then
11993   withval="$with_x"
11994
11995 fi;
11996 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11997 if test "x$with_x" = xno; then
11998   # The user explicitly disabled X.
11999   have_x=disabled
12000 else
12001   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12002     # Both variables are already set.
12003     have_x=yes
12004   else
12005     if test "${ac_cv_have_x+set}" = set; then
12006   echo $ECHO_N "(cached) $ECHO_C" >&6
12007 else
12008   # One or both of the vars are not set, and there is no cached value.
12009 ac_x_includes=no ac_x_libraries=no
12010 rm -fr conftest.dir
12011 if mkdir conftest.dir; then
12012   cd conftest.dir
12013   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12014   cat >Imakefile <<'EOF'
12015 acfindx:
12016         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12017 EOF
12018   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12019     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
12020     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
12021     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12022     for ac_extension in a so sl dylib dll; do
12023       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12024          test -f "$ac_im_libdir/libX11.$ac_extension"; then
12025         ac_im_usrlibdir=$ac_im_libdir; break
12026       fi
12027     done
12028     # Screen out bogus values from the imake configuration.  They are
12029     # bogus both because they are the default anyway, and because
12030     # using them would break gcc on systems where it needs fixed includes.
12031     case $ac_im_incroot in
12032         /usr/include) ;;
12033         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12034     esac
12035     case $ac_im_usrlibdir in
12036         /usr/lib | /lib) ;;
12037         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12038     esac
12039   fi
12040   cd ..
12041   rm -fr conftest.dir
12042 fi
12043
12044 # Standard set of common directories for X headers.
12045 # Check X11 before X11Rn because it is often a symlink to the current release.
12046 ac_x_header_dirs='
12047 /usr/X11/include
12048 /usr/X11R7/include
12049 /usr/X11R6/include
12050 /usr/X11R5/include
12051 /usr/X11R4/include
12052
12053 /opt/local/include
12054 /opt/X11/include
12055
12056 /usr/include/X11
12057 /usr/include/X11R7
12058 /usr/include/X11R6
12059 /usr/include/X11R5
12060 /usr/include/X11R4
12061
12062 /usr/local/X11/include
12063 /usr/local/X11R7/include
12064 /usr/local/X11R6/include
12065 /usr/local/X11R5/include
12066 /usr/local/X11R4/include
12067
12068 /usr/local/include/X11
12069 /usr/local/include/X11R7
12070 /usr/local/include/X11R6
12071 /usr/local/include/X11R5
12072 /usr/local/include/X11R4
12073
12074 /usr/X386/include
12075 /usr/x386/include
12076 /usr/XFree86/include/X11
12077
12078 /usr/include
12079 /usr/local/include
12080 /usr/unsupported/include
12081 /usr/athena/include
12082 /usr/local/x11r5/include
12083 /usr/lpp/Xamples/include
12084
12085 /usr/openwin/include
12086 /usr/openwin/share/include'
12087
12088 if test "$ac_x_includes" = no; then
12089   # Guess where to find include files, by looking for Intrinsic.h.
12090   # First, try using that file with no special directory specified.
12091   cat >"conftest.$ac_ext" <<_ACEOF
12092 #line 12092 "configure"
12093 #include "confdefs.h"
12094 #include <X11/Intrinsic.h>
12095 _ACEOF
12096 if { (eval echo "$as_me:12096: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12097   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12098   ac_status=$?
12099   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12100   rm -f conftest.er1
12101   cat conftest.err >&5
12102   echo "$as_me:12102: \$? = $ac_status" >&5
12103   (exit "$ac_status"); } >/dev/null; then
12104   if test -s conftest.err; then
12105     ac_cpp_err=$ac_c_preproc_warn_flag
12106   else
12107     ac_cpp_err=
12108   fi
12109 else
12110   ac_cpp_err=yes
12111 fi
12112 if test -z "$ac_cpp_err"; then
12113   # We can compile using X headers with no special include directory.
12114 ac_x_includes=
12115 else
12116   echo "$as_me: failed program was:" >&5
12117   cat "conftest.$ac_ext" >&5
12118   for ac_dir in $ac_x_header_dirs; do
12119   if test -r "$ac_dir/X11/Intrinsic.h"; then
12120     ac_x_includes=$ac_dir
12121     break
12122   fi
12123 done
12124 fi
12125 rm -f conftest.err "conftest.$ac_ext"
12126 fi # $ac_x_includes = no
12127
12128 if test "$ac_x_libraries" = no; then
12129   # Check for the libraries.
12130   # See if we find them without any special options.
12131   # Don't add to $LIBS permanently.
12132   ac_save_LIBS=$LIBS
12133   LIBS="-lXt $LIBS"
12134   cat >"conftest.$ac_ext" <<_ACEOF
12135 #line 12135 "configure"
12136 #include "confdefs.h"
12137 #include <X11/Intrinsic.h>
12138 int
12139 main (void)
12140 {
12141 XtMalloc (0)
12142   ;
12143   return 0;
12144 }
12145 _ACEOF
12146 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12147 if { (eval echo "$as_me:12147: \"$ac_link\"") >&5
12148   (eval $ac_link) 2>&5
12149   ac_status=$?
12150   echo "$as_me:12150: \$? = $ac_status" >&5
12151   (exit "$ac_status"); } &&
12152          { ac_try='test -s "conftest$ac_exeext"'
12153   { (eval echo "$as_me:12153: \"$ac_try\"") >&5
12154   (eval $ac_try) 2>&5
12155   ac_status=$?
12156   echo "$as_me:12156: \$? = $ac_status" >&5
12157   (exit "$ac_status"); }; }; then
12158   LIBS=$ac_save_LIBS
12159 # We can link X programs with no special library path.
12160 ac_x_libraries=
12161 else
12162   echo "$as_me: failed program was:" >&5
12163 cat "conftest.$ac_ext" >&5
12164 LIBS=$ac_save_LIBS
12165 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12166 do
12167   # Don't even attempt the hair of trying to link an X program!
12168   for ac_extension in a so sl dylib dll; do
12169     if test -r "$ac_dir/libXt.$ac_extension"; then
12170       ac_x_libraries=$ac_dir
12171       break 2
12172     fi
12173   done
12174 done
12175 fi
12176 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12177 fi # $ac_x_libraries = no
12178
12179 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12180   # Didn't find X anywhere.  Cache the known absence of X.
12181   ac_cv_have_x="have_x=no"
12182 else
12183   # Record where we found X for the cache.
12184   ac_cv_have_x="have_x=yes \
12185                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12186 fi
12187 fi
12188
12189   fi
12190   eval "$ac_cv_have_x"
12191 fi # $with_x != no
12192
12193 if test "$have_x" != yes; then
12194   echo "$as_me:12194: result: $have_x" >&5
12195 echo "${ECHO_T}$have_x" >&6
12196   no_x=yes
12197 else
12198   # If each of the values was on the command line, it overrides each guess.
12199   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12200   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12201   # Update the cache value to reflect the command line values.
12202   ac_cv_have_x="have_x=yes \
12203                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12204   echo "$as_me:12204: result: libraries $x_libraries, headers $x_includes" >&5
12205 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12206 fi
12207
12208 if test "$no_x" = yes; then
12209   # Not all programs may use this symbol, but it does not hurt to define it.
12210
12211 cat >>confdefs.h <<\EOF
12212 #define X_DISPLAY_MISSING 1
12213 EOF
12214
12215   X_CFLAGS=
12216   X_PRE_LIBS=
12217   X_LIBS=
12218   X_EXTRA_LIBS=
12219 else
12220   if test -n "$x_includes"; then
12221     X_CFLAGS="$X_CFLAGS -I$x_includes"
12222   fi
12223
12224   # It would also be nice to do this for all -L options, not just this one.
12225   if test -n "$x_libraries"; then
12226     X_LIBS="$X_LIBS -L$x_libraries"
12227     # For Solaris; some versions of Sun CC require a space after -R and
12228     # others require no space.  Words are not sufficient . . . .
12229     case `(uname -sr) 2>/dev/null` in
12230     "SunOS 5"*)
12231       echo "$as_me:12231: checking whether -R must be followed by a space" >&5
12232 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12233       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12234       cat >"conftest.$ac_ext" <<_ACEOF
12235 #line 12235 "configure"
12236 #include "confdefs.h"
12237
12238 int
12239 main (void)
12240 {
12241
12242   ;
12243   return 0;
12244 }
12245 _ACEOF
12246 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12247 if { (eval echo "$as_me:12247: \"$ac_link\"") >&5
12248   (eval $ac_link) 2>&5
12249   ac_status=$?
12250   echo "$as_me:12250: \$? = $ac_status" >&5
12251   (exit "$ac_status"); } &&
12252          { ac_try='test -s "conftest$ac_exeext"'
12253   { (eval echo "$as_me:12253: \"$ac_try\"") >&5
12254   (eval $ac_try) 2>&5
12255   ac_status=$?
12256   echo "$as_me:12256: \$? = $ac_status" >&5
12257   (exit "$ac_status"); }; }; then
12258   ac_R_nospace=yes
12259 else
12260   echo "$as_me: failed program was:" >&5
12261 cat "conftest.$ac_ext" >&5
12262 ac_R_nospace=no
12263 fi
12264 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12265       if test $ac_R_nospace = yes; then
12266         echo "$as_me:12266: result: no" >&5
12267 echo "${ECHO_T}no" >&6
12268         X_LIBS="$X_LIBS -R$x_libraries"
12269       else
12270         LIBS="$ac_xsave_LIBS -R $x_libraries"
12271         cat >"conftest.$ac_ext" <<_ACEOF
12272 #line 12272 "configure"
12273 #include "confdefs.h"
12274
12275 int
12276 main (void)
12277 {
12278
12279   ;
12280   return 0;
12281 }
12282 _ACEOF
12283 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12284 if { (eval echo "$as_me:12284: \"$ac_link\"") >&5
12285   (eval $ac_link) 2>&5
12286   ac_status=$?
12287   echo "$as_me:12287: \$? = $ac_status" >&5
12288   (exit "$ac_status"); } &&
12289          { ac_try='test -s "conftest$ac_exeext"'
12290   { (eval echo "$as_me:12290: \"$ac_try\"") >&5
12291   (eval $ac_try) 2>&5
12292   ac_status=$?
12293   echo "$as_me:12293: \$? = $ac_status" >&5
12294   (exit "$ac_status"); }; }; then
12295   ac_R_space=yes
12296 else
12297   echo "$as_me: failed program was:" >&5
12298 cat "conftest.$ac_ext" >&5
12299 ac_R_space=no
12300 fi
12301 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12302         if test $ac_R_space = yes; then
12303           echo "$as_me:12303: result: yes" >&5
12304 echo "${ECHO_T}yes" >&6
12305           X_LIBS="$X_LIBS -R $x_libraries"
12306         else
12307           echo "$as_me:12307: result: neither works" >&5
12308 echo "${ECHO_T}neither works" >&6
12309         fi
12310       fi
12311       LIBS=$ac_xsave_LIBS
12312     esac
12313   fi
12314
12315   # Check for system-dependent libraries X programs must link with.
12316   # Do this before checking for the system-independent R6 libraries
12317   # (-lICE), since we may need -lsocket or whatever for X linking.
12318
12319   if test "$ISC" = yes; then
12320     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12321   else
12322     # Martyn Johnson says this is needed for Ultrix, if the X
12323     # libraries were built with DECnet support.  And Karl Berry says
12324     # the Alpha needs dnet_stub (dnet does not exist).
12325     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12326     cat >"conftest.$ac_ext" <<_ACEOF
12327 #line 12327 "configure"
12328 #include "confdefs.h"
12329
12330 /* Override any gcc2 internal prototype to avoid an error.  */
12331 #ifdef __cplusplus
12332 extern "C"
12333 #endif
12334 /* We use char because int might match the return type of a gcc2
12335    builtin and then its argument prototype would still apply.  */
12336 char XOpenDisplay ();
12337 int
12338 main (void)
12339 {
12340 XOpenDisplay ();
12341   ;
12342   return 0;
12343 }
12344 _ACEOF
12345 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12346 if { (eval echo "$as_me:12346: \"$ac_link\"") >&5
12347   (eval $ac_link) 2>&5
12348   ac_status=$?
12349   echo "$as_me:12349: \$? = $ac_status" >&5
12350   (exit "$ac_status"); } &&
12351          { ac_try='test -s "conftest$ac_exeext"'
12352   { (eval echo "$as_me:12352: \"$ac_try\"") >&5
12353   (eval $ac_try) 2>&5
12354   ac_status=$?
12355   echo "$as_me:12355: \$? = $ac_status" >&5
12356   (exit "$ac_status"); }; }; then
12357   :
12358 else
12359   echo "$as_me: failed program was:" >&5
12360 cat "conftest.$ac_ext" >&5
12361 echo "$as_me:12361: checking for dnet_ntoa in -ldnet" >&5
12362 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12363 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12364   echo $ECHO_N "(cached) $ECHO_C" >&6
12365 else
12366   ac_check_lib_save_LIBS=$LIBS
12367 LIBS="-ldnet  $LIBS"
12368 cat >"conftest.$ac_ext" <<_ACEOF
12369 #line 12369 "configure"
12370 #include "confdefs.h"
12371
12372 /* Override any gcc2 internal prototype to avoid an error.  */
12373 #ifdef __cplusplus
12374 extern "C"
12375 #endif
12376 /* We use char because int might match the return type of a gcc2
12377    builtin and then its argument prototype would still apply.  */
12378 char dnet_ntoa ();
12379 int
12380 main (void)
12381 {
12382 dnet_ntoa ();
12383   ;
12384   return 0;
12385 }
12386 _ACEOF
12387 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12388 if { (eval echo "$as_me:12388: \"$ac_link\"") >&5
12389   (eval $ac_link) 2>&5
12390   ac_status=$?
12391   echo "$as_me:12391: \$? = $ac_status" >&5
12392   (exit "$ac_status"); } &&
12393          { ac_try='test -s "conftest$ac_exeext"'
12394   { (eval echo "$as_me:12394: \"$ac_try\"") >&5
12395   (eval $ac_try) 2>&5
12396   ac_status=$?
12397   echo "$as_me:12397: \$? = $ac_status" >&5
12398   (exit "$ac_status"); }; }; then
12399   ac_cv_lib_dnet_dnet_ntoa=yes
12400 else
12401   echo "$as_me: failed program was:" >&5
12402 cat "conftest.$ac_ext" >&5
12403 ac_cv_lib_dnet_dnet_ntoa=no
12404 fi
12405 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12406 LIBS=$ac_check_lib_save_LIBS
12407 fi
12408 echo "$as_me:12408: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12409 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12410 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12411   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12412 fi
12413
12414     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12415       echo "$as_me:12415: checking for dnet_ntoa in -ldnet_stub" >&5
12416 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12417 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12418   echo $ECHO_N "(cached) $ECHO_C" >&6
12419 else
12420   ac_check_lib_save_LIBS=$LIBS
12421 LIBS="-ldnet_stub  $LIBS"
12422 cat >"conftest.$ac_ext" <<_ACEOF
12423 #line 12423 "configure"
12424 #include "confdefs.h"
12425
12426 /* Override any gcc2 internal prototype to avoid an error.  */
12427 #ifdef __cplusplus
12428 extern "C"
12429 #endif
12430 /* We use char because int might match the return type of a gcc2
12431    builtin and then its argument prototype would still apply.  */
12432 char dnet_ntoa ();
12433 int
12434 main (void)
12435 {
12436 dnet_ntoa ();
12437   ;
12438   return 0;
12439 }
12440 _ACEOF
12441 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12442 if { (eval echo "$as_me:12442: \"$ac_link\"") >&5
12443   (eval $ac_link) 2>&5
12444   ac_status=$?
12445   echo "$as_me:12445: \$? = $ac_status" >&5
12446   (exit "$ac_status"); } &&
12447          { ac_try='test -s "conftest$ac_exeext"'
12448   { (eval echo "$as_me:12448: \"$ac_try\"") >&5
12449   (eval $ac_try) 2>&5
12450   ac_status=$?
12451   echo "$as_me:12451: \$? = $ac_status" >&5
12452   (exit "$ac_status"); }; }; then
12453   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12454 else
12455   echo "$as_me: failed program was:" >&5
12456 cat "conftest.$ac_ext" >&5
12457 ac_cv_lib_dnet_stub_dnet_ntoa=no
12458 fi
12459 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12460 LIBS=$ac_check_lib_save_LIBS
12461 fi
12462 echo "$as_me:12462: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12463 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12464 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12465   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12466 fi
12467
12468     fi
12469 fi
12470 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12471     LIBS="$ac_xsave_LIBS"
12472
12473     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12474     # to get the SysV transport functions.
12475     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12476     # needs -lnsl.
12477     # The nsl library prevents programs from opening the X display
12478     # on Irix 5.2, according to T.E. Dickey.
12479     # The functions gethostbyname, getservbyname, and inet_addr are
12480     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12481     echo "$as_me:12481: checking for gethostbyname" >&5
12482 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12483 if test "${ac_cv_func_gethostbyname+set}" = set; then
12484   echo $ECHO_N "(cached) $ECHO_C" >&6
12485 else
12486   cat >"conftest.$ac_ext" <<_ACEOF
12487 #line 12487 "configure"
12488 #include "confdefs.h"
12489 #define gethostbyname autoconf_temporary
12490 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12491 #undef gethostbyname
12492
12493 #ifdef __cplusplus
12494 extern "C"
12495 #endif
12496
12497 /* We use char because int might match the return type of a gcc2
12498    builtin and then its argument prototype would still apply.  */
12499 char gethostbyname (void);
12500
12501 int
12502 main (void)
12503 {
12504
12505 /* The GNU C library defines stubs for functions which it implements
12506     to always fail with ENOSYS.  Some functions are actually named
12507     something starting with __ and the normal name is an alias.  */
12508 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12509 #error found stub for gethostbyname
12510 #endif
12511
12512         return gethostbyname ();
12513   ;
12514   return 0;
12515 }
12516 _ACEOF
12517 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12518 if { (eval echo "$as_me:12518: \"$ac_link\"") >&5
12519   (eval $ac_link) 2>&5
12520   ac_status=$?
12521   echo "$as_me:12521: \$? = $ac_status" >&5
12522   (exit "$ac_status"); } &&
12523          { ac_try='test -s "conftest$ac_exeext"'
12524   { (eval echo "$as_me:12524: \"$ac_try\"") >&5
12525   (eval $ac_try) 2>&5
12526   ac_status=$?
12527   echo "$as_me:12527: \$? = $ac_status" >&5
12528   (exit "$ac_status"); }; }; then
12529   ac_cv_func_gethostbyname=yes
12530 else
12531   echo "$as_me: failed program was:" >&5
12532 cat "conftest.$ac_ext" >&5
12533 ac_cv_func_gethostbyname=no
12534 fi
12535 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12536 fi
12537 echo "$as_me:12537: result: $ac_cv_func_gethostbyname" >&5
12538 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12539
12540     if test $ac_cv_func_gethostbyname = no; then
12541       echo "$as_me:12541: checking for gethostbyname in -lnsl" >&5
12542 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12543 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12544   echo $ECHO_N "(cached) $ECHO_C" >&6
12545 else
12546   ac_check_lib_save_LIBS=$LIBS
12547 LIBS="-lnsl  $LIBS"
12548 cat >"conftest.$ac_ext" <<_ACEOF
12549 #line 12549 "configure"
12550 #include "confdefs.h"
12551
12552 /* Override any gcc2 internal prototype to avoid an error.  */
12553 #ifdef __cplusplus
12554 extern "C"
12555 #endif
12556 /* We use char because int might match the return type of a gcc2
12557    builtin and then its argument prototype would still apply.  */
12558 char gethostbyname ();
12559 int
12560 main (void)
12561 {
12562 gethostbyname ();
12563   ;
12564   return 0;
12565 }
12566 _ACEOF
12567 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12568 if { (eval echo "$as_me:12568: \"$ac_link\"") >&5
12569   (eval $ac_link) 2>&5
12570   ac_status=$?
12571   echo "$as_me:12571: \$? = $ac_status" >&5
12572   (exit "$ac_status"); } &&
12573          { ac_try='test -s "conftest$ac_exeext"'
12574   { (eval echo "$as_me:12574: \"$ac_try\"") >&5
12575   (eval $ac_try) 2>&5
12576   ac_status=$?
12577   echo "$as_me:12577: \$? = $ac_status" >&5
12578   (exit "$ac_status"); }; }; then
12579   ac_cv_lib_nsl_gethostbyname=yes
12580 else
12581   echo "$as_me: failed program was:" >&5
12582 cat "conftest.$ac_ext" >&5
12583 ac_cv_lib_nsl_gethostbyname=no
12584 fi
12585 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12586 LIBS=$ac_check_lib_save_LIBS
12587 fi
12588 echo "$as_me:12588: result: $ac_cv_lib_nsl_gethostbyname" >&5
12589 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12590 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12591   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12592 fi
12593
12594       if test $ac_cv_lib_nsl_gethostbyname = no; then
12595         echo "$as_me:12595: checking for gethostbyname in -lbsd" >&5
12596 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12597 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12598   echo $ECHO_N "(cached) $ECHO_C" >&6
12599 else
12600   ac_check_lib_save_LIBS=$LIBS
12601 LIBS="-lbsd  $LIBS"
12602 cat >"conftest.$ac_ext" <<_ACEOF
12603 #line 12603 "configure"
12604 #include "confdefs.h"
12605
12606 /* Override any gcc2 internal prototype to avoid an error.  */
12607 #ifdef __cplusplus
12608 extern "C"
12609 #endif
12610 /* We use char because int might match the return type of a gcc2
12611    builtin and then its argument prototype would still apply.  */
12612 char gethostbyname ();
12613 int
12614 main (void)
12615 {
12616 gethostbyname ();
12617   ;
12618   return 0;
12619 }
12620 _ACEOF
12621 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12622 if { (eval echo "$as_me:12622: \"$ac_link\"") >&5
12623   (eval $ac_link) 2>&5
12624   ac_status=$?
12625   echo "$as_me:12625: \$? = $ac_status" >&5
12626   (exit "$ac_status"); } &&
12627          { ac_try='test -s "conftest$ac_exeext"'
12628   { (eval echo "$as_me:12628: \"$ac_try\"") >&5
12629   (eval $ac_try) 2>&5
12630   ac_status=$?
12631   echo "$as_me:12631: \$? = $ac_status" >&5
12632   (exit "$ac_status"); }; }; then
12633   ac_cv_lib_bsd_gethostbyname=yes
12634 else
12635   echo "$as_me: failed program was:" >&5
12636 cat "conftest.$ac_ext" >&5
12637 ac_cv_lib_bsd_gethostbyname=no
12638 fi
12639 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12640 LIBS=$ac_check_lib_save_LIBS
12641 fi
12642 echo "$as_me:12642: result: $ac_cv_lib_bsd_gethostbyname" >&5
12643 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12644 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
12645   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12646 fi
12647
12648       fi
12649     fi
12650
12651     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12652     # socket/setsockopt and other routines are undefined under SCO ODT
12653     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12654     # on later versions), says Simon Leinen: it contains gethostby*
12655     # variants that don't use the nameserver (or something).  -lsocket
12656     # must be given before -lnsl if both are needed.  We assume that
12657     # if connect needs -lnsl, so does gethostbyname.
12658     echo "$as_me:12658: checking for connect" >&5
12659 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12660 if test "${ac_cv_func_connect+set}" = set; then
12661   echo $ECHO_N "(cached) $ECHO_C" >&6
12662 else
12663   cat >"conftest.$ac_ext" <<_ACEOF
12664 #line 12664 "configure"
12665 #include "confdefs.h"
12666 #define connect autoconf_temporary
12667 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12668 #undef connect
12669
12670 #ifdef __cplusplus
12671 extern "C"
12672 #endif
12673
12674 /* We use char because int might match the return type of a gcc2
12675    builtin and then its argument prototype would still apply.  */
12676 char connect (void);
12677
12678 int
12679 main (void)
12680 {
12681
12682 /* The GNU C library defines stubs for functions which it implements
12683     to always fail with ENOSYS.  Some functions are actually named
12684     something starting with __ and the normal name is an alias.  */
12685 #if defined (__stub_connect) || defined (__stub___connect)
12686 #error found stub for connect
12687 #endif
12688
12689         return connect ();
12690   ;
12691   return 0;
12692 }
12693 _ACEOF
12694 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12695 if { (eval echo "$as_me:12695: \"$ac_link\"") >&5
12696   (eval $ac_link) 2>&5
12697   ac_status=$?
12698   echo "$as_me:12698: \$? = $ac_status" >&5
12699   (exit "$ac_status"); } &&
12700          { ac_try='test -s "conftest$ac_exeext"'
12701   { (eval echo "$as_me:12701: \"$ac_try\"") >&5
12702   (eval $ac_try) 2>&5
12703   ac_status=$?
12704   echo "$as_me:12704: \$? = $ac_status" >&5
12705   (exit "$ac_status"); }; }; then
12706   ac_cv_func_connect=yes
12707 else
12708   echo "$as_me: failed program was:" >&5
12709 cat "conftest.$ac_ext" >&5
12710 ac_cv_func_connect=no
12711 fi
12712 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12713 fi
12714 echo "$as_me:12714: result: $ac_cv_func_connect" >&5
12715 echo "${ECHO_T}$ac_cv_func_connect" >&6
12716
12717     if test $ac_cv_func_connect = no; then
12718       echo "$as_me:12718: checking for connect in -lsocket" >&5
12719 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12720 if test "${ac_cv_lib_socket_connect+set}" = set; then
12721   echo $ECHO_N "(cached) $ECHO_C" >&6
12722 else
12723   ac_check_lib_save_LIBS=$LIBS
12724 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12725 cat >"conftest.$ac_ext" <<_ACEOF
12726 #line 12726 "configure"
12727 #include "confdefs.h"
12728
12729 /* Override any gcc2 internal prototype to avoid an error.  */
12730 #ifdef __cplusplus
12731 extern "C"
12732 #endif
12733 /* We use char because int might match the return type of a gcc2
12734    builtin and then its argument prototype would still apply.  */
12735 char connect ();
12736 int
12737 main (void)
12738 {
12739 connect ();
12740   ;
12741   return 0;
12742 }
12743 _ACEOF
12744 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12745 if { (eval echo "$as_me:12745: \"$ac_link\"") >&5
12746   (eval $ac_link) 2>&5
12747   ac_status=$?
12748   echo "$as_me:12748: \$? = $ac_status" >&5
12749   (exit "$ac_status"); } &&
12750          { ac_try='test -s "conftest$ac_exeext"'
12751   { (eval echo "$as_me:12751: \"$ac_try\"") >&5
12752   (eval $ac_try) 2>&5
12753   ac_status=$?
12754   echo "$as_me:12754: \$? = $ac_status" >&5
12755   (exit "$ac_status"); }; }; then
12756   ac_cv_lib_socket_connect=yes
12757 else
12758   echo "$as_me: failed program was:" >&5
12759 cat "conftest.$ac_ext" >&5
12760 ac_cv_lib_socket_connect=no
12761 fi
12762 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12763 LIBS=$ac_check_lib_save_LIBS
12764 fi
12765 echo "$as_me:12765: result: $ac_cv_lib_socket_connect" >&5
12766 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12767 if test "$ac_cv_lib_socket_connect" = yes; then
12768   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12769 fi
12770
12771     fi
12772
12773     # Guillermo Gomez says -lposix is necessary on A/UX.
12774     echo "$as_me:12774: checking for remove" >&5
12775 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12776 if test "${ac_cv_func_remove+set}" = set; then
12777   echo $ECHO_N "(cached) $ECHO_C" >&6
12778 else
12779   cat >"conftest.$ac_ext" <<_ACEOF
12780 #line 12780 "configure"
12781 #include "confdefs.h"
12782 #define remove autoconf_temporary
12783 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12784 #undef remove
12785
12786 #ifdef __cplusplus
12787 extern "C"
12788 #endif
12789
12790 /* We use char because int might match the return type of a gcc2
12791    builtin and then its argument prototype would still apply.  */
12792 char remove (void);
12793
12794 int
12795 main (void)
12796 {
12797
12798 /* The GNU C library defines stubs for functions which it implements
12799     to always fail with ENOSYS.  Some functions are actually named
12800     something starting with __ and the normal name is an alias.  */
12801 #if defined (__stub_remove) || defined (__stub___remove)
12802 #error found stub for remove
12803 #endif
12804
12805         return remove ();
12806   ;
12807   return 0;
12808 }
12809 _ACEOF
12810 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12811 if { (eval echo "$as_me:12811: \"$ac_link\"") >&5
12812   (eval $ac_link) 2>&5
12813   ac_status=$?
12814   echo "$as_me:12814: \$? = $ac_status" >&5
12815   (exit "$ac_status"); } &&
12816          { ac_try='test -s "conftest$ac_exeext"'
12817   { (eval echo "$as_me:12817: \"$ac_try\"") >&5
12818   (eval $ac_try) 2>&5
12819   ac_status=$?
12820   echo "$as_me:12820: \$? = $ac_status" >&5
12821   (exit "$ac_status"); }; }; then
12822   ac_cv_func_remove=yes
12823 else
12824   echo "$as_me: failed program was:" >&5
12825 cat "conftest.$ac_ext" >&5
12826 ac_cv_func_remove=no
12827 fi
12828 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12829 fi
12830 echo "$as_me:12830: result: $ac_cv_func_remove" >&5
12831 echo "${ECHO_T}$ac_cv_func_remove" >&6
12832
12833     if test $ac_cv_func_remove = no; then
12834       echo "$as_me:12834: checking for remove in -lposix" >&5
12835 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12836 if test "${ac_cv_lib_posix_remove+set}" = set; then
12837   echo $ECHO_N "(cached) $ECHO_C" >&6
12838 else
12839   ac_check_lib_save_LIBS=$LIBS
12840 LIBS="-lposix  $LIBS"
12841 cat >"conftest.$ac_ext" <<_ACEOF
12842 #line 12842 "configure"
12843 #include "confdefs.h"
12844
12845 /* Override any gcc2 internal prototype to avoid an error.  */
12846 #ifdef __cplusplus
12847 extern "C"
12848 #endif
12849 /* We use char because int might match the return type of a gcc2
12850    builtin and then its argument prototype would still apply.  */
12851 char remove ();
12852 int
12853 main (void)
12854 {
12855 remove ();
12856   ;
12857   return 0;
12858 }
12859 _ACEOF
12860 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12861 if { (eval echo "$as_me:12861: \"$ac_link\"") >&5
12862   (eval $ac_link) 2>&5
12863   ac_status=$?
12864   echo "$as_me:12864: \$? = $ac_status" >&5
12865   (exit "$ac_status"); } &&
12866          { ac_try='test -s "conftest$ac_exeext"'
12867   { (eval echo "$as_me:12867: \"$ac_try\"") >&5
12868   (eval $ac_try) 2>&5
12869   ac_status=$?
12870   echo "$as_me:12870: \$? = $ac_status" >&5
12871   (exit "$ac_status"); }; }; then
12872   ac_cv_lib_posix_remove=yes
12873 else
12874   echo "$as_me: failed program was:" >&5
12875 cat "conftest.$ac_ext" >&5
12876 ac_cv_lib_posix_remove=no
12877 fi
12878 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12879 LIBS=$ac_check_lib_save_LIBS
12880 fi
12881 echo "$as_me:12881: result: $ac_cv_lib_posix_remove" >&5
12882 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12883 if test "$ac_cv_lib_posix_remove" = yes; then
12884   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12885 fi
12886
12887     fi
12888
12889     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12890     echo "$as_me:12890: checking for shmat" >&5
12891 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12892 if test "${ac_cv_func_shmat+set}" = set; then
12893   echo $ECHO_N "(cached) $ECHO_C" >&6
12894 else
12895   cat >"conftest.$ac_ext" <<_ACEOF
12896 #line 12896 "configure"
12897 #include "confdefs.h"
12898 #define shmat autoconf_temporary
12899 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12900 #undef shmat
12901
12902 #ifdef __cplusplus
12903 extern "C"
12904 #endif
12905
12906 /* We use char because int might match the return type of a gcc2
12907    builtin and then its argument prototype would still apply.  */
12908 char shmat (void);
12909
12910 int
12911 main (void)
12912 {
12913
12914 /* The GNU C library defines stubs for functions which it implements
12915     to always fail with ENOSYS.  Some functions are actually named
12916     something starting with __ and the normal name is an alias.  */
12917 #if defined (__stub_shmat) || defined (__stub___shmat)
12918 #error found stub for shmat
12919 #endif
12920
12921         return shmat ();
12922   ;
12923   return 0;
12924 }
12925 _ACEOF
12926 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12927 if { (eval echo "$as_me:12927: \"$ac_link\"") >&5
12928   (eval $ac_link) 2>&5
12929   ac_status=$?
12930   echo "$as_me:12930: \$? = $ac_status" >&5
12931   (exit "$ac_status"); } &&
12932          { ac_try='test -s "conftest$ac_exeext"'
12933   { (eval echo "$as_me:12933: \"$ac_try\"") >&5
12934   (eval $ac_try) 2>&5
12935   ac_status=$?
12936   echo "$as_me:12936: \$? = $ac_status" >&5
12937   (exit "$ac_status"); }; }; then
12938   ac_cv_func_shmat=yes
12939 else
12940   echo "$as_me: failed program was:" >&5
12941 cat "conftest.$ac_ext" >&5
12942 ac_cv_func_shmat=no
12943 fi
12944 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12945 fi
12946 echo "$as_me:12946: result: $ac_cv_func_shmat" >&5
12947 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12948
12949     if test $ac_cv_func_shmat = no; then
12950       echo "$as_me:12950: checking for shmat in -lipc" >&5
12951 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12952 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12953   echo $ECHO_N "(cached) $ECHO_C" >&6
12954 else
12955   ac_check_lib_save_LIBS=$LIBS
12956 LIBS="-lipc  $LIBS"
12957 cat >"conftest.$ac_ext" <<_ACEOF
12958 #line 12958 "configure"
12959 #include "confdefs.h"
12960
12961 /* Override any gcc2 internal prototype to avoid an error.  */
12962 #ifdef __cplusplus
12963 extern "C"
12964 #endif
12965 /* We use char because int might match the return type of a gcc2
12966    builtin and then its argument prototype would still apply.  */
12967 char shmat ();
12968 int
12969 main (void)
12970 {
12971 shmat ();
12972   ;
12973   return 0;
12974 }
12975 _ACEOF
12976 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12977 if { (eval echo "$as_me:12977: \"$ac_link\"") >&5
12978   (eval $ac_link) 2>&5
12979   ac_status=$?
12980   echo "$as_me:12980: \$? = $ac_status" >&5
12981   (exit "$ac_status"); } &&
12982          { ac_try='test -s "conftest$ac_exeext"'
12983   { (eval echo "$as_me:12983: \"$ac_try\"") >&5
12984   (eval $ac_try) 2>&5
12985   ac_status=$?
12986   echo "$as_me:12986: \$? = $ac_status" >&5
12987   (exit "$ac_status"); }; }; then
12988   ac_cv_lib_ipc_shmat=yes
12989 else
12990   echo "$as_me: failed program was:" >&5
12991 cat "conftest.$ac_ext" >&5
12992 ac_cv_lib_ipc_shmat=no
12993 fi
12994 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12995 LIBS=$ac_check_lib_save_LIBS
12996 fi
12997 echo "$as_me:12997: result: $ac_cv_lib_ipc_shmat" >&5
12998 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12999 if test "$ac_cv_lib_ipc_shmat" = yes; then
13000   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13001 fi
13002
13003     fi
13004   fi
13005
13006   # Check for libraries that X11R6 Xt/Xaw programs need.
13007   ac_save_LDFLAGS=$LDFLAGS
13008   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13009   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13010   # check for ICE first), but we must link in the order -lSM -lICE or
13011   # we get undefined symbols.  So assume we have SM if we have ICE.
13012   # These have to be linked with before -lX11, unlike the other
13013   # libraries we check for below, so use a different variable.
13014   # John Interrante, Karl Berry
13015   echo "$as_me:13015: checking for IceConnectionNumber in -lICE" >&5
13016 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13017 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13018   echo $ECHO_N "(cached) $ECHO_C" >&6
13019 else
13020   ac_check_lib_save_LIBS=$LIBS
13021 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
13022 cat >"conftest.$ac_ext" <<_ACEOF
13023 #line 13023 "configure"
13024 #include "confdefs.h"
13025
13026 /* Override any gcc2 internal prototype to avoid an error.  */
13027 #ifdef __cplusplus
13028 extern "C"
13029 #endif
13030 /* We use char because int might match the return type of a gcc2
13031    builtin and then its argument prototype would still apply.  */
13032 char IceConnectionNumber ();
13033 int
13034 main (void)
13035 {
13036 IceConnectionNumber ();
13037   ;
13038   return 0;
13039 }
13040 _ACEOF
13041 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13042 if { (eval echo "$as_me:13042: \"$ac_link\"") >&5
13043   (eval $ac_link) 2>&5
13044   ac_status=$?
13045   echo "$as_me:13045: \$? = $ac_status" >&5
13046   (exit "$ac_status"); } &&
13047          { ac_try='test -s "conftest$ac_exeext"'
13048   { (eval echo "$as_me:13048: \"$ac_try\"") >&5
13049   (eval $ac_try) 2>&5
13050   ac_status=$?
13051   echo "$as_me:13051: \$? = $ac_status" >&5
13052   (exit "$ac_status"); }; }; then
13053   ac_cv_lib_ICE_IceConnectionNumber=yes
13054 else
13055   echo "$as_me: failed program was:" >&5
13056 cat "conftest.$ac_ext" >&5
13057 ac_cv_lib_ICE_IceConnectionNumber=no
13058 fi
13059 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13060 LIBS=$ac_check_lib_save_LIBS
13061 fi
13062 echo "$as_me:13062: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13063 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13064 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13065   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13066 fi
13067
13068   LDFLAGS=$ac_save_LDFLAGS
13069
13070 fi
13071
13072 cf_x_athena=${cf_x_athena:-Xaw}
13073
13074 echo "$as_me:13074: checking if you want to link with Xaw 3d library" >&5
13075 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13076 withval=
13077
13078 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13079 if test "${with_Xaw3d+set}" = set; then
13080   withval="$with_Xaw3d"
13081
13082 fi;
13083 if test "$withval" = yes ; then
13084         cf_x_athena=Xaw3d
13085         echo "$as_me:13085: result: yes" >&5
13086 echo "${ECHO_T}yes" >&6
13087 else
13088         echo "$as_me:13088: result: no" >&5
13089 echo "${ECHO_T}no" >&6
13090 fi
13091
13092 echo "$as_me:13092: checking if you want to link with Xaw 3d xft library" >&5
13093 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13094 withval=
13095
13096 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13097 if test "${with_Xaw3dxft+set}" = set; then
13098   withval="$with_Xaw3dxft"
13099
13100 fi;
13101 if test "$withval" = yes ; then
13102         cf_x_athena=Xaw3dxft
13103         echo "$as_me:13103: result: yes" >&5
13104 echo "${ECHO_T}yes" >&6
13105 else
13106         echo "$as_me:13106: result: no" >&5
13107 echo "${ECHO_T}no" >&6
13108 fi
13109
13110 echo "$as_me:13110: checking if you want to link with neXT Athena library" >&5
13111 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13112 withval=
13113
13114 # Check whether --with-neXtaw or --without-neXtaw was given.
13115 if test "${with_neXtaw+set}" = set; then
13116   withval="$with_neXtaw"
13117
13118 fi;
13119 if test "$withval" = yes ; then
13120         cf_x_athena=neXtaw
13121         echo "$as_me:13121: result: yes" >&5
13122 echo "${ECHO_T}yes" >&6
13123 else
13124         echo "$as_me:13124: result: no" >&5
13125 echo "${ECHO_T}no" >&6
13126 fi
13127
13128 echo "$as_me:13128: checking if you want to link with Athena-Plus library" >&5
13129 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13130 withval=
13131
13132 # Check whether --with-XawPlus or --without-XawPlus was given.
13133 if test "${with_XawPlus+set}" = set; then
13134   withval="$with_XawPlus"
13135
13136 fi;
13137 if test "$withval" = yes ; then
13138         cf_x_athena=XawPlus
13139         echo "$as_me:13139: result: yes" >&5
13140 echo "${ECHO_T}yes" >&6
13141 else
13142         echo "$as_me:13142: result: no" >&5
13143 echo "${ECHO_T}no" >&6
13144 fi
13145
13146 cf_x_athena_lib=""
13147
13148 if test "$PKG_CONFIG" != none ; then
13149         cf_athena_list=
13150         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13151         for cf_athena_pkg in \
13152                 $cf_athena_list \
13153                 ${cf_x_athena} \
13154                 ${cf_x_athena}-devel \
13155                 lib${cf_x_athena} \
13156                 lib${cf_x_athena}-devel
13157         do
13158
13159 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13160         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13161
13162 echo "${as_me:-configure}:13162: testing found package $cf_athena_pkg ..." 1>&5
13163
13164         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13165         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13166         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13167
13168 echo "${as_me:-configure}:13168: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13169
13170         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13171
13172 echo "${as_me:-configure}:13172: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13173
13174 cf_fix_cppflags=no
13175 cf_new_cflags=
13176 cf_new_cppflags=
13177 cf_new_extra_cppflags=
13178
13179 for cf_add_cflags in $cf_pkgconfig_incs
13180 do
13181 case "$cf_fix_cppflags" in
13182 (no)
13183         case "$cf_add_cflags" in
13184         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13185                 case "$cf_add_cflags" in
13186                 (-D*)
13187                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13188
13189                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13190                                 && test -z "${cf_tst_cflags}" \
13191                                 && cf_fix_cppflags=yes
13192
13193                         if test "$cf_fix_cppflags" = yes ; then
13194
13195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13197
13198                                 continue
13199                         elif test "${cf_tst_cflags}" = "\"'" ; then
13200
13201         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13202         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13203
13204                                 continue
13205                         fi
13206                         ;;
13207                 esac
13208                 case "$CPPFLAGS" in
13209                 (*$cf_add_cflags)
13210                         ;;
13211                 (*)
13212                         case "$cf_add_cflags" in
13213                         (-D*)
13214                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13215
13216 CPPFLAGS=`echo "$CPPFLAGS" | \
13217         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13218                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13219
13220                                 ;;
13221                         esac
13222
13223         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13224         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13225
13226                         ;;
13227                 esac
13228                 ;;
13229         (*)
13230
13231         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13232         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13233
13234                 ;;
13235         esac
13236         ;;
13237 (yes)
13238
13239         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13240         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13241
13242         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13243
13244         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13245                 && test -z "${cf_tst_cflags}" \
13246                 && cf_fix_cppflags=no
13247         ;;
13248 esac
13249 done
13250
13251 if test -n "$cf_new_cflags" ; then
13252
13253         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13254         CFLAGS="${CFLAGS}$cf_new_cflags"
13255
13256 fi
13257
13258 if test -n "$cf_new_cppflags" ; then
13259
13260         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13261         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13262
13263 fi
13264
13265 if test -n "$cf_new_extra_cppflags" ; then
13266
13267         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13268         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13269
13270 fi
13271
13272 cf_add_libs="$LIBS"
13273 # reverse order
13274 cf_add_0lib=
13275 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13276 # filter duplicates
13277 for cf_add_1lib in $cf_add_0lib; do
13278         for cf_add_2lib in $cf_add_libs; do
13279                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13280                         cf_add_1lib=
13281                         break
13282                 fi
13283         done
13284         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13285 done
13286 LIBS="$cf_add_libs"
13287
13288                         cf_x_athena_lib="$cf_pkgconfig_libs"
13289
13290 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13291
13292                         cat >>confdefs.h <<EOF
13293 #define $cf_x_athena_LIBS 1
13294 EOF
13295
13296         for cf_trim_lib in Xmu Xt X11
13297         do
13298                 case "$LIBS" in
13299                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13300                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13301                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13302
13303 echo "${as_me:-configure}:13303: testing ..trimmed $LIBS ..." 1>&5
13304
13305                         ;;
13306                 esac
13307         done
13308
13309 echo "$as_me:13309: checking for usable $cf_x_athena/Xmu package" >&5
13310 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13311 if test "${cf_cv_xaw_compat+set}" = set; then
13312   echo $ECHO_N "(cached) $ECHO_C" >&6
13313 else
13314
13315 cat >"conftest.$ac_ext" <<_ACEOF
13316 #line 13316 "configure"
13317 #include "confdefs.h"
13318
13319 #include <X11/Xmu/CharSet.h>
13320
13321 int
13322 main (void)
13323 {
13324
13325 int check = XmuCompareISOLatin1("big", "small");
13326 (void)check;
13327
13328   ;
13329   return 0;
13330 }
13331 _ACEOF
13332 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13333 if { (eval echo "$as_me:13333: \"$ac_link\"") >&5
13334   (eval $ac_link) 2>&5
13335   ac_status=$?
13336   echo "$as_me:13336: \$? = $ac_status" >&5
13337   (exit "$ac_status"); } &&
13338          { ac_try='test -s "conftest$ac_exeext"'
13339   { (eval echo "$as_me:13339: \"$ac_try\"") >&5
13340   (eval $ac_try) 2>&5
13341   ac_status=$?
13342   echo "$as_me:13342: \$? = $ac_status" >&5
13343   (exit "$ac_status"); }; }; then
13344   cf_cv_xaw_compat=yes
13345 else
13346   echo "$as_me: failed program was:" >&5
13347 cat "conftest.$ac_ext" >&5
13348 cf_cv_xaw_compat=no
13349 fi
13350 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13351 fi
13352 echo "$as_me:13352: result: $cf_cv_xaw_compat" >&5
13353 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13354
13355                         if test "$cf_cv_xaw_compat" = no
13356                         then
13357                                 # workaround for broken ".pc" files...
13358                                 case "$cf_x_athena_lib" in
13359                                 (*-lXmu*)
13360                                         ;;
13361                                 (*)
13362                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13363
13364 echo "${as_me:-configure}:13364: testing work around broken package ..." 1>&5
13365
13366                                         cf_save_xmu="$LIBS"
13367                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13368
13369 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13370         test -n "$verbose" && echo "    found package xmu" 1>&6
13371
13372 echo "${as_me:-configure}:13372: testing found package xmu ..." 1>&5
13373
13374         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13375         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13376         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13377
13378 echo "${as_me:-configure}:13378: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13379
13380         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13381
13382 echo "${as_me:-configure}:13382: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13383
13384 cf_fix_cppflags=no
13385 cf_new_cflags=
13386 cf_new_cppflags=
13387 cf_new_extra_cppflags=
13388
13389 for cf_add_cflags in $cf_pkgconfig_incs
13390 do
13391 case "$cf_fix_cppflags" in
13392 (no)
13393         case "$cf_add_cflags" in
13394         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13395                 case "$cf_add_cflags" in
13396                 (-D*)
13397                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13398
13399                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13400                                 && test -z "${cf_tst_cflags}" \
13401                                 && cf_fix_cppflags=yes
13402
13403                         if test "$cf_fix_cppflags" = yes ; then
13404
13405         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13406         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13407
13408                                 continue
13409                         elif test "${cf_tst_cflags}" = "\"'" ; then
13410
13411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13413
13414                                 continue
13415                         fi
13416                         ;;
13417                 esac
13418                 case "$CPPFLAGS" in
13419                 (*$cf_add_cflags)
13420                         ;;
13421                 (*)
13422                         case "$cf_add_cflags" in
13423                         (-D*)
13424                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13425
13426 CPPFLAGS=`echo "$CPPFLAGS" | \
13427         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13428                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13429
13430                                 ;;
13431                         esac
13432
13433         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13434         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13435
13436                         ;;
13437                 esac
13438                 ;;
13439         (*)
13440
13441         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13442         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13443
13444                 ;;
13445         esac
13446         ;;
13447 (yes)
13448
13449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13451
13452         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13453
13454         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13455                 && test -z "${cf_tst_cflags}" \
13456                 && cf_fix_cppflags=no
13457         ;;
13458 esac
13459 done
13460
13461 if test -n "$cf_new_cflags" ; then
13462
13463         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13464         CFLAGS="${CFLAGS}$cf_new_cflags"
13465
13466 fi
13467
13468 if test -n "$cf_new_cppflags" ; then
13469
13470         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13471         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13472
13473 fi
13474
13475 if test -n "$cf_new_extra_cppflags" ; then
13476
13477         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13478         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13479
13480 fi
13481
13482 cf_add_libs="$LIBS"
13483 # reverse order
13484 cf_add_0lib=
13485 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13486 # filter duplicates
13487 for cf_add_1lib in $cf_add_0lib; do
13488         for cf_add_2lib in $cf_add_libs; do
13489                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13490                         cf_add_1lib=
13491                         break
13492                 fi
13493         done
13494         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13495 done
13496 LIBS="$cf_add_libs"
13497
13498                                                         LIBS="$cf_save_xmu"
13499
13500 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13501
13502 echo "${as_me:-configure}:13502: testing ...before $LIBS ..." 1>&5
13503
13504 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13505 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13506
13507 echo "${as_me:-configure}:13507: testing ...after  $LIBS ..." 1>&5
13508
13509 else
13510         cf_pkgconfig_incs=
13511         cf_pkgconfig_libs=
13512
13513 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13514
13515 echo "${as_me:-configure}:13515: testing ...before $LIBS ..." 1>&5
13516
13517 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13518 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13519
13520 echo "${as_me:-configure}:13520: testing ...after  $LIBS ..." 1>&5
13521
13522 fi
13523
13524         for cf_trim_lib in Xmu Xt X11
13525         do
13526                 case "$LIBS" in
13527                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13528                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13529                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13530
13531 echo "${as_me:-configure}:13531: testing ..trimmed $LIBS ..." 1>&5
13532
13533                         ;;
13534                 esac
13535         done
13536
13537                                         ;;
13538                                 esac
13539                         fi
13540
13541                         break
13542 else
13543         cf_pkgconfig_incs=
13544         cf_pkgconfig_libs=
13545         :
13546 fi
13547
13548         done
13549 fi
13550
13551 if test -z "$cf_x_athena_lib" ; then
13552
13553 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13554         test -n "$verbose" && echo "    found package Xext" 1>&6
13555
13556 echo "${as_me:-configure}:13556: testing found package Xext ..." 1>&5
13557
13558         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13559         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13560         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13561
13562 echo "${as_me:-configure}:13562: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13563
13564         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13565
13566 echo "${as_me:-configure}:13566: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13567
13568 cf_fix_cppflags=no
13569 cf_new_cflags=
13570 cf_new_cppflags=
13571 cf_new_extra_cppflags=
13572
13573 for cf_add_cflags in $cf_pkgconfig_incs
13574 do
13575 case "$cf_fix_cppflags" in
13576 (no)
13577         case "$cf_add_cflags" in
13578         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13579                 case "$cf_add_cflags" in
13580                 (-D*)
13581                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13582
13583                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13584                                 && test -z "${cf_tst_cflags}" \
13585                                 && cf_fix_cppflags=yes
13586
13587                         if test "$cf_fix_cppflags" = yes ; then
13588
13589         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13590         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13591
13592                                 continue
13593                         elif test "${cf_tst_cflags}" = "\"'" ; then
13594
13595         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13596         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13597
13598                                 continue
13599                         fi
13600                         ;;
13601                 esac
13602                 case "$CPPFLAGS" in
13603                 (*$cf_add_cflags)
13604                         ;;
13605                 (*)
13606                         case "$cf_add_cflags" in
13607                         (-D*)
13608                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13609
13610 CPPFLAGS=`echo "$CPPFLAGS" | \
13611         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13612                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13613
13614                                 ;;
13615                         esac
13616
13617         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13618         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13619
13620                         ;;
13621                 esac
13622                 ;;
13623         (*)
13624
13625         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13626         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13627
13628                 ;;
13629         esac
13630         ;;
13631 (yes)
13632
13633         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13634         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13635
13636         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13637
13638         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13639                 && test -z "${cf_tst_cflags}" \
13640                 && cf_fix_cppflags=no
13641         ;;
13642 esac
13643 done
13644
13645 if test -n "$cf_new_cflags" ; then
13646
13647         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13648         CFLAGS="${CFLAGS}$cf_new_cflags"
13649
13650 fi
13651
13652 if test -n "$cf_new_cppflags" ; then
13653
13654         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13655         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13656
13657 fi
13658
13659 if test -n "$cf_new_extra_cppflags" ; then
13660
13661         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13662         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13663
13664 fi
13665
13666 cf_add_libs="$LIBS"
13667 # reverse order
13668 cf_add_0lib=
13669 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13670 # filter duplicates
13671 for cf_add_1lib in $cf_add_0lib; do
13672         for cf_add_2lib in $cf_add_libs; do
13673                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13674                         cf_add_1lib=
13675                         break
13676                 fi
13677         done
13678         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13679 done
13680 LIBS="$cf_add_libs"
13681
13682         :
13683 else
13684         cf_pkgconfig_incs=
13685         cf_pkgconfig_libs=
13686
13687         echo "$as_me:13687: checking for XextCreateExtension in -lXext" >&5
13688 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13689 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13690   echo $ECHO_N "(cached) $ECHO_C" >&6
13691 else
13692   ac_check_lib_save_LIBS=$LIBS
13693 LIBS="-lXext  $LIBS"
13694 cat >"conftest.$ac_ext" <<_ACEOF
13695 #line 13695 "configure"
13696 #include "confdefs.h"
13697
13698 /* Override any gcc2 internal prototype to avoid an error.  */
13699 #ifdef __cplusplus
13700 extern "C"
13701 #endif
13702 /* We use char because int might match the return type of a gcc2
13703    builtin and then its argument prototype would still apply.  */
13704 char XextCreateExtension ();
13705 int
13706 main (void)
13707 {
13708 XextCreateExtension ();
13709   ;
13710   return 0;
13711 }
13712 _ACEOF
13713 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13714 if { (eval echo "$as_me:13714: \"$ac_link\"") >&5
13715   (eval $ac_link) 2>&5
13716   ac_status=$?
13717   echo "$as_me:13717: \$? = $ac_status" >&5
13718   (exit "$ac_status"); } &&
13719          { ac_try='test -s "conftest$ac_exeext"'
13720   { (eval echo "$as_me:13720: \"$ac_try\"") >&5
13721   (eval $ac_try) 2>&5
13722   ac_status=$?
13723   echo "$as_me:13723: \$? = $ac_status" >&5
13724   (exit "$ac_status"); }; }; then
13725   ac_cv_lib_Xext_XextCreateExtension=yes
13726 else
13727   echo "$as_me: failed program was:" >&5
13728 cat "conftest.$ac_ext" >&5
13729 ac_cv_lib_Xext_XextCreateExtension=no
13730 fi
13731 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13732 LIBS=$ac_check_lib_save_LIBS
13733 fi
13734 echo "$as_me:13734: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13735 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13736 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
13737
13738 cf_add_libs="$LIBS"
13739 # reverse order
13740 cf_add_0lib=
13741 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13742 # filter duplicates
13743 for cf_add_1lib in $cf_add_0lib; do
13744         for cf_add_2lib in $cf_add_libs; do
13745                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13746                         cf_add_1lib=
13747                         break
13748                 fi
13749         done
13750         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13751 done
13752 LIBS="$cf_add_libs"
13753
13754 fi
13755
13756 fi
13757
13758 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13759 # in some cases has installed dummy files in the former, other cases replaced
13760 # it with a link to the new location).  This complicates the configure script.
13761 # Check for that pitfall, and recover using pkg-config
13762 #
13763 # If none of these are set, the configuration is almost certainly broken.
13764 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13765 then
13766
13767 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
13768         test -n "$verbose" && echo "    found package x11" 1>&6
13769
13770 echo "${as_me:-configure}:13770: testing found package x11 ..." 1>&5
13771
13772         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
13773         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
13774         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13775
13776 echo "${as_me:-configure}:13776: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13777
13778         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13779
13780 echo "${as_me:-configure}:13780: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13781
13782 cf_fix_cppflags=no
13783 cf_new_cflags=
13784 cf_new_cppflags=
13785 cf_new_extra_cppflags=
13786
13787 for cf_add_cflags in $cf_pkgconfig_incs
13788 do
13789 case "$cf_fix_cppflags" in
13790 (no)
13791         case "$cf_add_cflags" in
13792         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13793                 case "$cf_add_cflags" in
13794                 (-D*)
13795                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13796
13797                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13798                                 && test -z "${cf_tst_cflags}" \
13799                                 && cf_fix_cppflags=yes
13800
13801                         if test "$cf_fix_cppflags" = yes ; then
13802
13803         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13804         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13805
13806                                 continue
13807                         elif test "${cf_tst_cflags}" = "\"'" ; then
13808
13809         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13810         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13811
13812                                 continue
13813                         fi
13814                         ;;
13815                 esac
13816                 case "$CPPFLAGS" in
13817                 (*$cf_add_cflags)
13818                         ;;
13819                 (*)
13820                         case "$cf_add_cflags" in
13821                         (-D*)
13822                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13823
13824 CPPFLAGS=`echo "$CPPFLAGS" | \
13825         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13826                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13827
13828                                 ;;
13829                         esac
13830
13831         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13832         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13833
13834                         ;;
13835                 esac
13836                 ;;
13837         (*)
13838
13839         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13840         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13841
13842                 ;;
13843         esac
13844         ;;
13845 (yes)
13846
13847         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13848         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13849
13850         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13851
13852         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13853                 && test -z "${cf_tst_cflags}" \
13854                 && cf_fix_cppflags=no
13855         ;;
13856 esac
13857 done
13858
13859 if test -n "$cf_new_cflags" ; then
13860
13861         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13862         CFLAGS="${CFLAGS}$cf_new_cflags"
13863
13864 fi
13865
13866 if test -n "$cf_new_cppflags" ; then
13867
13868         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13869         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13870
13871 fi
13872
13873 if test -n "$cf_new_extra_cppflags" ; then
13874
13875         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13876         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13877
13878 fi
13879
13880 cf_add_libs="$LIBS"
13881 # reverse order
13882 cf_add_0lib=
13883 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13884 # filter duplicates
13885 for cf_add_1lib in $cf_add_0lib; do
13886         for cf_add_2lib in $cf_add_libs; do
13887                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13888                         cf_add_1lib=
13889                         break
13890                 fi
13891         done
13892         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13893 done
13894 LIBS="$cf_add_libs"
13895
13896         :
13897 else
13898         cf_pkgconfig_incs=
13899         cf_pkgconfig_libs=
13900         { echo "$as_me:13900: WARNING: unable to find X11 library" >&5
13901 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13902 fi
13903
13904 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
13905         test -n "$verbose" && echo "    found package ice" 1>&6
13906
13907 echo "${as_me:-configure}:13907: testing found package ice ..." 1>&5
13908
13909         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
13910         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
13911         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13912
13913 echo "${as_me:-configure}:13913: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13914
13915         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13916
13917 echo "${as_me:-configure}:13917: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13918
13919 cf_fix_cppflags=no
13920 cf_new_cflags=
13921 cf_new_cppflags=
13922 cf_new_extra_cppflags=
13923
13924 for cf_add_cflags in $cf_pkgconfig_incs
13925 do
13926 case "$cf_fix_cppflags" in
13927 (no)
13928         case "$cf_add_cflags" in
13929         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13930                 case "$cf_add_cflags" in
13931                 (-D*)
13932                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13933
13934                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13935                                 && test -z "${cf_tst_cflags}" \
13936                                 && cf_fix_cppflags=yes
13937
13938                         if test "$cf_fix_cppflags" = yes ; then
13939
13940         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13941         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13942
13943                                 continue
13944                         elif test "${cf_tst_cflags}" = "\"'" ; then
13945
13946         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13947         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13948
13949                                 continue
13950                         fi
13951                         ;;
13952                 esac
13953                 case "$CPPFLAGS" in
13954                 (*$cf_add_cflags)
13955                         ;;
13956                 (*)
13957                         case "$cf_add_cflags" in
13958                         (-D*)
13959                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13960
13961 CPPFLAGS=`echo "$CPPFLAGS" | \
13962         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13963                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13964
13965                                 ;;
13966                         esac
13967
13968         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13969         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13970
13971                         ;;
13972                 esac
13973                 ;;
13974         (*)
13975
13976         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13977         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13978
13979                 ;;
13980         esac
13981         ;;
13982 (yes)
13983
13984         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13985         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13986
13987         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13988
13989         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13990                 && test -z "${cf_tst_cflags}" \
13991                 && cf_fix_cppflags=no
13992         ;;
13993 esac
13994 done
13995
13996 if test -n "$cf_new_cflags" ; then
13997
13998         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13999         CFLAGS="${CFLAGS}$cf_new_cflags"
14000
14001 fi
14002
14003 if test -n "$cf_new_cppflags" ; then
14004
14005         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14006         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14007
14008 fi
14009
14010 if test -n "$cf_new_extra_cppflags" ; then
14011
14012         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14013         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14014
14015 fi
14016
14017 cf_add_libs="$LIBS"
14018 # reverse order
14019 cf_add_0lib=
14020 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14021 # filter duplicates
14022 for cf_add_1lib in $cf_add_0lib; do
14023         for cf_add_2lib in $cf_add_libs; do
14024                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14025                         cf_add_1lib=
14026                         break
14027                 fi
14028         done
14029         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14030 done
14031 LIBS="$cf_add_libs"
14032
14033         :
14034 else
14035         cf_pkgconfig_incs=
14036         cf_pkgconfig_libs=
14037         { echo "$as_me:14037: WARNING: unable to find ICE library" >&5
14038 echo "$as_me: WARNING: unable to find ICE library" >&2;}
14039 fi
14040
14041 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14042         test -n "$verbose" && echo "    found package sm" 1>&6
14043
14044 echo "${as_me:-configure}:14044: testing found package sm ..." 1>&5
14045
14046         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14047         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14048         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14049
14050 echo "${as_me:-configure}:14050: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14051
14052         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14053
14054 echo "${as_me:-configure}:14054: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14055
14056 cf_fix_cppflags=no
14057 cf_new_cflags=
14058 cf_new_cppflags=
14059 cf_new_extra_cppflags=
14060
14061 for cf_add_cflags in $cf_pkgconfig_incs
14062 do
14063 case "$cf_fix_cppflags" in
14064 (no)
14065         case "$cf_add_cflags" in
14066         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14067                 case "$cf_add_cflags" in
14068                 (-D*)
14069                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14070
14071                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14072                                 && test -z "${cf_tst_cflags}" \
14073                                 && cf_fix_cppflags=yes
14074
14075                         if test "$cf_fix_cppflags" = yes ; then
14076
14077         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14078         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14079
14080                                 continue
14081                         elif test "${cf_tst_cflags}" = "\"'" ; then
14082
14083         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14084         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14085
14086                                 continue
14087                         fi
14088                         ;;
14089                 esac
14090                 case "$CPPFLAGS" in
14091                 (*$cf_add_cflags)
14092                         ;;
14093                 (*)
14094                         case "$cf_add_cflags" in
14095                         (-D*)
14096                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14097
14098 CPPFLAGS=`echo "$CPPFLAGS" | \
14099         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14100                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14101
14102                                 ;;
14103                         esac
14104
14105         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14106         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14107
14108                         ;;
14109                 esac
14110                 ;;
14111         (*)
14112
14113         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14114         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14115
14116                 ;;
14117         esac
14118         ;;
14119 (yes)
14120
14121         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14122         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14123
14124         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14125
14126         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14127                 && test -z "${cf_tst_cflags}" \
14128                 && cf_fix_cppflags=no
14129         ;;
14130 esac
14131 done
14132
14133 if test -n "$cf_new_cflags" ; then
14134
14135         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14136         CFLAGS="${CFLAGS}$cf_new_cflags"
14137
14138 fi
14139
14140 if test -n "$cf_new_cppflags" ; then
14141
14142         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14143         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14144
14145 fi
14146
14147 if test -n "$cf_new_extra_cppflags" ; then
14148
14149         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14150         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14151
14152 fi
14153
14154 cf_add_libs="$LIBS"
14155 # reverse order
14156 cf_add_0lib=
14157 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14158 # filter duplicates
14159 for cf_add_1lib in $cf_add_0lib; do
14160         for cf_add_2lib in $cf_add_libs; do
14161                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14162                         cf_add_1lib=
14163                         break
14164                 fi
14165         done
14166         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14167 done
14168 LIBS="$cf_add_libs"
14169
14170         :
14171 else
14172         cf_pkgconfig_incs=
14173         cf_pkgconfig_libs=
14174         { echo "$as_me:14174: WARNING: unable to find SM library" >&5
14175 echo "$as_me: WARNING: unable to find SM library" >&2;}
14176 fi
14177
14178 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14179         test -n "$verbose" && echo "    found package xt" 1>&6
14180
14181 echo "${as_me:-configure}:14181: testing found package xt ..." 1>&5
14182
14183         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14184         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14185         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14186
14187 echo "${as_me:-configure}:14187: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14188
14189         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14190
14191 echo "${as_me:-configure}:14191: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14192
14193 cf_fix_cppflags=no
14194 cf_new_cflags=
14195 cf_new_cppflags=
14196 cf_new_extra_cppflags=
14197
14198 for cf_add_cflags in $cf_pkgconfig_incs
14199 do
14200 case "$cf_fix_cppflags" in
14201 (no)
14202         case "$cf_add_cflags" in
14203         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14204                 case "$cf_add_cflags" in
14205                 (-D*)
14206                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14207
14208                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14209                                 && test -z "${cf_tst_cflags}" \
14210                                 && cf_fix_cppflags=yes
14211
14212                         if test "$cf_fix_cppflags" = yes ; then
14213
14214         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14215         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14216
14217                                 continue
14218                         elif test "${cf_tst_cflags}" = "\"'" ; then
14219
14220         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14221         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14222
14223                                 continue
14224                         fi
14225                         ;;
14226                 esac
14227                 case "$CPPFLAGS" in
14228                 (*$cf_add_cflags)
14229                         ;;
14230                 (*)
14231                         case "$cf_add_cflags" in
14232                         (-D*)
14233                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14234
14235 CPPFLAGS=`echo "$CPPFLAGS" | \
14236         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14237                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14238
14239                                 ;;
14240                         esac
14241
14242         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14243         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14244
14245                         ;;
14246                 esac
14247                 ;;
14248         (*)
14249
14250         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14251         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14252
14253                 ;;
14254         esac
14255         ;;
14256 (yes)
14257
14258         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14259         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14260
14261         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14262
14263         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14264                 && test -z "${cf_tst_cflags}" \
14265                 && cf_fix_cppflags=no
14266         ;;
14267 esac
14268 done
14269
14270 if test -n "$cf_new_cflags" ; then
14271
14272         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14273         CFLAGS="${CFLAGS}$cf_new_cflags"
14274
14275 fi
14276
14277 if test -n "$cf_new_cppflags" ; then
14278
14279         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14280         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14281
14282 fi
14283
14284 if test -n "$cf_new_extra_cppflags" ; then
14285
14286         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14287         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14288
14289 fi
14290
14291 cf_add_libs="$LIBS"
14292 # reverse order
14293 cf_add_0lib=
14294 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14295 # filter duplicates
14296 for cf_add_1lib in $cf_add_0lib; do
14297         for cf_add_2lib in $cf_add_libs; do
14298                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14299                         cf_add_1lib=
14300                         break
14301                 fi
14302         done
14303         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14304 done
14305 LIBS="$cf_add_libs"
14306
14307         :
14308 else
14309         cf_pkgconfig_incs=
14310         cf_pkgconfig_libs=
14311         { echo "$as_me:14311: WARNING: unable to find Xt library" >&5
14312 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14313 fi
14314
14315 else
14316         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14317 fi
14318
14319 cf_have_X_LIBS=no
14320
14321 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14322         test -n "$verbose" && echo "    found package xt" 1>&6
14323
14324 echo "${as_me:-configure}:14324: testing found package xt ..." 1>&5
14325
14326         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14327         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14328         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14329
14330 echo "${as_me:-configure}:14330: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14331
14332         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14333
14334 echo "${as_me:-configure}:14334: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14335
14336 cf_fix_cppflags=no
14337 cf_new_cflags=
14338 cf_new_cppflags=
14339 cf_new_extra_cppflags=
14340
14341 for cf_add_cflags in $cf_pkgconfig_incs
14342 do
14343 case "$cf_fix_cppflags" in
14344 (no)
14345         case "$cf_add_cflags" in
14346         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14347                 case "$cf_add_cflags" in
14348                 (-D*)
14349                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14350
14351                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14352                                 && test -z "${cf_tst_cflags}" \
14353                                 && cf_fix_cppflags=yes
14354
14355                         if test "$cf_fix_cppflags" = yes ; then
14356
14357         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14358         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14359
14360                                 continue
14361                         elif test "${cf_tst_cflags}" = "\"'" ; then
14362
14363         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14364         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14365
14366                                 continue
14367                         fi
14368                         ;;
14369                 esac
14370                 case "$CPPFLAGS" in
14371                 (*$cf_add_cflags)
14372                         ;;
14373                 (*)
14374                         case "$cf_add_cflags" in
14375                         (-D*)
14376                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14377
14378 CPPFLAGS=`echo "$CPPFLAGS" | \
14379         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14380                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14381
14382                                 ;;
14383                         esac
14384
14385         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14386         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14387
14388                         ;;
14389                 esac
14390                 ;;
14391         (*)
14392
14393         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14394         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14395
14396                 ;;
14397         esac
14398         ;;
14399 (yes)
14400
14401         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14402         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14403
14404         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14405
14406         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14407                 && test -z "${cf_tst_cflags}" \
14408                 && cf_fix_cppflags=no
14409         ;;
14410 esac
14411 done
14412
14413 if test -n "$cf_new_cflags" ; then
14414
14415         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14416         CFLAGS="${CFLAGS}$cf_new_cflags"
14417
14418 fi
14419
14420 if test -n "$cf_new_cppflags" ; then
14421
14422         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14423         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14424
14425 fi
14426
14427 if test -n "$cf_new_extra_cppflags" ; then
14428
14429         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14430         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14431
14432 fi
14433
14434 cf_add_libs="$LIBS"
14435 # reverse order
14436 cf_add_0lib=
14437 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14438 # filter duplicates
14439 for cf_add_1lib in $cf_add_0lib; do
14440         for cf_add_2lib in $cf_add_libs; do
14441                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14442                         cf_add_1lib=
14443                         break
14444                 fi
14445         done
14446         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14447 done
14448 LIBS="$cf_add_libs"
14449
14450         case "x$LIBS" in
14451         (*-lX11*)
14452                 ;;
14453         (*)
14454 # we have an "xt" package, but it may omit Xt's dependency on X11
14455 echo "$as_me:14455: checking for usable X dependency" >&5
14456 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14457 if test "${cf_cv_xt_x11_compat+set}" = set; then
14458   echo $ECHO_N "(cached) $ECHO_C" >&6
14459 else
14460
14461 cat >"conftest.$ac_ext" <<_ACEOF
14462 #line 14462 "configure"
14463 #include "confdefs.h"
14464
14465 #include <X11/Xlib.h>
14466
14467 int
14468 main (void)
14469 {
14470
14471         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14472         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14473         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14474         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14475
14476   ;
14477   return 0;
14478 }
14479 _ACEOF
14480 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14481 if { (eval echo "$as_me:14481: \"$ac_link\"") >&5
14482   (eval $ac_link) 2>&5
14483   ac_status=$?
14484   echo "$as_me:14484: \$? = $ac_status" >&5
14485   (exit "$ac_status"); } &&
14486          { ac_try='test -s "conftest$ac_exeext"'
14487   { (eval echo "$as_me:14487: \"$ac_try\"") >&5
14488   (eval $ac_try) 2>&5
14489   ac_status=$?
14490   echo "$as_me:14490: \$? = $ac_status" >&5
14491   (exit "$ac_status"); }; }; then
14492   cf_cv_xt_x11_compat=yes
14493 else
14494   echo "$as_me: failed program was:" >&5
14495 cat "conftest.$ac_ext" >&5
14496 cf_cv_xt_x11_compat=no
14497 fi
14498 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14499 fi
14500 echo "$as_me:14500: result: $cf_cv_xt_x11_compat" >&5
14501 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14502                 if test "$cf_cv_xt_x11_compat" = no
14503                 then
14504                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14505
14506 echo "${as_me:-configure}:14506: testing work around broken X11 dependency ..." 1>&5
14507
14508                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14509
14510 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14511         test -n "$verbose" && echo "    found package x11" 1>&6
14512
14513 echo "${as_me:-configure}:14513: testing found package x11 ..." 1>&5
14514
14515         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14516         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14517         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14518
14519 echo "${as_me:-configure}:14519: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14520
14521         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14522
14523 echo "${as_me:-configure}:14523: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14524
14525 cf_fix_cppflags=no
14526 cf_new_cflags=
14527 cf_new_cppflags=
14528 cf_new_extra_cppflags=
14529
14530 for cf_add_cflags in $cf_pkgconfig_incs
14531 do
14532 case "$cf_fix_cppflags" in
14533 (no)
14534         case "$cf_add_cflags" in
14535         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14536                 case "$cf_add_cflags" in
14537                 (-D*)
14538                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14539
14540                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14541                                 && test -z "${cf_tst_cflags}" \
14542                                 && cf_fix_cppflags=yes
14543
14544                         if test "$cf_fix_cppflags" = yes ; then
14545
14546         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14547         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14548
14549                                 continue
14550                         elif test "${cf_tst_cflags}" = "\"'" ; then
14551
14552         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14553         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14554
14555                                 continue
14556                         fi
14557                         ;;
14558                 esac
14559                 case "$CPPFLAGS" in
14560                 (*$cf_add_cflags)
14561                         ;;
14562                 (*)
14563                         case "$cf_add_cflags" in
14564                         (-D*)
14565                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14566
14567 CPPFLAGS=`echo "$CPPFLAGS" | \
14568         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14569                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14570
14571                                 ;;
14572                         esac
14573
14574         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14575         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14576
14577                         ;;
14578                 esac
14579                 ;;
14580         (*)
14581
14582         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14583         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14584
14585                 ;;
14586         esac
14587         ;;
14588 (yes)
14589
14590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14592
14593         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14594
14595         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14596                 && test -z "${cf_tst_cflags}" \
14597                 && cf_fix_cppflags=no
14598         ;;
14599 esac
14600 done
14601
14602 if test -n "$cf_new_cflags" ; then
14603
14604         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14605         CFLAGS="${CFLAGS}$cf_new_cflags"
14606
14607 fi
14608
14609 if test -n "$cf_new_cppflags" ; then
14610
14611         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14612         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14613
14614 fi
14615
14616 if test -n "$cf_new_extra_cppflags" ; then
14617
14618         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14619         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14620
14621 fi
14622
14623 cf_add_libs="$LIBS"
14624 # reverse order
14625 cf_add_0lib=
14626 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14627 # filter duplicates
14628 for cf_add_1lib in $cf_add_0lib; do
14629         for cf_add_2lib in $cf_add_libs; do
14630                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14631                         cf_add_1lib=
14632                         break
14633                 fi
14634         done
14635         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14636 done
14637 LIBS="$cf_add_libs"
14638
14639         :
14640 else
14641         cf_pkgconfig_incs=
14642         cf_pkgconfig_libs=
14643
14644 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14645
14646 echo "${as_me:-configure}:14646: testing ...before $LIBS ..." 1>&5
14647
14648 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14649 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14650
14651 echo "${as_me:-configure}:14651: testing ...after  $LIBS ..." 1>&5
14652
14653 fi
14654
14655                 fi
14656                 ;;
14657         esac
14658
14659 echo "$as_me:14659: checking for usable X Toolkit package" >&5
14660 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14661 if test "${cf_cv_xt_ice_compat+set}" = set; then
14662   echo $ECHO_N "(cached) $ECHO_C" >&6
14663 else
14664
14665 cat >"conftest.$ac_ext" <<_ACEOF
14666 #line 14666 "configure"
14667 #include "confdefs.h"
14668
14669 #include <X11/Shell.h>
14670
14671 int
14672 main (void)
14673 {
14674 int num = IceConnectionNumber(0); (void) num
14675
14676   ;
14677   return 0;
14678 }
14679 _ACEOF
14680 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14681 if { (eval echo "$as_me:14681: \"$ac_link\"") >&5
14682   (eval $ac_link) 2>&5
14683   ac_status=$?
14684   echo "$as_me:14684: \$? = $ac_status" >&5
14685   (exit "$ac_status"); } &&
14686          { ac_try='test -s "conftest$ac_exeext"'
14687   { (eval echo "$as_me:14687: \"$ac_try\"") >&5
14688   (eval $ac_try) 2>&5
14689   ac_status=$?
14690   echo "$as_me:14690: \$? = $ac_status" >&5
14691   (exit "$ac_status"); }; }; then
14692   cf_cv_xt_ice_compat=yes
14693 else
14694   echo "$as_me: failed program was:" >&5
14695 cat "conftest.$ac_ext" >&5
14696 cf_cv_xt_ice_compat=no
14697 fi
14698 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14699 fi
14700 echo "$as_me:14700: result: $cf_cv_xt_ice_compat" >&5
14701 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14702
14703         if test "$cf_cv_xt_ice_compat" = no
14704         then
14705                 # workaround for broken ".pc" files used for X Toolkit.
14706                 case "x$X_PRE_LIBS" in
14707                 (*-lICE*)
14708                         case "x$LIBS" in
14709                         (*-lICE*)
14710                                 ;;
14711                         (*)
14712                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14713
14714 echo "${as_me:-configure}:14714: testing work around broken ICE dependency ..." 1>&5
14715
14716 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14717         test -n "$verbose" && echo "    found package ice" 1>&6
14718
14719 echo "${as_me:-configure}:14719: testing found package ice ..." 1>&5
14720
14721         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14722         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14723         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14724
14725 echo "${as_me:-configure}:14725: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14726
14727         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14728
14729 echo "${as_me:-configure}:14729: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14730
14731 cf_fix_cppflags=no
14732 cf_new_cflags=
14733 cf_new_cppflags=
14734 cf_new_extra_cppflags=
14735
14736 for cf_add_cflags in $cf_pkgconfig_incs
14737 do
14738 case "$cf_fix_cppflags" in
14739 (no)
14740         case "$cf_add_cflags" in
14741         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14742                 case "$cf_add_cflags" in
14743                 (-D*)
14744                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14745
14746                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14747                                 && test -z "${cf_tst_cflags}" \
14748                                 && cf_fix_cppflags=yes
14749
14750                         if test "$cf_fix_cppflags" = yes ; then
14751
14752         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14753         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14754
14755                                 continue
14756                         elif test "${cf_tst_cflags}" = "\"'" ; then
14757
14758         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14759         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14760
14761                                 continue
14762                         fi
14763                         ;;
14764                 esac
14765                 case "$CPPFLAGS" in
14766                 (*$cf_add_cflags)
14767                         ;;
14768                 (*)
14769                         case "$cf_add_cflags" in
14770                         (-D*)
14771                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14772
14773 CPPFLAGS=`echo "$CPPFLAGS" | \
14774         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14775                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14776
14777                                 ;;
14778                         esac
14779
14780         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14781         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14782
14783                         ;;
14784                 esac
14785                 ;;
14786         (*)
14787
14788         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14789         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14790
14791                 ;;
14792         esac
14793         ;;
14794 (yes)
14795
14796         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14797         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14798
14799         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14800
14801         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14802                 && test -z "${cf_tst_cflags}" \
14803                 && cf_fix_cppflags=no
14804         ;;
14805 esac
14806 done
14807
14808 if test -n "$cf_new_cflags" ; then
14809
14810         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14811         CFLAGS="${CFLAGS}$cf_new_cflags"
14812
14813 fi
14814
14815 if test -n "$cf_new_cppflags" ; then
14816
14817         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14818         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14819
14820 fi
14821
14822 if test -n "$cf_new_extra_cppflags" ; then
14823
14824         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14825         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14826
14827 fi
14828
14829 cf_add_libs="$LIBS"
14830 # reverse order
14831 cf_add_0lib=
14832 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14833 # filter duplicates
14834 for cf_add_1lib in $cf_add_0lib; do
14835         for cf_add_2lib in $cf_add_libs; do
14836                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14837                         cf_add_1lib=
14838                         break
14839                 fi
14840         done
14841         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14842 done
14843 LIBS="$cf_add_libs"
14844
14845 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14846         test -n "$verbose" && echo "    found package sm" 1>&6
14847
14848 echo "${as_me:-configure}:14848: testing found package sm ..." 1>&5
14849
14850         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14851         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14852         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14853
14854 echo "${as_me:-configure}:14854: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14855
14856         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14857
14858 echo "${as_me:-configure}:14858: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14859
14860 cf_fix_cppflags=no
14861 cf_new_cflags=
14862 cf_new_cppflags=
14863 cf_new_extra_cppflags=
14864
14865 for cf_add_cflags in $cf_pkgconfig_incs
14866 do
14867 case "$cf_fix_cppflags" in
14868 (no)
14869         case "$cf_add_cflags" in
14870         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14871                 case "$cf_add_cflags" in
14872                 (-D*)
14873                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14874
14875                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14876                                 && test -z "${cf_tst_cflags}" \
14877                                 && cf_fix_cppflags=yes
14878
14879                         if test "$cf_fix_cppflags" = yes ; then
14880
14881         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14882         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14883
14884                                 continue
14885                         elif test "${cf_tst_cflags}" = "\"'" ; then
14886
14887         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14888         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14889
14890                                 continue
14891                         fi
14892                         ;;
14893                 esac
14894                 case "$CPPFLAGS" in
14895                 (*$cf_add_cflags)
14896                         ;;
14897                 (*)
14898                         case "$cf_add_cflags" in
14899                         (-D*)
14900                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14901
14902 CPPFLAGS=`echo "$CPPFLAGS" | \
14903         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14904                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14905
14906                                 ;;
14907                         esac
14908
14909         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14910         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14911
14912                         ;;
14913                 esac
14914                 ;;
14915         (*)
14916
14917         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14918         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14919
14920                 ;;
14921         esac
14922         ;;
14923 (yes)
14924
14925         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14926         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14927
14928         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14929
14930         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14931                 && test -z "${cf_tst_cflags}" \
14932                 && cf_fix_cppflags=no
14933         ;;
14934 esac
14935 done
14936
14937 if test -n "$cf_new_cflags" ; then
14938
14939         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14940         CFLAGS="${CFLAGS}$cf_new_cflags"
14941
14942 fi
14943
14944 if test -n "$cf_new_cppflags" ; then
14945
14946         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14947         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14948
14949 fi
14950
14951 if test -n "$cf_new_extra_cppflags" ; then
14952
14953         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14954         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14955
14956 fi
14957
14958 cf_add_libs="$LIBS"
14959 # reverse order
14960 cf_add_0lib=
14961 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14962 # filter duplicates
14963 for cf_add_1lib in $cf_add_0lib; do
14964         for cf_add_2lib in $cf_add_libs; do
14965                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14966                         cf_add_1lib=
14967                         break
14968                 fi
14969         done
14970         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14971 done
14972 LIBS="$cf_add_libs"
14973
14974         :
14975 else
14976         cf_pkgconfig_incs=
14977         cf_pkgconfig_libs=
14978         :
14979 fi
14980
14981 else
14982         cf_pkgconfig_incs=
14983         cf_pkgconfig_libs=
14984
14985 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14986
14987 echo "${as_me:-configure}:14987: testing ...before $LIBS ..." 1>&5
14988
14989 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14990 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14991
14992 echo "${as_me:-configure}:14992: testing ...after  $LIBS ..." 1>&5
14993
14994 fi
14995
14996                                 ;;
14997                         esac
14998                         ;;
14999                 esac
15000         fi
15001
15002         cf_have_X_LIBS=yes
15003
15004 else
15005         cf_pkgconfig_incs=
15006         cf_pkgconfig_libs=
15007
15008         LDFLAGS="$X_LIBS $LDFLAGS"
15009
15010 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15011
15012 echo "${as_me:-configure}:15012: testing checking additions to CFLAGS ..." 1>&5
15013
15014 cf_check_cflags="$CFLAGS"
15015 cf_check_cppflags="$CPPFLAGS"
15016
15017 cf_fix_cppflags=no
15018 cf_new_cflags=
15019 cf_new_cppflags=
15020 cf_new_extra_cppflags=
15021
15022 for cf_add_cflags in $X_CFLAGS
15023 do
15024 case "$cf_fix_cppflags" in
15025 (no)
15026         case "$cf_add_cflags" in
15027         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15028                 case "$cf_add_cflags" in
15029                 (-D*)
15030                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15031
15032                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15033                                 && test -z "${cf_tst_cflags}" \
15034                                 && cf_fix_cppflags=yes
15035
15036                         if test "$cf_fix_cppflags" = yes ; then
15037
15038         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15039         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15040
15041                                 continue
15042                         elif test "${cf_tst_cflags}" = "\"'" ; then
15043
15044         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15045         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15046
15047                                 continue
15048                         fi
15049                         ;;
15050                 esac
15051                 case "$CPPFLAGS" in
15052                 (*$cf_add_cflags)
15053                         ;;
15054                 (*)
15055                         case "$cf_add_cflags" in
15056                         (-D*)
15057                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15058
15059 CPPFLAGS=`echo "$CPPFLAGS" | \
15060         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15061                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15062
15063                                 ;;
15064                         esac
15065
15066         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15067         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15068
15069                         ;;
15070                 esac
15071                 ;;
15072         (*)
15073
15074         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15075         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15076
15077                 ;;
15078         esac
15079         ;;
15080 (yes)
15081
15082         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15083         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15084
15085         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15086
15087         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15088                 && test -z "${cf_tst_cflags}" \
15089                 && cf_fix_cppflags=no
15090         ;;
15091 esac
15092 done
15093
15094 if test -n "$cf_new_cflags" ; then
15095         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15096
15097 echo "${as_me:-configure}:15097: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15098
15099         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15100         CFLAGS="${CFLAGS}$cf_new_cflags"
15101
15102 fi
15103
15104 if test -n "$cf_new_cppflags" ; then
15105         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15106
15107 echo "${as_me:-configure}:15107: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15108
15109         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15110         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15111
15112 fi
15113
15114 if test -n "$cf_new_extra_cppflags" ; then
15115         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15116
15117 echo "${as_me:-configure}:15117: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15118
15119         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15120         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15121
15122 fi
15123
15124 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15125 cat >"conftest.$ac_ext" <<_ACEOF
15126 #line 15126 "configure"
15127 #include "confdefs.h"
15128 #include <stdio.h>
15129 int
15130 main (void)
15131 {
15132 printf("Hello world");
15133   ;
15134   return 0;
15135 }
15136 _ACEOF
15137 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15138 if { (eval echo "$as_me:15138: \"$ac_link\"") >&5
15139   (eval $ac_link) 2>&5
15140   ac_status=$?
15141   echo "$as_me:15141: \$? = $ac_status" >&5
15142   (exit "$ac_status"); } &&
15143          { ac_try='test -s "conftest$ac_exeext"'
15144   { (eval echo "$as_me:15144: \"$ac_try\"") >&5
15145   (eval $ac_try) 2>&5
15146   ac_status=$?
15147   echo "$as_me:15147: \$? = $ac_status" >&5
15148   (exit "$ac_status"); }; }; then
15149   :
15150 else
15151   echo "$as_me: failed program was:" >&5
15152 cat "conftest.$ac_ext" >&5
15153 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15154
15155 echo "${as_me:-configure}:15155: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15156
15157          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15158                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15159
15160 echo "${as_me:-configure}:15160: testing but keeping change to \$CPPFLAGS ..." 1>&5
15161
15162          fi
15163          CFLAGS="$cf_check_cflags"
15164 fi
15165 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15166 fi
15167
15168         echo "$as_me:15168: checking for XOpenDisplay" >&5
15169 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15170 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15171   echo $ECHO_N "(cached) $ECHO_C" >&6
15172 else
15173   cat >"conftest.$ac_ext" <<_ACEOF
15174 #line 15174 "configure"
15175 #include "confdefs.h"
15176 #define XOpenDisplay autoconf_temporary
15177 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15178 #undef XOpenDisplay
15179
15180 #ifdef __cplusplus
15181 extern "C"
15182 #endif
15183
15184 /* We use char because int might match the return type of a gcc2
15185    builtin and then its argument prototype would still apply.  */
15186 char XOpenDisplay (void);
15187
15188 int
15189 main (void)
15190 {
15191
15192 /* The GNU C library defines stubs for functions which it implements
15193     to always fail with ENOSYS.  Some functions are actually named
15194     something starting with __ and the normal name is an alias.  */
15195 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15196 #error found stub for XOpenDisplay
15197 #endif
15198
15199         return XOpenDisplay ();
15200   ;
15201   return 0;
15202 }
15203 _ACEOF
15204 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15205 if { (eval echo "$as_me:15205: \"$ac_link\"") >&5
15206   (eval $ac_link) 2>&5
15207   ac_status=$?
15208   echo "$as_me:15208: \$? = $ac_status" >&5
15209   (exit "$ac_status"); } &&
15210          { ac_try='test -s "conftest$ac_exeext"'
15211   { (eval echo "$as_me:15211: \"$ac_try\"") >&5
15212   (eval $ac_try) 2>&5
15213   ac_status=$?
15214   echo "$as_me:15214: \$? = $ac_status" >&5
15215   (exit "$ac_status"); }; }; then
15216   ac_cv_func_XOpenDisplay=yes
15217 else
15218   echo "$as_me: failed program was:" >&5
15219 cat "conftest.$ac_ext" >&5
15220 ac_cv_func_XOpenDisplay=no
15221 fi
15222 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15223 fi
15224 echo "$as_me:15224: result: $ac_cv_func_XOpenDisplay" >&5
15225 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15226 if test "$ac_cv_func_XOpenDisplay" = yes; then
15227   :
15228 else
15229
15230         echo "$as_me:15230: checking for XOpenDisplay in -lX11" >&5
15231 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15232 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15233   echo $ECHO_N "(cached) $ECHO_C" >&6
15234 else
15235   ac_check_lib_save_LIBS=$LIBS
15236 LIBS="-lX11  $LIBS"
15237 cat >"conftest.$ac_ext" <<_ACEOF
15238 #line 15238 "configure"
15239 #include "confdefs.h"
15240
15241 /* Override any gcc2 internal prototype to avoid an error.  */
15242 #ifdef __cplusplus
15243 extern "C"
15244 #endif
15245 /* We use char because int might match the return type of a gcc2
15246    builtin and then its argument prototype would still apply.  */
15247 char XOpenDisplay ();
15248 int
15249 main (void)
15250 {
15251 XOpenDisplay ();
15252   ;
15253   return 0;
15254 }
15255 _ACEOF
15256 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15257 if { (eval echo "$as_me:15257: \"$ac_link\"") >&5
15258   (eval $ac_link) 2>&5
15259   ac_status=$?
15260   echo "$as_me:15260: \$? = $ac_status" >&5
15261   (exit "$ac_status"); } &&
15262          { ac_try='test -s "conftest$ac_exeext"'
15263   { (eval echo "$as_me:15263: \"$ac_try\"") >&5
15264   (eval $ac_try) 2>&5
15265   ac_status=$?
15266   echo "$as_me:15266: \$? = $ac_status" >&5
15267   (exit "$ac_status"); }; }; then
15268   ac_cv_lib_X11_XOpenDisplay=yes
15269 else
15270   echo "$as_me: failed program was:" >&5
15271 cat "conftest.$ac_ext" >&5
15272 ac_cv_lib_X11_XOpenDisplay=no
15273 fi
15274 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15275 LIBS=$ac_check_lib_save_LIBS
15276 fi
15277 echo "$as_me:15277: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15278 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15279 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15280
15281 cf_add_libs="$LIBS"
15282 # reverse order
15283 cf_add_0lib=
15284 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15285 # filter duplicates
15286 for cf_add_1lib in $cf_add_0lib; do
15287         for cf_add_2lib in $cf_add_libs; do
15288                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15289                         cf_add_1lib=
15290                         break
15291                 fi
15292         done
15293         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15294 done
15295 LIBS="$cf_add_libs"
15296
15297 fi
15298
15299 fi
15300
15301         echo "$as_me:15301: checking for XtAppInitialize" >&5
15302 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15303 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15304   echo $ECHO_N "(cached) $ECHO_C" >&6
15305 else
15306   cat >"conftest.$ac_ext" <<_ACEOF
15307 #line 15307 "configure"
15308 #include "confdefs.h"
15309 #define XtAppInitialize autoconf_temporary
15310 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15311 #undef XtAppInitialize
15312
15313 #ifdef __cplusplus
15314 extern "C"
15315 #endif
15316
15317 /* We use char because int might match the return type of a gcc2
15318    builtin and then its argument prototype would still apply.  */
15319 char XtAppInitialize (void);
15320
15321 int
15322 main (void)
15323 {
15324
15325 /* The GNU C library defines stubs for functions which it implements
15326     to always fail with ENOSYS.  Some functions are actually named
15327     something starting with __ and the normal name is an alias.  */
15328 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15329 #error found stub for XtAppInitialize
15330 #endif
15331
15332         return XtAppInitialize ();
15333   ;
15334   return 0;
15335 }
15336 _ACEOF
15337 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15338 if { (eval echo "$as_me:15338: \"$ac_link\"") >&5
15339   (eval $ac_link) 2>&5
15340   ac_status=$?
15341   echo "$as_me:15341: \$? = $ac_status" >&5
15342   (exit "$ac_status"); } &&
15343          { ac_try='test -s "conftest$ac_exeext"'
15344   { (eval echo "$as_me:15344: \"$ac_try\"") >&5
15345   (eval $ac_try) 2>&5
15346   ac_status=$?
15347   echo "$as_me:15347: \$? = $ac_status" >&5
15348   (exit "$ac_status"); }; }; then
15349   ac_cv_func_XtAppInitialize=yes
15350 else
15351   echo "$as_me: failed program was:" >&5
15352 cat "conftest.$ac_ext" >&5
15353 ac_cv_func_XtAppInitialize=no
15354 fi
15355 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15356 fi
15357 echo "$as_me:15357: result: $ac_cv_func_XtAppInitialize" >&5
15358 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15359 if test "$ac_cv_func_XtAppInitialize" = yes; then
15360   :
15361 else
15362
15363         echo "$as_me:15363: checking for XtAppInitialize in -lXt" >&5
15364 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15365 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15366   echo $ECHO_N "(cached) $ECHO_C" >&6
15367 else
15368   ac_check_lib_save_LIBS=$LIBS
15369 LIBS="-lXt  $LIBS"
15370 cat >"conftest.$ac_ext" <<_ACEOF
15371 #line 15371 "configure"
15372 #include "confdefs.h"
15373
15374 /* Override any gcc2 internal prototype to avoid an error.  */
15375 #ifdef __cplusplus
15376 extern "C"
15377 #endif
15378 /* We use char because int might match the return type of a gcc2
15379    builtin and then its argument prototype would still apply.  */
15380 char XtAppInitialize ();
15381 int
15382 main (void)
15383 {
15384 XtAppInitialize ();
15385   ;
15386   return 0;
15387 }
15388 _ACEOF
15389 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15390 if { (eval echo "$as_me:15390: \"$ac_link\"") >&5
15391   (eval $ac_link) 2>&5
15392   ac_status=$?
15393   echo "$as_me:15393: \$? = $ac_status" >&5
15394   (exit "$ac_status"); } &&
15395          { ac_try='test -s "conftest$ac_exeext"'
15396   { (eval echo "$as_me:15396: \"$ac_try\"") >&5
15397   (eval $ac_try) 2>&5
15398   ac_status=$?
15399   echo "$as_me:15399: \$? = $ac_status" >&5
15400   (exit "$ac_status"); }; }; then
15401   ac_cv_lib_Xt_XtAppInitialize=yes
15402 else
15403   echo "$as_me: failed program was:" >&5
15404 cat "conftest.$ac_ext" >&5
15405 ac_cv_lib_Xt_XtAppInitialize=no
15406 fi
15407 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15408 LIBS=$ac_check_lib_save_LIBS
15409 fi
15410 echo "$as_me:15410: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15411 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15412 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15413
15414 cat >>confdefs.h <<\EOF
15415 #define HAVE_LIBXT 1
15416 EOF
15417
15418                  cf_have_X_LIBS=Xt
15419                  LIBS="-lXt $LIBS"
15420 fi
15421
15422 fi
15423
15424 fi
15425
15426 if test "$cf_have_X_LIBS" = no ; then
15427         { echo "$as_me:15427: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15428 test program.  You will have to check and add the proper libraries by hand
15429 to makefile." >&5
15430 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15431 test program.  You will have to check and add the proper libraries by hand
15432 to makefile." >&2;}
15433 fi
15434
15435 cf_x_athena_root=$cf_x_athena
15436 cf_x_athena_inc=""
15437
15438 for cf_path in default \
15439         /usr/contrib/X11R6 \
15440         /usr/contrib/X11R5 \
15441         /usr/lib/X11R5 \
15442         /usr/local
15443 do
15444         if test -z "$cf_x_athena_inc" ; then
15445
15446 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15447 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15448 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15449 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15450 for cf_X_CFLAGS in $X_CFLAGS
15451 do
15452         case "x$cf_X_CFLAGS" in
15453         x-[IUD]*)
15454                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15455                 ;;
15456         *)
15457                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15458                 ;;
15459         esac
15460 done
15461
15462                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15463                 if test "$cf_path" != default ; then
15464
15465         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15466         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15467
15468                         echo "$as_me:15468: checking for $cf_test in $cf_path" >&5
15469 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15470                 else
15471                         echo "$as_me:15471: checking for $cf_test" >&5
15472 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15473                 fi
15474                 cat >"conftest.$ac_ext" <<_ACEOF
15475 #line 15475 "configure"
15476 #include "confdefs.h"
15477
15478 #include <X11/Intrinsic.h>
15479 #include <$cf_test>
15480 int
15481 main (void)
15482 {
15483
15484   ;
15485   return 0;
15486 }
15487 _ACEOF
15488 rm -f "conftest.$ac_objext"
15489 if { (eval echo "$as_me:15489: \"$ac_compile\"") >&5
15490   (eval $ac_compile) 2>&5
15491   ac_status=$?
15492   echo "$as_me:15492: \$? = $ac_status" >&5
15493   (exit "$ac_status"); } &&
15494          { ac_try='test -s "conftest.$ac_objext"'
15495   { (eval echo "$as_me:15495: \"$ac_try\"") >&5
15496   (eval $ac_try) 2>&5
15497   ac_status=$?
15498   echo "$as_me:15498: \$? = $ac_status" >&5
15499   (exit "$ac_status"); }; }; then
15500   cf_result=yes
15501 else
15502   echo "$as_me: failed program was:" >&5
15503 cat "conftest.$ac_ext" >&5
15504 cf_result=no
15505 fi
15506 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15507                 echo "$as_me:15507: result: $cf_result" >&5
15508 echo "${ECHO_T}$cf_result" >&6
15509
15510 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15511 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15512 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15513
15514                 if test "$cf_result" = yes ; then
15515                         test "$cf_path"  = default && cf_x_athena_inc=default
15516                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15517                         break
15518                 fi
15519         fi
15520 done
15521
15522 if test -z "$cf_x_athena_inc" ; then
15523         { echo "$as_me:15523: WARNING: Unable to find Athena header files" >&5
15524 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15525 elif test "$cf_x_athena_inc" != default ; then
15526
15527         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15528         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15529
15530 fi
15531
15532 cf_x_athena_root=$cf_x_athena
15533 cf_x_athena_lib=""
15534
15535 for cf_path in default \
15536         /usr/contrib/X11R6 \
15537         /usr/contrib/X11R5 \
15538         /usr/lib/X11R5 \
15539         /usr/local
15540 do
15541         for cf_lib in \
15542                 ${cf_x_athena_root} \
15543                 ${cf_x_athena_root}7 \
15544                 ${cf_x_athena_root}6
15545         do
15546         for cf_libs in \
15547                 "-l$cf_lib -lXmu" \
15548                 "-l$cf_lib -lXpm -lXmu" \
15549                 "-l${cf_lib}_s -lXmu_s"
15550         do
15551                 test -n "$cf_x_athena_lib" && break
15552
15553 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15554 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15555 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15556 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15557 for cf_X_CFLAGS in $X_CFLAGS
15558 do
15559         case "x$cf_X_CFLAGS" in
15560         x-[IUD]*)
15561                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15562                 ;;
15563         *)
15564                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15565                 ;;
15566         esac
15567 done
15568
15569                 cf_test=XawSimpleMenuAddGlobalActions
15570                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15571
15572 cf_add_libs="$LIBS"
15573 # reverse order
15574 cf_add_0lib=
15575 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15576 # filter duplicates
15577 for cf_add_1lib in $cf_add_0lib; do
15578         for cf_add_2lib in $cf_add_libs; do
15579                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15580                         cf_add_1lib=
15581                         break
15582                 fi
15583         done
15584         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15585 done
15586 LIBS="$cf_add_libs"
15587
15588                 echo "$as_me:15588: checking for $cf_test in $cf_libs" >&5
15589 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15590                 cat >"conftest.$ac_ext" <<_ACEOF
15591 #line 15591 "configure"
15592 #include "confdefs.h"
15593
15594 #include <X11/Intrinsic.h>
15595 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15596
15597 int
15598 main (void)
15599 {
15600
15601 $cf_test((XtAppContext) 0)
15602   ;
15603   return 0;
15604 }
15605 _ACEOF
15606 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15607 if { (eval echo "$as_me:15607: \"$ac_link\"") >&5
15608   (eval $ac_link) 2>&5
15609   ac_status=$?
15610   echo "$as_me:15610: \$? = $ac_status" >&5
15611   (exit "$ac_status"); } &&
15612          { ac_try='test -s "conftest$ac_exeext"'
15613   { (eval echo "$as_me:15613: \"$ac_try\"") >&5
15614   (eval $ac_try) 2>&5
15615   ac_status=$?
15616   echo "$as_me:15616: \$? = $ac_status" >&5
15617   (exit "$ac_status"); }; }; then
15618   cf_result=yes
15619 else
15620   echo "$as_me: failed program was:" >&5
15621 cat "conftest.$ac_ext" >&5
15622 cf_result=no
15623 fi
15624 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15625                 echo "$as_me:15625: result: $cf_result" >&5
15626 echo "${ECHO_T}$cf_result" >&6
15627
15628 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15629 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15630 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15631
15632                 if test "$cf_result" = yes ; then
15633                         cf_x_athena_lib="$cf_libs"
15634                         break
15635                 fi
15636         done # cf_libs
15637                 test -n "$cf_x_athena_lib" && break
15638         done # cf_lib
15639 done
15640
15641 if test -z "$cf_x_athena_lib" ; then
15642         { { echo "$as_me:15642: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15643 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15644    { (exit 1); exit 1; }; }
15645 fi
15646
15647 cf_add_libs="$LIBS"
15648 # reverse order
15649 cf_add_0lib=
15650 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15651 # filter duplicates
15652 for cf_add_1lib in $cf_add_0lib; do
15653         for cf_add_2lib in $cf_add_libs; do
15654                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15655                         cf_add_1lib=
15656                         break
15657                 fi
15658         done
15659         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15660 done
15661 LIBS="$cf_add_libs"
15662
15663 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15664
15665 cat >>confdefs.h <<EOF
15666 #define $cf_x_athena_LIBS 1
15667 EOF
15668
15669 fi
15670
15671 if test -n "$ac_tool_prefix"; then
15672   for ac_prog in xcurses-config
15673   do
15674     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15675 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15676 echo "$as_me:15676: checking for $ac_word" >&5
15677 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15678 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15679   echo $ECHO_N "(cached) $ECHO_C" >&6
15680 else
15681   if test -n "$XCURSES_CONFIG"; then
15682   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15683 else
15684   ac_save_IFS=$IFS; IFS=$ac_path_separator
15685 ac_dummy="$PATH"
15686 for ac_dir in $ac_dummy; do
15687   IFS=$ac_save_IFS
15688   test -z "$ac_dir" && ac_dir=.
15689   $as_executable_p "$ac_dir/$ac_word" || continue
15690 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15691 echo "$as_me:15691: found $ac_dir/$ac_word" >&5
15692 break
15693 done
15694
15695 fi
15696 fi
15697 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15698 if test -n "$XCURSES_CONFIG"; then
15699   echo "$as_me:15699: result: $XCURSES_CONFIG" >&5
15700 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15701 else
15702   echo "$as_me:15702: result: no" >&5
15703 echo "${ECHO_T}no" >&6
15704 fi
15705
15706     test -n "$XCURSES_CONFIG" && break
15707   done
15708 fi
15709 if test -z "$XCURSES_CONFIG"; then
15710   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15711   for ac_prog in xcurses-config
15712 do
15713   # Extract the first word of "$ac_prog", so it can be a program name with args.
15714 set dummy $ac_prog; ac_word=$2
15715 echo "$as_me:15715: checking for $ac_word" >&5
15716 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15717 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15718   echo $ECHO_N "(cached) $ECHO_C" >&6
15719 else
15720   if test -n "$ac_ct_XCURSES_CONFIG"; then
15721   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15722 else
15723   ac_save_IFS=$IFS; IFS=$ac_path_separator
15724 ac_dummy="$PATH"
15725 for ac_dir in $ac_dummy; do
15726   IFS=$ac_save_IFS
15727   test -z "$ac_dir" && ac_dir=.
15728   $as_executable_p "$ac_dir/$ac_word" || continue
15729 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15730 echo "$as_me:15730: found $ac_dir/$ac_word" >&5
15731 break
15732 done
15733
15734 fi
15735 fi
15736 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15737 if test -n "$ac_ct_XCURSES_CONFIG"; then
15738   echo "$as_me:15738: result: $ac_ct_XCURSES_CONFIG" >&5
15739 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15740 else
15741   echo "$as_me:15741: result: no" >&5
15742 echo "${ECHO_T}no" >&6
15743 fi
15744
15745   test -n "$ac_ct_XCURSES_CONFIG" && break
15746 done
15747 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15748
15749   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15750 fi
15751
15752 if test "$XCURSES_CONFIG" != none ; then
15753
15754 cf_fix_cppflags=no
15755 cf_new_cflags=
15756 cf_new_cppflags=
15757 cf_new_extra_cppflags=
15758
15759 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15760 do
15761 case "$cf_fix_cppflags" in
15762 (no)
15763         case "$cf_add_cflags" in
15764         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15765                 case "$cf_add_cflags" in
15766                 (-D*)
15767                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15768
15769                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15770                                 && test -z "${cf_tst_cflags}" \
15771                                 && cf_fix_cppflags=yes
15772
15773                         if test "$cf_fix_cppflags" = yes ; then
15774
15775         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15776         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15777
15778                                 continue
15779                         elif test "${cf_tst_cflags}" = "\"'" ; then
15780
15781         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15782         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15783
15784                                 continue
15785                         fi
15786                         ;;
15787                 esac
15788                 case "$CPPFLAGS" in
15789                 (*$cf_add_cflags)
15790                         ;;
15791                 (*)
15792                         case "$cf_add_cflags" in
15793                         (-D*)
15794                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15795
15796 CPPFLAGS=`echo "$CPPFLAGS" | \
15797         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15798                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15799
15800                                 ;;
15801                         esac
15802
15803         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15804         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15805
15806                         ;;
15807                 esac
15808                 ;;
15809         (*)
15810
15811         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15812         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15813
15814                 ;;
15815         esac
15816         ;;
15817 (yes)
15818
15819         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15820         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15821
15822         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15823
15824         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15825                 && test -z "${cf_tst_cflags}" \
15826                 && cf_fix_cppflags=no
15827         ;;
15828 esac
15829 done
15830
15831 if test -n "$cf_new_cflags" ; then
15832
15833         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15834         CFLAGS="${CFLAGS}$cf_new_cflags"
15835
15836 fi
15837
15838 if test -n "$cf_new_cppflags" ; then
15839
15840         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15841         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15842
15843 fi
15844
15845 if test -n "$cf_new_extra_cppflags" ; then
15846
15847         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15848         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15849
15850 fi
15851
15852 cf_add_libs="$LIBS"
15853 # reverse order
15854 cf_add_0lib=
15855 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15856 # filter duplicates
15857 for cf_add_1lib in $cf_add_0lib; do
15858         for cf_add_2lib in $cf_add_libs; do
15859                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15860                         cf_add_1lib=
15861                         break
15862                 fi
15863         done
15864         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15865 done
15866 LIBS="$cf_add_libs"
15867
15868 cf_cv_lib_XCurses=yes
15869
15870 else
15871
15872 LDFLAGS="$LDFLAGS $X_LIBS"
15873
15874 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15875
15876 echo "${as_me:-configure}:15876: testing checking additions to CFLAGS ..." 1>&5
15877
15878 cf_check_cflags="$CFLAGS"
15879 cf_check_cppflags="$CPPFLAGS"
15880
15881 cf_fix_cppflags=no
15882 cf_new_cflags=
15883 cf_new_cppflags=
15884 cf_new_extra_cppflags=
15885
15886 for cf_add_cflags in $X_CFLAGS
15887 do
15888 case "$cf_fix_cppflags" in
15889 (no)
15890         case "$cf_add_cflags" in
15891         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15892                 case "$cf_add_cflags" in
15893                 (-D*)
15894                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15895
15896                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15897                                 && test -z "${cf_tst_cflags}" \
15898                                 && cf_fix_cppflags=yes
15899
15900                         if test "$cf_fix_cppflags" = yes ; then
15901
15902         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15903         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15904
15905                                 continue
15906                         elif test "${cf_tst_cflags}" = "\"'" ; then
15907
15908         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15909         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15910
15911                                 continue
15912                         fi
15913                         ;;
15914                 esac
15915                 case "$CPPFLAGS" in
15916                 (*$cf_add_cflags)
15917                         ;;
15918                 (*)
15919                         case "$cf_add_cflags" in
15920                         (-D*)
15921                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15922
15923 CPPFLAGS=`echo "$CPPFLAGS" | \
15924         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15925                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15926
15927                                 ;;
15928                         esac
15929
15930         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15931         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15932
15933                         ;;
15934                 esac
15935                 ;;
15936         (*)
15937
15938         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15939         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15940
15941                 ;;
15942         esac
15943         ;;
15944 (yes)
15945
15946         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15947         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15948
15949         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15950
15951         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15952                 && test -z "${cf_tst_cflags}" \
15953                 && cf_fix_cppflags=no
15954         ;;
15955 esac
15956 done
15957
15958 if test -n "$cf_new_cflags" ; then
15959         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15960
15961 echo "${as_me:-configure}:15961: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15962
15963         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15964         CFLAGS="${CFLAGS}$cf_new_cflags"
15965
15966 fi
15967
15968 if test -n "$cf_new_cppflags" ; then
15969         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15970
15971 echo "${as_me:-configure}:15971: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15972
15973         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15974         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15975
15976 fi
15977
15978 if test -n "$cf_new_extra_cppflags" ; then
15979         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15980
15981 echo "${as_me:-configure}:15981: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15982
15983         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15984         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15985
15986 fi
15987
15988 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15989 cat >"conftest.$ac_ext" <<_ACEOF
15990 #line 15990 "configure"
15991 #include "confdefs.h"
15992 #include <stdio.h>
15993 int
15994 main (void)
15995 {
15996 printf("Hello world");
15997   ;
15998   return 0;
15999 }
16000 _ACEOF
16001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16002 if { (eval echo "$as_me:16002: \"$ac_link\"") >&5
16003   (eval $ac_link) 2>&5
16004   ac_status=$?
16005   echo "$as_me:16005: \$? = $ac_status" >&5
16006   (exit "$ac_status"); } &&
16007          { ac_try='test -s "conftest$ac_exeext"'
16008   { (eval echo "$as_me:16008: \"$ac_try\"") >&5
16009   (eval $ac_try) 2>&5
16010   ac_status=$?
16011   echo "$as_me:16011: \$? = $ac_status" >&5
16012   (exit "$ac_status"); }; }; then
16013   :
16014 else
16015   echo "$as_me: failed program was:" >&5
16016 cat "conftest.$ac_ext" >&5
16017 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
16018
16019 echo "${as_me:-configure}:16019: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
16020
16021          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16022                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
16023
16024 echo "${as_me:-configure}:16024: testing but keeping change to \$CPPFLAGS ..." 1>&5
16025
16026          fi
16027          CFLAGS="$cf_check_cflags"
16028 fi
16029 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16030 fi
16031
16032 echo "$as_me:16032: checking for XOpenDisplay in -lX11" >&5
16033 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16034 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16035   echo $ECHO_N "(cached) $ECHO_C" >&6
16036 else
16037   ac_check_lib_save_LIBS=$LIBS
16038 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
16039 cat >"conftest.$ac_ext" <<_ACEOF
16040 #line 16040 "configure"
16041 #include "confdefs.h"
16042
16043 /* Override any gcc2 internal prototype to avoid an error.  */
16044 #ifdef __cplusplus
16045 extern "C"
16046 #endif
16047 /* We use char because int might match the return type of a gcc2
16048    builtin and then its argument prototype would still apply.  */
16049 char XOpenDisplay ();
16050 int
16051 main (void)
16052 {
16053 XOpenDisplay ();
16054   ;
16055   return 0;
16056 }
16057 _ACEOF
16058 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16059 if { (eval echo "$as_me:16059: \"$ac_link\"") >&5
16060   (eval $ac_link) 2>&5
16061   ac_status=$?
16062   echo "$as_me:16062: \$? = $ac_status" >&5
16063   (exit "$ac_status"); } &&
16064          { ac_try='test -s "conftest$ac_exeext"'
16065   { (eval echo "$as_me:16065: \"$ac_try\"") >&5
16066   (eval $ac_try) 2>&5
16067   ac_status=$?
16068   echo "$as_me:16068: \$? = $ac_status" >&5
16069   (exit "$ac_status"); }; }; then
16070   ac_cv_lib_X11_XOpenDisplay=yes
16071 else
16072   echo "$as_me: failed program was:" >&5
16073 cat "conftest.$ac_ext" >&5
16074 ac_cv_lib_X11_XOpenDisplay=no
16075 fi
16076 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16077 LIBS=$ac_check_lib_save_LIBS
16078 fi
16079 echo "$as_me:16079: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16080 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16081 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16082
16083 cf_add_libs="$LIBS"
16084 # reverse order
16085 cf_add_0lib=
16086 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16087 # filter duplicates
16088 for cf_add_1lib in $cf_add_0lib; do
16089         for cf_add_2lib in $cf_add_libs; do
16090                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16091                         cf_add_1lib=
16092                         break
16093                 fi
16094         done
16095         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16096 done
16097 LIBS="$cf_add_libs"
16098
16099 fi
16100
16101 echo "$as_me:16101: checking for XCurses library" >&5
16102 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16103 if test "${cf_cv_lib_XCurses+set}" = set; then
16104   echo $ECHO_N "(cached) $ECHO_C" >&6
16105 else
16106
16107 cf_add_libs="$LIBS"
16108 # reverse order
16109 cf_add_0lib=
16110 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16111 # filter duplicates
16112 for cf_add_1lib in $cf_add_0lib; do
16113         for cf_add_2lib in $cf_add_libs; do
16114                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16115                         cf_add_1lib=
16116                         break
16117                 fi
16118         done
16119         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16120 done
16121 LIBS="$cf_add_libs"
16122
16123 cat >"conftest.$ac_ext" <<_ACEOF
16124 #line 16124 "configure"
16125 #include "confdefs.h"
16126
16127 #include <xcurses.h>
16128 char *XCursesProgramName = "test";
16129
16130 int
16131 main (void)
16132 {
16133 XCursesExit();
16134   ;
16135   return 0;
16136 }
16137 _ACEOF
16138 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16139 if { (eval echo "$as_me:16139: \"$ac_link\"") >&5
16140   (eval $ac_link) 2>&5
16141   ac_status=$?
16142   echo "$as_me:16142: \$? = $ac_status" >&5
16143   (exit "$ac_status"); } &&
16144          { ac_try='test -s "conftest$ac_exeext"'
16145   { (eval echo "$as_me:16145: \"$ac_try\"") >&5
16146   (eval $ac_try) 2>&5
16147   ac_status=$?
16148   echo "$as_me:16148: \$? = $ac_status" >&5
16149   (exit "$ac_status"); }; }; then
16150   cf_cv_lib_XCurses=yes
16151 else
16152   echo "$as_me: failed program was:" >&5
16153 cat "conftest.$ac_ext" >&5
16154 cf_cv_lib_XCurses=no
16155 fi
16156 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16157
16158 fi
16159 echo "$as_me:16159: result: $cf_cv_lib_XCurses" >&5
16160 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16161
16162 fi
16163
16164 if test "$cf_cv_lib_XCurses" = yes ; then
16165
16166 cat >>confdefs.h <<\EOF
16167 #define UNIX 1
16168 EOF
16169
16170 cat >>confdefs.h <<\EOF
16171 #define XCURSES 1
16172 EOF
16173
16174         echo "$as_me:16174: checking for xcurses.h" >&5
16175 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16176 if test "${ac_cv_header_xcurses_h+set}" = set; then
16177   echo $ECHO_N "(cached) $ECHO_C" >&6
16178 else
16179   cat >"conftest.$ac_ext" <<_ACEOF
16180 #line 16180 "configure"
16181 #include "confdefs.h"
16182 #include <xcurses.h>
16183 _ACEOF
16184 if { (eval echo "$as_me:16184: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16185   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16186   ac_status=$?
16187   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16188   rm -f conftest.er1
16189   cat conftest.err >&5
16190   echo "$as_me:16190: \$? = $ac_status" >&5
16191   (exit "$ac_status"); } >/dev/null; then
16192   if test -s conftest.err; then
16193     ac_cpp_err=$ac_c_preproc_warn_flag
16194   else
16195     ac_cpp_err=
16196   fi
16197 else
16198   ac_cpp_err=yes
16199 fi
16200 if test -z "$ac_cpp_err"; then
16201   ac_cv_header_xcurses_h=yes
16202 else
16203   echo "$as_me: failed program was:" >&5
16204   cat "conftest.$ac_ext" >&5
16205   ac_cv_header_xcurses_h=no
16206 fi
16207 rm -f conftest.err "conftest.$ac_ext"
16208 fi
16209 echo "$as_me:16209: result: $ac_cv_header_xcurses_h" >&5
16210 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16211 if test "$ac_cv_header_xcurses_h" = yes; then
16212
16213 cat >>confdefs.h <<\EOF
16214 #define HAVE_XCURSES 1
16215 EOF
16216
16217 fi
16218
16219 else
16220         { { echo "$as_me:16220: error: Cannot link with XCurses" >&5
16221 echo "$as_me: error: Cannot link with XCurses" >&2;}
16222    { (exit 1); exit 1; }; }
16223 fi
16224
16225         ;;
16226 (*)
16227         { { echo "$as_me:16227: error: unexpected screen-value: $cf_cv_screen" >&5
16228 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16229    { (exit 1); exit 1; }; }
16230         ;;
16231 esac
16232
16233 : ${cf_nculib_root:=$cf_cv_screen}
16234 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16235 echo "$as_me:16235: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16236 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16237 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16238   echo $ECHO_N "(cached) $ECHO_C" >&6
16239 else
16240   ac_check_lib_save_LIBS=$LIBS
16241 LIBS="-l$cf_nculib_root  $LIBS"
16242 cat >"conftest.$ac_ext" <<_ACEOF
16243 #line 16243 "configure"
16244 #include "confdefs.h"
16245
16246 /* Override any gcc2 internal prototype to avoid an error.  */
16247 #ifdef __cplusplus
16248 extern "C"
16249 #endif
16250 /* We use char because int might match the return type of a gcc2
16251    builtin and then its argument prototype would still apply.  */
16252 char _nc_init_pthreads ();
16253 int
16254 main (void)
16255 {
16256 _nc_init_pthreads ();
16257   ;
16258   return 0;
16259 }
16260 _ACEOF
16261 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16262 if { (eval echo "$as_me:16262: \"$ac_link\"") >&5
16263   (eval $ac_link) 2>&5
16264   ac_status=$?
16265   echo "$as_me:16265: \$? = $ac_status" >&5
16266   (exit "$ac_status"); } &&
16267          { ac_try='test -s "conftest$ac_exeext"'
16268   { (eval echo "$as_me:16268: \"$ac_try\"") >&5
16269   (eval $ac_try) 2>&5
16270   ac_status=$?
16271   echo "$as_me:16271: \$? = $ac_status" >&5
16272   (exit "$ac_status"); }; }; then
16273   eval "$as_ac_Lib=yes"
16274 else
16275   echo "$as_me: failed program was:" >&5
16276 cat "conftest.$ac_ext" >&5
16277 eval "$as_ac_Lib=no"
16278 fi
16279 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16280 LIBS=$ac_check_lib_save_LIBS
16281 fi
16282 echo "$as_me:16282: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16283 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16284 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16285   cf_cv_ncurses_pthreads=yes
16286 else
16287   cf_cv_ncurses_pthreads=no
16288 fi
16289
16290 if test "$cf_cv_ncurses_pthreads" = yes
16291 then
16292
16293 cf_add_libs="$LIBS"
16294 # reverse order
16295 cf_add_0lib=
16296 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16297 # filter duplicates
16298 for cf_add_1lib in $cf_add_0lib; do
16299         for cf_add_2lib in $cf_add_libs; do
16300                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16301                         cf_add_1lib=
16302                         break
16303                 fi
16304         done
16305         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16306 done
16307 LIBS="$cf_add_libs"
16308
16309 fi
16310
16311 case $cf_cv_screen in
16312 (ncurses*)
16313         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16314         ;;
16315 esac
16316
16317 echo "$as_me:16317: checking for X11 rgb file" >&5
16318 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16319
16320 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16321 if test "${with_x11_rgb+set}" = set; then
16322   withval="$with_x11_rgb"
16323   RGB_PATH=$withval
16324 else
16325   RGB_PATH=auto
16326 fi;
16327
16328 if test "x$RGB_PATH" = xauto
16329 then
16330         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16331         for cf_path in \
16332                 /opt/local/share/X11/rgb.txt \
16333                 /opt/X11/share/X11/rgb.txt \
16334                 /usr/share/X11/rgb.txt \
16335                 /usr/X11/share/X11/rgb.txt \
16336                 /usr/X11/lib/X11/rgb.txt \
16337                 /usr/lib/X11/rgb.txt \
16338                 /etc/X11/rgb.txt \
16339                 /usr/pkg/lib/X11/rgb.txt \
16340                 /usr/X11R7/lib/X11/rgb.txt \
16341                 /usr/X11R6/lib/X11/rgb.txt \
16342                 /usr/X11R5/lib/X11/rgb.txt \
16343                 /usr/X11R4/lib/X11/rgb.txt \
16344                 /usr/local/lib/X11/rgb.txt \
16345                 /usr/local/share/X11/rgb.txt \
16346                 /usr/lib64/X11/rgb.txt
16347         do
16348                 if test -f "$cf_path" ; then
16349                         RGB_PATH="$cf_path"
16350                         break
16351                 fi
16352         done
16353 else
16354         cf_path=$RGB_PATH
16355
16356 if test "x$prefix" != xNONE; then
16357         cf_path_syntax="$prefix"
16358 else
16359         cf_path_syntax="$ac_default_prefix"
16360 fi
16361
16362 case ".$cf_path" in
16363 (.\$\(*\)*|.\'*\'*)
16364         ;;
16365 (..|./*|.\\*)
16366         ;;
16367 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16368         ;;
16369 (.\$\{*prefix\}*|.\$\{*dir\}*)
16370         eval cf_path="$cf_path"
16371         case ".$cf_path" in
16372         (.NONE/*)
16373                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16374                 ;;
16375         esac
16376         ;;
16377 (.no|.NONE/*)
16378         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16379         ;;
16380 (*)
16381         { { echo "$as_me:16381: error: expected a pathname, not \"$cf_path\"" >&5
16382 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16383    { (exit 1); exit 1; }; }
16384         ;;
16385 esac
16386
16387 fi
16388
16389 echo "$as_me:16389: result: $RGB_PATH" >&5
16390 echo "${ECHO_T}$RGB_PATH" >&6
16391
16392 cat >>confdefs.h <<EOF
16393 #define RGB_PATH "$cf_path"
16394 EOF
16395
16396 no_x11_rgb=
16397 if test "$RGB_PATH" = no
16398 then
16399         no_x11_rgb="#"
16400 fi
16401
16402 cf_curses_headers=
16403
16404 case $cf_cv_screen in
16405 (pdcurses)
16406         cf_default_panel=no
16407         cf_default_form=no
16408         cf_default_menu=no
16409         cf_default_tinfo=no
16410         ;;
16411 (xcurses|bsdcurses)
16412         cf_default_panel=no
16413         cf_default_form=no
16414         cf_default_menu=no
16415         cf_default_tinfo=yes
16416         ;;
16417 (*)
16418         cf_default_panel=yes
16419         cf_default_form=yes
16420         cf_default_menu=yes
16421         cf_default_tinfo=yes
16422         case $cf_cv_screen in
16423         (ncurses*)
16424                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16425                 ;;
16426         esac
16427         ;;
16428 esac
16429
16430 echo "$as_me:16430: checking for desired basename for form library" >&5
16431 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16432
16433 # Check whether --with-form-libname or --without-form-libname was given.
16434 if test "${with_form_libname+set}" = set; then
16435   withval="$with_form_libname"
16436   with_lib_basename=$withval
16437 else
16438   with_lib_basename=form
16439 fi;
16440 FORM_NAME="$with_lib_basename"
16441
16442 case "x$FORM_NAME" in
16443 (x|xno|xnone|xyes)
16444         FORM_NAME=form
16445         ;;
16446 (*)
16447         ;;
16448 esac
16449
16450 echo "$as_me:16450: result: $FORM_NAME" >&5
16451 echo "${ECHO_T}$FORM_NAME" >&6
16452
16453 echo "$as_me:16453: checking for desired basename for menu library" >&5
16454 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16455
16456 # Check whether --with-menu-libname or --without-menu-libname was given.
16457 if test "${with_menu_libname+set}" = set; then
16458   withval="$with_menu_libname"
16459   with_lib_basename=$withval
16460 else
16461   with_lib_basename=menu
16462 fi;
16463 MENU_NAME="$with_lib_basename"
16464
16465 case "x$MENU_NAME" in
16466 (x|xno|xnone|xyes)
16467         MENU_NAME=menu
16468         ;;
16469 (*)
16470         ;;
16471 esac
16472
16473 echo "$as_me:16473: result: $MENU_NAME" >&5
16474 echo "${ECHO_T}$MENU_NAME" >&6
16475
16476 echo "$as_me:16476: checking for desired basename for panel library" >&5
16477 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16478
16479 # Check whether --with-panel-libname or --without-panel-libname was given.
16480 if test "${with_panel_libname+set}" = set; then
16481   withval="$with_panel_libname"
16482   with_lib_basename=$withval
16483 else
16484   with_lib_basename=panel
16485 fi;
16486 PANEL_NAME="$with_lib_basename"
16487
16488 case "x$PANEL_NAME" in
16489 (x|xno|xnone|xyes)
16490         PANEL_NAME=panel
16491         ;;
16492 (*)
16493         ;;
16494 esac
16495
16496 echo "$as_me:16496: result: $PANEL_NAME" >&5
16497 echo "${ECHO_T}$PANEL_NAME" >&6
16498
16499 echo "$as_me:16499: checking if you want to check for panel functions" >&5
16500 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16501
16502 # Check whether --enable-panel or --disable-panel was given.
16503 if test "${enable_panel+set}" = set; then
16504   enableval="$enable_panel"
16505   test "$enableval" != no && enableval=yes
16506         if test "$enableval" != "yes" ; then
16507     cf_enable_panel=no
16508         else
16509                 cf_enable_panel=$cf_default_panel
16510         fi
16511 else
16512   enableval=yes
16513         cf_enable_panel=$cf_default_panel
16514
16515 fi;
16516 echo "$as_me:16516: result: $cf_enable_panel" >&5
16517 echo "${ECHO_T}$cf_enable_panel" >&6
16518 if test $cf_enable_panel = yes
16519 then
16520
16521 cf_have_curses_lib=no
16522
16523 : ${NCURSES_CONFIG_PKG:=none}
16524 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16525         :
16526 elif test "x${PKG_CONFIG:=none}" != xnone; then
16527         echo "$as_me:16527: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16528 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16529         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16530                 echo "$as_me:16530: result: yes" >&5
16531 echo "${ECHO_T}yes" >&6
16532
16533                 echo "$as_me:16533: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16534 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16535
16536                 cf_save_CPPFLAGS="$CPPFLAGS"
16537                 cf_save_LIBS="$LIBS"
16538
16539 cf_fix_cppflags=no
16540 cf_new_cflags=
16541 cf_new_cppflags=
16542 cf_new_extra_cppflags=
16543
16544 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16545 do
16546 case "$cf_fix_cppflags" in
16547 (no)
16548         case "$cf_add_cflags" in
16549         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16550                 case "$cf_add_cflags" in
16551                 (-D*)
16552                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16553
16554                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16555                                 && test -z "${cf_tst_cflags}" \
16556                                 && cf_fix_cppflags=yes
16557
16558                         if test "$cf_fix_cppflags" = yes ; then
16559
16560         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16561         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16562
16563                                 continue
16564                         elif test "${cf_tst_cflags}" = "\"'" ; then
16565
16566         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16567         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16568
16569                                 continue
16570                         fi
16571                         ;;
16572                 esac
16573                 case "$CPPFLAGS" in
16574                 (*$cf_add_cflags)
16575                         ;;
16576                 (*)
16577                         case "$cf_add_cflags" in
16578                         (-D*)
16579                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16580
16581 CPPFLAGS=`echo "$CPPFLAGS" | \
16582         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16583                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16584
16585                                 ;;
16586                         esac
16587
16588         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16589         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16590
16591                         ;;
16592                 esac
16593                 ;;
16594         (*)
16595
16596         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16597         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16598
16599                 ;;
16600         esac
16601         ;;
16602 (yes)
16603
16604         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16605         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16606
16607         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16608
16609         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16610                 && test -z "${cf_tst_cflags}" \
16611                 && cf_fix_cppflags=no
16612         ;;
16613 esac
16614 done
16615
16616 if test -n "$cf_new_cflags" ; then
16617
16618         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16619         CFLAGS="${CFLAGS}$cf_new_cflags"
16620
16621 fi
16622
16623 if test -n "$cf_new_cppflags" ; then
16624
16625         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16626         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16627
16628 fi
16629
16630 if test -n "$cf_new_extra_cppflags" ; then
16631
16632         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16633         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16634
16635 fi
16636
16637 cf_add_libs="$LIBS"
16638 # reverse order
16639 cf_add_0lib=
16640 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16641 # filter duplicates
16642 for cf_add_1lib in $cf_add_0lib; do
16643         for cf_add_2lib in $cf_add_libs; do
16644                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16645                         cf_add_1lib=
16646                         break
16647                 fi
16648         done
16649         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16650 done
16651 LIBS="$cf_add_libs"
16652
16653                 cat >"conftest.$ac_ext" <<_ACEOF
16654 #line 16654 "configure"
16655 #include "confdefs.h"
16656 #include <$PANEL_NAME.h>
16657 int
16658 main (void)
16659 {
16660 (void) new_panel ( 0 );
16661   ;
16662   return 0;
16663 }
16664 _ACEOF
16665 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16666 if { (eval echo "$as_me:16666: \"$ac_link\"") >&5
16667   (eval $ac_link) 2>&5
16668   ac_status=$?
16669   echo "$as_me:16669: \$? = $ac_status" >&5
16670   (exit "$ac_status"); } &&
16671          { ac_try='test -s "conftest$ac_exeext"'
16672   { (eval echo "$as_me:16672: \"$ac_try\"") >&5
16673   (eval $ac_try) 2>&5
16674   ac_status=$?
16675   echo "$as_me:16675: \$? = $ac_status" >&5
16676   (exit "$ac_status"); }; }; then
16677   if test "$cross_compiling" = yes; then
16678   cf_have_curses_lib=maybe
16679 else
16680   cat >"conftest.$ac_ext" <<_ACEOF
16681 #line 16681 "configure"
16682 #include "confdefs.h"
16683 #include <$PANEL_NAME.h>
16684                                 int main(void)
16685                                 { (void) new_panel ( 0 ); return 0; }
16686 _ACEOF
16687 rm -f "conftest$ac_exeext"
16688 if { (eval echo "$as_me:16688: \"$ac_link\"") >&5
16689   (eval $ac_link) 2>&5
16690   ac_status=$?
16691   echo "$as_me:16691: \$? = $ac_status" >&5
16692   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16693   { (eval echo "$as_me:16693: \"$ac_try\"") >&5
16694   (eval $ac_try) 2>&5
16695   ac_status=$?
16696   echo "$as_me:16696: \$? = $ac_status" >&5
16697   (exit "$ac_status"); }; }; then
16698   cf_have_curses_lib=yes
16699 else
16700   echo "$as_me: program exited with status $ac_status" >&5
16701 echo "$as_me: failed program was:" >&5
16702 cat "conftest.$ac_ext" >&5
16703 cf_have_curses_lib=no
16704 fi
16705 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16706 fi
16707 else
16708   echo "$as_me: failed program was:" >&5
16709 cat "conftest.$ac_ext" >&5
16710 cf_have_curses_lib=no
16711 fi
16712 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16713                 echo "$as_me:16713: result: $cf_have_curses_lib" >&5
16714 echo "${ECHO_T}$cf_have_curses_lib" >&6
16715                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16716                 if test "$cf_have_curses_lib" != "yes"
16717                 then
16718                         CPPFLAGS="$cf_save_CPPFLAGS"
16719                         LIBS="$cf_save_LIBS"
16720                 else
16721
16722 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16723
16724                         cat >>confdefs.h <<EOF
16725 #define $cf_upper 1
16726 EOF
16727
16728                 fi
16729         fi
16730 fi
16731 if test "$cf_have_curses_lib" = no; then
16732         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16733 echo "$as_me:16733: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16734 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16735 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16736   echo $ECHO_N "(cached) $ECHO_C" >&6
16737 else
16738   ac_check_lib_save_LIBS=$LIBS
16739 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16740 cat >"conftest.$ac_ext" <<_ACEOF
16741 #line 16741 "configure"
16742 #include "confdefs.h"
16743
16744 /* Override any gcc2 internal prototype to avoid an error.  */
16745 #ifdef __cplusplus
16746 extern "C"
16747 #endif
16748 /* We use char because int might match the return type of a gcc2
16749    builtin and then its argument prototype would still apply.  */
16750 char new_panel ();
16751 int
16752 main (void)
16753 {
16754 new_panel ();
16755   ;
16756   return 0;
16757 }
16758 _ACEOF
16759 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16760 if { (eval echo "$as_me:16760: \"$ac_link\"") >&5
16761   (eval $ac_link) 2>&5
16762   ac_status=$?
16763   echo "$as_me:16763: \$? = $ac_status" >&5
16764   (exit "$ac_status"); } &&
16765          { ac_try='test -s "conftest$ac_exeext"'
16766   { (eval echo "$as_me:16766: \"$ac_try\"") >&5
16767   (eval $ac_try) 2>&5
16768   ac_status=$?
16769   echo "$as_me:16769: \$? = $ac_status" >&5
16770   (exit "$ac_status"); }; }; then
16771   eval "$as_ac_Lib=yes"
16772 else
16773   echo "$as_me: failed program was:" >&5
16774 cat "conftest.$ac_ext" >&5
16775 eval "$as_ac_Lib=no"
16776 fi
16777 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16778 LIBS=$ac_check_lib_save_LIBS
16779 fi
16780 echo "$as_me:16780: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16781 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16782 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16783
16784 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16785
16786 cf_add_libs="$LIBS"
16787 # reverse order
16788 cf_add_0lib=
16789 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16790 # filter duplicates
16791 for cf_add_1lib in $cf_add_0lib; do
16792         for cf_add_2lib in $cf_add_libs; do
16793                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16794                         cf_add_1lib=
16795                         break
16796                 fi
16797         done
16798         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16799 done
16800 LIBS="$cf_add_libs"
16801
16802                 cat >>confdefs.h <<EOF
16803 #define $cf_upper 1
16804 EOF
16805
16806 fi
16807
16808 fi
16809
16810         cf_curses_headers="$cf_curses_headers panel.h"
16811 fi
16812
16813 echo "$as_me:16813: checking if you want to check for menu functions" >&5
16814 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16815
16816 # Check whether --enable-menu or --disable-menu was given.
16817 if test "${enable_menu+set}" = set; then
16818   enableval="$enable_menu"
16819   test "$enableval" != no && enableval=yes
16820         if test "$enableval" != "yes" ; then
16821     cf_enable_menu=no
16822         else
16823                 cf_enable_menu=$cf_default_menu
16824         fi
16825 else
16826   enableval=yes
16827         cf_enable_menu=$cf_default_menu
16828
16829 fi;
16830 echo "$as_me:16830: result: $cf_enable_menu" >&5
16831 echo "${ECHO_T}$cf_enable_menu" >&6
16832 if test $cf_enable_menu = yes
16833 then
16834         case $cf_cv_screen in
16835         (ncurses*)
16836                 ;;
16837         (curses*)
16838
16839 echo "$as_me:16839: checking for NetBSD menu.h" >&5
16840 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16841 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16842   echo $ECHO_N "(cached) $ECHO_C" >&6
16843 else
16844
16845 cat >"conftest.$ac_ext" <<_ACEOF
16846 #line 16846 "configure"
16847 #include "confdefs.h"
16848
16849 #include <${cf_cv_ncurses_header:-curses.h}>
16850 #include <menu.h>
16851
16852 int
16853 main (void)
16854 {
16855
16856         MENU *menu;
16857         int y = menu->max_item_width;
16858
16859   ;
16860   return 0;
16861 }
16862 _ACEOF
16863 rm -f "conftest.$ac_objext"
16864 if { (eval echo "$as_me:16864: \"$ac_compile\"") >&5
16865   (eval $ac_compile) 2>&5
16866   ac_status=$?
16867   echo "$as_me:16867: \$? = $ac_status" >&5
16868   (exit "$ac_status"); } &&
16869          { ac_try='test -s "conftest.$ac_objext"'
16870   { (eval echo "$as_me:16870: \"$ac_try\"") >&5
16871   (eval $ac_try) 2>&5
16872   ac_status=$?
16873   echo "$as_me:16873: \$? = $ac_status" >&5
16874   (exit "$ac_status"); }; }; then
16875   cf_cv_netbsd_menu_h=yes
16876
16877 else
16878   echo "$as_me: failed program was:" >&5
16879 cat "conftest.$ac_ext" >&5
16880 cf_cv_netbsd_menu_h=no
16881 fi
16882 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16883
16884 fi
16885 echo "$as_me:16885: result: $cf_cv_netbsd_menu_h" >&5
16886 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16887
16888 test "$cf_cv_netbsd_menu_h" = yes &&
16889 cat >>confdefs.h <<\EOF
16890 #define HAVE_NETBSD_MENU_H 1
16891 EOF
16892
16893                 ;;
16894         esac
16895
16896 cf_have_curses_lib=no
16897
16898 : ${NCURSES_CONFIG_PKG:=none}
16899 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16900         :
16901 elif test "x${PKG_CONFIG:=none}" != xnone; then
16902         echo "$as_me:16902: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16903 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16904         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
16905                 echo "$as_me:16905: result: yes" >&5
16906 echo "${ECHO_T}yes" >&6
16907
16908                 echo "$as_me:16908: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16909 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16910
16911                 cf_save_CPPFLAGS="$CPPFLAGS"
16912                 cf_save_LIBS="$LIBS"
16913
16914 cf_fix_cppflags=no
16915 cf_new_cflags=
16916 cf_new_cppflags=
16917 cf_new_extra_cppflags=
16918
16919 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
16920 do
16921 case "$cf_fix_cppflags" in
16922 (no)
16923         case "$cf_add_cflags" in
16924         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16925                 case "$cf_add_cflags" in
16926                 (-D*)
16927                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16928
16929                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16930                                 && test -z "${cf_tst_cflags}" \
16931                                 && cf_fix_cppflags=yes
16932
16933                         if test "$cf_fix_cppflags" = yes ; then
16934
16935         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16936         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16937
16938                                 continue
16939                         elif test "${cf_tst_cflags}" = "\"'" ; then
16940
16941         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16942         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16943
16944                                 continue
16945                         fi
16946                         ;;
16947                 esac
16948                 case "$CPPFLAGS" in
16949                 (*$cf_add_cflags)
16950                         ;;
16951                 (*)
16952                         case "$cf_add_cflags" in
16953                         (-D*)
16954                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16955
16956 CPPFLAGS=`echo "$CPPFLAGS" | \
16957         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16958                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16959
16960                                 ;;
16961                         esac
16962
16963         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16964         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16965
16966                         ;;
16967                 esac
16968                 ;;
16969         (*)
16970
16971         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16972         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16973
16974                 ;;
16975         esac
16976         ;;
16977 (yes)
16978
16979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16981
16982         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16983
16984         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16985                 && test -z "${cf_tst_cflags}" \
16986                 && cf_fix_cppflags=no
16987         ;;
16988 esac
16989 done
16990
16991 if test -n "$cf_new_cflags" ; then
16992
16993         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16994         CFLAGS="${CFLAGS}$cf_new_cflags"
16995
16996 fi
16997
16998 if test -n "$cf_new_cppflags" ; then
16999
17000         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17001         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17002
17003 fi
17004
17005 if test -n "$cf_new_extra_cppflags" ; then
17006
17007         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17008         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17009
17010 fi
17011
17012 cf_add_libs="$LIBS"
17013 # reverse order
17014 cf_add_0lib=
17015 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17016 # filter duplicates
17017 for cf_add_1lib in $cf_add_0lib; do
17018         for cf_add_2lib in $cf_add_libs; do
17019                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17020                         cf_add_1lib=
17021                         break
17022                 fi
17023         done
17024         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17025 done
17026 LIBS="$cf_add_libs"
17027
17028                 cat >"conftest.$ac_ext" <<_ACEOF
17029 #line 17029 "configure"
17030 #include "confdefs.h"
17031 #include <$MENU_NAME.h>
17032 int
17033 main (void)
17034 {
17035 (void) menu_driver ( 0,0 );
17036   ;
17037   return 0;
17038 }
17039 _ACEOF
17040 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17041 if { (eval echo "$as_me:17041: \"$ac_link\"") >&5
17042   (eval $ac_link) 2>&5
17043   ac_status=$?
17044   echo "$as_me:17044: \$? = $ac_status" >&5
17045   (exit "$ac_status"); } &&
17046          { ac_try='test -s "conftest$ac_exeext"'
17047   { (eval echo "$as_me:17047: \"$ac_try\"") >&5
17048   (eval $ac_try) 2>&5
17049   ac_status=$?
17050   echo "$as_me:17050: \$? = $ac_status" >&5
17051   (exit "$ac_status"); }; }; then
17052   if test "$cross_compiling" = yes; then
17053   cf_have_curses_lib=maybe
17054 else
17055   cat >"conftest.$ac_ext" <<_ACEOF
17056 #line 17056 "configure"
17057 #include "confdefs.h"
17058 #include <$MENU_NAME.h>
17059                                 int main(void)
17060                                 { (void) menu_driver ( 0,0 ); return 0; }
17061 _ACEOF
17062 rm -f "conftest$ac_exeext"
17063 if { (eval echo "$as_me:17063: \"$ac_link\"") >&5
17064   (eval $ac_link) 2>&5
17065   ac_status=$?
17066   echo "$as_me:17066: \$? = $ac_status" >&5
17067   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17068   { (eval echo "$as_me:17068: \"$ac_try\"") >&5
17069   (eval $ac_try) 2>&5
17070   ac_status=$?
17071   echo "$as_me:17071: \$? = $ac_status" >&5
17072   (exit "$ac_status"); }; }; then
17073   cf_have_curses_lib=yes
17074 else
17075   echo "$as_me: program exited with status $ac_status" >&5
17076 echo "$as_me: failed program was:" >&5
17077 cat "conftest.$ac_ext" >&5
17078 cf_have_curses_lib=no
17079 fi
17080 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17081 fi
17082 else
17083   echo "$as_me: failed program was:" >&5
17084 cat "conftest.$ac_ext" >&5
17085 cf_have_curses_lib=no
17086 fi
17087 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17088                 echo "$as_me:17088: result: $cf_have_curses_lib" >&5
17089 echo "${ECHO_T}$cf_have_curses_lib" >&6
17090                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17091                 if test "$cf_have_curses_lib" != "yes"
17092                 then
17093                         CPPFLAGS="$cf_save_CPPFLAGS"
17094                         LIBS="$cf_save_LIBS"
17095                 else
17096
17097 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17098
17099                         cat >>confdefs.h <<EOF
17100 #define $cf_upper 1
17101 EOF
17102
17103                 fi
17104         fi
17105 fi
17106 if test "$cf_have_curses_lib" = no; then
17107         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17108 echo "$as_me:17108: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17109 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17110 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17111   echo $ECHO_N "(cached) $ECHO_C" >&6
17112 else
17113   ac_check_lib_save_LIBS=$LIBS
17114 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17115 cat >"conftest.$ac_ext" <<_ACEOF
17116 #line 17116 "configure"
17117 #include "confdefs.h"
17118
17119 /* Override any gcc2 internal prototype to avoid an error.  */
17120 #ifdef __cplusplus
17121 extern "C"
17122 #endif
17123 /* We use char because int might match the return type of a gcc2
17124    builtin and then its argument prototype would still apply.  */
17125 char menu_driver ();
17126 int
17127 main (void)
17128 {
17129 menu_driver ();
17130   ;
17131   return 0;
17132 }
17133 _ACEOF
17134 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17135 if { (eval echo "$as_me:17135: \"$ac_link\"") >&5
17136   (eval $ac_link) 2>&5
17137   ac_status=$?
17138   echo "$as_me:17138: \$? = $ac_status" >&5
17139   (exit "$ac_status"); } &&
17140          { ac_try='test -s "conftest$ac_exeext"'
17141   { (eval echo "$as_me:17141: \"$ac_try\"") >&5
17142   (eval $ac_try) 2>&5
17143   ac_status=$?
17144   echo "$as_me:17144: \$? = $ac_status" >&5
17145   (exit "$ac_status"); }; }; then
17146   eval "$as_ac_Lib=yes"
17147 else
17148   echo "$as_me: failed program was:" >&5
17149 cat "conftest.$ac_ext" >&5
17150 eval "$as_ac_Lib=no"
17151 fi
17152 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17153 LIBS=$ac_check_lib_save_LIBS
17154 fi
17155 echo "$as_me:17155: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17156 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17157 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17158
17159 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17160
17161 cf_add_libs="$LIBS"
17162 # reverse order
17163 cf_add_0lib=
17164 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17165 # filter duplicates
17166 for cf_add_1lib in $cf_add_0lib; do
17167         for cf_add_2lib in $cf_add_libs; do
17168                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17169                         cf_add_1lib=
17170                         break
17171                 fi
17172         done
17173         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17174 done
17175 LIBS="$cf_add_libs"
17176
17177                 cat >>confdefs.h <<EOF
17178 #define $cf_upper 1
17179 EOF
17180
17181 fi
17182
17183 fi
17184
17185         cf_curses_headers="$cf_curses_headers menu.h"
17186 fi
17187
17188 echo "$as_me:17188: checking if you want to check for form functions" >&5
17189 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17190
17191 # Check whether --enable-form or --disable-form was given.
17192 if test "${enable_form+set}" = set; then
17193   enableval="$enable_form"
17194   test "$enableval" != no && enableval=yes
17195         if test "$enableval" != "yes" ; then
17196     cf_enable_form=no
17197         else
17198                 cf_enable_form=$cf_default_form
17199         fi
17200 else
17201   enableval=yes
17202         cf_enable_form=$cf_default_form
17203
17204 fi;
17205 echo "$as_me:17205: result: $cf_enable_form" >&5
17206 echo "${ECHO_T}$cf_enable_form" >&6
17207 if test $cf_enable_form = yes
17208 then
17209         case $cf_cv_screen in
17210         (ncurses*)
17211                 ;;
17212         (curses*)
17213
17214 echo "$as_me:17214: checking for NetBSD form.h" >&5
17215 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17216 if test "${cf_cv_netbsd_form_h+set}" = set; then
17217   echo $ECHO_N "(cached) $ECHO_C" >&6
17218 else
17219
17220 cat >"conftest.$ac_ext" <<_ACEOF
17221 #line 17221 "configure"
17222 #include "confdefs.h"
17223
17224 #include <${cf_cv_ncurses_header:-curses.h}>
17225 #include <form.h>
17226
17227 int
17228 main (void)
17229 {
17230
17231         FORM *form;
17232         int y = current_field(form)->cursor_ypos;
17233         int x = current_field(form)->cursor_xpos;
17234
17235   ;
17236   return 0;
17237 }
17238 _ACEOF
17239 rm -f "conftest.$ac_objext"
17240 if { (eval echo "$as_me:17240: \"$ac_compile\"") >&5
17241   (eval $ac_compile) 2>&5
17242   ac_status=$?
17243   echo "$as_me:17243: \$? = $ac_status" >&5
17244   (exit "$ac_status"); } &&
17245          { ac_try='test -s "conftest.$ac_objext"'
17246   { (eval echo "$as_me:17246: \"$ac_try\"") >&5
17247   (eval $ac_try) 2>&5
17248   ac_status=$?
17249   echo "$as_me:17249: \$? = $ac_status" >&5
17250   (exit "$ac_status"); }; }; then
17251   cf_cv_netbsd_form_h=yes
17252
17253 else
17254   echo "$as_me: failed program was:" >&5
17255 cat "conftest.$ac_ext" >&5
17256 cf_cv_netbsd_form_h=no
17257 fi
17258 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17259
17260 fi
17261 echo "$as_me:17261: result: $cf_cv_netbsd_form_h" >&5
17262 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17263
17264 test "$cf_cv_netbsd_form_h" = yes &&
17265 cat >>confdefs.h <<\EOF
17266 #define HAVE_NETBSD_FORM_H 1
17267 EOF
17268
17269                 ;;
17270         esac
17271
17272 cf_have_curses_lib=no
17273
17274 : ${NCURSES_CONFIG_PKG:=none}
17275 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17276         :
17277 elif test "x${PKG_CONFIG:=none}" != xnone; then
17278         echo "$as_me:17278: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17279 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17280         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17281                 echo "$as_me:17281: result: yes" >&5
17282 echo "${ECHO_T}yes" >&6
17283
17284                 echo "$as_me:17284: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17285 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17286
17287                 cf_save_CPPFLAGS="$CPPFLAGS"
17288                 cf_save_LIBS="$LIBS"
17289
17290 cf_fix_cppflags=no
17291 cf_new_cflags=
17292 cf_new_cppflags=
17293 cf_new_extra_cppflags=
17294
17295 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17296 do
17297 case "$cf_fix_cppflags" in
17298 (no)
17299         case "$cf_add_cflags" in
17300         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17301                 case "$cf_add_cflags" in
17302                 (-D*)
17303                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17304
17305                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17306                                 && test -z "${cf_tst_cflags}" \
17307                                 && cf_fix_cppflags=yes
17308
17309                         if test "$cf_fix_cppflags" = yes ; then
17310
17311         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17312         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17313
17314                                 continue
17315                         elif test "${cf_tst_cflags}" = "\"'" ; then
17316
17317         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17318         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17319
17320                                 continue
17321                         fi
17322                         ;;
17323                 esac
17324                 case "$CPPFLAGS" in
17325                 (*$cf_add_cflags)
17326                         ;;
17327                 (*)
17328                         case "$cf_add_cflags" in
17329                         (-D*)
17330                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17331
17332 CPPFLAGS=`echo "$CPPFLAGS" | \
17333         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17334                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17335
17336                                 ;;
17337                         esac
17338
17339         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17340         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17341
17342                         ;;
17343                 esac
17344                 ;;
17345         (*)
17346
17347         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17348         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17349
17350                 ;;
17351         esac
17352         ;;
17353 (yes)
17354
17355         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17356         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17357
17358         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17359
17360         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17361                 && test -z "${cf_tst_cflags}" \
17362                 && cf_fix_cppflags=no
17363         ;;
17364 esac
17365 done
17366
17367 if test -n "$cf_new_cflags" ; then
17368
17369         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17370         CFLAGS="${CFLAGS}$cf_new_cflags"
17371
17372 fi
17373
17374 if test -n "$cf_new_cppflags" ; then
17375
17376         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17377         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17378
17379 fi
17380
17381 if test -n "$cf_new_extra_cppflags" ; then
17382
17383         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17384         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17385
17386 fi
17387
17388 cf_add_libs="$LIBS"
17389 # reverse order
17390 cf_add_0lib=
17391 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17392 # filter duplicates
17393 for cf_add_1lib in $cf_add_0lib; do
17394         for cf_add_2lib in $cf_add_libs; do
17395                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17396                         cf_add_1lib=
17397                         break
17398                 fi
17399         done
17400         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17401 done
17402 LIBS="$cf_add_libs"
17403
17404                 cat >"conftest.$ac_ext" <<_ACEOF
17405 #line 17405 "configure"
17406 #include "confdefs.h"
17407 #include <$FORM_NAME.h>
17408 int
17409 main (void)
17410 {
17411 (void) form_driver ( 0,0 );
17412   ;
17413   return 0;
17414 }
17415 _ACEOF
17416 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17417 if { (eval echo "$as_me:17417: \"$ac_link\"") >&5
17418   (eval $ac_link) 2>&5
17419   ac_status=$?
17420   echo "$as_me:17420: \$? = $ac_status" >&5
17421   (exit "$ac_status"); } &&
17422          { ac_try='test -s "conftest$ac_exeext"'
17423   { (eval echo "$as_me:17423: \"$ac_try\"") >&5
17424   (eval $ac_try) 2>&5
17425   ac_status=$?
17426   echo "$as_me:17426: \$? = $ac_status" >&5
17427   (exit "$ac_status"); }; }; then
17428   if test "$cross_compiling" = yes; then
17429   cf_have_curses_lib=maybe
17430 else
17431   cat >"conftest.$ac_ext" <<_ACEOF
17432 #line 17432 "configure"
17433 #include "confdefs.h"
17434 #include <$FORM_NAME.h>
17435                                 int main(void)
17436                                 { (void) form_driver ( 0,0 ); return 0; }
17437 _ACEOF
17438 rm -f "conftest$ac_exeext"
17439 if { (eval echo "$as_me:17439: \"$ac_link\"") >&5
17440   (eval $ac_link) 2>&5
17441   ac_status=$?
17442   echo "$as_me:17442: \$? = $ac_status" >&5
17443   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17444   { (eval echo "$as_me:17444: \"$ac_try\"") >&5
17445   (eval $ac_try) 2>&5
17446   ac_status=$?
17447   echo "$as_me:17447: \$? = $ac_status" >&5
17448   (exit "$ac_status"); }; }; then
17449   cf_have_curses_lib=yes
17450 else
17451   echo "$as_me: program exited with status $ac_status" >&5
17452 echo "$as_me: failed program was:" >&5
17453 cat "conftest.$ac_ext" >&5
17454 cf_have_curses_lib=no
17455 fi
17456 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17457 fi
17458 else
17459   echo "$as_me: failed program was:" >&5
17460 cat "conftest.$ac_ext" >&5
17461 cf_have_curses_lib=no
17462 fi
17463 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17464                 echo "$as_me:17464: result: $cf_have_curses_lib" >&5
17465 echo "${ECHO_T}$cf_have_curses_lib" >&6
17466                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17467                 if test "$cf_have_curses_lib" != "yes"
17468                 then
17469                         CPPFLAGS="$cf_save_CPPFLAGS"
17470                         LIBS="$cf_save_LIBS"
17471                 else
17472
17473 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17474
17475                         cat >>confdefs.h <<EOF
17476 #define $cf_upper 1
17477 EOF
17478
17479                 fi
17480         fi
17481 fi
17482 if test "$cf_have_curses_lib" = no; then
17483         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17484 echo "$as_me:17484: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17485 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17486 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17487   echo $ECHO_N "(cached) $ECHO_C" >&6
17488 else
17489   ac_check_lib_save_LIBS=$LIBS
17490 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17491 cat >"conftest.$ac_ext" <<_ACEOF
17492 #line 17492 "configure"
17493 #include "confdefs.h"
17494
17495 /* Override any gcc2 internal prototype to avoid an error.  */
17496 #ifdef __cplusplus
17497 extern "C"
17498 #endif
17499 /* We use char because int might match the return type of a gcc2
17500    builtin and then its argument prototype would still apply.  */
17501 char form_driver ();
17502 int
17503 main (void)
17504 {
17505 form_driver ();
17506   ;
17507   return 0;
17508 }
17509 _ACEOF
17510 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17511 if { (eval echo "$as_me:17511: \"$ac_link\"") >&5
17512   (eval $ac_link) 2>&5
17513   ac_status=$?
17514   echo "$as_me:17514: \$? = $ac_status" >&5
17515   (exit "$ac_status"); } &&
17516          { ac_try='test -s "conftest$ac_exeext"'
17517   { (eval echo "$as_me:17517: \"$ac_try\"") >&5
17518   (eval $ac_try) 2>&5
17519   ac_status=$?
17520   echo "$as_me:17520: \$? = $ac_status" >&5
17521   (exit "$ac_status"); }; }; then
17522   eval "$as_ac_Lib=yes"
17523 else
17524   echo "$as_me: failed program was:" >&5
17525 cat "conftest.$ac_ext" >&5
17526 eval "$as_ac_Lib=no"
17527 fi
17528 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17529 LIBS=$ac_check_lib_save_LIBS
17530 fi
17531 echo "$as_me:17531: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17532 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17533 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17534
17535 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17536
17537 cf_add_libs="$LIBS"
17538 # reverse order
17539 cf_add_0lib=
17540 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17541 # filter duplicates
17542 for cf_add_1lib in $cf_add_0lib; do
17543         for cf_add_2lib in $cf_add_libs; do
17544                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17545                         cf_add_1lib=
17546                         break
17547                 fi
17548         done
17549         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17550 done
17551 LIBS="$cf_add_libs"
17552
17553                 cat >>confdefs.h <<EOF
17554 #define $cf_upper 1
17555 EOF
17556
17557 fi
17558
17559 fi
17560
17561         cf_curses_headers="$cf_curses_headers form.h"
17562 fi
17563
17564 # look for curses-related headers
17565
17566 for ac_header in $cf_curses_headers
17567 do
17568 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17569 echo "$as_me:17569: checking for $ac_header" >&5
17570 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17571 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17572   echo $ECHO_N "(cached) $ECHO_C" >&6
17573 else
17574   cat >"conftest.$ac_ext" <<_ACEOF
17575 #line 17575 "configure"
17576 #include "confdefs.h"
17577 #include <$ac_header>
17578 _ACEOF
17579 if { (eval echo "$as_me:17579: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17580   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17581   ac_status=$?
17582   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17583   rm -f conftest.er1
17584   cat conftest.err >&5
17585   echo "$as_me:17585: \$? = $ac_status" >&5
17586   (exit "$ac_status"); } >/dev/null; then
17587   if test -s conftest.err; then
17588     ac_cpp_err=$ac_c_preproc_warn_flag
17589   else
17590     ac_cpp_err=
17591   fi
17592 else
17593   ac_cpp_err=yes
17594 fi
17595 if test -z "$ac_cpp_err"; then
17596   eval "$as_ac_Header=yes"
17597 else
17598   echo "$as_me: failed program was:" >&5
17599   cat "conftest.$ac_ext" >&5
17600   eval "$as_ac_Header=no"
17601 fi
17602 rm -f conftest.err "conftest.$ac_ext"
17603 fi
17604 echo "$as_me:17604: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17605 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17606 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17607   cat >>confdefs.h <<EOF
17608 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17609 EOF
17610
17611 fi
17612 done
17613
17614 echo "$as_me:17614: checking for ANSI C header files" >&5
17615 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17616 if test "${ac_cv_header_stdc+set}" = set; then
17617   echo $ECHO_N "(cached) $ECHO_C" >&6
17618 else
17619   cat >"conftest.$ac_ext" <<_ACEOF
17620 #line 17620 "configure"
17621 #include "confdefs.h"
17622 #include <stdlib.h>
17623 #include <stdarg.h>
17624 #include <string.h>
17625 #include <float.h>
17626
17627 _ACEOF
17628 if { (eval echo "$as_me:17628: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17629   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17630   ac_status=$?
17631   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17632   rm -f conftest.er1
17633   cat conftest.err >&5
17634   echo "$as_me:17634: \$? = $ac_status" >&5
17635   (exit "$ac_status"); } >/dev/null; then
17636   if test -s conftest.err; then
17637     ac_cpp_err=$ac_c_preproc_warn_flag
17638   else
17639     ac_cpp_err=
17640   fi
17641 else
17642   ac_cpp_err=yes
17643 fi
17644 if test -z "$ac_cpp_err"; then
17645   ac_cv_header_stdc=yes
17646 else
17647   echo "$as_me: failed program was:" >&5
17648   cat "conftest.$ac_ext" >&5
17649   ac_cv_header_stdc=no
17650 fi
17651 rm -f conftest.err "conftest.$ac_ext"
17652
17653 if test $ac_cv_header_stdc = yes; then
17654   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17655   cat >"conftest.$ac_ext" <<_ACEOF
17656 #line 17656 "configure"
17657 #include "confdefs.h"
17658 #include <string.h>
17659
17660 _ACEOF
17661 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17662   $EGREP "memchr" >/dev/null 2>&1; then
17663   :
17664 else
17665   ac_cv_header_stdc=no
17666 fi
17667 rm -rf conftest*
17668
17669 fi
17670
17671 if test $ac_cv_header_stdc = yes; then
17672   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17673   cat >"conftest.$ac_ext" <<_ACEOF
17674 #line 17674 "configure"
17675 #include "confdefs.h"
17676 #include <stdlib.h>
17677
17678 _ACEOF
17679 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17680   $EGREP "free" >/dev/null 2>&1; then
17681   :
17682 else
17683   ac_cv_header_stdc=no
17684 fi
17685 rm -rf conftest*
17686
17687 fi
17688
17689 if test $ac_cv_header_stdc = yes; then
17690   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17691   if test "$cross_compiling" = yes; then
17692   :
17693 else
17694   cat >"conftest.$ac_ext" <<_ACEOF
17695 #line 17695 "configure"
17696 #include "confdefs.h"
17697 #include <ctype.h>
17698 #if ((' ' & 0x0FF) == 0x020)
17699 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17700 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17701 #else
17702 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17703                      || ('j' <= (c) && (c) <= 'r') \
17704                      || ('s' <= (c) && (c) <= 'z'))
17705 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17706 #endif
17707
17708 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17709 int
17710 main (void)
17711 {
17712   int i;
17713   for (i = 0; i < 256; i++)
17714     if (XOR (islower (i), ISLOWER (i))
17715         || toupper (i) != TOUPPER (i))
17716       $ac_main_return(2);
17717   $ac_main_return (0);
17718 }
17719 _ACEOF
17720 rm -f "conftest$ac_exeext"
17721 if { (eval echo "$as_me:17721: \"$ac_link\"") >&5
17722   (eval $ac_link) 2>&5
17723   ac_status=$?
17724   echo "$as_me:17724: \$? = $ac_status" >&5
17725   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17726   { (eval echo "$as_me:17726: \"$ac_try\"") >&5
17727   (eval $ac_try) 2>&5
17728   ac_status=$?
17729   echo "$as_me:17729: \$? = $ac_status" >&5
17730   (exit "$ac_status"); }; }; then
17731   :
17732 else
17733   echo "$as_me: program exited with status $ac_status" >&5
17734 echo "$as_me: failed program was:" >&5
17735 cat "conftest.$ac_ext" >&5
17736 ac_cv_header_stdc=no
17737 fi
17738 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17739 fi
17740 fi
17741 fi
17742 echo "$as_me:17742: result: $ac_cv_header_stdc" >&5
17743 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17744 if test $ac_cv_header_stdc = yes; then
17745
17746 cat >>confdefs.h <<\EOF
17747 #define STDC_HEADERS 1
17748 EOF
17749
17750 fi
17751
17752 echo "$as_me:17752: checking whether time.h and sys/time.h may both be included" >&5
17753 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17754 if test "${ac_cv_header_time+set}" = set; then
17755   echo $ECHO_N "(cached) $ECHO_C" >&6
17756 else
17757   cat >"conftest.$ac_ext" <<_ACEOF
17758 #line 17758 "configure"
17759 #include "confdefs.h"
17760 #include <sys/types.h>
17761 #include <sys/time.h>
17762 #include <time.h>
17763
17764 int
17765 main (void)
17766 {
17767 if ((struct tm *) 0)
17768 return 0;
17769   ;
17770   return 0;
17771 }
17772 _ACEOF
17773 rm -f "conftest.$ac_objext"
17774 if { (eval echo "$as_me:17774: \"$ac_compile\"") >&5
17775   (eval $ac_compile) 2>&5
17776   ac_status=$?
17777   echo "$as_me:17777: \$? = $ac_status" >&5
17778   (exit "$ac_status"); } &&
17779          { ac_try='test -s "conftest.$ac_objext"'
17780   { (eval echo "$as_me:17780: \"$ac_try\"") >&5
17781   (eval $ac_try) 2>&5
17782   ac_status=$?
17783   echo "$as_me:17783: \$? = $ac_status" >&5
17784   (exit "$ac_status"); }; }; then
17785   ac_cv_header_time=yes
17786 else
17787   echo "$as_me: failed program was:" >&5
17788 cat "conftest.$ac_ext" >&5
17789 ac_cv_header_time=no
17790 fi
17791 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17792 fi
17793 echo "$as_me:17793: result: $ac_cv_header_time" >&5
17794 echo "${ECHO_T}$ac_cv_header_time" >&6
17795 if test $ac_cv_header_time = yes; then
17796
17797 cat >>confdefs.h <<\EOF
17798 #define TIME_WITH_SYS_TIME 1
17799 EOF
17800
17801 fi
17802
17803 for ac_header in \
17804 getopt.h \
17805 locale.h \
17806 math.h \
17807 stdarg.h \
17808 stdint.h \
17809 sys/ioctl.h \
17810 sys/select.h \
17811 sys/time.h \
17812 termios.h \
17813 unistd.h \
17814
17815 do
17816 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17817 echo "$as_me:17817: checking for $ac_header" >&5
17818 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17819 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17820   echo $ECHO_N "(cached) $ECHO_C" >&6
17821 else
17822   cat >"conftest.$ac_ext" <<_ACEOF
17823 #line 17823 "configure"
17824 #include "confdefs.h"
17825 #include <$ac_header>
17826 _ACEOF
17827 if { (eval echo "$as_me:17827: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17828   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17829   ac_status=$?
17830   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17831   rm -f conftest.er1
17832   cat conftest.err >&5
17833   echo "$as_me:17833: \$? = $ac_status" >&5
17834   (exit "$ac_status"); } >/dev/null; then
17835   if test -s conftest.err; then
17836     ac_cpp_err=$ac_c_preproc_warn_flag
17837   else
17838     ac_cpp_err=
17839   fi
17840 else
17841   ac_cpp_err=yes
17842 fi
17843 if test -z "$ac_cpp_err"; then
17844   eval "$as_ac_Header=yes"
17845 else
17846   echo "$as_me: failed program was:" >&5
17847   cat "conftest.$ac_ext" >&5
17848   eval "$as_ac_Header=no"
17849 fi
17850 rm -f conftest.err "conftest.$ac_ext"
17851 fi
17852 echo "$as_me:17852: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17853 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17854 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17855   cat >>confdefs.h <<EOF
17856 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17857 EOF
17858
17859 fi
17860 done
17861
17862 for ac_header in unistd.h getopt.h
17863 do
17864 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17865 echo "$as_me:17865: checking for $ac_header" >&5
17866 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17867 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17868   echo $ECHO_N "(cached) $ECHO_C" >&6
17869 else
17870   cat >"conftest.$ac_ext" <<_ACEOF
17871 #line 17871 "configure"
17872 #include "confdefs.h"
17873 #include <$ac_header>
17874 _ACEOF
17875 if { (eval echo "$as_me:17875: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17876   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17877   ac_status=$?
17878   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17879   rm -f conftest.er1
17880   cat conftest.err >&5
17881   echo "$as_me:17881: \$? = $ac_status" >&5
17882   (exit "$ac_status"); } >/dev/null; then
17883   if test -s conftest.err; then
17884     ac_cpp_err=$ac_c_preproc_warn_flag
17885   else
17886     ac_cpp_err=
17887   fi
17888 else
17889   ac_cpp_err=yes
17890 fi
17891 if test -z "$ac_cpp_err"; then
17892   eval "$as_ac_Header=yes"
17893 else
17894   echo "$as_me: failed program was:" >&5
17895   cat "conftest.$ac_ext" >&5
17896   eval "$as_ac_Header=no"
17897 fi
17898 rm -f conftest.err "conftest.$ac_ext"
17899 fi
17900 echo "$as_me:17900: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17901 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17902 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17903   cat >>confdefs.h <<EOF
17904 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17905 EOF
17906
17907 fi
17908 done
17909
17910 echo "$as_me:17910: checking for header declaring getopt variables" >&5
17911 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17912 if test "${cf_cv_getopt_header+set}" = set; then
17913   echo $ECHO_N "(cached) $ECHO_C" >&6
17914 else
17915
17916 cf_cv_getopt_header=none
17917 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17918 do
17919 cat >"conftest.$ac_ext" <<_ACEOF
17920 #line 17920 "configure"
17921 #include "confdefs.h"
17922
17923 #include <$cf_header>
17924 int
17925 main (void)
17926 {
17927 int x = optind; char *y = optarg
17928   ;
17929   return 0;
17930 }
17931 _ACEOF
17932 rm -f "conftest.$ac_objext"
17933 if { (eval echo "$as_me:17933: \"$ac_compile\"") >&5
17934   (eval $ac_compile) 2>&5
17935   ac_status=$?
17936   echo "$as_me:17936: \$? = $ac_status" >&5
17937   (exit "$ac_status"); } &&
17938          { ac_try='test -s "conftest.$ac_objext"'
17939   { (eval echo "$as_me:17939: \"$ac_try\"") >&5
17940   (eval $ac_try) 2>&5
17941   ac_status=$?
17942   echo "$as_me:17942: \$? = $ac_status" >&5
17943   (exit "$ac_status"); }; }; then
17944   cf_cv_getopt_header=$cf_header
17945  break
17946 else
17947   echo "$as_me: failed program was:" >&5
17948 cat "conftest.$ac_ext" >&5
17949 fi
17950 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17951 done
17952
17953 fi
17954 echo "$as_me:17954: result: $cf_cv_getopt_header" >&5
17955 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17956 if test "$cf_cv_getopt_header" != none ; then
17957
17958 cat >>confdefs.h <<\EOF
17959 #define HAVE_GETOPT_HEADER 1
17960 EOF
17961
17962 fi
17963 if test "$cf_cv_getopt_header" = getopt.h ; then
17964
17965 cat >>confdefs.h <<\EOF
17966 #define NEED_GETOPT_H 1
17967 EOF
17968
17969 fi
17970
17971 for ac_func in \
17972 getopt \
17973 gettimeofday \
17974 snprintf \
17975 strdup \
17976 strstr \
17977 tsearch \
17978
17979 do
17980 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17981 echo "$as_me:17981: checking for $ac_func" >&5
17982 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17983 if eval "test \"\${$as_ac_var+set}\" = set"; then
17984   echo $ECHO_N "(cached) $ECHO_C" >&6
17985 else
17986   cat >"conftest.$ac_ext" <<_ACEOF
17987 #line 17987 "configure"
17988 #include "confdefs.h"
17989 #define $ac_func autoconf_temporary
17990 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17991 #undef $ac_func
17992
17993 #ifdef __cplusplus
17994 extern "C"
17995 #endif
17996
17997 /* We use char because int might match the return type of a gcc2
17998    builtin and then its argument prototype would still apply.  */
17999 char $ac_func (void);
18000
18001 int
18002 main (void)
18003 {
18004
18005 /* The GNU C library defines stubs for functions which it implements
18006     to always fail with ENOSYS.  Some functions are actually named
18007     something starting with __ and the normal name is an alias.  */
18008 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18009 #error found stub for $ac_func
18010 #endif
18011
18012         return $ac_func ();
18013   ;
18014   return 0;
18015 }
18016 _ACEOF
18017 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18018 if { (eval echo "$as_me:18018: \"$ac_link\"") >&5
18019   (eval $ac_link) 2>&5
18020   ac_status=$?
18021   echo "$as_me:18021: \$? = $ac_status" >&5
18022   (exit "$ac_status"); } &&
18023          { ac_try='test -s "conftest$ac_exeext"'
18024   { (eval echo "$as_me:18024: \"$ac_try\"") >&5
18025   (eval $ac_try) 2>&5
18026   ac_status=$?
18027   echo "$as_me:18027: \$? = $ac_status" >&5
18028   (exit "$ac_status"); }; }; then
18029   eval "$as_ac_var=yes"
18030 else
18031   echo "$as_me: failed program was:" >&5
18032 cat "conftest.$ac_ext" >&5
18033 eval "$as_ac_var=no"
18034 fi
18035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18036 fi
18037 echo "$as_me:18037: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18038 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18039 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18040   cat >>confdefs.h <<EOF
18041 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18042 EOF
18043
18044 fi
18045 done
18046
18047 # use a compile-check to work with ncurses*-config and subdirectory includes
18048 echo "$as_me:18048: checking if we can use termcap.h" >&5
18049 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18050 if test "${cf_cv_have_termcap_h+set}" = set; then
18051   echo $ECHO_N "(cached) $ECHO_C" >&6
18052 else
18053
18054         cat >"conftest.$ac_ext" <<_ACEOF
18055 #line 18055 "configure"
18056 #include "confdefs.h"
18057
18058 #include <curses.h>
18059 #ifdef NCURSES_VERSION
18060 #undef NCURSES_VERSION
18061 #endif
18062 #include <termcap.h>
18063 #ifndef NCURSES_VERSION
18064 #error wrong header
18065 #endif
18066
18067 int
18068 main (void)
18069 {
18070 return 0;
18071   ;
18072   return 0;
18073 }
18074 _ACEOF
18075 rm -f "conftest.$ac_objext"
18076 if { (eval echo "$as_me:18076: \"$ac_compile\"") >&5
18077   (eval $ac_compile) 2>&5
18078   ac_status=$?
18079   echo "$as_me:18079: \$? = $ac_status" >&5
18080   (exit "$ac_status"); } &&
18081          { ac_try='test -s "conftest.$ac_objext"'
18082   { (eval echo "$as_me:18082: \"$ac_try\"") >&5
18083   (eval $ac_try) 2>&5
18084   ac_status=$?
18085   echo "$as_me:18085: \$? = $ac_status" >&5
18086   (exit "$ac_status"); }; }; then
18087   cf_cv_have_termcap_h=yes
18088 else
18089   echo "$as_me: failed program was:" >&5
18090 cat "conftest.$ac_ext" >&5
18091 cf_cv_have_termcap_h=no
18092 fi
18093 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18094 fi
18095 echo "$as_me:18095: result: $cf_cv_have_termcap_h" >&5
18096 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18097 if test "x$cf_cv_have_termcap_h" = xyes
18098 then
18099
18100 cat >>confdefs.h <<\EOF
18101 #define HAVE_TERMCAP_H 1
18102 EOF
18103
18104 else
18105 echo "$as_me:18105: checking if we can use ncurses/termcap.h" >&5
18106 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18107 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18108   echo $ECHO_N "(cached) $ECHO_C" >&6
18109 else
18110
18111         cat >"conftest.$ac_ext" <<_ACEOF
18112 #line 18112 "configure"
18113 #include "confdefs.h"
18114
18115 #include <ncurses/curses.h>
18116 #ifdef NCURSES_VERSION
18117 #undef NCURSES_VERSION
18118 #endif
18119 #include <ncurses/termcap.h>
18120 #ifndef NCURSES_VERSION
18121 #error wrong header
18122 #endif
18123
18124 int
18125 main (void)
18126 {
18127 return 0;
18128   ;
18129   return 0;
18130 }
18131 _ACEOF
18132 rm -f "conftest.$ac_objext"
18133 if { (eval echo "$as_me:18133: \"$ac_compile\"") >&5
18134   (eval $ac_compile) 2>&5
18135   ac_status=$?
18136   echo "$as_me:18136: \$? = $ac_status" >&5
18137   (exit "$ac_status"); } &&
18138          { ac_try='test -s "conftest.$ac_objext"'
18139   { (eval echo "$as_me:18139: \"$ac_try\"") >&5
18140   (eval $ac_try) 2>&5
18141   ac_status=$?
18142   echo "$as_me:18142: \$? = $ac_status" >&5
18143   (exit "$ac_status"); }; }; then
18144   cf_cv_have_ncurses_termcap_h=yes
18145 else
18146   echo "$as_me: failed program was:" >&5
18147 cat "conftest.$ac_ext" >&5
18148 cf_cv_have_ncurses_termcap_h=no
18149 fi
18150 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18151 fi
18152 echo "$as_me:18152: result: $cf_cv_have_ncurses_termcap_h" >&5
18153 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18154 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18155 cat >>confdefs.h <<\EOF
18156 #define HAVE_NCURSES_TERMCAP_H 1
18157 EOF
18158
18159 fi
18160
18161 if test "x$ac_cv_func_getopt" = xno; then
18162         { { echo "$as_me:18162: error: getopt is required for building programs" >&5
18163 echo "$as_me: error: getopt is required for building programs" >&2;}
18164    { (exit 1); exit 1; }; }
18165 fi
18166
18167 if test "$cf_enable_widec" = yes; then
18168
18169 for ac_func in \
18170 mblen \
18171 mbrlen \
18172 mbrtowc \
18173 mbsrtowcs \
18174 mbstowcs \
18175 mbtowc \
18176 wcsrtombs \
18177 wcstombs \
18178
18179 do
18180 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18181 echo "$as_me:18181: checking for $ac_func" >&5
18182 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18183 if eval "test \"\${$as_ac_var+set}\" = set"; then
18184   echo $ECHO_N "(cached) $ECHO_C" >&6
18185 else
18186   cat >"conftest.$ac_ext" <<_ACEOF
18187 #line 18187 "configure"
18188 #include "confdefs.h"
18189 #define $ac_func autoconf_temporary
18190 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18191 #undef $ac_func
18192
18193 #ifdef __cplusplus
18194 extern "C"
18195 #endif
18196
18197 /* We use char because int might match the return type of a gcc2
18198    builtin and then its argument prototype would still apply.  */
18199 char $ac_func (void);
18200
18201 int
18202 main (void)
18203 {
18204
18205 /* The GNU C library defines stubs for functions which it implements
18206     to always fail with ENOSYS.  Some functions are actually named
18207     something starting with __ and the normal name is an alias.  */
18208 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18209 #error found stub for $ac_func
18210 #endif
18211
18212         return $ac_func ();
18213   ;
18214   return 0;
18215 }
18216 _ACEOF
18217 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18218 if { (eval echo "$as_me:18218: \"$ac_link\"") >&5
18219   (eval $ac_link) 2>&5
18220   ac_status=$?
18221   echo "$as_me:18221: \$? = $ac_status" >&5
18222   (exit "$ac_status"); } &&
18223          { ac_try='test -s "conftest$ac_exeext"'
18224   { (eval echo "$as_me:18224: \"$ac_try\"") >&5
18225   (eval $ac_try) 2>&5
18226   ac_status=$?
18227   echo "$as_me:18227: \$? = $ac_status" >&5
18228   (exit "$ac_status"); }; }; then
18229   eval "$as_ac_var=yes"
18230 else
18231   echo "$as_me: failed program was:" >&5
18232 cat "conftest.$ac_ext" >&5
18233 eval "$as_ac_var=no"
18234 fi
18235 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18236 fi
18237 echo "$as_me:18237: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18238 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18239 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18240   cat >>confdefs.h <<EOF
18241 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18242 EOF
18243
18244 fi
18245 done
18246
18247 fi
18248
18249 echo "$as_me:18249: checking definition to turn on extended curses functions" >&5
18250 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18251 if test "${cf_cv_need_xopen_extension+set}" = set; then
18252   echo $ECHO_N "(cached) $ECHO_C" >&6
18253 else
18254
18255 cf_cv_need_xopen_extension=unknown
18256 cat >"conftest.$ac_ext" <<_ACEOF
18257 #line 18257 "configure"
18258 #include "confdefs.h"
18259
18260 #include <stdlib.h>
18261 #include <${cf_cv_ncurses_header:-curses.h}>
18262 int
18263 main (void)
18264 {
18265
18266 #if defined(NCURSES_VERSION_PATCH)
18267 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18268         make an error
18269 #endif
18270 #endif
18271 #ifdef NCURSES_VERSION
18272         cchar_t check;
18273         int check2 = curs_set((int)sizeof(check));
18274 #endif
18275         long x = winnstr(stdscr, "", 0);
18276         int x1, y1;
18277 #ifdef NCURSES_VERSION
18278         (void)check2;
18279 #endif
18280         getbegyx(stdscr, y1, x1);
18281         (void)x;
18282         (void)y1;
18283         (void)x1;
18284
18285   ;
18286   return 0;
18287 }
18288 _ACEOF
18289 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18290 if { (eval echo "$as_me:18290: \"$ac_link\"") >&5
18291   (eval $ac_link) 2>&5
18292   ac_status=$?
18293   echo "$as_me:18293: \$? = $ac_status" >&5
18294   (exit "$ac_status"); } &&
18295          { ac_try='test -s "conftest$ac_exeext"'
18296   { (eval echo "$as_me:18296: \"$ac_try\"") >&5
18297   (eval $ac_try) 2>&5
18298   ac_status=$?
18299   echo "$as_me:18299: \$? = $ac_status" >&5
18300   (exit "$ac_status"); }; }; then
18301   cf_cv_need_xopen_extension=none
18302 else
18303   echo "$as_me: failed program was:" >&5
18304 cat "conftest.$ac_ext" >&5
18305
18306         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18307         do
18308                 cat >"conftest.$ac_ext" <<_ACEOF
18309 #line 18309 "configure"
18310 #include "confdefs.h"
18311
18312 #define $cf_try_xopen_extension 1
18313 #include <stdlib.h>
18314 #include <${cf_cv_ncurses_header:-curses.h}>
18315 int
18316 main (void)
18317 {
18318
18319 #ifdef NCURSES_VERSION
18320                 cchar_t check;
18321                 int check2 = curs_set((int)sizeof(check));
18322 #endif
18323                 long x = winnstr(stdscr, "", 0);
18324                 int x1, y1;
18325                 getbegyx(stdscr, y1, x1);
18326 #ifdef NCURSES_VERSION
18327                 (void)check2;
18328 #endif
18329                 (void)x;
18330                 (void)y1;
18331                 (void)x1;
18332
18333   ;
18334   return 0;
18335 }
18336 _ACEOF
18337 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18338 if { (eval echo "$as_me:18338: \"$ac_link\"") >&5
18339   (eval $ac_link) 2>&5
18340   ac_status=$?
18341   echo "$as_me:18341: \$? = $ac_status" >&5
18342   (exit "$ac_status"); } &&
18343          { ac_try='test -s "conftest$ac_exeext"'
18344   { (eval echo "$as_me:18344: \"$ac_try\"") >&5
18345   (eval $ac_try) 2>&5
18346   ac_status=$?
18347   echo "$as_me:18347: \$? = $ac_status" >&5
18348   (exit "$ac_status"); }; }; then
18349   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18350 else
18351   echo "$as_me: failed program was:" >&5
18352 cat "conftest.$ac_ext" >&5
18353 fi
18354 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18355         done
18356
18357 fi
18358 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18359
18360 fi
18361 echo "$as_me:18361: result: $cf_cv_need_xopen_extension" >&5
18362 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18363
18364 case "$cf_cv_need_xopen_extension" in
18365 (*_*)
18366
18367         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18368         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18369
18370         ;;
18371 esac
18372
18373 echo "$as_me:18373: checking for term.h" >&5
18374 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18375 if test "${cf_cv_term_header+set}" = set; then
18376   echo $ECHO_N "(cached) $ECHO_C" >&6
18377 else
18378
18379 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18380 # for <term.h> if we do not find the variant.
18381
18382 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18383
18384 case "${cf_cv_ncurses_header:-curses.h}" in
18385 (*/*)
18386         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18387         cf_header_list="$cf_header_item $cf_header_list"
18388         ;;
18389 esac
18390
18391 for cf_header in $cf_header_list
18392 do
18393         cat >"conftest.$ac_ext" <<_ACEOF
18394 #line 18394 "configure"
18395 #include "confdefs.h"
18396
18397 #include <${cf_cv_ncurses_header:-curses.h}>
18398 #include <${cf_header}>
18399 int
18400 main (void)
18401 {
18402 WINDOW *x; (void)x
18403   ;
18404   return 0;
18405 }
18406 _ACEOF
18407 rm -f "conftest.$ac_objext"
18408 if { (eval echo "$as_me:18408: \"$ac_compile\"") >&5
18409   (eval $ac_compile) 2>&5
18410   ac_status=$?
18411   echo "$as_me:18411: \$? = $ac_status" >&5
18412   (exit "$ac_status"); } &&
18413          { ac_try='test -s "conftest.$ac_objext"'
18414   { (eval echo "$as_me:18414: \"$ac_try\"") >&5
18415   (eval $ac_try) 2>&5
18416   ac_status=$?
18417   echo "$as_me:18417: \$? = $ac_status" >&5
18418   (exit "$ac_status"); }; }; then
18419   cf_cv_term_header=$cf_header
18420          break
18421 else
18422   echo "$as_me: failed program was:" >&5
18423 cat "conftest.$ac_ext" >&5
18424 cf_cv_term_header=no
18425 fi
18426 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18427 done
18428
18429 case "$cf_cv_term_header" in
18430 (no)
18431         # If curses is ncurses, some packagers still mess it up by trying to make
18432         # us use GNU termcap.  This handles the most common case.
18433         for cf_header in ncurses/term.h ncursesw/term.h
18434         do
18435                 cat >"conftest.$ac_ext" <<_ACEOF
18436 #line 18436 "configure"
18437 #include "confdefs.h"
18438
18439 #include <${cf_cv_ncurses_header:-curses.h}>
18440 #ifdef NCURSES_VERSION
18441 #include <${cf_header}>
18442 #else
18443 make an error
18444 #endif
18445 int
18446 main (void)
18447 {
18448 WINDOW *x; (void)x
18449   ;
18450   return 0;
18451 }
18452 _ACEOF
18453 rm -f "conftest.$ac_objext"
18454 if { (eval echo "$as_me:18454: \"$ac_compile\"") >&5
18455   (eval $ac_compile) 2>&5
18456   ac_status=$?
18457   echo "$as_me:18457: \$? = $ac_status" >&5
18458   (exit "$ac_status"); } &&
18459          { ac_try='test -s "conftest.$ac_objext"'
18460   { (eval echo "$as_me:18460: \"$ac_try\"") >&5
18461   (eval $ac_try) 2>&5
18462   ac_status=$?
18463   echo "$as_me:18463: \$? = $ac_status" >&5
18464   (exit "$ac_status"); }; }; then
18465   cf_cv_term_header=$cf_header
18466                          break
18467 else
18468   echo "$as_me: failed program was:" >&5
18469 cat "conftest.$ac_ext" >&5
18470 cf_cv_term_header=no
18471 fi
18472 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18473         done
18474         ;;
18475 esac
18476
18477 fi
18478 echo "$as_me:18478: result: $cf_cv_term_header" >&5
18479 echo "${ECHO_T}$cf_cv_term_header" >&6
18480
18481 case "$cf_cv_term_header" in
18482 (term.h)
18483
18484 cat >>confdefs.h <<\EOF
18485 #define HAVE_TERM_H 1
18486 EOF
18487
18488         ;;
18489 (ncurses/term.h)
18490
18491 cat >>confdefs.h <<\EOF
18492 #define HAVE_NCURSES_TERM_H 1
18493 EOF
18494
18495         ;;
18496 (ncursesw/term.h)
18497
18498 cat >>confdefs.h <<\EOF
18499 #define HAVE_NCURSESW_TERM_H 1
18500 EOF
18501
18502         ;;
18503 esac
18504
18505 echo "$as_me:18505: checking for unctrl.h" >&5
18506 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18507 if test "${cf_cv_unctrl_header+set}" = set; then
18508   echo $ECHO_N "(cached) $ECHO_C" >&6
18509 else
18510
18511 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18512 # for <unctrl.h> if we do not find the variant.
18513
18514 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18515
18516 case "${cf_cv_ncurses_header:-curses.h}" in
18517 (*/*)
18518         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18519         cf_header_list="$cf_header_item $cf_header_list"
18520         ;;
18521 esac
18522
18523 for cf_header in $cf_header_list
18524 do
18525         cat >"conftest.$ac_ext" <<_ACEOF
18526 #line 18526 "configure"
18527 #include "confdefs.h"
18528
18529 #include <${cf_cv_ncurses_header:-curses.h}>
18530 #include <${cf_header}>
18531 int
18532 main (void)
18533 {
18534 WINDOW *x; (void)x
18535   ;
18536   return 0;
18537 }
18538 _ACEOF
18539 rm -f "conftest.$ac_objext"
18540 if { (eval echo "$as_me:18540: \"$ac_compile\"") >&5
18541   (eval $ac_compile) 2>&5
18542   ac_status=$?
18543   echo "$as_me:18543: \$? = $ac_status" >&5
18544   (exit "$ac_status"); } &&
18545          { ac_try='test -s "conftest.$ac_objext"'
18546   { (eval echo "$as_me:18546: \"$ac_try\"") >&5
18547   (eval $ac_try) 2>&5
18548   ac_status=$?
18549   echo "$as_me:18549: \$? = $ac_status" >&5
18550   (exit "$ac_status"); }; }; then
18551   cf_cv_unctrl_header=$cf_header
18552          break
18553 else
18554   echo "$as_me: failed program was:" >&5
18555 cat "conftest.$ac_ext" >&5
18556 cf_cv_unctrl_header=no
18557 fi
18558 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18559 done
18560
18561 fi
18562 echo "$as_me:18562: result: $cf_cv_unctrl_header" >&5
18563 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18564
18565 case "$cf_cv_unctrl_header" in
18566 (no)
18567         { echo "$as_me:18567: WARNING: unctrl.h header not found" >&5
18568 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18569         ;;
18570 esac
18571
18572 case "$cf_cv_unctrl_header" in
18573 (unctrl.h)
18574
18575 cat >>confdefs.h <<\EOF
18576 #define HAVE_UNCTRL_H 1
18577 EOF
18578
18579         ;;
18580 (ncurses/unctrl.h)
18581
18582 cat >>confdefs.h <<\EOF
18583 #define HAVE_NCURSES_UNCTRL_H 1
18584 EOF
18585
18586         ;;
18587 (ncursesw/unctrl.h)
18588
18589 cat >>confdefs.h <<\EOF
18590 #define HAVE_NCURSESW_UNCTRL_H 1
18591 EOF
18592
18593         ;;
18594 esac
18595
18596 for cf_func in \
18597 alloc_pair \
18598 assume_default_colors \
18599 chgat \
18600 color_content \
18601 color_set \
18602 copywin \
18603 delscreen \
18604 dupwin \
18605 exit_curses \
18606 exit_terminfo \
18607 filter \
18608 getbegx \
18609 getcurx \
18610 getmaxx \
18611 getnstr \
18612 getparx \
18613 getwin \
18614 halfdelay \
18615 init_extended_color \
18616 mvderwin \
18617 mvvline \
18618 mvwin \
18619 mvwvline \
18620 napms \
18621 newpad \
18622 putwin \
18623 reset_color_pairs \
18624 resize_term \
18625 resizeterm \
18626 restartterm \
18627 ripoffline \
18628 scr_dump \
18629 setupterm \
18630 slk_color \
18631 slk_init \
18632 termattrs \
18633 termname \
18634 tgetent \
18635 tigetnum \
18636 tigetstr \
18637 tputs_sp \
18638 typeahead \
18639 use_default_colors \
18640 use_env \
18641 use_extended_names \
18642 use_screen \
18643 use_window \
18644 vid_puts \
18645 vidputs \
18646 vsscanf \
18647 vw_printw \
18648 wchgat \
18649 winsdelln \
18650 winsstr \
18651 wresize \
18652 wsyncdown \
18653 _tracef \
18654
18655 do
18656
18657 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18658
18659         echo "$as_me:18659: checking for ${cf_func}" >&5
18660 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18661
18662 echo "${as_me:-configure}:18662: testing ${cf_func} ..." 1>&5
18663
18664         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18665   echo $ECHO_N "(cached) $ECHO_C" >&6
18666 else
18667
18668                 eval cf_result='$ac_cv_func_'$cf_func
18669                 if test ".$cf_result" != ".no"; then
18670                         cat >"conftest.$ac_ext" <<_ACEOF
18671 #line 18671 "configure"
18672 #include "confdefs.h"
18673
18674 #ifdef HAVE_XCURSES
18675 #include <xcurses.h>
18676 char * XCursesProgramName = "test";
18677 #else
18678 #include <${cf_cv_ncurses_header:-curses.h}>
18679 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18680 #include <ncursesw/term.h>
18681 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18682 #include <ncurses/term.h>
18683 #elif defined(HAVE_TERM_H)
18684 #include <term.h>
18685 #endif
18686 #endif
18687
18688 int
18689 main (void)
18690 {
18691
18692 #ifndef ${cf_func}
18693 long foo = (long)(&${cf_func});
18694 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18695 if (foo + 1234L > 5678L)
18696         ${cf_cv_main_return:-return}(foo != 0);
18697 #endif
18698
18699   ;
18700   return 0;
18701 }
18702 _ACEOF
18703 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18704 if { (eval echo "$as_me:18704: \"$ac_link\"") >&5
18705   (eval $ac_link) 2>&5
18706   ac_status=$?
18707   echo "$as_me:18707: \$? = $ac_status" >&5
18708   (exit "$ac_status"); } &&
18709          { ac_try='test -s "conftest$ac_exeext"'
18710   { (eval echo "$as_me:18710: \"$ac_try\"") >&5
18711   (eval $ac_try) 2>&5
18712   ac_status=$?
18713   echo "$as_me:18713: \$? = $ac_status" >&5
18714   (exit "$ac_status"); }; }; then
18715   cf_result=yes
18716 else
18717   echo "$as_me: failed program was:" >&5
18718 cat "conftest.$ac_ext" >&5
18719 cf_result=no
18720 fi
18721 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18722                 fi
18723                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18724
18725 fi
18726
18727         # use the computed/retrieved cache-value:
18728         eval 'cf_result=$cf_cv_func_'$cf_func
18729         echo "$as_me:18729: result: $cf_result" >&5
18730 echo "${ECHO_T}$cf_result" >&6
18731         if test "$cf_result" != no; then
18732                 cat >>confdefs.h <<EOF
18733 #define HAVE_${cf_tr_func} 1
18734 EOF
18735
18736         fi
18737 done
18738
18739 for cf_func in tputs
18740 do
18741
18742 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18743
18744         echo "$as_me:18744: checking for ${cf_func}" >&5
18745 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18746
18747 echo "${as_me:-configure}:18747: testing ${cf_func} ..." 1>&5
18748
18749         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18750   echo $ECHO_N "(cached) $ECHO_C" >&6
18751 else
18752
18753                 eval cf_result='$ac_cv_func_'$cf_func
18754                 if test ".$cf_result" != ".no"; then
18755                         cat >"conftest.$ac_ext" <<_ACEOF
18756 #line 18756 "configure"
18757 #include "confdefs.h"
18758
18759 #ifdef HAVE_XCURSES
18760 #include <xcurses.h>
18761 char * XCursesProgramName = "test";
18762 #else
18763 #include <${cf_cv_ncurses_header:-curses.h}>
18764 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18765 #include <ncursesw/term.h>
18766 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18767 #include <ncurses/term.h>
18768 #elif defined(HAVE_TERM_H)
18769 #include <term.h>
18770 #endif
18771 #endif
18772
18773 int
18774 main (void)
18775 {
18776
18777 #ifndef ${cf_func}
18778 long foo = (long)(&${cf_func});
18779 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18780 if (foo + 1234L > 5678L)
18781         ${cf_cv_main_return:-return}(foo != 0);
18782 #endif
18783
18784   ;
18785   return 0;
18786 }
18787 _ACEOF
18788 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18789 if { (eval echo "$as_me:18789: \"$ac_link\"") >&5
18790   (eval $ac_link) 2>&5
18791   ac_status=$?
18792   echo "$as_me:18792: \$? = $ac_status" >&5
18793   (exit "$ac_status"); } &&
18794          { ac_try='test -s "conftest$ac_exeext"'
18795   { (eval echo "$as_me:18795: \"$ac_try\"") >&5
18796   (eval $ac_try) 2>&5
18797   ac_status=$?
18798   echo "$as_me:18798: \$? = $ac_status" >&5
18799   (exit "$ac_status"); }; }; then
18800   cf_result=yes
18801 else
18802   echo "$as_me: failed program was:" >&5
18803 cat "conftest.$ac_ext" >&5
18804 cf_result=no
18805 fi
18806 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18807                 fi
18808                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18809
18810 fi
18811
18812         # use the computed/retrieved cache-value:
18813         eval 'cf_result=$cf_cv_func_'$cf_func
18814         echo "$as_me:18814: result: $cf_result" >&5
18815 echo "${ECHO_T}$cf_result" >&6
18816         if test "$cf_result" != no; then
18817                 cat >>confdefs.h <<EOF
18818 #define HAVE_${cf_tr_func} 1
18819 EOF
18820
18821         fi
18822 done
18823
18824 if test "x$cf_cv_func_tputs" = xyes
18825 then
18826         cf_done=no
18827         for cf_arg in int char
18828         do
18829                 for cf_ret in int void
18830                 do
18831                         if test "$cf_ret" = void
18832                         then
18833                                 cf_return="/* nothing */"
18834                         else
18835                                 cf_return="return value"
18836                         fi
18837                         cat >"conftest.$ac_ext" <<_ACEOF
18838 #line 18838 "configure"
18839 #include "confdefs.h"
18840
18841 #include <${cf_cv_ncurses_header:-curses.h}>
18842 #include <$cf_cv_term_header>
18843
18844 static $cf_ret outc($cf_arg value) { $cf_return; }
18845
18846 int
18847 main (void)
18848 {
18849
18850         tputs("hello", 0, outc);
18851         ${cf_cv_main_return:-return}(0);
18852
18853   ;
18854   return 0;
18855 }
18856 _ACEOF
18857 rm -f "conftest.$ac_objext"
18858 if { (eval echo "$as_me:18858: \"$ac_compile\"") >&5
18859   (eval $ac_compile) 2>&5
18860   ac_status=$?
18861   echo "$as_me:18861: \$? = $ac_status" >&5
18862   (exit "$ac_status"); } &&
18863          { ac_try='test -s "conftest.$ac_objext"'
18864   { (eval echo "$as_me:18864: \"$ac_try\"") >&5
18865   (eval $ac_try) 2>&5
18866   ac_status=$?
18867   echo "$as_me:18867: \$? = $ac_status" >&5
18868   (exit "$ac_status"); }; }; then
18869
18870                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18871
18872 echo "${as_me:-configure}:18872: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18873
18874                 cat >>confdefs.h <<EOF
18875 #define TPUTS_ARG               $cf_arg
18876 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18877 #define TPUTS_RETURN(value)     $cf_return
18878 EOF
18879                 cf_done=yes
18880                 break
18881
18882 else
18883   echo "$as_me: failed program was:" >&5
18884 cat "conftest.$ac_ext" >&5
18885 fi
18886 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18887                 done
18888                 test "$cf_done" = yes && break
18889         done
18890 fi
18891
18892 echo "$as_me:18892: checking for ncurses extended functions" >&5
18893 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18894 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18895   echo $ECHO_N "(cached) $ECHO_C" >&6
18896 else
18897
18898 cat >"conftest.$ac_ext" <<_ACEOF
18899 #line 18899 "configure"
18900 #include "confdefs.h"
18901
18902 #include <${cf_cv_ncurses_header:-curses.h}>
18903 int
18904 main (void)
18905 {
18906
18907 int x = NCURSES_EXT_FUNCS
18908
18909   ;
18910   return 0;
18911 }
18912 _ACEOF
18913 rm -f "conftest.$ac_objext"
18914 if { (eval echo "$as_me:18914: \"$ac_compile\"") >&5
18915   (eval $ac_compile) 2>&5
18916   ac_status=$?
18917   echo "$as_me:18917: \$? = $ac_status" >&5
18918   (exit "$ac_status"); } &&
18919          { ac_try='test -s "conftest.$ac_objext"'
18920   { (eval echo "$as_me:18920: \"$ac_try\"") >&5
18921   (eval $ac_try) 2>&5
18922   ac_status=$?
18923   echo "$as_me:18923: \$? = $ac_status" >&5
18924   (exit "$ac_status"); }; }; then
18925   cf_cv_ncurses_ext_funcs=defined
18926 else
18927   echo "$as_me: failed program was:" >&5
18928 cat "conftest.$ac_ext" >&5
18929
18930 cat >"conftest.$ac_ext" <<_ACEOF
18931 #line 18931 "configure"
18932 #include "confdefs.h"
18933
18934 #include <${cf_cv_ncurses_header:-curses.h}>
18935 int
18936 main (void)
18937 {
18938
18939         (void) assume_default_colors (0, 0);
18940         (void) curses_version ();
18941         (void) define_key (0, 0);
18942         (void) is_term_resized (0, 0);
18943         (void) key_defined (0);
18944         (void) keybound (0, 0);
18945         (void) keyok (0, 0);
18946         (void) resize_term (0, 0);
18947         (void) resizeterm (0, 0);
18948         (void) use_default_colors ();
18949         (void) use_extended_names (0);
18950         (void) wresize (0, 0, 0);
18951   ;
18952   return 0;
18953 }
18954 _ACEOF
18955 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18956 if { (eval echo "$as_me:18956: \"$ac_link\"") >&5
18957   (eval $ac_link) 2>&5
18958   ac_status=$?
18959   echo "$as_me:18959: \$? = $ac_status" >&5
18960   (exit "$ac_status"); } &&
18961          { ac_try='test -s "conftest$ac_exeext"'
18962   { (eval echo "$as_me:18962: \"$ac_try\"") >&5
18963   (eval $ac_try) 2>&5
18964   ac_status=$?
18965   echo "$as_me:18965: \$? = $ac_status" >&5
18966   (exit "$ac_status"); }; }; then
18967   cf_cv_ncurses_ext_funcs=yes
18968 else
18969   echo "$as_me: failed program was:" >&5
18970 cat "conftest.$ac_ext" >&5
18971 cf_cv_ncurses_ext_funcs=no
18972 fi
18973 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18974
18975 fi
18976 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18977
18978 fi
18979 echo "$as_me:18979: result: $cf_cv_ncurses_ext_funcs" >&5
18980 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18981 test "$cf_cv_ncurses_ext_funcs" = yes &&
18982 cat >>confdefs.h <<\EOF
18983 #define NCURSES_EXT_FUNCS 1
18984 EOF
18985
18986 if test "$cf_enable_widec" = yes
18987 then
18988         # workaround for systems with ncurses before 20111029, due to change of
18989         # feature test macro from _XPG5 to _XOPEN_SOURCE
18990         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18991         then
18992                 cf_define_xpg5=no
18993                 echo "$as_me:18993: checking if _XPG5 should be defined to enable wide-characters" >&5
18994 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18995
18996                 cat >"conftest.$ac_ext" <<_ACEOF
18997 #line 18997 "configure"
18998 #include "confdefs.h"
18999
19000 #include <${cf_cv_ncurses_header:-curses.h}>
19001 int
19002 main (void)
19003 {
19004 int x = _XPG5
19005   ;
19006   return 0;
19007 }
19008 _ACEOF
19009 rm -f "conftest.$ac_objext"
19010 if { (eval echo "$as_me:19010: \"$ac_compile\"") >&5
19011   (eval $ac_compile) 2>&5
19012   ac_status=$?
19013   echo "$as_me:19013: \$? = $ac_status" >&5
19014   (exit "$ac_status"); } &&
19015          { ac_try='test -s "conftest.$ac_objext"'
19016   { (eval echo "$as_me:19016: \"$ac_try\"") >&5
19017   (eval $ac_try) 2>&5
19018   ac_status=$?
19019   echo "$as_me:19019: \$? = $ac_status" >&5
19020   (exit "$ac_status"); }; }; then
19021   :
19022 else
19023   echo "$as_me: failed program was:" >&5
19024 cat "conftest.$ac_ext" >&5
19025 cf_save_cppflags="$CPPFLAGS"
19026                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19027                          cat >"conftest.$ac_ext" <<_ACEOF
19028 #line 19028 "configure"
19029 #include "confdefs.h"
19030
19031 #include <${cf_cv_ncurses_header:-curses.h}>
19032 int
19033 main (void)
19034 {
19035 int x = _XPG5
19036   ;
19037   return 0;
19038 }
19039 _ACEOF
19040 rm -f "conftest.$ac_objext"
19041 if { (eval echo "$as_me:19041: \"$ac_compile\"") >&5
19042   (eval $ac_compile) 2>&5
19043   ac_status=$?
19044   echo "$as_me:19044: \$? = $ac_status" >&5
19045   (exit "$ac_status"); } &&
19046          { ac_try='test -s "conftest.$ac_objext"'
19047   { (eval echo "$as_me:19047: \"$ac_try\"") >&5
19048   (eval $ac_try) 2>&5
19049   ac_status=$?
19050   echo "$as_me:19050: \$? = $ac_status" >&5
19051   (exit "$ac_status"); }; }; then
19052   cf_define_xpg5=yes
19053 else
19054   echo "$as_me: failed program was:" >&5
19055 cat "conftest.$ac_ext" >&5
19056 fi
19057 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19058                          CPPFLAGS="$cf_save_cppflags"
19059 fi
19060 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19061                 echo "$as_me:19061: result: $cf_define_xpg5" >&5
19062 echo "${ECHO_T}$cf_define_xpg5" >&6
19063
19064                 if test "$cf_define_xpg5" = yes
19065                 then
19066                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19067                 fi
19068         fi
19069
19070         echo "$as_me:19070: checking for wide-character functions" >&5
19071 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19072 if test "${cf_cv_widechar_funcs+set}" = set; then
19073   echo $ECHO_N "(cached) $ECHO_C" >&6
19074 else
19075
19076         cat >"conftest.$ac_ext" <<_ACEOF
19077 #line 19077 "configure"
19078 #include "confdefs.h"
19079
19080 #include <${cf_cv_ncurses_header:-curses.h}>
19081 int
19082 main (void)
19083 {
19084
19085                 static wchar_t src_wchar[2];
19086                 static cchar_t dst_cchar;
19087                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19088
19089   ;
19090   return 0;
19091 }
19092 _ACEOF
19093 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19094 if { (eval echo "$as_me:19094: \"$ac_link\"") >&5
19095   (eval $ac_link) 2>&5
19096   ac_status=$?
19097   echo "$as_me:19097: \$? = $ac_status" >&5
19098   (exit "$ac_status"); } &&
19099          { ac_try='test -s "conftest$ac_exeext"'
19100   { (eval echo "$as_me:19100: \"$ac_try\"") >&5
19101   (eval $ac_try) 2>&5
19102   ac_status=$?
19103   echo "$as_me:19103: \$? = $ac_status" >&5
19104   (exit "$ac_status"); }; }; then
19105   cf_cv_widechar_funcs=yes
19106 else
19107   echo "$as_me: failed program was:" >&5
19108 cat "conftest.$ac_ext" >&5
19109 cf_cv_widechar_funcs=no
19110 fi
19111 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19112
19113 fi
19114 echo "$as_me:19114: result: $cf_cv_widechar_funcs" >&5
19115 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19116         if test "$cf_cv_widechar_funcs" != no ; then
19117
19118 cat >>confdefs.h <<\EOF
19119 #define USE_WIDEC_SUPPORT 1
19120 EOF
19121
19122         else
19123                 cat >>confdefs.h <<\EOF
19124 #define USE_WIDEC_SUPPORT 0
19125 EOF
19126
19127         fi
19128 else
19129         cat >>confdefs.h <<\EOF
19130 #define USE_WIDEC_SUPPORT 0
19131 EOF
19132
19133 fi
19134
19135 echo "$as_me:19135: checking if $cf_cv_screen library uses pthreads" >&5
19136 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19137 if test "${cf_cv_use_pthreads+set}" = set; then
19138   echo $ECHO_N "(cached) $ECHO_C" >&6
19139 else
19140
19141 cat >"conftest.$ac_ext" <<_ACEOF
19142 #line 19142 "configure"
19143 #include "confdefs.h"
19144
19145 #include <${cf_cv_ncurses_header:-curses.h}>
19146 extern void _nc_init_pthreads(void);
19147
19148 int
19149 main (void)
19150 {
19151
19152         initscr();
19153         _nc_init_pthreads();
19154
19155   ;
19156   return 0;
19157 }
19158 _ACEOF
19159 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19160 if { (eval echo "$as_me:19160: \"$ac_link\"") >&5
19161   (eval $ac_link) 2>&5
19162   ac_status=$?
19163   echo "$as_me:19163: \$? = $ac_status" >&5
19164   (exit "$ac_status"); } &&
19165          { ac_try='test -s "conftest$ac_exeext"'
19166   { (eval echo "$as_me:19166: \"$ac_try\"") >&5
19167   (eval $ac_try) 2>&5
19168   ac_status=$?
19169   echo "$as_me:19169: \$? = $ac_status" >&5
19170   (exit "$ac_status"); }; }; then
19171   cf_cv_use_pthreads=yes
19172 else
19173   echo "$as_me: failed program was:" >&5
19174 cat "conftest.$ac_ext" >&5
19175 cf_cv_use_pthreads=no
19176 fi
19177 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19178
19179 fi
19180 echo "$as_me:19180: result: $cf_cv_use_pthreads" >&5
19181 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19182 test $cf_cv_use_pthreads = yes &&
19183 cat >>confdefs.h <<\EOF
19184 #define USE_PTHREADS 1
19185 EOF
19186
19187 echo "$as_me:19187: checking if sys/time.h works with sys/select.h" >&5
19188 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19189 if test "${cf_cv_sys_time_select+set}" = set; then
19190   echo $ECHO_N "(cached) $ECHO_C" >&6
19191 else
19192
19193 cat >"conftest.$ac_ext" <<_ACEOF
19194 #line 19194 "configure"
19195 #include "confdefs.h"
19196
19197 #include <sys/types.h>
19198 #ifdef HAVE_SYS_TIME_H
19199 #include <sys/time.h>
19200 #endif
19201 #ifdef HAVE_SYS_SELECT_H
19202 #include <sys/select.h>
19203 #endif
19204
19205 int
19206 main (void)
19207 {
19208
19209   ;
19210   return 0;
19211 }
19212 _ACEOF
19213 rm -f "conftest.$ac_objext"
19214 if { (eval echo "$as_me:19214: \"$ac_compile\"") >&5
19215   (eval $ac_compile) 2>&5
19216   ac_status=$?
19217   echo "$as_me:19217: \$? = $ac_status" >&5
19218   (exit "$ac_status"); } &&
19219          { ac_try='test -s "conftest.$ac_objext"'
19220   { (eval echo "$as_me:19220: \"$ac_try\"") >&5
19221   (eval $ac_try) 2>&5
19222   ac_status=$?
19223   echo "$as_me:19223: \$? = $ac_status" >&5
19224   (exit "$ac_status"); }; }; then
19225   cf_cv_sys_time_select=yes
19226 else
19227   echo "$as_me: failed program was:" >&5
19228 cat "conftest.$ac_ext" >&5
19229 cf_cv_sys_time_select=no
19230 fi
19231 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19232
19233 fi
19234
19235 echo "$as_me:19235: result: $cf_cv_sys_time_select" >&5
19236 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19237 test "$cf_cv_sys_time_select" = yes &&
19238 cat >>confdefs.h <<\EOF
19239 #define HAVE_SYS_TIME_SELECT 1
19240 EOF
19241
19242 # special check for test/ditto.c
19243
19244 echo "$as_me:19244: checking for openpty in -lutil" >&5
19245 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19246 if test "${ac_cv_lib_util_openpty+set}" = set; then
19247   echo $ECHO_N "(cached) $ECHO_C" >&6
19248 else
19249   ac_check_lib_save_LIBS=$LIBS
19250 LIBS="-lutil  $LIBS"
19251 cat >"conftest.$ac_ext" <<_ACEOF
19252 #line 19252 "configure"
19253 #include "confdefs.h"
19254
19255 /* Override any gcc2 internal prototype to avoid an error.  */
19256 #ifdef __cplusplus
19257 extern "C"
19258 #endif
19259 /* We use char because int might match the return type of a gcc2
19260    builtin and then its argument prototype would still apply.  */
19261 char openpty ();
19262 int
19263 main (void)
19264 {
19265 openpty ();
19266   ;
19267   return 0;
19268 }
19269 _ACEOF
19270 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19271 if { (eval echo "$as_me:19271: \"$ac_link\"") >&5
19272   (eval $ac_link) 2>&5
19273   ac_status=$?
19274   echo "$as_me:19274: \$? = $ac_status" >&5
19275   (exit "$ac_status"); } &&
19276          { ac_try='test -s "conftest$ac_exeext"'
19277   { (eval echo "$as_me:19277: \"$ac_try\"") >&5
19278   (eval $ac_try) 2>&5
19279   ac_status=$?
19280   echo "$as_me:19280: \$? = $ac_status" >&5
19281   (exit "$ac_status"); }; }; then
19282   ac_cv_lib_util_openpty=yes
19283 else
19284   echo "$as_me: failed program was:" >&5
19285 cat "conftest.$ac_ext" >&5
19286 ac_cv_lib_util_openpty=no
19287 fi
19288 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19289 LIBS=$ac_check_lib_save_LIBS
19290 fi
19291 echo "$as_me:19291: result: $ac_cv_lib_util_openpty" >&5
19292 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19293 if test "$ac_cv_lib_util_openpty" = yes; then
19294   cf_cv_lib_util=yes
19295 else
19296   cf_cv_lib_util=no
19297 fi
19298
19299 echo "$as_me:19299: checking for openpty header" >&5
19300 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19301 if test "${cf_cv_func_openpty+set}" = set; then
19302   echo $ECHO_N "(cached) $ECHO_C" >&6
19303 else
19304
19305         cf_save_LIBS="$LIBS"
19306         test "$cf_cv_lib_util" = yes && {
19307 cf_add_libs="$LIBS"
19308 # reverse order
19309 cf_add_0lib=
19310 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19311 # filter duplicates
19312 for cf_add_1lib in $cf_add_0lib; do
19313         for cf_add_2lib in $cf_add_libs; do
19314                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19315                         cf_add_1lib=
19316                         break
19317                 fi
19318         done
19319         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19320 done
19321 LIBS="$cf_add_libs"
19322  }
19323         for cf_header in pty.h libutil.h util.h
19324         do
19325         cat >"conftest.$ac_ext" <<_ACEOF
19326 #line 19326 "configure"
19327 #include "confdefs.h"
19328
19329 #include <$cf_header>
19330
19331 int
19332 main (void)
19333 {
19334
19335         int x = openpty((int *)0, (int *)0, (char *)0,
19336                                    (struct termios *)0, (struct winsize *)0);
19337
19338   ;
19339   return 0;
19340 }
19341 _ACEOF
19342 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19343 if { (eval echo "$as_me:19343: \"$ac_link\"") >&5
19344   (eval $ac_link) 2>&5
19345   ac_status=$?
19346   echo "$as_me:19346: \$? = $ac_status" >&5
19347   (exit "$ac_status"); } &&
19348          { ac_try='test -s "conftest$ac_exeext"'
19349   { (eval echo "$as_me:19349: \"$ac_try\"") >&5
19350   (eval $ac_try) 2>&5
19351   ac_status=$?
19352   echo "$as_me:19352: \$? = $ac_status" >&5
19353   (exit "$ac_status"); }; }; then
19354
19355                 cf_cv_func_openpty=$cf_header
19356                 break
19357
19358 else
19359   echo "$as_me: failed program was:" >&5
19360 cat "conftest.$ac_ext" >&5
19361
19362                 cf_cv_func_openpty=no
19363
19364 fi
19365 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19366         done
19367         LIBS="$cf_save_LIBS"
19368
19369 fi
19370 echo "$as_me:19370: result: $cf_cv_func_openpty" >&5
19371 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19372
19373 if test "$cf_cv_func_openpty" != no ; then
19374
19375 cat >>confdefs.h <<EOF
19376 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19377 EOF
19378
19379 cat >>confdefs.h <<\EOF
19380 #define USE_XTERM_PTY 1
19381 EOF
19382
19383         if test "x$cf_cv_lib_util" = xyes ; then
19384
19385 cf_add_libs="$TEST_LIBS"
19386 # reverse order
19387 cf_add_0lib=
19388 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19389 # filter duplicates
19390 for cf_add_1lib in $cf_add_0lib; do
19391         for cf_add_2lib in $cf_add_libs; do
19392                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19393                         cf_add_1lib=
19394                         break
19395                 fi
19396         done
19397         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19398 done
19399 TEST_LIBS="$cf_add_libs"
19400
19401         fi
19402 fi
19403
19404 echo "$as_me:19404: checking for function curses_version" >&5
19405 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19406 if test "${cf_cv_func_curses_version+set}" = set; then
19407   echo $ECHO_N "(cached) $ECHO_C" >&6
19408 else
19409
19410 if test "$cross_compiling" = yes; then
19411   cf_cv_func_curses_version=unknown
19412 else
19413   cat >"conftest.$ac_ext" <<_ACEOF
19414 #line 19414 "configure"
19415 #include "confdefs.h"
19416
19417 #include <${cf_cv_ncurses_header:-curses.h}>
19418 int main(void)
19419 {
19420         char temp[1024];
19421         sprintf(temp, "%s\\n", curses_version());
19422         ${cf_cv_main_return:-return}(0);
19423 }
19424
19425 _ACEOF
19426 rm -f "conftest$ac_exeext"
19427 if { (eval echo "$as_me:19427: \"$ac_link\"") >&5
19428   (eval $ac_link) 2>&5
19429   ac_status=$?
19430   echo "$as_me:19430: \$? = $ac_status" >&5
19431   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19432   { (eval echo "$as_me:19432: \"$ac_try\"") >&5
19433   (eval $ac_try) 2>&5
19434   ac_status=$?
19435   echo "$as_me:19435: \$? = $ac_status" >&5
19436   (exit "$ac_status"); }; }; then
19437   cf_cv_func_curses_version=yes
19438
19439 else
19440   echo "$as_me: program exited with status $ac_status" >&5
19441 echo "$as_me: failed program was:" >&5
19442 cat "conftest.$ac_ext" >&5
19443 cf_cv_func_curses_version=no
19444
19445 fi
19446 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19447 fi
19448 rm -f core
19449 fi
19450 echo "$as_me:19450: result: $cf_cv_func_curses_version" >&5
19451 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19452 test "$cf_cv_func_curses_version" = yes &&
19453 cat >>confdefs.h <<\EOF
19454 #define HAVE_CURSES_VERSION 1
19455 EOF
19456
19457 echo "$as_me:19457: checking for alternate character set array" >&5
19458 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19459 if test "${cf_cv_curses_acs_map+set}" = set; then
19460   echo $ECHO_N "(cached) $ECHO_C" >&6
19461 else
19462
19463 cf_cv_curses_acs_map=unknown
19464 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19465 do
19466 cat >"conftest.$ac_ext" <<_ACEOF
19467 #line 19467 "configure"
19468 #include "confdefs.h"
19469
19470 #include <${cf_cv_ncurses_header:-curses.h}>
19471
19472 int
19473 main (void)
19474 {
19475
19476 ${name}['k'] = ACS_PLUS
19477
19478   ;
19479   return 0;
19480 }
19481 _ACEOF
19482 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19483 if { (eval echo "$as_me:19483: \"$ac_link\"") >&5
19484   (eval $ac_link) 2>&5
19485   ac_status=$?
19486   echo "$as_me:19486: \$? = $ac_status" >&5
19487   (exit "$ac_status"); } &&
19488          { ac_try='test -s "conftest$ac_exeext"'
19489   { (eval echo "$as_me:19489: \"$ac_try\"") >&5
19490   (eval $ac_try) 2>&5
19491   ac_status=$?
19492   echo "$as_me:19492: \$? = $ac_status" >&5
19493   (exit "$ac_status"); }; }; then
19494   cf_cv_curses_acs_map=$name; break
19495 else
19496   echo "$as_me: failed program was:" >&5
19497 cat "conftest.$ac_ext" >&5
19498 fi
19499 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19500 done
19501
19502 fi
19503 echo "$as_me:19503: result: $cf_cv_curses_acs_map" >&5
19504 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19505
19506 test "$cf_cv_curses_acs_map" != unknown &&
19507 cat >>confdefs.h <<EOF
19508 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19509 EOF
19510
19511 if test "$cf_enable_widec" = yes; then
19512
19513 echo "$as_me:19513: checking for wide alternate character set array" >&5
19514 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19515 if test "${cf_cv_curses_wacs_map+set}" = set; then
19516   echo $ECHO_N "(cached) $ECHO_C" >&6
19517 else
19518
19519         cf_cv_curses_wacs_map=unknown
19520         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19521         do
19522         cat >"conftest.$ac_ext" <<_ACEOF
19523 #line 19523 "configure"
19524 #include "confdefs.h"
19525
19526 #ifndef _XOPEN_SOURCE_EXTENDED
19527 #define _XOPEN_SOURCE_EXTENDED
19528 #endif
19529 #include <${cf_cv_ncurses_header:-curses.h}>
19530 int
19531 main (void)
19532 {
19533 void *foo = &(${name}['k']); (void)foo
19534   ;
19535   return 0;
19536 }
19537 _ACEOF
19538 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19539 if { (eval echo "$as_me:19539: \"$ac_link\"") >&5
19540   (eval $ac_link) 2>&5
19541   ac_status=$?
19542   echo "$as_me:19542: \$? = $ac_status" >&5
19543   (exit "$ac_status"); } &&
19544          { ac_try='test -s "conftest$ac_exeext"'
19545   { (eval echo "$as_me:19545: \"$ac_try\"") >&5
19546   (eval $ac_try) 2>&5
19547   ac_status=$?
19548   echo "$as_me:19548: \$? = $ac_status" >&5
19549   (exit "$ac_status"); }; }; then
19550   cf_cv_curses_wacs_map=$name
19551          break
19552 else
19553   echo "$as_me: failed program was:" >&5
19554 cat "conftest.$ac_ext" >&5
19555 fi
19556 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19557         done
19558 fi
19559 echo "$as_me:19559: result: $cf_cv_curses_wacs_map" >&5
19560 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19561
19562 test "$cf_cv_curses_wacs_map" != unknown &&
19563 cat >>confdefs.h <<EOF
19564 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19565 EOF
19566
19567 echo "$as_me:19567: checking for wide alternate character constants" >&5
19568 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19569 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19570   echo $ECHO_N "(cached) $ECHO_C" >&6
19571 else
19572
19573 cf_cv_curses_wacs_symbols=no
19574 if test "$cf_cv_curses_wacs_map" != unknown
19575 then
19576         cat >"conftest.$ac_ext" <<_ACEOF
19577 #line 19577 "configure"
19578 #include "confdefs.h"
19579
19580 #ifndef _XOPEN_SOURCE_EXTENDED
19581 #define _XOPEN_SOURCE_EXTENDED
19582 #endif
19583 #include <${cf_cv_ncurses_header:-curses.h}>
19584 int
19585 main (void)
19586 {
19587 cchar_t *foo = WACS_PLUS;
19588          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
19589   ;
19590   return 0;
19591 }
19592 _ACEOF
19593 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19594 if { (eval echo "$as_me:19594: \"$ac_link\"") >&5
19595   (eval $ac_link) 2>&5
19596   ac_status=$?
19597   echo "$as_me:19597: \$? = $ac_status" >&5
19598   (exit "$ac_status"); } &&
19599          { ac_try='test -s "conftest$ac_exeext"'
19600   { (eval echo "$as_me:19600: \"$ac_try\"") >&5
19601   (eval $ac_try) 2>&5
19602   ac_status=$?
19603   echo "$as_me:19603: \$? = $ac_status" >&5
19604   (exit "$ac_status"); }; }; then
19605   cf_cv_curses_wacs_symbols=yes
19606 else
19607   echo "$as_me: failed program was:" >&5
19608 cat "conftest.$ac_ext" >&5
19609 fi
19610 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19611 else
19612         cat >"conftest.$ac_ext" <<_ACEOF
19613 #line 19613 "configure"
19614 #include "confdefs.h"
19615
19616 #ifndef _XOPEN_SOURCE_EXTENDED
19617 #define _XOPEN_SOURCE_EXTENDED
19618 #endif
19619 #include <${cf_cv_ncurses_header:-curses.h}>
19620 int
19621 main (void)
19622 {
19623 cchar_t *foo = WACS_PLUS; (void)foo
19624   ;
19625   return 0;
19626 }
19627 _ACEOF
19628 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19629 if { (eval echo "$as_me:19629: \"$ac_link\"") >&5
19630   (eval $ac_link) 2>&5
19631   ac_status=$?
19632   echo "$as_me:19632: \$? = $ac_status" >&5
19633   (exit "$ac_status"); } &&
19634          { ac_try='test -s "conftest$ac_exeext"'
19635   { (eval echo "$as_me:19635: \"$ac_try\"") >&5
19636   (eval $ac_try) 2>&5
19637   ac_status=$?
19638   echo "$as_me:19638: \$? = $ac_status" >&5
19639   (exit "$ac_status"); }; }; then
19640   cf_cv_curses_wacs_symbols=yes
19641 else
19642   echo "$as_me: failed program was:" >&5
19643 cat "conftest.$ac_ext" >&5
19644 fi
19645 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19646 fi
19647
19648 fi
19649 echo "$as_me:19649: result: $cf_cv_curses_wacs_symbols" >&5
19650 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19651
19652 test "$cf_cv_curses_wacs_symbols" != no &&
19653 cat >>confdefs.h <<\EOF
19654 #define CURSES_WACS_SYMBOLS 1
19655 EOF
19656
19657 fi
19658
19659 echo "$as_me:19659: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19660 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19661 cat >"conftest.$ac_ext" <<_ACEOF
19662 #line 19662 "configure"
19663 #include "confdefs.h"
19664
19665 #ifndef _XOPEN_SOURCE_EXTENDED
19666 #define _XOPEN_SOURCE_EXTENDED
19667 #endif
19668 #include <${cf_cv_ncurses_header:-curses.h}>
19669 int
19670 main (void)
19671 {
19672
19673 attr_t foo
19674
19675   ;
19676   return 0;
19677 }
19678 _ACEOF
19679 rm -f "conftest.$ac_objext"
19680 if { (eval echo "$as_me:19680: \"$ac_compile\"") >&5
19681   (eval $ac_compile) 2>&5
19682   ac_status=$?
19683   echo "$as_me:19683: \$? = $ac_status" >&5
19684   (exit "$ac_status"); } &&
19685          { ac_try='test -s "conftest.$ac_objext"'
19686   { (eval echo "$as_me:19686: \"$ac_try\"") >&5
19687   (eval $ac_try) 2>&5
19688   ac_status=$?
19689   echo "$as_me:19689: \$? = $ac_status" >&5
19690   (exit "$ac_status"); }; }; then
19691   cf_result=yes
19692 else
19693   echo "$as_me: failed program was:" >&5
19694 cat "conftest.$ac_ext" >&5
19695 cf_result=no
19696 fi
19697 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19698 echo "$as_me:19698: result: $cf_result" >&5
19699 echo "${ECHO_T}$cf_result" >&6
19700 if test "$cf_result" = yes ; then
19701
19702 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19703
19704 cat >>confdefs.h <<EOF
19705 #define $cf_result 1
19706 EOF
19707
19708 else
19709
19710 cat >>confdefs.h <<EOF
19711 #define attr_t long
19712 EOF
19713
19714 fi
19715
19716 if test "$cf_enable_widec" = yes; then
19717
19718 # This is needed on Tru64 5.0 to declare mbstate_t
19719 echo "$as_me:19719: checking if we must include wchar.h to declare mbstate_t" >&5
19720 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19721 if test "${cf_cv_mbstate_t+set}" = set; then
19722   echo $ECHO_N "(cached) $ECHO_C" >&6
19723 else
19724
19725 cat >"conftest.$ac_ext" <<_ACEOF
19726 #line 19726 "configure"
19727 #include "confdefs.h"
19728
19729 #include <stdlib.h>
19730 #include <stdarg.h>
19731 #include <stdio.h>
19732 #ifdef HAVE_LIBUTF8_H
19733 #include <libutf8.h>
19734 #endif
19735 int
19736 main (void)
19737 {
19738 mbstate_t state
19739   ;
19740   return 0;
19741 }
19742 _ACEOF
19743 rm -f "conftest.$ac_objext"
19744 if { (eval echo "$as_me:19744: \"$ac_compile\"") >&5
19745   (eval $ac_compile) 2>&5
19746   ac_status=$?
19747   echo "$as_me:19747: \$? = $ac_status" >&5
19748   (exit "$ac_status"); } &&
19749          { ac_try='test -s "conftest.$ac_objext"'
19750   { (eval echo "$as_me:19750: \"$ac_try\"") >&5
19751   (eval $ac_try) 2>&5
19752   ac_status=$?
19753   echo "$as_me:19753: \$? = $ac_status" >&5
19754   (exit "$ac_status"); }; }; then
19755   cf_cv_mbstate_t=no
19756 else
19757   echo "$as_me: failed program was:" >&5
19758 cat "conftest.$ac_ext" >&5
19759 cat >"conftest.$ac_ext" <<_ACEOF
19760 #line 19760 "configure"
19761 #include "confdefs.h"
19762
19763 #include <stdlib.h>
19764 #include <stdarg.h>
19765 #include <stdio.h>
19766 #include <wchar.h>
19767 #ifdef HAVE_LIBUTF8_H
19768 #include <libutf8.h>
19769 #endif
19770 int
19771 main (void)
19772 {
19773 mbstate_t value
19774   ;
19775   return 0;
19776 }
19777 _ACEOF
19778 rm -f "conftest.$ac_objext"
19779 if { (eval echo "$as_me:19779: \"$ac_compile\"") >&5
19780   (eval $ac_compile) 2>&5
19781   ac_status=$?
19782   echo "$as_me:19782: \$? = $ac_status" >&5
19783   (exit "$ac_status"); } &&
19784          { ac_try='test -s "conftest.$ac_objext"'
19785   { (eval echo "$as_me:19785: \"$ac_try\"") >&5
19786   (eval $ac_try) 2>&5
19787   ac_status=$?
19788   echo "$as_me:19788: \$? = $ac_status" >&5
19789   (exit "$ac_status"); }; }; then
19790   cf_cv_mbstate_t=yes
19791 else
19792   echo "$as_me: failed program was:" >&5
19793 cat "conftest.$ac_ext" >&5
19794 cf_cv_mbstate_t=unknown
19795 fi
19796 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19797 fi
19798 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19799 fi
19800 echo "$as_me:19800: result: $cf_cv_mbstate_t" >&5
19801 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19802
19803 if test "$cf_cv_mbstate_t" = yes ; then
19804
19805 cat >>confdefs.h <<\EOF
19806 #define NEED_WCHAR_H 1
19807 EOF
19808
19809         NEED_WCHAR_H=1
19810 fi
19811
19812 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19813 if test "$cf_cv_mbstate_t" = unknown ; then
19814         NCURSES_MBSTATE_T=1
19815 fi
19816
19817 # if we find mbstate_t in either place, use substitution to provide a fallback.
19818 if test "$cf_cv_mbstate_t" != unknown ; then
19819         NCURSES_OK_MBSTATE_T=1
19820 fi
19821
19822 # This is needed on Tru64 5.0 to declare wchar_t
19823 echo "$as_me:19823: checking if we must include wchar.h to declare wchar_t" >&5
19824 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19825 if test "${cf_cv_wchar_t+set}" = set; then
19826   echo $ECHO_N "(cached) $ECHO_C" >&6
19827 else
19828
19829 cat >"conftest.$ac_ext" <<_ACEOF
19830 #line 19830 "configure"
19831 #include "confdefs.h"
19832
19833 #include <stdlib.h>
19834 #include <stdarg.h>
19835 #include <stdio.h>
19836 #ifdef HAVE_LIBUTF8_H
19837 #include <libutf8.h>
19838 #endif
19839 int
19840 main (void)
19841 {
19842 wchar_t state
19843   ;
19844   return 0;
19845 }
19846 _ACEOF
19847 rm -f "conftest.$ac_objext"
19848 if { (eval echo "$as_me:19848: \"$ac_compile\"") >&5
19849   (eval $ac_compile) 2>&5
19850   ac_status=$?
19851   echo "$as_me:19851: \$? = $ac_status" >&5
19852   (exit "$ac_status"); } &&
19853          { ac_try='test -s "conftest.$ac_objext"'
19854   { (eval echo "$as_me:19854: \"$ac_try\"") >&5
19855   (eval $ac_try) 2>&5
19856   ac_status=$?
19857   echo "$as_me:19857: \$? = $ac_status" >&5
19858   (exit "$ac_status"); }; }; then
19859   cf_cv_wchar_t=no
19860 else
19861   echo "$as_me: failed program was:" >&5
19862 cat "conftest.$ac_ext" >&5
19863 cat >"conftest.$ac_ext" <<_ACEOF
19864 #line 19864 "configure"
19865 #include "confdefs.h"
19866
19867 #include <stdlib.h>
19868 #include <stdarg.h>
19869 #include <stdio.h>
19870 #include <wchar.h>
19871 #ifdef HAVE_LIBUTF8_H
19872 #include <libutf8.h>
19873 #endif
19874 int
19875 main (void)
19876 {
19877 wchar_t value
19878   ;
19879   return 0;
19880 }
19881 _ACEOF
19882 rm -f "conftest.$ac_objext"
19883 if { (eval echo "$as_me:19883: \"$ac_compile\"") >&5
19884   (eval $ac_compile) 2>&5
19885   ac_status=$?
19886   echo "$as_me:19886: \$? = $ac_status" >&5
19887   (exit "$ac_status"); } &&
19888          { ac_try='test -s "conftest.$ac_objext"'
19889   { (eval echo "$as_me:19889: \"$ac_try\"") >&5
19890   (eval $ac_try) 2>&5
19891   ac_status=$?
19892   echo "$as_me:19892: \$? = $ac_status" >&5
19893   (exit "$ac_status"); }; }; then
19894   cf_cv_wchar_t=yes
19895 else
19896   echo "$as_me: failed program was:" >&5
19897 cat "conftest.$ac_ext" >&5
19898 cf_cv_wchar_t=unknown
19899 fi
19900 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19901 fi
19902 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19903 fi
19904 echo "$as_me:19904: result: $cf_cv_wchar_t" >&5
19905 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19906
19907 if test "$cf_cv_wchar_t" = yes ; then
19908
19909 cat >>confdefs.h <<\EOF
19910 #define NEED_WCHAR_H 1
19911 EOF
19912
19913         NEED_WCHAR_H=1
19914 fi
19915
19916 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19917 if test "$cf_cv_wchar_t" = unknown ; then
19918         NCURSES_WCHAR_T=1
19919 fi
19920
19921 # if we find wchar_t in either place, use substitution to provide a fallback.
19922 if test "$cf_cv_wchar_t" != unknown ; then
19923         NCURSES_OK_WCHAR_T=1
19924 fi
19925
19926 # This is needed on Tru64 5.0 to declare wint_t
19927 echo "$as_me:19927: checking if we must include wchar.h to declare wint_t" >&5
19928 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19929 if test "${cf_cv_wint_t+set}" = set; then
19930   echo $ECHO_N "(cached) $ECHO_C" >&6
19931 else
19932
19933 cat >"conftest.$ac_ext" <<_ACEOF
19934 #line 19934 "configure"
19935 #include "confdefs.h"
19936
19937 #include <stdlib.h>
19938 #include <stdarg.h>
19939 #include <stdio.h>
19940 #ifdef HAVE_LIBUTF8_H
19941 #include <libutf8.h>
19942 #endif
19943 int
19944 main (void)
19945 {
19946 wint_t state
19947   ;
19948   return 0;
19949 }
19950 _ACEOF
19951 rm -f "conftest.$ac_objext"
19952 if { (eval echo "$as_me:19952: \"$ac_compile\"") >&5
19953   (eval $ac_compile) 2>&5
19954   ac_status=$?
19955   echo "$as_me:19955: \$? = $ac_status" >&5
19956   (exit "$ac_status"); } &&
19957          { ac_try='test -s "conftest.$ac_objext"'
19958   { (eval echo "$as_me:19958: \"$ac_try\"") >&5
19959   (eval $ac_try) 2>&5
19960   ac_status=$?
19961   echo "$as_me:19961: \$? = $ac_status" >&5
19962   (exit "$ac_status"); }; }; then
19963   cf_cv_wint_t=no
19964 else
19965   echo "$as_me: failed program was:" >&5
19966 cat "conftest.$ac_ext" >&5
19967 cat >"conftest.$ac_ext" <<_ACEOF
19968 #line 19968 "configure"
19969 #include "confdefs.h"
19970
19971 #include <stdlib.h>
19972 #include <stdarg.h>
19973 #include <stdio.h>
19974 #include <wchar.h>
19975 #ifdef HAVE_LIBUTF8_H
19976 #include <libutf8.h>
19977 #endif
19978 int
19979 main (void)
19980 {
19981 wint_t value
19982   ;
19983   return 0;
19984 }
19985 _ACEOF
19986 rm -f "conftest.$ac_objext"
19987 if { (eval echo "$as_me:19987: \"$ac_compile\"") >&5
19988   (eval $ac_compile) 2>&5
19989   ac_status=$?
19990   echo "$as_me:19990: \$? = $ac_status" >&5
19991   (exit "$ac_status"); } &&
19992          { ac_try='test -s "conftest.$ac_objext"'
19993   { (eval echo "$as_me:19993: \"$ac_try\"") >&5
19994   (eval $ac_try) 2>&5
19995   ac_status=$?
19996   echo "$as_me:19996: \$? = $ac_status" >&5
19997   (exit "$ac_status"); }; }; then
19998   cf_cv_wint_t=yes
19999 else
20000   echo "$as_me: failed program was:" >&5
20001 cat "conftest.$ac_ext" >&5
20002 cf_cv_wint_t=unknown
20003 fi
20004 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20005 fi
20006 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20007 fi
20008 echo "$as_me:20008: result: $cf_cv_wint_t" >&5
20009 echo "${ECHO_T}$cf_cv_wint_t" >&6
20010
20011 if test "$cf_cv_wint_t" = yes ; then
20012
20013 cat >>confdefs.h <<\EOF
20014 #define NEED_WCHAR_H 1
20015 EOF
20016
20017         NEED_WCHAR_H=1
20018 fi
20019
20020 # if we do not find wint_t in either place, use substitution to provide a fallback.
20021 if test "$cf_cv_wint_t" = unknown ; then
20022         NCURSES_WINT_T=1
20023 fi
20024
20025 # if we find wint_t in either place, use substitution to provide a fallback.
20026 if test "$cf_cv_wint_t" != unknown ; then
20027         NCURSES_OK_WINT_T=1
20028 fi
20029
20030         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20031
20032 echo "$as_me:20032: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20033 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20034 cat >"conftest.$ac_ext" <<_ACEOF
20035 #line 20035 "configure"
20036 #include "confdefs.h"
20037
20038 #ifndef _XOPEN_SOURCE_EXTENDED
20039 #define _XOPEN_SOURCE_EXTENDED
20040 #endif
20041 #include <${cf_cv_ncurses_header:-curses.h}>
20042 int
20043 main (void)
20044 {
20045
20046 mbstate_t foo
20047
20048   ;
20049   return 0;
20050 }
20051 _ACEOF
20052 rm -f "conftest.$ac_objext"
20053 if { (eval echo "$as_me:20053: \"$ac_compile\"") >&5
20054   (eval $ac_compile) 2>&5
20055   ac_status=$?
20056   echo "$as_me:20056: \$? = $ac_status" >&5
20057   (exit "$ac_status"); } &&
20058          { ac_try='test -s "conftest.$ac_objext"'
20059   { (eval echo "$as_me:20059: \"$ac_try\"") >&5
20060   (eval $ac_try) 2>&5
20061   ac_status=$?
20062   echo "$as_me:20062: \$? = $ac_status" >&5
20063   (exit "$ac_status"); }; }; then
20064   cf_result=yes
20065 else
20066   echo "$as_me: failed program was:" >&5
20067 cat "conftest.$ac_ext" >&5
20068 cf_result=no
20069 fi
20070 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20071 echo "$as_me:20071: result: $cf_result" >&5
20072 echo "${ECHO_T}$cf_result" >&6
20073 if test "$cf_result" = yes ; then
20074
20075 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20076
20077 cat >>confdefs.h <<EOF
20078 #define $cf_result 1
20079 EOF
20080
20081 else
20082
20083 cat >>confdefs.h <<EOF
20084 #define mbstate_t long
20085 EOF
20086
20087 fi
20088
20089         fi
20090
20091         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20092
20093 echo "$as_me:20093: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20094 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20095 cat >"conftest.$ac_ext" <<_ACEOF
20096 #line 20096 "configure"
20097 #include "confdefs.h"
20098
20099 #ifndef _XOPEN_SOURCE_EXTENDED
20100 #define _XOPEN_SOURCE_EXTENDED
20101 #endif
20102 #include <${cf_cv_ncurses_header:-curses.h}>
20103 int
20104 main (void)
20105 {
20106
20107 wchar_t foo
20108
20109   ;
20110   return 0;
20111 }
20112 _ACEOF
20113 rm -f "conftest.$ac_objext"
20114 if { (eval echo "$as_me:20114: \"$ac_compile\"") >&5
20115   (eval $ac_compile) 2>&5
20116   ac_status=$?
20117   echo "$as_me:20117: \$? = $ac_status" >&5
20118   (exit "$ac_status"); } &&
20119          { ac_try='test -s "conftest.$ac_objext"'
20120   { (eval echo "$as_me:20120: \"$ac_try\"") >&5
20121   (eval $ac_try) 2>&5
20122   ac_status=$?
20123   echo "$as_me:20123: \$? = $ac_status" >&5
20124   (exit "$ac_status"); }; }; then
20125   cf_result=yes
20126 else
20127   echo "$as_me: failed program was:" >&5
20128 cat "conftest.$ac_ext" >&5
20129 cf_result=no
20130 fi
20131 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20132 echo "$as_me:20132: result: $cf_result" >&5
20133 echo "${ECHO_T}$cf_result" >&6
20134 if test "$cf_result" = yes ; then
20135
20136 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20137
20138 cat >>confdefs.h <<EOF
20139 #define $cf_result 1
20140 EOF
20141
20142 else
20143
20144 cat >>confdefs.h <<EOF
20145 #define wchar_t long
20146 EOF
20147
20148 fi
20149
20150         fi
20151
20152         if test "$NCURSES_OK_WINT_T" = 0 ; then
20153
20154 echo "$as_me:20154: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20155 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20156 cat >"conftest.$ac_ext" <<_ACEOF
20157 #line 20157 "configure"
20158 #include "confdefs.h"
20159
20160 #ifndef _XOPEN_SOURCE_EXTENDED
20161 #define _XOPEN_SOURCE_EXTENDED
20162 #endif
20163 #include <${cf_cv_ncurses_header:-curses.h}>
20164 int
20165 main (void)
20166 {
20167
20168 wint_t foo
20169
20170   ;
20171   return 0;
20172 }
20173 _ACEOF
20174 rm -f "conftest.$ac_objext"
20175 if { (eval echo "$as_me:20175: \"$ac_compile\"") >&5
20176   (eval $ac_compile) 2>&5
20177   ac_status=$?
20178   echo "$as_me:20178: \$? = $ac_status" >&5
20179   (exit "$ac_status"); } &&
20180          { ac_try='test -s "conftest.$ac_objext"'
20181   { (eval echo "$as_me:20181: \"$ac_try\"") >&5
20182   (eval $ac_try) 2>&5
20183   ac_status=$?
20184   echo "$as_me:20184: \$? = $ac_status" >&5
20185   (exit "$ac_status"); }; }; then
20186   cf_result=yes
20187 else
20188   echo "$as_me: failed program was:" >&5
20189 cat "conftest.$ac_ext" >&5
20190 cf_result=no
20191 fi
20192 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20193 echo "$as_me:20193: result: $cf_result" >&5
20194 echo "${ECHO_T}$cf_result" >&6
20195 if test "$cf_result" = yes ; then
20196
20197 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20198
20199 cat >>confdefs.h <<EOF
20200 #define $cf_result 1
20201 EOF
20202
20203 else
20204
20205 cat >>confdefs.h <<EOF
20206 #define wint_t long
20207 EOF
20208
20209 fi
20210
20211         fi
20212 fi
20213
20214 for cf_data in \
20215 TABSIZE \
20216 curscr \
20217 ospeed \
20218 boolnames \
20219 boolfnames \
20220 ttytype
20221 do
20222 echo "$as_me:20222: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20223 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20224
20225 cat >"conftest.$ac_ext" <<_ACEOF
20226 #line 20226 "configure"
20227 #include "confdefs.h"
20228
20229 #ifdef HAVE_XCURSES
20230 #include <xcurses.h>
20231 char * XCursesProgramName = "test";
20232 #else
20233 #include <${cf_cv_ncurses_header:-curses.h}>
20234 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20235 #include <ncursesw/term.h>
20236 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20237 #include <ncurses/term.h>
20238 #elif defined(HAVE_TERM_H)
20239 #include <term.h>
20240 #endif
20241 #endif
20242
20243 int
20244 main (void)
20245 {
20246
20247 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20248         const void *foo = (const void *)($cf_data);
20249 #else
20250         const void *foo = &($cf_data);
20251 #endif
20252         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20253
20254   ;
20255   return 0;
20256 }
20257 _ACEOF
20258 rm -f "conftest.$ac_objext"
20259 if { (eval echo "$as_me:20259: \"$ac_compile\"") >&5
20260   (eval $ac_compile) 2>&5
20261   ac_status=$?
20262   echo "$as_me:20262: \$? = $ac_status" >&5
20263   (exit "$ac_status"); } &&
20264          { ac_try='test -s "conftest.$ac_objext"'
20265   { (eval echo "$as_me:20265: \"$ac_try\"") >&5
20266   (eval $ac_try) 2>&5
20267   ac_status=$?
20268   echo "$as_me:20268: \$? = $ac_status" >&5
20269   (exit "$ac_status"); }; }; then
20270   cf_result=yes
20271
20272 else
20273   echo "$as_me: failed program was:" >&5
20274 cat "conftest.$ac_ext" >&5
20275 cf_result=no
20276 fi
20277 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20278 echo "$as_me:20278: result: $cf_result" >&5
20279 echo "${ECHO_T}$cf_result" >&6
20280
20281 if test "$cf_result" = yes ; then
20282
20283 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20284
20285         cat >>confdefs.h <<EOF
20286 #define $cf_result 1
20287 EOF
20288
20289 else
20290         echo "$as_me:20290: checking for data $cf_data in library" >&5
20291 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20292         # BSD linkers insist on making weak linkage, but resolve at runtime.
20293         if test "$cross_compiling" = yes; then
20294
20295         # cross-compiling
20296         cat >"conftest.$ac_ext" <<_ACEOF
20297 #line 20297 "configure"
20298 #include "confdefs.h"
20299
20300 #ifdef HAVE_XCURSES
20301 #include <xcurses.h>
20302 char * XCursesProgramName = "test";
20303 #else
20304 #include <${cf_cv_ncurses_header:-curses.h}>
20305 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20306 #include <ncursesw/term.h>
20307 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20308 #include <ncurses/term.h>
20309 #elif defined(HAVE_TERM_H)
20310 #include <term.h>
20311 #endif
20312 #endif
20313
20314 extern char $cf_data;
20315 int
20316 main (void)
20317 {
20318
20319         do {
20320
20321 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20322         const void *foo = (const void *)($cf_data);
20323 #else
20324         const void *foo = &($cf_data);
20325 #endif
20326         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20327
20328                 ${cf_cv_main_return:-return}(foo == 0);
20329         } while (0)
20330
20331   ;
20332   return 0;
20333 }
20334 _ACEOF
20335 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20336 if { (eval echo "$as_me:20336: \"$ac_link\"") >&5
20337   (eval $ac_link) 2>&5
20338   ac_status=$?
20339   echo "$as_me:20339: \$? = $ac_status" >&5
20340   (exit "$ac_status"); } &&
20341          { ac_try='test -s "conftest$ac_exeext"'
20342   { (eval echo "$as_me:20342: \"$ac_try\"") >&5
20343   (eval $ac_try) 2>&5
20344   ac_status=$?
20345   echo "$as_me:20345: \$? = $ac_status" >&5
20346   (exit "$ac_status"); }; }; then
20347   cf_result=yes
20348 else
20349   echo "$as_me: failed program was:" >&5
20350 cat "conftest.$ac_ext" >&5
20351 cf_result=no
20352 fi
20353 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20354
20355 else
20356   cat >"conftest.$ac_ext" <<_ACEOF
20357 #line 20357 "configure"
20358 #include "confdefs.h"
20359
20360 #ifdef HAVE_XCURSES
20361 #include <xcurses.h>
20362 char * XCursesProgramName = "test";
20363 #else
20364 #include <${cf_cv_ncurses_header:-curses.h}>
20365 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20366 #include <ncursesw/term.h>
20367 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20368 #include <ncurses/term.h>
20369 #elif defined(HAVE_TERM_H)
20370 #include <term.h>
20371 #endif
20372 #endif
20373
20374 extern char $cf_data;
20375 int main(void)
20376 {
20377
20378 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20379         const void *foo = (const void *)($cf_data);
20380 #else
20381         const void *foo = &($cf_data);
20382 #endif
20383         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20384
20385         ${cf_cv_main_return:-return}(foo == 0);
20386 }
20387 _ACEOF
20388 rm -f "conftest$ac_exeext"
20389 if { (eval echo "$as_me:20389: \"$ac_link\"") >&5
20390   (eval $ac_link) 2>&5
20391   ac_status=$?
20392   echo "$as_me:20392: \$? = $ac_status" >&5
20393   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20394   { (eval echo "$as_me:20394: \"$ac_try\"") >&5
20395   (eval $ac_try) 2>&5
20396   ac_status=$?
20397   echo "$as_me:20397: \$? = $ac_status" >&5
20398   (exit "$ac_status"); }; }; then
20399   cf_result=yes
20400
20401 else
20402   echo "$as_me: program exited with status $ac_status" >&5
20403 echo "$as_me: failed program was:" >&5
20404 cat "conftest.$ac_ext" >&5
20405 cf_result=no
20406 fi
20407 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20408 fi
20409         echo "$as_me:20409: result: $cf_result" >&5
20410 echo "${ECHO_T}$cf_result" >&6
20411         if test "$cf_result" = yes ; then
20412
20413 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20414
20415                 cat >>confdefs.h <<EOF
20416 #define $cf_result 1
20417 EOF
20418
20419                 # do not exit loop here, since we prefer system's declarations
20420         fi
20421 fi
20422 done
20423
20424 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20425 then
20426         echo "$as_me:20426: checking for X" >&5
20427 echo $ECHO_N "checking for X... $ECHO_C" >&6
20428
20429 # Check whether --with-x or --without-x was given.
20430 if test "${with_x+set}" = set; then
20431   withval="$with_x"
20432
20433 fi;
20434 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20435 if test "x$with_x" = xno; then
20436   # The user explicitly disabled X.
20437   have_x=disabled
20438 else
20439   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20440     # Both variables are already set.
20441     have_x=yes
20442   else
20443     if test "${ac_cv_have_x+set}" = set; then
20444   echo $ECHO_N "(cached) $ECHO_C" >&6
20445 else
20446   # One or both of the vars are not set, and there is no cached value.
20447 ac_x_includes=no ac_x_libraries=no
20448 rm -fr conftest.dir
20449 if mkdir conftest.dir; then
20450   cd conftest.dir
20451   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20452   cat >Imakefile <<'EOF'
20453 acfindx:
20454         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20455 EOF
20456   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20457     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20458     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20459     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20460     for ac_extension in a so sl dylib dll; do
20461       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20462          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20463         ac_im_usrlibdir=$ac_im_libdir; break
20464       fi
20465     done
20466     # Screen out bogus values from the imake configuration.  They are
20467     # bogus both because they are the default anyway, and because
20468     # using them would break gcc on systems where it needs fixed includes.
20469     case $ac_im_incroot in
20470         /usr/include) ;;
20471         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20472     esac
20473     case $ac_im_usrlibdir in
20474         /usr/lib | /lib) ;;
20475         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20476     esac
20477   fi
20478   cd ..
20479   rm -fr conftest.dir
20480 fi
20481
20482 # Standard set of common directories for X headers.
20483 # Check X11 before X11Rn because it is often a symlink to the current release.
20484 ac_x_header_dirs='
20485 /usr/X11/include
20486 /usr/X11R7/include
20487 /usr/X11R6/include
20488 /usr/X11R5/include
20489 /usr/X11R4/include
20490
20491 /opt/local/include
20492 /opt/X11/include
20493
20494 /usr/include/X11
20495 /usr/include/X11R7
20496 /usr/include/X11R6
20497 /usr/include/X11R5
20498 /usr/include/X11R4
20499
20500 /usr/local/X11/include
20501 /usr/local/X11R7/include
20502 /usr/local/X11R6/include
20503 /usr/local/X11R5/include
20504 /usr/local/X11R4/include
20505
20506 /usr/local/include/X11
20507 /usr/local/include/X11R7
20508 /usr/local/include/X11R6
20509 /usr/local/include/X11R5
20510 /usr/local/include/X11R4
20511
20512 /usr/X386/include
20513 /usr/x386/include
20514 /usr/XFree86/include/X11
20515
20516 /usr/include
20517 /usr/local/include
20518 /usr/unsupported/include
20519 /usr/athena/include
20520 /usr/local/x11r5/include
20521 /usr/lpp/Xamples/include
20522
20523 /usr/openwin/include
20524 /usr/openwin/share/include'
20525
20526 if test "$ac_x_includes" = no; then
20527   # Guess where to find include files, by looking for Intrinsic.h.
20528   # First, try using that file with no special directory specified.
20529   cat >"conftest.$ac_ext" <<_ACEOF
20530 #line 20530 "configure"
20531 #include "confdefs.h"
20532 #include <X11/Intrinsic.h>
20533 _ACEOF
20534 if { (eval echo "$as_me:20534: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20535   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20536   ac_status=$?
20537   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20538   rm -f conftest.er1
20539   cat conftest.err >&5
20540   echo "$as_me:20540: \$? = $ac_status" >&5
20541   (exit "$ac_status"); } >/dev/null; then
20542   if test -s conftest.err; then
20543     ac_cpp_err=$ac_c_preproc_warn_flag
20544   else
20545     ac_cpp_err=
20546   fi
20547 else
20548   ac_cpp_err=yes
20549 fi
20550 if test -z "$ac_cpp_err"; then
20551   # We can compile using X headers with no special include directory.
20552 ac_x_includes=
20553 else
20554   echo "$as_me: failed program was:" >&5
20555   cat "conftest.$ac_ext" >&5
20556   for ac_dir in $ac_x_header_dirs; do
20557   if test -r "$ac_dir/X11/Intrinsic.h"; then
20558     ac_x_includes=$ac_dir
20559     break
20560   fi
20561 done
20562 fi
20563 rm -f conftest.err "conftest.$ac_ext"
20564 fi # $ac_x_includes = no
20565
20566 if test "$ac_x_libraries" = no; then
20567   # Check for the libraries.
20568   # See if we find them without any special options.
20569   # Don't add to $LIBS permanently.
20570   ac_save_LIBS=$LIBS
20571   LIBS="-lXt $LIBS"
20572   cat >"conftest.$ac_ext" <<_ACEOF
20573 #line 20573 "configure"
20574 #include "confdefs.h"
20575 #include <X11/Intrinsic.h>
20576 int
20577 main (void)
20578 {
20579 XtMalloc (0)
20580   ;
20581   return 0;
20582 }
20583 _ACEOF
20584 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20585 if { (eval echo "$as_me:20585: \"$ac_link\"") >&5
20586   (eval $ac_link) 2>&5
20587   ac_status=$?
20588   echo "$as_me:20588: \$? = $ac_status" >&5
20589   (exit "$ac_status"); } &&
20590          { ac_try='test -s "conftest$ac_exeext"'
20591   { (eval echo "$as_me:20591: \"$ac_try\"") >&5
20592   (eval $ac_try) 2>&5
20593   ac_status=$?
20594   echo "$as_me:20594: \$? = $ac_status" >&5
20595   (exit "$ac_status"); }; }; then
20596   LIBS=$ac_save_LIBS
20597 # We can link X programs with no special library path.
20598 ac_x_libraries=
20599 else
20600   echo "$as_me: failed program was:" >&5
20601 cat "conftest.$ac_ext" >&5
20602 LIBS=$ac_save_LIBS
20603 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20604 do
20605   # Don't even attempt the hair of trying to link an X program!
20606   for ac_extension in a so sl dylib dll; do
20607     if test -r "$ac_dir/libXt.$ac_extension"; then
20608       ac_x_libraries=$ac_dir
20609       break 2
20610     fi
20611   done
20612 done
20613 fi
20614 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20615 fi # $ac_x_libraries = no
20616
20617 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20618   # Didn't find X anywhere.  Cache the known absence of X.
20619   ac_cv_have_x="have_x=no"
20620 else
20621   # Record where we found X for the cache.
20622   ac_cv_have_x="have_x=yes \
20623                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20624 fi
20625 fi
20626
20627   fi
20628   eval "$ac_cv_have_x"
20629 fi # $with_x != no
20630
20631 if test "$have_x" != yes; then
20632   echo "$as_me:20632: result: $have_x" >&5
20633 echo "${ECHO_T}$have_x" >&6
20634   no_x=yes
20635 else
20636   # If each of the values was on the command line, it overrides each guess.
20637   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20638   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20639   # Update the cache value to reflect the command line values.
20640   ac_cv_have_x="have_x=yes \
20641                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20642   echo "$as_me:20642: result: libraries $x_libraries, headers $x_includes" >&5
20643 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20644 fi
20645
20646         if test "$no_x" = yes; then
20647   # Not all programs may use this symbol, but it does not hurt to define it.
20648
20649 cat >>confdefs.h <<\EOF
20650 #define X_DISPLAY_MISSING 1
20651 EOF
20652
20653   X_CFLAGS=
20654   X_PRE_LIBS=
20655   X_LIBS=
20656   X_EXTRA_LIBS=
20657 else
20658   if test -n "$x_includes"; then
20659     X_CFLAGS="$X_CFLAGS -I$x_includes"
20660   fi
20661
20662   # It would also be nice to do this for all -L options, not just this one.
20663   if test -n "$x_libraries"; then
20664     X_LIBS="$X_LIBS -L$x_libraries"
20665     # For Solaris; some versions of Sun CC require a space after -R and
20666     # others require no space.  Words are not sufficient . . . .
20667     case `(uname -sr) 2>/dev/null` in
20668     "SunOS 5"*)
20669       echo "$as_me:20669: checking whether -R must be followed by a space" >&5
20670 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20671       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20672       cat >"conftest.$ac_ext" <<_ACEOF
20673 #line 20673 "configure"
20674 #include "confdefs.h"
20675
20676 int
20677 main (void)
20678 {
20679
20680   ;
20681   return 0;
20682 }
20683 _ACEOF
20684 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20685 if { (eval echo "$as_me:20685: \"$ac_link\"") >&5
20686   (eval $ac_link) 2>&5
20687   ac_status=$?
20688   echo "$as_me:20688: \$? = $ac_status" >&5
20689   (exit "$ac_status"); } &&
20690          { ac_try='test -s "conftest$ac_exeext"'
20691   { (eval echo "$as_me:20691: \"$ac_try\"") >&5
20692   (eval $ac_try) 2>&5
20693   ac_status=$?
20694   echo "$as_me:20694: \$? = $ac_status" >&5
20695   (exit "$ac_status"); }; }; then
20696   ac_R_nospace=yes
20697 else
20698   echo "$as_me: failed program was:" >&5
20699 cat "conftest.$ac_ext" >&5
20700 ac_R_nospace=no
20701 fi
20702 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20703       if test $ac_R_nospace = yes; then
20704         echo "$as_me:20704: result: no" >&5
20705 echo "${ECHO_T}no" >&6
20706         X_LIBS="$X_LIBS -R$x_libraries"
20707       else
20708         LIBS="$ac_xsave_LIBS -R $x_libraries"
20709         cat >"conftest.$ac_ext" <<_ACEOF
20710 #line 20710 "configure"
20711 #include "confdefs.h"
20712
20713 int
20714 main (void)
20715 {
20716
20717   ;
20718   return 0;
20719 }
20720 _ACEOF
20721 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20722 if { (eval echo "$as_me:20722: \"$ac_link\"") >&5
20723   (eval $ac_link) 2>&5
20724   ac_status=$?
20725   echo "$as_me:20725: \$? = $ac_status" >&5
20726   (exit "$ac_status"); } &&
20727          { ac_try='test -s "conftest$ac_exeext"'
20728   { (eval echo "$as_me:20728: \"$ac_try\"") >&5
20729   (eval $ac_try) 2>&5
20730   ac_status=$?
20731   echo "$as_me:20731: \$? = $ac_status" >&5
20732   (exit "$ac_status"); }; }; then
20733   ac_R_space=yes
20734 else
20735   echo "$as_me: failed program was:" >&5
20736 cat "conftest.$ac_ext" >&5
20737 ac_R_space=no
20738 fi
20739 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20740         if test $ac_R_space = yes; then
20741           echo "$as_me:20741: result: yes" >&5
20742 echo "${ECHO_T}yes" >&6
20743           X_LIBS="$X_LIBS -R $x_libraries"
20744         else
20745           echo "$as_me:20745: result: neither works" >&5
20746 echo "${ECHO_T}neither works" >&6
20747         fi
20748       fi
20749       LIBS=$ac_xsave_LIBS
20750     esac
20751   fi
20752
20753   # Check for system-dependent libraries X programs must link with.
20754   # Do this before checking for the system-independent R6 libraries
20755   # (-lICE), since we may need -lsocket or whatever for X linking.
20756
20757   if test "$ISC" = yes; then
20758     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20759   else
20760     # Martyn Johnson says this is needed for Ultrix, if the X
20761     # libraries were built with DECnet support.  And Karl Berry says
20762     # the Alpha needs dnet_stub (dnet does not exist).
20763     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20764     cat >"conftest.$ac_ext" <<_ACEOF
20765 #line 20765 "configure"
20766 #include "confdefs.h"
20767
20768 /* Override any gcc2 internal prototype to avoid an error.  */
20769 #ifdef __cplusplus
20770 extern "C"
20771 #endif
20772 /* We use char because int might match the return type of a gcc2
20773    builtin and then its argument prototype would still apply.  */
20774 char XOpenDisplay ();
20775 int
20776 main (void)
20777 {
20778 XOpenDisplay ();
20779   ;
20780   return 0;
20781 }
20782 _ACEOF
20783 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20784 if { (eval echo "$as_me:20784: \"$ac_link\"") >&5
20785   (eval $ac_link) 2>&5
20786   ac_status=$?
20787   echo "$as_me:20787: \$? = $ac_status" >&5
20788   (exit "$ac_status"); } &&
20789          { ac_try='test -s "conftest$ac_exeext"'
20790   { (eval echo "$as_me:20790: \"$ac_try\"") >&5
20791   (eval $ac_try) 2>&5
20792   ac_status=$?
20793   echo "$as_me:20793: \$? = $ac_status" >&5
20794   (exit "$ac_status"); }; }; then
20795   :
20796 else
20797   echo "$as_me: failed program was:" >&5
20798 cat "conftest.$ac_ext" >&5
20799 echo "$as_me:20799: checking for dnet_ntoa in -ldnet" >&5
20800 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20801 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20802   echo $ECHO_N "(cached) $ECHO_C" >&6
20803 else
20804   ac_check_lib_save_LIBS=$LIBS
20805 LIBS="-ldnet  $LIBS"
20806 cat >"conftest.$ac_ext" <<_ACEOF
20807 #line 20807 "configure"
20808 #include "confdefs.h"
20809
20810 /* Override any gcc2 internal prototype to avoid an error.  */
20811 #ifdef __cplusplus
20812 extern "C"
20813 #endif
20814 /* We use char because int might match the return type of a gcc2
20815    builtin and then its argument prototype would still apply.  */
20816 char dnet_ntoa ();
20817 int
20818 main (void)
20819 {
20820 dnet_ntoa ();
20821   ;
20822   return 0;
20823 }
20824 _ACEOF
20825 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20826 if { (eval echo "$as_me:20826: \"$ac_link\"") >&5
20827   (eval $ac_link) 2>&5
20828   ac_status=$?
20829   echo "$as_me:20829: \$? = $ac_status" >&5
20830   (exit "$ac_status"); } &&
20831          { ac_try='test -s "conftest$ac_exeext"'
20832   { (eval echo "$as_me:20832: \"$ac_try\"") >&5
20833   (eval $ac_try) 2>&5
20834   ac_status=$?
20835   echo "$as_me:20835: \$? = $ac_status" >&5
20836   (exit "$ac_status"); }; }; then
20837   ac_cv_lib_dnet_dnet_ntoa=yes
20838 else
20839   echo "$as_me: failed program was:" >&5
20840 cat "conftest.$ac_ext" >&5
20841 ac_cv_lib_dnet_dnet_ntoa=no
20842 fi
20843 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20844 LIBS=$ac_check_lib_save_LIBS
20845 fi
20846 echo "$as_me:20846: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20847 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20848 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
20849   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20850 fi
20851
20852     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20853       echo "$as_me:20853: checking for dnet_ntoa in -ldnet_stub" >&5
20854 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20855 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20856   echo $ECHO_N "(cached) $ECHO_C" >&6
20857 else
20858   ac_check_lib_save_LIBS=$LIBS
20859 LIBS="-ldnet_stub  $LIBS"
20860 cat >"conftest.$ac_ext" <<_ACEOF
20861 #line 20861 "configure"
20862 #include "confdefs.h"
20863
20864 /* Override any gcc2 internal prototype to avoid an error.  */
20865 #ifdef __cplusplus
20866 extern "C"
20867 #endif
20868 /* We use char because int might match the return type of a gcc2
20869    builtin and then its argument prototype would still apply.  */
20870 char dnet_ntoa ();
20871 int
20872 main (void)
20873 {
20874 dnet_ntoa ();
20875   ;
20876   return 0;
20877 }
20878 _ACEOF
20879 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20880 if { (eval echo "$as_me:20880: \"$ac_link\"") >&5
20881   (eval $ac_link) 2>&5
20882   ac_status=$?
20883   echo "$as_me:20883: \$? = $ac_status" >&5
20884   (exit "$ac_status"); } &&
20885          { ac_try='test -s "conftest$ac_exeext"'
20886   { (eval echo "$as_me:20886: \"$ac_try\"") >&5
20887   (eval $ac_try) 2>&5
20888   ac_status=$?
20889   echo "$as_me:20889: \$? = $ac_status" >&5
20890   (exit "$ac_status"); }; }; then
20891   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20892 else
20893   echo "$as_me: failed program was:" >&5
20894 cat "conftest.$ac_ext" >&5
20895 ac_cv_lib_dnet_stub_dnet_ntoa=no
20896 fi
20897 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20898 LIBS=$ac_check_lib_save_LIBS
20899 fi
20900 echo "$as_me:20900: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20901 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20902 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
20903   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20904 fi
20905
20906     fi
20907 fi
20908 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20909     LIBS="$ac_xsave_LIBS"
20910
20911     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20912     # to get the SysV transport functions.
20913     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20914     # needs -lnsl.
20915     # The nsl library prevents programs from opening the X display
20916     # on Irix 5.2, according to T.E. Dickey.
20917     # The functions gethostbyname, getservbyname, and inet_addr are
20918     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20919     echo "$as_me:20919: checking for gethostbyname" >&5
20920 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20921 if test "${ac_cv_func_gethostbyname+set}" = set; then
20922   echo $ECHO_N "(cached) $ECHO_C" >&6
20923 else
20924   cat >"conftest.$ac_ext" <<_ACEOF
20925 #line 20925 "configure"
20926 #include "confdefs.h"
20927 #define gethostbyname autoconf_temporary
20928 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20929 #undef gethostbyname
20930
20931 #ifdef __cplusplus
20932 extern "C"
20933 #endif
20934
20935 /* We use char because int might match the return type of a gcc2
20936    builtin and then its argument prototype would still apply.  */
20937 char gethostbyname (void);
20938
20939 int
20940 main (void)
20941 {
20942
20943 /* The GNU C library defines stubs for functions which it implements
20944     to always fail with ENOSYS.  Some functions are actually named
20945     something starting with __ and the normal name is an alias.  */
20946 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
20947 #error found stub for gethostbyname
20948 #endif
20949
20950         return gethostbyname ();
20951   ;
20952   return 0;
20953 }
20954 _ACEOF
20955 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20956 if { (eval echo "$as_me:20956: \"$ac_link\"") >&5
20957   (eval $ac_link) 2>&5
20958   ac_status=$?
20959   echo "$as_me:20959: \$? = $ac_status" >&5
20960   (exit "$ac_status"); } &&
20961          { ac_try='test -s "conftest$ac_exeext"'
20962   { (eval echo "$as_me:20962: \"$ac_try\"") >&5
20963   (eval $ac_try) 2>&5
20964   ac_status=$?
20965   echo "$as_me:20965: \$? = $ac_status" >&5
20966   (exit "$ac_status"); }; }; then
20967   ac_cv_func_gethostbyname=yes
20968 else
20969   echo "$as_me: failed program was:" >&5
20970 cat "conftest.$ac_ext" >&5
20971 ac_cv_func_gethostbyname=no
20972 fi
20973 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20974 fi
20975 echo "$as_me:20975: result: $ac_cv_func_gethostbyname" >&5
20976 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
20977
20978     if test $ac_cv_func_gethostbyname = no; then
20979       echo "$as_me:20979: checking for gethostbyname in -lnsl" >&5
20980 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
20981 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
20982   echo $ECHO_N "(cached) $ECHO_C" >&6
20983 else
20984   ac_check_lib_save_LIBS=$LIBS
20985 LIBS="-lnsl  $LIBS"
20986 cat >"conftest.$ac_ext" <<_ACEOF
20987 #line 20987 "configure"
20988 #include "confdefs.h"
20989
20990 /* Override any gcc2 internal prototype to avoid an error.  */
20991 #ifdef __cplusplus
20992 extern "C"
20993 #endif
20994 /* We use char because int might match the return type of a gcc2
20995    builtin and then its argument prototype would still apply.  */
20996 char gethostbyname ();
20997 int
20998 main (void)
20999 {
21000 gethostbyname ();
21001   ;
21002   return 0;
21003 }
21004 _ACEOF
21005 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21006 if { (eval echo "$as_me:21006: \"$ac_link\"") >&5
21007   (eval $ac_link) 2>&5
21008   ac_status=$?
21009   echo "$as_me:21009: \$? = $ac_status" >&5
21010   (exit "$ac_status"); } &&
21011          { ac_try='test -s "conftest$ac_exeext"'
21012   { (eval echo "$as_me:21012: \"$ac_try\"") >&5
21013   (eval $ac_try) 2>&5
21014   ac_status=$?
21015   echo "$as_me:21015: \$? = $ac_status" >&5
21016   (exit "$ac_status"); }; }; then
21017   ac_cv_lib_nsl_gethostbyname=yes
21018 else
21019   echo "$as_me: failed program was:" >&5
21020 cat "conftest.$ac_ext" >&5
21021 ac_cv_lib_nsl_gethostbyname=no
21022 fi
21023 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21024 LIBS=$ac_check_lib_save_LIBS
21025 fi
21026 echo "$as_me:21026: result: $ac_cv_lib_nsl_gethostbyname" >&5
21027 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21028 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21029   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21030 fi
21031
21032       if test $ac_cv_lib_nsl_gethostbyname = no; then
21033         echo "$as_me:21033: checking for gethostbyname in -lbsd" >&5
21034 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21035 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21036   echo $ECHO_N "(cached) $ECHO_C" >&6
21037 else
21038   ac_check_lib_save_LIBS=$LIBS
21039 LIBS="-lbsd  $LIBS"
21040 cat >"conftest.$ac_ext" <<_ACEOF
21041 #line 21041 "configure"
21042 #include "confdefs.h"
21043
21044 /* Override any gcc2 internal prototype to avoid an error.  */
21045 #ifdef __cplusplus
21046 extern "C"
21047 #endif
21048 /* We use char because int might match the return type of a gcc2
21049    builtin and then its argument prototype would still apply.  */
21050 char gethostbyname ();
21051 int
21052 main (void)
21053 {
21054 gethostbyname ();
21055   ;
21056   return 0;
21057 }
21058 _ACEOF
21059 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21060 if { (eval echo "$as_me:21060: \"$ac_link\"") >&5
21061   (eval $ac_link) 2>&5
21062   ac_status=$?
21063   echo "$as_me:21063: \$? = $ac_status" >&5
21064   (exit "$ac_status"); } &&
21065          { ac_try='test -s "conftest$ac_exeext"'
21066   { (eval echo "$as_me:21066: \"$ac_try\"") >&5
21067   (eval $ac_try) 2>&5
21068   ac_status=$?
21069   echo "$as_me:21069: \$? = $ac_status" >&5
21070   (exit "$ac_status"); }; }; then
21071   ac_cv_lib_bsd_gethostbyname=yes
21072 else
21073   echo "$as_me: failed program was:" >&5
21074 cat "conftest.$ac_ext" >&5
21075 ac_cv_lib_bsd_gethostbyname=no
21076 fi
21077 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21078 LIBS=$ac_check_lib_save_LIBS
21079 fi
21080 echo "$as_me:21080: result: $ac_cv_lib_bsd_gethostbyname" >&5
21081 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21082 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21083   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21084 fi
21085
21086       fi
21087     fi
21088
21089     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21090     # socket/setsockopt and other routines are undefined under SCO ODT
21091     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21092     # on later versions), says Simon Leinen: it contains gethostby*
21093     # variants that don't use the nameserver (or something).  -lsocket
21094     # must be given before -lnsl if both are needed.  We assume that
21095     # if connect needs -lnsl, so does gethostbyname.
21096     echo "$as_me:21096: checking for connect" >&5
21097 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21098 if test "${ac_cv_func_connect+set}" = set; then
21099   echo $ECHO_N "(cached) $ECHO_C" >&6
21100 else
21101   cat >"conftest.$ac_ext" <<_ACEOF
21102 #line 21102 "configure"
21103 #include "confdefs.h"
21104 #define connect autoconf_temporary
21105 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21106 #undef connect
21107
21108 #ifdef __cplusplus
21109 extern "C"
21110 #endif
21111
21112 /* We use char because int might match the return type of a gcc2
21113    builtin and then its argument prototype would still apply.  */
21114 char connect (void);
21115
21116 int
21117 main (void)
21118 {
21119
21120 /* The GNU C library defines stubs for functions which it implements
21121     to always fail with ENOSYS.  Some functions are actually named
21122     something starting with __ and the normal name is an alias.  */
21123 #if defined (__stub_connect) || defined (__stub___connect)
21124 #error found stub for connect
21125 #endif
21126
21127         return connect ();
21128   ;
21129   return 0;
21130 }
21131 _ACEOF
21132 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21133 if { (eval echo "$as_me:21133: \"$ac_link\"") >&5
21134   (eval $ac_link) 2>&5
21135   ac_status=$?
21136   echo "$as_me:21136: \$? = $ac_status" >&5
21137   (exit "$ac_status"); } &&
21138          { ac_try='test -s "conftest$ac_exeext"'
21139   { (eval echo "$as_me:21139: \"$ac_try\"") >&5
21140   (eval $ac_try) 2>&5
21141   ac_status=$?
21142   echo "$as_me:21142: \$? = $ac_status" >&5
21143   (exit "$ac_status"); }; }; then
21144   ac_cv_func_connect=yes
21145 else
21146   echo "$as_me: failed program was:" >&5
21147 cat "conftest.$ac_ext" >&5
21148 ac_cv_func_connect=no
21149 fi
21150 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21151 fi
21152 echo "$as_me:21152: result: $ac_cv_func_connect" >&5
21153 echo "${ECHO_T}$ac_cv_func_connect" >&6
21154
21155     if test $ac_cv_func_connect = no; then
21156       echo "$as_me:21156: checking for connect in -lsocket" >&5
21157 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21158 if test "${ac_cv_lib_socket_connect+set}" = set; then
21159   echo $ECHO_N "(cached) $ECHO_C" >&6
21160 else
21161   ac_check_lib_save_LIBS=$LIBS
21162 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21163 cat >"conftest.$ac_ext" <<_ACEOF
21164 #line 21164 "configure"
21165 #include "confdefs.h"
21166
21167 /* Override any gcc2 internal prototype to avoid an error.  */
21168 #ifdef __cplusplus
21169 extern "C"
21170 #endif
21171 /* We use char because int might match the return type of a gcc2
21172    builtin and then its argument prototype would still apply.  */
21173 char connect ();
21174 int
21175 main (void)
21176 {
21177 connect ();
21178   ;
21179   return 0;
21180 }
21181 _ACEOF
21182 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21183 if { (eval echo "$as_me:21183: \"$ac_link\"") >&5
21184   (eval $ac_link) 2>&5
21185   ac_status=$?
21186   echo "$as_me:21186: \$? = $ac_status" >&5
21187   (exit "$ac_status"); } &&
21188          { ac_try='test -s "conftest$ac_exeext"'
21189   { (eval echo "$as_me:21189: \"$ac_try\"") >&5
21190   (eval $ac_try) 2>&5
21191   ac_status=$?
21192   echo "$as_me:21192: \$? = $ac_status" >&5
21193   (exit "$ac_status"); }; }; then
21194   ac_cv_lib_socket_connect=yes
21195 else
21196   echo "$as_me: failed program was:" >&5
21197 cat "conftest.$ac_ext" >&5
21198 ac_cv_lib_socket_connect=no
21199 fi
21200 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21201 LIBS=$ac_check_lib_save_LIBS
21202 fi
21203 echo "$as_me:21203: result: $ac_cv_lib_socket_connect" >&5
21204 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21205 if test "$ac_cv_lib_socket_connect" = yes; then
21206   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21207 fi
21208
21209     fi
21210
21211     # Guillermo Gomez says -lposix is necessary on A/UX.
21212     echo "$as_me:21212: checking for remove" >&5
21213 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21214 if test "${ac_cv_func_remove+set}" = set; then
21215   echo $ECHO_N "(cached) $ECHO_C" >&6
21216 else
21217   cat >"conftest.$ac_ext" <<_ACEOF
21218 #line 21218 "configure"
21219 #include "confdefs.h"
21220 #define remove autoconf_temporary
21221 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21222 #undef remove
21223
21224 #ifdef __cplusplus
21225 extern "C"
21226 #endif
21227
21228 /* We use char because int might match the return type of a gcc2
21229    builtin and then its argument prototype would still apply.  */
21230 char remove (void);
21231
21232 int
21233 main (void)
21234 {
21235
21236 /* The GNU C library defines stubs for functions which it implements
21237     to always fail with ENOSYS.  Some functions are actually named
21238     something starting with __ and the normal name is an alias.  */
21239 #if defined (__stub_remove) || defined (__stub___remove)
21240 #error found stub for remove
21241 #endif
21242
21243         return remove ();
21244   ;
21245   return 0;
21246 }
21247 _ACEOF
21248 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21249 if { (eval echo "$as_me:21249: \"$ac_link\"") >&5
21250   (eval $ac_link) 2>&5
21251   ac_status=$?
21252   echo "$as_me:21252: \$? = $ac_status" >&5
21253   (exit "$ac_status"); } &&
21254          { ac_try='test -s "conftest$ac_exeext"'
21255   { (eval echo "$as_me:21255: \"$ac_try\"") >&5
21256   (eval $ac_try) 2>&5
21257   ac_status=$?
21258   echo "$as_me:21258: \$? = $ac_status" >&5
21259   (exit "$ac_status"); }; }; then
21260   ac_cv_func_remove=yes
21261 else
21262   echo "$as_me: failed program was:" >&5
21263 cat "conftest.$ac_ext" >&5
21264 ac_cv_func_remove=no
21265 fi
21266 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21267 fi
21268 echo "$as_me:21268: result: $ac_cv_func_remove" >&5
21269 echo "${ECHO_T}$ac_cv_func_remove" >&6
21270
21271     if test $ac_cv_func_remove = no; then
21272       echo "$as_me:21272: checking for remove in -lposix" >&5
21273 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21274 if test "${ac_cv_lib_posix_remove+set}" = set; then
21275   echo $ECHO_N "(cached) $ECHO_C" >&6
21276 else
21277   ac_check_lib_save_LIBS=$LIBS
21278 LIBS="-lposix  $LIBS"
21279 cat >"conftest.$ac_ext" <<_ACEOF
21280 #line 21280 "configure"
21281 #include "confdefs.h"
21282
21283 /* Override any gcc2 internal prototype to avoid an error.  */
21284 #ifdef __cplusplus
21285 extern "C"
21286 #endif
21287 /* We use char because int might match the return type of a gcc2
21288    builtin and then its argument prototype would still apply.  */
21289 char remove ();
21290 int
21291 main (void)
21292 {
21293 remove ();
21294   ;
21295   return 0;
21296 }
21297 _ACEOF
21298 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21299 if { (eval echo "$as_me:21299: \"$ac_link\"") >&5
21300   (eval $ac_link) 2>&5
21301   ac_status=$?
21302   echo "$as_me:21302: \$? = $ac_status" >&5
21303   (exit "$ac_status"); } &&
21304          { ac_try='test -s "conftest$ac_exeext"'
21305   { (eval echo "$as_me:21305: \"$ac_try\"") >&5
21306   (eval $ac_try) 2>&5
21307   ac_status=$?
21308   echo "$as_me:21308: \$? = $ac_status" >&5
21309   (exit "$ac_status"); }; }; then
21310   ac_cv_lib_posix_remove=yes
21311 else
21312   echo "$as_me: failed program was:" >&5
21313 cat "conftest.$ac_ext" >&5
21314 ac_cv_lib_posix_remove=no
21315 fi
21316 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21317 LIBS=$ac_check_lib_save_LIBS
21318 fi
21319 echo "$as_me:21319: result: $ac_cv_lib_posix_remove" >&5
21320 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21321 if test "$ac_cv_lib_posix_remove" = yes; then
21322   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21323 fi
21324
21325     fi
21326
21327     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21328     echo "$as_me:21328: checking for shmat" >&5
21329 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21330 if test "${ac_cv_func_shmat+set}" = set; then
21331   echo $ECHO_N "(cached) $ECHO_C" >&6
21332 else
21333   cat >"conftest.$ac_ext" <<_ACEOF
21334 #line 21334 "configure"
21335 #include "confdefs.h"
21336 #define shmat autoconf_temporary
21337 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21338 #undef shmat
21339
21340 #ifdef __cplusplus
21341 extern "C"
21342 #endif
21343
21344 /* We use char because int might match the return type of a gcc2
21345    builtin and then its argument prototype would still apply.  */
21346 char shmat (void);
21347
21348 int
21349 main (void)
21350 {
21351
21352 /* The GNU C library defines stubs for functions which it implements
21353     to always fail with ENOSYS.  Some functions are actually named
21354     something starting with __ and the normal name is an alias.  */
21355 #if defined (__stub_shmat) || defined (__stub___shmat)
21356 #error found stub for shmat
21357 #endif
21358
21359         return shmat ();
21360   ;
21361   return 0;
21362 }
21363 _ACEOF
21364 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21365 if { (eval echo "$as_me:21365: \"$ac_link\"") >&5
21366   (eval $ac_link) 2>&5
21367   ac_status=$?
21368   echo "$as_me:21368: \$? = $ac_status" >&5
21369   (exit "$ac_status"); } &&
21370          { ac_try='test -s "conftest$ac_exeext"'
21371   { (eval echo "$as_me:21371: \"$ac_try\"") >&5
21372   (eval $ac_try) 2>&5
21373   ac_status=$?
21374   echo "$as_me:21374: \$? = $ac_status" >&5
21375   (exit "$ac_status"); }; }; then
21376   ac_cv_func_shmat=yes
21377 else
21378   echo "$as_me: failed program was:" >&5
21379 cat "conftest.$ac_ext" >&5
21380 ac_cv_func_shmat=no
21381 fi
21382 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21383 fi
21384 echo "$as_me:21384: result: $ac_cv_func_shmat" >&5
21385 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21386
21387     if test $ac_cv_func_shmat = no; then
21388       echo "$as_me:21388: checking for shmat in -lipc" >&5
21389 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21390 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21391   echo $ECHO_N "(cached) $ECHO_C" >&6
21392 else
21393   ac_check_lib_save_LIBS=$LIBS
21394 LIBS="-lipc  $LIBS"
21395 cat >"conftest.$ac_ext" <<_ACEOF
21396 #line 21396 "configure"
21397 #include "confdefs.h"
21398
21399 /* Override any gcc2 internal prototype to avoid an error.  */
21400 #ifdef __cplusplus
21401 extern "C"
21402 #endif
21403 /* We use char because int might match the return type of a gcc2
21404    builtin and then its argument prototype would still apply.  */
21405 char shmat ();
21406 int
21407 main (void)
21408 {
21409 shmat ();
21410   ;
21411   return 0;
21412 }
21413 _ACEOF
21414 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21415 if { (eval echo "$as_me:21415: \"$ac_link\"") >&5
21416   (eval $ac_link) 2>&5
21417   ac_status=$?
21418   echo "$as_me:21418: \$? = $ac_status" >&5
21419   (exit "$ac_status"); } &&
21420          { ac_try='test -s "conftest$ac_exeext"'
21421   { (eval echo "$as_me:21421: \"$ac_try\"") >&5
21422   (eval $ac_try) 2>&5
21423   ac_status=$?
21424   echo "$as_me:21424: \$? = $ac_status" >&5
21425   (exit "$ac_status"); }; }; then
21426   ac_cv_lib_ipc_shmat=yes
21427 else
21428   echo "$as_me: failed program was:" >&5
21429 cat "conftest.$ac_ext" >&5
21430 ac_cv_lib_ipc_shmat=no
21431 fi
21432 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21433 LIBS=$ac_check_lib_save_LIBS
21434 fi
21435 echo "$as_me:21435: result: $ac_cv_lib_ipc_shmat" >&5
21436 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21437 if test "$ac_cv_lib_ipc_shmat" = yes; then
21438   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21439 fi
21440
21441     fi
21442   fi
21443
21444   # Check for libraries that X11R6 Xt/Xaw programs need.
21445   ac_save_LDFLAGS=$LDFLAGS
21446   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21447   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21448   # check for ICE first), but we must link in the order -lSM -lICE or
21449   # we get undefined symbols.  So assume we have SM if we have ICE.
21450   # These have to be linked with before -lX11, unlike the other
21451   # libraries we check for below, so use a different variable.
21452   # John Interrante, Karl Berry
21453   echo "$as_me:21453: checking for IceConnectionNumber in -lICE" >&5
21454 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21455 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21456   echo $ECHO_N "(cached) $ECHO_C" >&6
21457 else
21458   ac_check_lib_save_LIBS=$LIBS
21459 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21460 cat >"conftest.$ac_ext" <<_ACEOF
21461 #line 21461 "configure"
21462 #include "confdefs.h"
21463
21464 /* Override any gcc2 internal prototype to avoid an error.  */
21465 #ifdef __cplusplus
21466 extern "C"
21467 #endif
21468 /* We use char because int might match the return type of a gcc2
21469    builtin and then its argument prototype would still apply.  */
21470 char IceConnectionNumber ();
21471 int
21472 main (void)
21473 {
21474 IceConnectionNumber ();
21475   ;
21476   return 0;
21477 }
21478 _ACEOF
21479 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21480 if { (eval echo "$as_me:21480: \"$ac_link\"") >&5
21481   (eval $ac_link) 2>&5
21482   ac_status=$?
21483   echo "$as_me:21483: \$? = $ac_status" >&5
21484   (exit "$ac_status"); } &&
21485          { ac_try='test -s "conftest$ac_exeext"'
21486   { (eval echo "$as_me:21486: \"$ac_try\"") >&5
21487   (eval $ac_try) 2>&5
21488   ac_status=$?
21489   echo "$as_me:21489: \$? = $ac_status" >&5
21490   (exit "$ac_status"); }; }; then
21491   ac_cv_lib_ICE_IceConnectionNumber=yes
21492 else
21493   echo "$as_me: failed program was:" >&5
21494 cat "conftest.$ac_ext" >&5
21495 ac_cv_lib_ICE_IceConnectionNumber=no
21496 fi
21497 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21498 LIBS=$ac_check_lib_save_LIBS
21499 fi
21500 echo "$as_me:21500: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21501 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21502 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21503   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21504 fi
21505
21506   LDFLAGS=$ac_save_LDFLAGS
21507
21508 fi
21509
21510 fi
21511
21512 if test "$GCC" = yes || test "$GXX" = yes
21513 then
21514
21515 if test "$GCC" = yes || test "$GXX" = yes
21516 then
21517         case $CFLAGS in
21518         (*-Werror=*)
21519                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21520
21521 echo "${as_me:-configure}:21521: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21522
21523                 cf_temp_flags=
21524                 for cf_temp_scan in $CFLAGS
21525                 do
21526                         case "x$cf_temp_scan" in
21527                         (x-Werror=*)
21528
21529         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21530         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21531
21532                                 ;;
21533                         (*)
21534
21535         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21536         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21537
21538                                 ;;
21539                         esac
21540                 done
21541                 CFLAGS="$cf_temp_flags"
21542                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21543
21544 echo "${as_me:-configure}:21544: testing ... fixed $CFLAGS ..." 1>&5
21545
21546                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21547
21548 echo "${as_me:-configure}:21548: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21549
21550                 ;;
21551         esac
21552 fi
21553
21554 if test "$GCC" = yes || test "$GXX" = yes
21555 then
21556         case $CPPFLAGS in
21557         (*-Werror=*)
21558                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21559
21560 echo "${as_me:-configure}:21560: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21561
21562                 cf_temp_flags=
21563                 for cf_temp_scan in $CPPFLAGS
21564                 do
21565                         case "x$cf_temp_scan" in
21566                         (x-Werror=*)
21567
21568         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21569         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21570
21571                                 ;;
21572                         (*)
21573
21574         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21575         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21576
21577                                 ;;
21578                         esac
21579                 done
21580                 CPPFLAGS="$cf_temp_flags"
21581                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21582
21583 echo "${as_me:-configure}:21583: testing ... fixed $CPPFLAGS ..." 1>&5
21584
21585                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21586
21587 echo "${as_me:-configure}:21587: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21588
21589                 ;;
21590         esac
21591 fi
21592
21593 if test "$GCC" = yes || test "$GXX" = yes
21594 then
21595         case $LDFLAGS in
21596         (*-Werror=*)
21597                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21598
21599 echo "${as_me:-configure}:21599: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21600
21601                 cf_temp_flags=
21602                 for cf_temp_scan in $LDFLAGS
21603                 do
21604                         case "x$cf_temp_scan" in
21605                         (x-Werror=*)
21606
21607         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21608         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21609
21610                                 ;;
21611                         (*)
21612
21613         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21614         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21615
21616                                 ;;
21617                         esac
21618                 done
21619                 LDFLAGS="$cf_temp_flags"
21620                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21621
21622 echo "${as_me:-configure}:21622: testing ... fixed $LDFLAGS ..." 1>&5
21623
21624                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21625
21626 echo "${as_me:-configure}:21626: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21627
21628                 ;;
21629         esac
21630 fi
21631
21632 echo "$as_me:21632: checking if you want to turn on gcc warnings" >&5
21633 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21634
21635 # Check whether --enable-warnings or --disable-warnings was given.
21636 if test "${enable_warnings+set}" = set; then
21637   enableval="$enable_warnings"
21638   test "$enableval" != yes && enableval=no
21639         if test "$enableval" != "no" ; then
21640     enable_warnings=yes
21641         else
21642                 enable_warnings=no
21643         fi
21644 else
21645   enableval=no
21646         enable_warnings=no
21647
21648 fi;
21649 echo "$as_me:21649: result: $enable_warnings" >&5
21650 echo "${ECHO_T}$enable_warnings" >&6
21651 if test "$enable_warnings" = "yes"
21652 then
21653
21654 if test "$GCC" = yes || test "$GXX" = yes
21655 then
21656 cat > conftest.i <<EOF
21657 #ifndef GCC_PRINTF
21658 #define GCC_PRINTF 0
21659 #endif
21660 #ifndef GCC_SCANF
21661 #define GCC_SCANF 0
21662 #endif
21663 #ifndef GCC_NORETURN
21664 #define GCC_NORETURN /* nothing */
21665 #endif
21666 #ifndef GCC_UNUSED
21667 #define GCC_UNUSED /* nothing */
21668 #endif
21669 EOF
21670 if test "$GCC" = yes
21671 then
21672         { echo "$as_me:21672: checking for $CC __attribute__ directives..." >&5
21673 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21674 cat > "conftest.$ac_ext" <<EOF
21675 #line 21675 "${as_me:-configure}"
21676 #include "confdefs.h"
21677 #include "conftest.h"
21678 #include "conftest.i"
21679 #if     GCC_PRINTF
21680 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21681 #else
21682 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21683 #endif
21684 #if     GCC_SCANF
21685 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21686 #else
21687 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21688 #endif
21689 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21690 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
21691 extern GCC_NORETURN void foo(void);
21692 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21693 EOF
21694         cf_printf_attribute=no
21695         cf_scanf_attribute=no
21696         for cf_attribute in scanf printf unused noreturn
21697         do
21698
21699 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21700
21701                 cf_directive="__attribute__(($cf_attribute))"
21702                 echo "checking for $CC $cf_directive" 1>&5
21703
21704                 case "$cf_attribute" in
21705                 (printf)
21706                         cf_printf_attribute=yes
21707                         cat >conftest.h <<EOF
21708 #define GCC_$cf_ATTRIBUTE 1
21709 EOF
21710                         ;;
21711                 (scanf)
21712                         cf_scanf_attribute=yes
21713                         cat >conftest.h <<EOF
21714 #define GCC_$cf_ATTRIBUTE 1
21715 EOF
21716                         ;;
21717                 (*)
21718                         cat >conftest.h <<EOF
21719 #define GCC_$cf_ATTRIBUTE $cf_directive
21720 EOF
21721                         ;;
21722                 esac
21723
21724                 if { (eval echo "$as_me:21724: \"$ac_compile\"") >&5
21725   (eval $ac_compile) 2>&5
21726   ac_status=$?
21727   echo "$as_me:21727: \$? = $ac_status" >&5
21728   (exit "$ac_status"); }; then
21729                         test -n "$verbose" && echo "$as_me:21729: result: ... $cf_attribute" >&5
21730 echo "${ECHO_T}... $cf_attribute" >&6
21731                         cat conftest.h >>confdefs.h
21732                         case "$cf_attribute" in
21733                         (noreturn)
21734
21735 cat >>confdefs.h <<EOF
21736 #define GCC_NORETURN $cf_directive
21737 EOF
21738
21739                                 ;;
21740                         (printf)
21741                                 cf_value='/* nothing */'
21742                                 if test "$cf_printf_attribute" != no ; then
21743                                         cf_value='__attribute__((format(printf,fmt,var)))'
21744
21745 cat >>confdefs.h <<\EOF
21746 #define GCC_PRINTF 1
21747 EOF
21748
21749                                 fi
21750
21751 cat >>confdefs.h <<EOF
21752 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21753 EOF
21754
21755                                 ;;
21756                         (scanf)
21757                                 cf_value='/* nothing */'
21758                                 if test "$cf_scanf_attribute" != no ; then
21759                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21760
21761 cat >>confdefs.h <<\EOF
21762 #define GCC_SCANF 1
21763 EOF
21764
21765                                 fi
21766
21767 cat >>confdefs.h <<EOF
21768 #define GCC_SCANFLIKE(fmt,var) $cf_value
21769 EOF
21770
21771                                 ;;
21772                         (unused)
21773
21774 cat >>confdefs.h <<EOF
21775 #define GCC_UNUSED $cf_directive
21776 EOF
21777
21778                                 ;;
21779                         esac
21780                 fi
21781         done
21782 else
21783         ${FGREP-fgrep} define conftest.i >>confdefs.h
21784 fi
21785 rm -rf ./conftest*
21786 fi
21787
21788 if test "x$have_x" = xyes; then
21789
21790 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21791 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21792 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21793 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21794 for cf_X_CFLAGS in $X_CFLAGS
21795 do
21796         case "x$cf_X_CFLAGS" in
21797         x-[IUD]*)
21798                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21799                 ;;
21800         *)
21801                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21802                 ;;
21803         esac
21804 done
21805
21806 cat >"conftest.$ac_ext" <<_ACEOF
21807 #line 21807 "configure"
21808 #include "confdefs.h"
21809
21810 #include <stdlib.h>
21811 #include <X11/Intrinsic.h>
21812
21813 int
21814 main (void)
21815 {
21816 String foo = malloc(1); (void)foo
21817   ;
21818   return 0;
21819 }
21820 _ACEOF
21821 rm -f "conftest.$ac_objext"
21822 if { (eval echo "$as_me:21822: \"$ac_compile\"") >&5
21823   (eval $ac_compile) 2>&5
21824   ac_status=$?
21825   echo "$as_me:21825: \$? = $ac_status" >&5
21826   (exit "$ac_status"); } &&
21827          { ac_try='test -s "conftest.$ac_objext"'
21828   { (eval echo "$as_me:21828: \"$ac_try\"") >&5
21829   (eval $ac_try) 2>&5
21830   ac_status=$?
21831   echo "$as_me:21831: \$? = $ac_status" >&5
21832   (exit "$ac_status"); }; }; then
21833
21834 echo "$as_me:21834: checking for X11/Xt const-feature" >&5
21835 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21836 if test "${cf_cv_const_x_string+set}" = set; then
21837   echo $ECHO_N "(cached) $ECHO_C" >&6
21838 else
21839
21840         cat >"conftest.$ac_ext" <<_ACEOF
21841 #line 21841 "configure"
21842 #include "confdefs.h"
21843
21844 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21845 #undef  XTSTRINGDEFINES /* X11R5 and later */
21846 #include <stdlib.h>
21847 #include <X11/Intrinsic.h>
21848
21849 int
21850 main (void)
21851 {
21852 String foo = malloc(1); *foo = 0
21853   ;
21854   return 0;
21855 }
21856 _ACEOF
21857 rm -f "conftest.$ac_objext"
21858 if { (eval echo "$as_me:21858: \"$ac_compile\"") >&5
21859   (eval $ac_compile) 2>&5
21860   ac_status=$?
21861   echo "$as_me:21861: \$? = $ac_status" >&5
21862   (exit "$ac_status"); } &&
21863          { ac_try='test -s "conftest.$ac_objext"'
21864   { (eval echo "$as_me:21864: \"$ac_try\"") >&5
21865   (eval $ac_try) 2>&5
21866   ac_status=$?
21867   echo "$as_me:21867: \$? = $ac_status" >&5
21868   (exit "$ac_status"); }; }; then
21869
21870                         cf_cv_const_x_string=no
21871
21872 else
21873   echo "$as_me: failed program was:" >&5
21874 cat "conftest.$ac_ext" >&5
21875
21876                         cf_cv_const_x_string=yes
21877
21878 fi
21879 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21880
21881 fi
21882 echo "$as_me:21882: result: $cf_cv_const_x_string" >&5
21883 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21884
21885 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21886 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21887 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21888
21889 case "$cf_cv_const_x_string" in
21890 (no)
21891
21892         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21893         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21894
21895         ;;
21896 (*)
21897
21898         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21899         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21900
21901         ;;
21902 esac
21903
21904 else
21905   echo "$as_me: failed program was:" >&5
21906 cat "conftest.$ac_ext" >&5
21907 fi
21908 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21909  fi
21910 cat > "conftest.$ac_ext" <<EOF
21911 #line 21911 "${as_me:-configure}"
21912 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21913 EOF
21914 if test "$INTEL_COMPILER" = yes
21915 then
21916 # The "-wdXXX" options suppress warnings:
21917 # remark #1419: external declaration in primary source file
21918 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21919 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21920 # remark #193: zero used for undefined preprocessing identifier
21921 # remark #593: variable "curs_sb_left_arrow" was set but never used
21922 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21923 # remark #869: parameter "tw" was never referenced
21924 # remark #981: operands are evaluated in unspecified order
21925 # warning #279: controlling expression is constant
21926
21927         { echo "$as_me:21927: checking for $CC warning options..." >&5
21928 echo "$as_me: checking for $CC warning options..." >&6;}
21929         cf_save_CFLAGS="$CFLAGS"
21930         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21931         for cf_opt in \
21932                 wd1419 \
21933                 wd1683 \
21934                 wd1684 \
21935                 wd193 \
21936                 wd593 \
21937                 wd279 \
21938                 wd810 \
21939                 wd869 \
21940                 wd981
21941         do
21942                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21943                 if { (eval echo "$as_me:21943: \"$ac_compile\"") >&5
21944   (eval $ac_compile) 2>&5
21945   ac_status=$?
21946   echo "$as_me:21946: \$? = $ac_status" >&5
21947   (exit "$ac_status"); }; then
21948                         test -n "$verbose" && echo "$as_me:21948: result: ... -$cf_opt" >&5
21949 echo "${ECHO_T}... -$cf_opt" >&6
21950                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21951                 fi
21952         done
21953         CFLAGS="$cf_save_CFLAGS"
21954 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
21955 then
21956         { echo "$as_me:21956: checking for $CC warning options..." >&5
21957 echo "$as_me: checking for $CC warning options..." >&6;}
21958         cf_save_CFLAGS="$CFLAGS"
21959         cf_warn_CONST=""
21960         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
21961         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
21962         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
21963         for cf_opt in W Wall \
21964                 Wbad-function-cast \
21965                 Wcast-align \
21966                 Wcast-qual \
21967                 Wdeclaration-after-statement \
21968                 Wextra \
21969                 Winline \
21970                 Wmissing-declarations \
21971                 Wmissing-prototypes \
21972                 Wnested-externs \
21973                 Wpointer-arith \
21974                 Wshadow \
21975                 Wstrict-prototypes \
21976                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
21977         do
21978                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21979                 if { (eval echo "$as_me:21979: \"$ac_compile\"") >&5
21980   (eval $ac_compile) 2>&5
21981   ac_status=$?
21982   echo "$as_me:21982: \$? = $ac_status" >&5
21983   (exit "$ac_status"); }; then
21984                         test -n "$verbose" && echo "$as_me:21984: result: ... -$cf_opt" >&5
21985 echo "${ECHO_T}... -$cf_opt" >&6
21986                         case "$cf_opt" in
21987                         (Winline)
21988                                 case "$GCC_VERSION" in
21989                                 ([34].*)
21990                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21991
21992 echo "${as_me:-configure}:21992: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21993
21994                                         continue;;
21995                                 esac
21996                                 ;;
21997                         (Wpointer-arith)
21998                                 case "$GCC_VERSION" in
21999                                 ([12].*)
22000                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22001
22002 echo "${as_me:-configure}:22002: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22003
22004                                         continue;;
22005                                 esac
22006                                 ;;
22007                         esac
22008                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22009                 fi
22010         done
22011         CFLAGS="$cf_save_CFLAGS"
22012 fi
22013 rm -rf ./conftest*
22014
22015 fi
22016
22017 fi
22018
22019 echo "$as_me:22019: checking if you want to use dmalloc for testing" >&5
22020 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22021
22022 # Check whether --with-dmalloc or --without-dmalloc was given.
22023 if test "${with_dmalloc+set}" = set; then
22024   withval="$with_dmalloc"
22025
22026 cat >>confdefs.h <<EOF
22027 #define USE_DMALLOC 1
22028 EOF
22029
22030         : "${with_cflags:=-g}"
22031         : "${enable_leaks:=no}"
22032          with_dmalloc=yes
22033 else
22034   with_dmalloc=
22035 fi;
22036 echo "$as_me:22036: result: ${with_dmalloc:-no}" >&5
22037 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22038
22039 case ".$with_cflags" in
22040 (.*-g*)
22041         case .$CFLAGS in
22042         (.*-g*)
22043                 ;;
22044         (*)
22045
22046 cf_fix_cppflags=no
22047 cf_new_cflags=
22048 cf_new_cppflags=
22049 cf_new_extra_cppflags=
22050
22051 for cf_add_cflags in -g
22052 do
22053 case "$cf_fix_cppflags" in
22054 (no)
22055         case "$cf_add_cflags" in
22056         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22057                 case "$cf_add_cflags" in
22058                 (-D*)
22059                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22060
22061                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22062                                 && test -z "${cf_tst_cflags}" \
22063                                 && cf_fix_cppflags=yes
22064
22065                         if test "$cf_fix_cppflags" = yes ; then
22066
22067         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22068         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22069
22070                                 continue
22071                         elif test "${cf_tst_cflags}" = "\"'" ; then
22072
22073         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22074         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22075
22076                                 continue
22077                         fi
22078                         ;;
22079                 esac
22080                 case "$CPPFLAGS" in
22081                 (*$cf_add_cflags)
22082                         ;;
22083                 (*)
22084                         case "$cf_add_cflags" in
22085                         (-D*)
22086                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22087
22088 CPPFLAGS=`echo "$CPPFLAGS" | \
22089         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22090                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22091
22092                                 ;;
22093                         esac
22094
22095         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22096         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22097
22098                         ;;
22099                 esac
22100                 ;;
22101         (*)
22102
22103         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22104         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22105
22106                 ;;
22107         esac
22108         ;;
22109 (yes)
22110
22111         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22112         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22113
22114         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22115
22116         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22117                 && test -z "${cf_tst_cflags}" \
22118                 && cf_fix_cppflags=no
22119         ;;
22120 esac
22121 done
22122
22123 if test -n "$cf_new_cflags" ; then
22124
22125         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22126         CFLAGS="${CFLAGS}$cf_new_cflags"
22127
22128 fi
22129
22130 if test -n "$cf_new_cppflags" ; then
22131
22132         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22133         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22134
22135 fi
22136
22137 if test -n "$cf_new_extra_cppflags" ; then
22138
22139         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22140         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22141
22142 fi
22143
22144                 ;;
22145         esac
22146         ;;
22147 esac
22148
22149 if test "$with_dmalloc" = yes ; then
22150         echo "$as_me:22150: checking for dmalloc.h" >&5
22151 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22152 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22153   echo $ECHO_N "(cached) $ECHO_C" >&6
22154 else
22155   cat >"conftest.$ac_ext" <<_ACEOF
22156 #line 22156 "configure"
22157 #include "confdefs.h"
22158 #include <dmalloc.h>
22159 _ACEOF
22160 if { (eval echo "$as_me:22160: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22161   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22162   ac_status=$?
22163   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22164   rm -f conftest.er1
22165   cat conftest.err >&5
22166   echo "$as_me:22166: \$? = $ac_status" >&5
22167   (exit "$ac_status"); } >/dev/null; then
22168   if test -s conftest.err; then
22169     ac_cpp_err=$ac_c_preproc_warn_flag
22170   else
22171     ac_cpp_err=
22172   fi
22173 else
22174   ac_cpp_err=yes
22175 fi
22176 if test -z "$ac_cpp_err"; then
22177   ac_cv_header_dmalloc_h=yes
22178 else
22179   echo "$as_me: failed program was:" >&5
22180   cat "conftest.$ac_ext" >&5
22181   ac_cv_header_dmalloc_h=no
22182 fi
22183 rm -f conftest.err "conftest.$ac_ext"
22184 fi
22185 echo "$as_me:22185: result: $ac_cv_header_dmalloc_h" >&5
22186 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22187 if test "$ac_cv_header_dmalloc_h" = yes; then
22188
22189 echo "$as_me:22189: checking for dmalloc_debug in -ldmalloc" >&5
22190 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22191 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22192   echo $ECHO_N "(cached) $ECHO_C" >&6
22193 else
22194   ac_check_lib_save_LIBS=$LIBS
22195 LIBS="-ldmalloc  $LIBS"
22196 cat >"conftest.$ac_ext" <<_ACEOF
22197 #line 22197 "configure"
22198 #include "confdefs.h"
22199
22200 /* Override any gcc2 internal prototype to avoid an error.  */
22201 #ifdef __cplusplus
22202 extern "C"
22203 #endif
22204 /* We use char because int might match the return type of a gcc2
22205    builtin and then its argument prototype would still apply.  */
22206 char dmalloc_debug ();
22207 int
22208 main (void)
22209 {
22210 dmalloc_debug ();
22211   ;
22212   return 0;
22213 }
22214 _ACEOF
22215 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22216 if { (eval echo "$as_me:22216: \"$ac_link\"") >&5
22217   (eval $ac_link) 2>&5
22218   ac_status=$?
22219   echo "$as_me:22219: \$? = $ac_status" >&5
22220   (exit "$ac_status"); } &&
22221          { ac_try='test -s "conftest$ac_exeext"'
22222   { (eval echo "$as_me:22222: \"$ac_try\"") >&5
22223   (eval $ac_try) 2>&5
22224   ac_status=$?
22225   echo "$as_me:22225: \$? = $ac_status" >&5
22226   (exit "$ac_status"); }; }; then
22227   ac_cv_lib_dmalloc_dmalloc_debug=yes
22228 else
22229   echo "$as_me: failed program was:" >&5
22230 cat "conftest.$ac_ext" >&5
22231 ac_cv_lib_dmalloc_dmalloc_debug=no
22232 fi
22233 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22234 LIBS=$ac_check_lib_save_LIBS
22235 fi
22236 echo "$as_me:22236: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22237 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22238 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22239   cat >>confdefs.h <<EOF
22240 #define HAVE_LIBDMALLOC 1
22241 EOF
22242
22243   LIBS="-ldmalloc $LIBS"
22244
22245 fi
22246
22247 fi
22248
22249 fi
22250
22251 echo "$as_me:22251: checking if you want to use dbmalloc for testing" >&5
22252 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22253
22254 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22255 if test "${with_dbmalloc+set}" = set; then
22256   withval="$with_dbmalloc"
22257
22258 cat >>confdefs.h <<EOF
22259 #define USE_DBMALLOC 1
22260 EOF
22261
22262         : "${with_cflags:=-g}"
22263         : "${enable_leaks:=no}"
22264          with_dbmalloc=yes
22265 else
22266   with_dbmalloc=
22267 fi;
22268 echo "$as_me:22268: result: ${with_dbmalloc:-no}" >&5
22269 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22270
22271 case ".$with_cflags" in
22272 (.*-g*)
22273         case .$CFLAGS in
22274         (.*-g*)
22275                 ;;
22276         (*)
22277
22278 cf_fix_cppflags=no
22279 cf_new_cflags=
22280 cf_new_cppflags=
22281 cf_new_extra_cppflags=
22282
22283 for cf_add_cflags in -g
22284 do
22285 case "$cf_fix_cppflags" in
22286 (no)
22287         case "$cf_add_cflags" in
22288         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22289                 case "$cf_add_cflags" in
22290                 (-D*)
22291                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22292
22293                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22294                                 && test -z "${cf_tst_cflags}" \
22295                                 && cf_fix_cppflags=yes
22296
22297                         if test "$cf_fix_cppflags" = yes ; then
22298
22299         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22300         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22301
22302                                 continue
22303                         elif test "${cf_tst_cflags}" = "\"'" ; then
22304
22305         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22306         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22307
22308                                 continue
22309                         fi
22310                         ;;
22311                 esac
22312                 case "$CPPFLAGS" in
22313                 (*$cf_add_cflags)
22314                         ;;
22315                 (*)
22316                         case "$cf_add_cflags" in
22317                         (-D*)
22318                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22319
22320 CPPFLAGS=`echo "$CPPFLAGS" | \
22321         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22322                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22323
22324                                 ;;
22325                         esac
22326
22327         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22328         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22329
22330                         ;;
22331                 esac
22332                 ;;
22333         (*)
22334
22335         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22336         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22337
22338                 ;;
22339         esac
22340         ;;
22341 (yes)
22342
22343         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22344         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22345
22346         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22347
22348         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22349                 && test -z "${cf_tst_cflags}" \
22350                 && cf_fix_cppflags=no
22351         ;;
22352 esac
22353 done
22354
22355 if test -n "$cf_new_cflags" ; then
22356
22357         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22358         CFLAGS="${CFLAGS}$cf_new_cflags"
22359
22360 fi
22361
22362 if test -n "$cf_new_cppflags" ; then
22363
22364         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22365         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22366
22367 fi
22368
22369 if test -n "$cf_new_extra_cppflags" ; then
22370
22371         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22372         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22373
22374 fi
22375
22376                 ;;
22377         esac
22378         ;;
22379 esac
22380
22381 if test "$with_dbmalloc" = yes ; then
22382         echo "$as_me:22382: checking for dbmalloc.h" >&5
22383 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22384 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22385   echo $ECHO_N "(cached) $ECHO_C" >&6
22386 else
22387   cat >"conftest.$ac_ext" <<_ACEOF
22388 #line 22388 "configure"
22389 #include "confdefs.h"
22390 #include <dbmalloc.h>
22391 _ACEOF
22392 if { (eval echo "$as_me:22392: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22393   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22394   ac_status=$?
22395   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22396   rm -f conftest.er1
22397   cat conftest.err >&5
22398   echo "$as_me:22398: \$? = $ac_status" >&5
22399   (exit "$ac_status"); } >/dev/null; then
22400   if test -s conftest.err; then
22401     ac_cpp_err=$ac_c_preproc_warn_flag
22402   else
22403     ac_cpp_err=
22404   fi
22405 else
22406   ac_cpp_err=yes
22407 fi
22408 if test -z "$ac_cpp_err"; then
22409   ac_cv_header_dbmalloc_h=yes
22410 else
22411   echo "$as_me: failed program was:" >&5
22412   cat "conftest.$ac_ext" >&5
22413   ac_cv_header_dbmalloc_h=no
22414 fi
22415 rm -f conftest.err "conftest.$ac_ext"
22416 fi
22417 echo "$as_me:22417: result: $ac_cv_header_dbmalloc_h" >&5
22418 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22419 if test "$ac_cv_header_dbmalloc_h" = yes; then
22420
22421 echo "$as_me:22421: checking for debug_malloc in -ldbmalloc" >&5
22422 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22423 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22424   echo $ECHO_N "(cached) $ECHO_C" >&6
22425 else
22426   ac_check_lib_save_LIBS=$LIBS
22427 LIBS="-ldbmalloc  $LIBS"
22428 cat >"conftest.$ac_ext" <<_ACEOF
22429 #line 22429 "configure"
22430 #include "confdefs.h"
22431
22432 /* Override any gcc2 internal prototype to avoid an error.  */
22433 #ifdef __cplusplus
22434 extern "C"
22435 #endif
22436 /* We use char because int might match the return type of a gcc2
22437    builtin and then its argument prototype would still apply.  */
22438 char debug_malloc ();
22439 int
22440 main (void)
22441 {
22442 debug_malloc ();
22443   ;
22444   return 0;
22445 }
22446 _ACEOF
22447 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22448 if { (eval echo "$as_me:22448: \"$ac_link\"") >&5
22449   (eval $ac_link) 2>&5
22450   ac_status=$?
22451   echo "$as_me:22451: \$? = $ac_status" >&5
22452   (exit "$ac_status"); } &&
22453          { ac_try='test -s "conftest$ac_exeext"'
22454   { (eval echo "$as_me:22454: \"$ac_try\"") >&5
22455   (eval $ac_try) 2>&5
22456   ac_status=$?
22457   echo "$as_me:22457: \$? = $ac_status" >&5
22458   (exit "$ac_status"); }; }; then
22459   ac_cv_lib_dbmalloc_debug_malloc=yes
22460 else
22461   echo "$as_me: failed program was:" >&5
22462 cat "conftest.$ac_ext" >&5
22463 ac_cv_lib_dbmalloc_debug_malloc=no
22464 fi
22465 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22466 LIBS=$ac_check_lib_save_LIBS
22467 fi
22468 echo "$as_me:22468: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22469 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22470 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22471   cat >>confdefs.h <<EOF
22472 #define HAVE_LIBDBMALLOC 1
22473 EOF
22474
22475   LIBS="-ldbmalloc $LIBS"
22476
22477 fi
22478
22479 fi
22480
22481 fi
22482
22483 echo "$as_me:22483: checking if you want to use valgrind for testing" >&5
22484 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22485
22486 # Check whether --with-valgrind or --without-valgrind was given.
22487 if test "${with_valgrind+set}" = set; then
22488   withval="$with_valgrind"
22489
22490 cat >>confdefs.h <<EOF
22491 #define USE_VALGRIND 1
22492 EOF
22493
22494         : "${with_cflags:=-g}"
22495         : "${enable_leaks:=no}"
22496          with_valgrind=yes
22497 else
22498   with_valgrind=
22499 fi;
22500 echo "$as_me:22500: result: ${with_valgrind:-no}" >&5
22501 echo "${ECHO_T}${with_valgrind:-no}" >&6
22502
22503 case ".$with_cflags" in
22504 (.*-g*)
22505         case .$CFLAGS in
22506         (.*-g*)
22507                 ;;
22508         (*)
22509
22510 cf_fix_cppflags=no
22511 cf_new_cflags=
22512 cf_new_cppflags=
22513 cf_new_extra_cppflags=
22514
22515 for cf_add_cflags in -g
22516 do
22517 case "$cf_fix_cppflags" in
22518 (no)
22519         case "$cf_add_cflags" in
22520         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22521                 case "$cf_add_cflags" in
22522                 (-D*)
22523                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22524
22525                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22526                                 && test -z "${cf_tst_cflags}" \
22527                                 && cf_fix_cppflags=yes
22528
22529                         if test "$cf_fix_cppflags" = yes ; then
22530
22531         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22532         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22533
22534                                 continue
22535                         elif test "${cf_tst_cflags}" = "\"'" ; then
22536
22537         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22538         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22539
22540                                 continue
22541                         fi
22542                         ;;
22543                 esac
22544                 case "$CPPFLAGS" in
22545                 (*$cf_add_cflags)
22546                         ;;
22547                 (*)
22548                         case "$cf_add_cflags" in
22549                         (-D*)
22550                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22551
22552 CPPFLAGS=`echo "$CPPFLAGS" | \
22553         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22554                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22555
22556                                 ;;
22557                         esac
22558
22559         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22560         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22561
22562                         ;;
22563                 esac
22564                 ;;
22565         (*)
22566
22567         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22568         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22569
22570                 ;;
22571         esac
22572         ;;
22573 (yes)
22574
22575         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22576         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22577
22578         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22579
22580         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22581                 && test -z "${cf_tst_cflags}" \
22582                 && cf_fix_cppflags=no
22583         ;;
22584 esac
22585 done
22586
22587 if test -n "$cf_new_cflags" ; then
22588
22589         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22590         CFLAGS="${CFLAGS}$cf_new_cflags"
22591
22592 fi
22593
22594 if test -n "$cf_new_cppflags" ; then
22595
22596         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22597         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22598
22599 fi
22600
22601 if test -n "$cf_new_extra_cppflags" ; then
22602
22603         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22604         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22605
22606 fi
22607
22608                 ;;
22609         esac
22610         ;;
22611 esac
22612
22613 echo "$as_me:22613: checking if you want to perform memory-leak testing" >&5
22614 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22615
22616 # Check whether --enable-leaks or --disable-leaks was given.
22617 if test "${enable_leaks+set}" = set; then
22618   enableval="$enable_leaks"
22619   enable_leaks=$enableval
22620 else
22621   enable_leaks=yes
22622 fi;
22623 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22624 echo "$as_me:22624: result: $with_no_leaks" >&5
22625 echo "${ECHO_T}$with_no_leaks" >&6
22626
22627 if test "$enable_leaks" = no ; then
22628
22629 cat >>confdefs.h <<\EOF
22630 #define NO_LEAKS 1
22631 EOF
22632
22633 cat >>confdefs.h <<\EOF
22634 #define YY_NO_LEAKS 1
22635 EOF
22636
22637 fi
22638
22639 LD_RPATH_OPT=
22640 if test "x$cf_cv_enable_rpath" != xno
22641 then
22642         echo "$as_me:22642: checking for an rpath option" >&5
22643 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22644         case "$cf_cv_system_name" in
22645         (irix*)
22646                 if test "$GCC" = yes; then
22647                         LD_RPATH_OPT="-Wl,-rpath,"
22648                 else
22649                         LD_RPATH_OPT="-rpath "
22650                 fi
22651                 ;;
22652         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22653                 LD_RPATH_OPT="-Wl,-rpath,"
22654                 ;;
22655         (openbsd[2-9].*|mirbsd*)
22656                 LD_RPATH_OPT="-Wl,-rpath,"
22657                 ;;
22658         (dragonfly*)
22659                 LD_RPATH_OPT="-rpath "
22660                 ;;
22661         (netbsd*)
22662                 LD_RPATH_OPT="-Wl,-rpath,"
22663                 ;;
22664         (osf*|mls+*)
22665                 LD_RPATH_OPT="-rpath "
22666                 ;;
22667         (solaris2*)
22668                 LD_RPATH_OPT="-R"
22669                 ;;
22670         (*)
22671                 ;;
22672         esac
22673         echo "$as_me:22673: result: $LD_RPATH_OPT" >&5
22674 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22675
22676         case "x$LD_RPATH_OPT" in
22677         (x-R*)
22678                 echo "$as_me:22678: checking if we need a space after rpath option" >&5
22679 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22680                 cf_save_LIBS="$LIBS"
22681
22682 cf_add_libs="$LIBS"
22683 # reverse order
22684 cf_add_0lib=
22685 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22686 # filter duplicates
22687 for cf_add_1lib in $cf_add_0lib; do
22688         for cf_add_2lib in $cf_add_libs; do
22689                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22690                         cf_add_1lib=
22691                         break
22692                 fi
22693         done
22694         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22695 done
22696 LIBS="$cf_add_libs"
22697
22698                 cat >"conftest.$ac_ext" <<_ACEOF
22699 #line 22699 "configure"
22700 #include "confdefs.h"
22701
22702 int
22703 main (void)
22704 {
22705
22706   ;
22707   return 0;
22708 }
22709 _ACEOF
22710 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22711 if { (eval echo "$as_me:22711: \"$ac_link\"") >&5
22712   (eval $ac_link) 2>&5
22713   ac_status=$?
22714   echo "$as_me:22714: \$? = $ac_status" >&5
22715   (exit "$ac_status"); } &&
22716          { ac_try='test -s "conftest$ac_exeext"'
22717   { (eval echo "$as_me:22717: \"$ac_try\"") >&5
22718   (eval $ac_try) 2>&5
22719   ac_status=$?
22720   echo "$as_me:22720: \$? = $ac_status" >&5
22721   (exit "$ac_status"); }; }; then
22722   cf_rpath_space=no
22723 else
22724   echo "$as_me: failed program was:" >&5
22725 cat "conftest.$ac_ext" >&5
22726 cf_rpath_space=yes
22727 fi
22728 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22729                 LIBS="$cf_save_LIBS"
22730                 echo "$as_me:22730: result: $cf_rpath_space" >&5
22731 echo "${ECHO_T}$cf_rpath_space" >&6
22732                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22733                 ;;
22734         esac
22735 fi
22736
22737 echo "$as_me:22737: checking if rpath-hack should be disabled" >&5
22738 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22739
22740 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22741 if test "${enable_rpath_hack+set}" = set; then
22742   enableval="$enable_rpath_hack"
22743   test "$enableval" != no && enableval=yes
22744         if test "$enableval" != "yes" ; then
22745     enable_rpath_hack=no
22746         else
22747                 enable_rpath_hack=yes
22748         fi
22749 else
22750   enableval=yes
22751         enable_rpath_hack=yes
22752
22753 fi;
22754 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
22755 echo "$as_me:22755: result: $cf_disable_rpath_hack" >&5
22756 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22757
22758 if test "$enable_rpath_hack" = yes ; then
22759
22760 echo "$as_me:22760: checking for updated LDFLAGS" >&5
22761 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22762 if test -n "$LD_RPATH_OPT" ; then
22763         echo "$as_me:22763: result: maybe" >&5
22764 echo "${ECHO_T}maybe" >&6
22765
22766         for ac_prog in ldd
22767 do
22768   # Extract the first word of "$ac_prog", so it can be a program name with args.
22769 set dummy $ac_prog; ac_word=$2
22770 echo "$as_me:22770: checking for $ac_word" >&5
22771 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22772 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22773   echo $ECHO_N "(cached) $ECHO_C" >&6
22774 else
22775   if test -n "$cf_ldd_prog"; then
22776   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22777 else
22778   ac_save_IFS=$IFS; IFS=$ac_path_separator
22779 ac_dummy="$PATH"
22780 for ac_dir in $ac_dummy; do
22781   IFS=$ac_save_IFS
22782   test -z "$ac_dir" && ac_dir=.
22783   $as_executable_p "$ac_dir/$ac_word" || continue
22784 ac_cv_prog_cf_ldd_prog="$ac_prog"
22785 echo "$as_me:22785: found $ac_dir/$ac_word" >&5
22786 break
22787 done
22788
22789 fi
22790 fi
22791 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22792 if test -n "$cf_ldd_prog"; then
22793   echo "$as_me:22793: result: $cf_ldd_prog" >&5
22794 echo "${ECHO_T}$cf_ldd_prog" >&6
22795 else
22796   echo "$as_me:22796: result: no" >&5
22797 echo "${ECHO_T}no" >&6
22798 fi
22799
22800   test -n "$cf_ldd_prog" && break
22801 done
22802 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22803
22804         cf_rpath_list="/usr/lib /lib"
22805         if test "$cf_ldd_prog" != no
22806         then
22807                 cf_rpath_oops=
22808
22809 cat >"conftest.$ac_ext" <<_ACEOF
22810 #line 22810 "configure"
22811 #include "confdefs.h"
22812 #include <stdio.h>
22813 int
22814 main (void)
22815 {
22816 printf("Hello");
22817   ;
22818   return 0;
22819 }
22820 _ACEOF
22821 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22822 if { (eval echo "$as_me:22822: \"$ac_link\"") >&5
22823   (eval $ac_link) 2>&5
22824   ac_status=$?
22825   echo "$as_me:22825: \$? = $ac_status" >&5
22826   (exit "$ac_status"); } &&
22827          { ac_try='test -s "conftest$ac_exeext"'
22828   { (eval echo "$as_me:22828: \"$ac_try\"") >&5
22829   (eval $ac_try) 2>&5
22830   ac_status=$?
22831   echo "$as_me:22831: \$? = $ac_status" >&5
22832   (exit "$ac_status"); }; }; then
22833   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22834                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22835 else
22836   echo "$as_me: failed program was:" >&5
22837 cat "conftest.$ac_ext" >&5
22838 fi
22839 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22840
22841                 # If we passed the link-test, but get a "not found" on a given library,
22842                 # this could be due to inept reconfiguration of gcc to make it only
22843                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22844                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22845                 # /usr/local libraries.
22846                 if test -n "$cf_rpath_oops"
22847                 then
22848                         for cf_rpath_src in $cf_rpath_oops
22849                         do
22850                                 for cf_rpath_dir in \
22851                                         /usr/local \
22852                                         /usr/pkg \
22853                                         /opt/sfw
22854                                 do
22855                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
22856                                         then
22857                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22858
22859 echo "${as_me:-configure}:22859: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22860
22861                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22862                                                 break
22863                                         fi
22864                                 done
22865                         done
22866                 fi
22867         fi
22868
22869         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22870
22871 echo "${as_me:-configure}:22871: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22872
22873 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22874
22875 echo "${as_me:-configure}:22875: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22876
22877 cf_rpath_dst=
22878 for cf_rpath_src in $LDFLAGS
22879 do
22880         case "$cf_rpath_src" in
22881         (-L*)
22882
22883                 # check if this refers to a directory which we will ignore
22884                 cf_rpath_skip=no
22885                 if test -n "$cf_rpath_list"
22886                 then
22887                         for cf_rpath_item in $cf_rpath_list
22888                         do
22889                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22890                                 then
22891                                         cf_rpath_skip=yes
22892                                         break
22893                                 fi
22894                         done
22895                 fi
22896
22897                 if test "$cf_rpath_skip" = no
22898                 then
22899                         # transform the option
22900                         if test "$LD_RPATH_OPT" = "-R " ; then
22901                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22902                         else
22903                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22904                         fi
22905
22906                         # if we have not already added this, add it now
22907                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22908                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22909                         then
22910                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22911
22912 echo "${as_me:-configure}:22912: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22913
22914                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22915                         fi
22916                 fi
22917                 ;;
22918         esac
22919         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22920 done
22921 LDFLAGS=$cf_rpath_dst
22922
22923 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22924
22925 echo "${as_me:-configure}:22925: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22926
22927 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
22928
22929 echo "${as_me:-configure}:22929: testing ...checking LIBS $LIBS ..." 1>&5
22930
22931 cf_rpath_dst=
22932 for cf_rpath_src in $LIBS
22933 do
22934         case "$cf_rpath_src" in
22935         (-L*)
22936
22937                 # check if this refers to a directory which we will ignore
22938                 cf_rpath_skip=no
22939                 if test -n "$cf_rpath_list"
22940                 then
22941                         for cf_rpath_item in $cf_rpath_list
22942                         do
22943                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22944                                 then
22945                                         cf_rpath_skip=yes
22946                                         break
22947                                 fi
22948                         done
22949                 fi
22950
22951                 if test "$cf_rpath_skip" = no
22952                 then
22953                         # transform the option
22954                         if test "$LD_RPATH_OPT" = "-R " ; then
22955                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22956                         else
22957                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22958                         fi
22959
22960                         # if we have not already added this, add it now
22961                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22962                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22963                         then
22964                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22965
22966 echo "${as_me:-configure}:22966: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22967
22968                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22969                         fi
22970                 fi
22971                 ;;
22972         esac
22973         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22974 done
22975 LIBS=$cf_rpath_dst
22976
22977 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
22978
22979 echo "${as_me:-configure}:22979: testing ...checked LIBS $LIBS ..." 1>&5
22980
22981         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22982
22983 echo "${as_me:-configure}:22983: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22984
22985 else
22986         echo "$as_me:22986: result: no" >&5
22987 echo "${ECHO_T}no" >&6
22988 fi
22989
22990 fi
22991
22992 TEST_ARGS="$LIBS"
22993 LIBS=
22994
22995 ac_config_files="$ac_config_files Makefile"
22996 ac_config_commands="$ac_config_commands default"
22997 cat >confcache <<\_ACEOF
22998 # This file is a shell script that caches the results of configure
22999 # tests run on this system so they can be shared between configure
23000 # scripts and configure runs, see configure's option --config-cache.
23001 # It is not useful on other systems.  If it contains results you don't
23002 # want to keep, you may remove or edit it.
23003 #
23004 # config.status only pays attention to the cache file if you give it
23005 # the --recheck option to rerun configure.
23006 #
23007 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23008 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23009 # following values.
23010
23011 _ACEOF
23012
23013 # The following way of writing the cache mishandles newlines in values,
23014 # but we know of no workaround that is simple, portable, and efficient.
23015 # So, don't put newlines in cache variables' values.
23016 # Ultrix sh set writes to stderr and can't be redirected directly,
23017 # and sets the high bit in the cache file unless we assign to the vars.
23018 {
23019   (set) 2>&1 |
23020     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23021     *ac_space=\ *)
23022       # `set' does not quote correctly, so add quotes (double-quote
23023       # substitution turns \\\\ into \\, and sed turns \\ into \).
23024       sed -n \
23025         "s/'/'\\\\''/g;
23026           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23027       ;;
23028     *)
23029       # `set' quotes correctly as required by POSIX, so do not add quotes.
23030       sed -n \
23031         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23032       ;;
23033     esac;
23034 } |
23035   sed '
23036      t clear
23037      : clear
23038      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23039      t end
23040      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23041      : end' >>confcache
23042 if cmp -s $cache_file confcache; then :; else
23043   if test -w $cache_file; then
23044     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23045     cat confcache >$cache_file
23046   else
23047     echo "not updating unwritable cache $cache_file"
23048   fi
23049 fi
23050 rm -f confcache
23051
23052 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23053 # Let make expand exec_prefix.
23054 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23055
23056 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23057 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23058 # trailing colons and then remove the whole line if VPATH becomes empty
23059 # (actually we leave an empty line to preserve line numbers).
23060 if test "x$srcdir" = x.; then
23061   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23062 s/:*\$(srcdir):*/:/;
23063 s/:*\${srcdir}:*/:/;
23064 s/:*@srcdir@:*/:/;
23065 s/^\([^=]*=[    ]*\):*/\1/;
23066 s/:*$//;
23067 s/^[^=]*=[      ]*$//;
23068 }'
23069 fi
23070
23071 DEFS=-DHAVE_CONFIG_H
23072
23073 : "${CONFIG_STATUS=./config.status}"
23074 ac_clean_files_save=$ac_clean_files
23075 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23076 { echo "$as_me:23076: creating $CONFIG_STATUS" >&5
23077 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23078 cat >"$CONFIG_STATUS" <<_ACEOF
23079 #! $SHELL
23080 # Generated automatically by configure.
23081 # Run this file to recreate the current configuration.
23082 # Compiler output produced by configure, useful for debugging
23083 # configure, is in config.log if it exists.
23084
23085 debug=false
23086 SHELL=\${CONFIG_SHELL-$SHELL}
23087 ac_cs_invocation="\$0 \$@"
23088
23089 CLICOLOR_FORCE= GREP_OPTIONS=
23090 unset CLICOLOR_FORCE GREP_OPTIONS
23091 _ACEOF
23092
23093 cat >>"$CONFIG_STATUS" <<\_ACEOF
23094 # Be Bourne compatible
23095 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23096   emulate sh
23097   NULLCMD=:
23098 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23099   set -o posix
23100 fi
23101
23102 # Name of the executable.
23103 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23104
23105 if expr a : '\(a\)' >/dev/null 2>&1; then
23106   as_expr=expr
23107 else
23108   as_expr=false
23109 fi
23110
23111 rm -f conf$$ conf$$.exe conf$$.file
23112 echo >conf$$.file
23113 if ln -s conf$$.file conf$$ 2>/dev/null; then
23114   # We could just check for DJGPP; but this test a) works b) is more generic
23115   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23116   if test -f conf$$.exe; then
23117     # Don't use ln at all; we don't have any links
23118     as_ln_s='cp -p'
23119   else
23120     as_ln_s='ln -s'
23121   fi
23122 elif ln conf$$.file conf$$ 2>/dev/null; then
23123   as_ln_s=ln
23124 else
23125   as_ln_s='cp -p'
23126 fi
23127 rm -f conf$$ conf$$.exe conf$$.file
23128
23129 as_executable_p="test -f"
23130
23131 # Support unset when possible.
23132 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23133   as_unset="unset"
23134 else
23135   as_unset="false"
23136 fi
23137
23138 # NLS nuisances.
23139 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23140 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23141 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23142 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23143 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23144 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23145 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23146 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23147
23148 # IFS
23149 # We need space, tab and new line, in precisely that order.
23150 as_nl='
23151 '
23152 IFS="   $as_nl"
23153
23154 # CDPATH.
23155 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23156
23157 exec 6>&1
23158
23159 _ACEOF
23160
23161 # Files that config.status was made for.
23162 if test -n "$ac_config_files"; then
23163   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23164 fi
23165
23166 if test -n "$ac_config_headers"; then
23167   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23168 fi
23169
23170 if test -n "$ac_config_links"; then
23171   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23172 fi
23173
23174 if test -n "$ac_config_commands"; then
23175   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23176 fi
23177
23178 cat >>"$CONFIG_STATUS" <<\EOF
23179
23180 ac_cs_usage="\
23181 \`$as_me' instantiates files from templates according to the
23182 current configuration.
23183
23184 Usage: $0 [OPTIONS] [FILE]...
23185
23186   -h, --help       print this help, then exit
23187   -V, --version    print version number, then exit
23188   -d, --debug      don't remove temporary files
23189       --recheck    update $as_me by reconfiguring in the same conditions
23190   --file=FILE[:TEMPLATE]
23191                    instantiate the configuration file FILE
23192   --header=FILE[:TEMPLATE]
23193                    instantiate the configuration header FILE
23194
23195 Configuration files:
23196 $config_files
23197
23198 Configuration headers:
23199 $config_headers
23200
23201 Configuration commands:
23202 $config_commands
23203
23204 Report bugs to <dickey@invisible-island.net>."
23205 EOF
23206
23207 cat >>"$CONFIG_STATUS" <<EOF
23208 ac_cs_version="\\
23209 config.status
23210 configured by $0, generated by GNU Autoconf 2.52.20210509,
23211   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23212
23213 Copyright 2003-2020,2021        Thomas E. Dickey
23214 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23215 Free Software Foundation, Inc.
23216 This config.status script is free software; the Free Software Foundation
23217 gives unlimited permission to copy, distribute and modify it."
23218 srcdir="$srcdir"
23219 INSTALL="$INSTALL"
23220 EOF
23221
23222 cat >>"$CONFIG_STATUS" <<\EOF
23223 # If no file are specified by the user, then we need to provide default
23224 # value.  By we need to know if files were specified by the user.
23225 ac_need_defaults=:
23226 while test $# != 0
23227 do
23228   case $1 in
23229   --*=*)
23230     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23231     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23232     shift
23233     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23234     shift
23235     ;;
23236   -*);;
23237   *) # This is not an option, so the user has probably given explicit
23238      # arguments.
23239      ac_need_defaults=false;;
23240   esac
23241
23242   case $1 in
23243   # Handling of the options.
23244 EOF
23245 cat >>"$CONFIG_STATUS" <<EOF
23246   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23247     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23248     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23249 EOF
23250 cat >>"$CONFIG_STATUS" <<\EOF
23251   --version | --vers* | -V )
23252     echo "$ac_cs_version"; exit 0 ;;
23253   --he | --h)
23254     # Conflict between --help and --header
23255     { { echo "$as_me:23255: error: ambiguous option: $1
23256 Try \`$0 --help' for more information." >&5
23257 echo "$as_me: error: ambiguous option: $1
23258 Try \`$0 --help' for more information." >&2;}
23259    { (exit 1); exit 1; }; };;
23260   --help | --hel | -h )
23261     echo "$ac_cs_usage"; exit 0 ;;
23262   --debug | --d* | -d )
23263     debug=: ;;
23264   --file | --fil | --fi | --f )
23265     shift
23266     CONFIG_FILES="$CONFIG_FILES $1"
23267     ac_need_defaults=false;;
23268   --header | --heade | --head | --hea )
23269     shift
23270     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23271     ac_need_defaults=false;;
23272
23273   # This is an error.
23274   -*) { { echo "$as_me:23274: error: unrecognized option: $1
23275 Try \`$0 --help' for more information." >&5
23276 echo "$as_me: error: unrecognized option: $1
23277 Try \`$0 --help' for more information." >&2;}
23278    { (exit 1); exit 1; }; } ;;
23279
23280   *) ac_config_targets="$ac_config_targets $1" ;;
23281
23282   esac
23283   shift
23284 done
23285
23286 exec 5>>config.log
23287 cat >&5 << _ACEOF
23288
23289 ## ----------------------- ##
23290 ## Running config.status.  ##
23291 ## ----------------------- ##
23292
23293 This file was extended by $as_me 2.52.20210509, executed with
23294   CONFIG_FILES    = $CONFIG_FILES
23295   CONFIG_HEADERS  = $CONFIG_HEADERS
23296   CONFIG_LINKS    = $CONFIG_LINKS
23297   CONFIG_COMMANDS = $CONFIG_COMMANDS
23298   > "$ac_cs_invocation"
23299 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23300
23301 _ACEOF
23302 EOF
23303
23304 cat >>"$CONFIG_STATUS" <<EOF
23305 #
23306 # INIT-COMMANDS section.
23307 #
23308
23309 AWK="$AWK"
23310 ECHO_CC="$ECHO_CC"
23311 ECHO_LD="$ECHO_LD"
23312 SHOW_CC="$SHOW_LD"
23313
23314 EOF
23315
23316 cat >>"$CONFIG_STATUS" <<\EOF
23317 for ac_config_target in $ac_config_targets
23318 do
23319   case "$ac_config_target" in
23320   # Handling of arguments.
23321   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23322   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23323   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23324   *) { { echo "$as_me:23324: error: invalid argument: $ac_config_target" >&5
23325 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23326    { (exit 1); exit 1; }; };;
23327   esac
23328 done
23329
23330 # If the user did not use the arguments to specify the items to instantiate,
23331 # then the envvar interface is used.  Set only those that are not.
23332 # We use the long form for the default assignment because of an extremely
23333 # bizarre bug on SunOS 4.1.3.
23334 if "$ac_need_defaults"; then
23335   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23336   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23337   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23338 fi
23339
23340 # Create a temporary directory, and hook for its removal unless debugging.
23341 $debug ||
23342 {
23343   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23344   trap '{ (exit 1); exit 1; }' 1 2 13 15
23345 }
23346
23347 # Create a (secure) tmp directory for tmp files.
23348 : ${TMPDIR=/tmp}
23349 {
23350   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23351   test -n "$tmp" && test -d "$tmp"
23352 }  ||
23353 {
23354   tmp=$TMPDIR/cs$$-$RANDOM
23355   (umask 077 && mkdir $tmp)
23356 } ||
23357 {
23358    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23359    { (exit 1); exit 1; }
23360 }
23361
23362 EOF
23363
23364 cat >>"$CONFIG_STATUS" <<EOF
23365
23366 #
23367 # CONFIG_FILES section.
23368 #
23369
23370 # No need to generate the scripts if there are no CONFIG_FILES.
23371 # This happens for instance when ./config.status config.h
23372 if test -n "\$CONFIG_FILES"; then
23373   # Protect against being on the right side of a sed subst in config.status.
23374   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23375    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23376 s,@SHELL@,$SHELL,;t t
23377 s,@exec_prefix@,$exec_prefix,;t t
23378 s,@prefix@,$prefix,;t t
23379 s,@program_transform_name@,$program_transform_name,;t t
23380 s,@bindir@,$bindir,;t t
23381 s,@sbindir@,$sbindir,;t t
23382 s,@libexecdir@,$libexecdir,;t t
23383 s,@datarootdir@,$datarootdir,;t t
23384 s,@datadir@,$datadir,;t t
23385 s,@sysconfdir@,$sysconfdir,;t t
23386 s,@sharedstatedir@,$sharedstatedir,;t t
23387 s,@localstatedir@,$localstatedir,;t t
23388 s,@runstatedir@,$runstatedir,;t t
23389 s,@libdir@,$libdir,;t t
23390 s,@includedir@,$includedir,;t t
23391 s,@oldincludedir@,$oldincludedir,;t t
23392 s,@infodir@,$infodir,;t t
23393 s,@mandir@,$mandir,;t t
23394 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23395 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23396 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23397 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23398 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23399 s,@build_alias@,$build_alias,;t t
23400 s,@host_alias@,$host_alias,;t t
23401 s,@target_alias@,$target_alias,;t t
23402 s,@ECHO_C@,$ECHO_C,;t t
23403 s,@ECHO_N@,$ECHO_N,;t t
23404 s,@ECHO_T@,$ECHO_T,;t t
23405 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23406 s,@DEFS@,$DEFS,;t t
23407 s,@LIBS@,$LIBS,;t t
23408 s,@build@,$build,;t t
23409 s,@build_cpu@,$build_cpu,;t t
23410 s,@build_vendor@,$build_vendor,;t t
23411 s,@build_os@,$build_os,;t t
23412 s,@host@,$host,;t t
23413 s,@host_cpu@,$host_cpu,;t t
23414 s,@host_vendor@,$host_vendor,;t t
23415 s,@host_os@,$host_os,;t t
23416 s,@SET_MAKE@,$SET_MAKE,;t t
23417 s,@CC@,$CC,;t t
23418 s,@CFLAGS@,$CFLAGS,;t t
23419 s,@LDFLAGS@,$LDFLAGS,;t t
23420 s,@CPPFLAGS@,$CPPFLAGS,;t t
23421 s,@ac_ct_CC@,$ac_ct_CC,;t t
23422 s,@EXEEXT@,$EXEEXT,;t t
23423 s,@OBJEXT@,$OBJEXT,;t t
23424 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23425 s,@CPP@,$CPP,;t t
23426 s,@GREP@,$GREP,;t t
23427 s,@EGREP@,$EGREP,;t t
23428 s,@AWK@,$AWK,;t t
23429 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23430 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23431 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23432 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23433 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23434 s,@LINT@,$LINT,;t t
23435 s,@LINT_OPTS@,$LINT_OPTS,;t t
23436 s,@CTAGS@,$CTAGS,;t t
23437 s,@ETAGS@,$ETAGS,;t t
23438 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23439 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23440 s,@MATH_LIB@,$MATH_LIB,;t t
23441 s,@top_builddir@,$top_builddir,;t t
23442 s,@CC_G_OPT@,$CC_G_OPT,;t t
23443 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23444 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23445 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23446 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23447 s,@LD@,$LD,;t t
23448 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23449 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23450 s,@LD_MODEL@,$LD_MODEL,;t t
23451 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23452 s,@LIBTOOL@,$LIBTOOL,;t t
23453 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23454 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23455 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23456 s,@LIB_LINK@,$LIB_LINK,;t t
23457 s,@LINK_TESTS@,$LINK_TESTS,;t t
23458 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23459 s,@PACKAGE@,$PACKAGE,;t t
23460 s,@PTHREAD@,$PTHREAD,;t t
23461 s,@TEST_ARGS@,$TEST_ARGS,;t t
23462 s,@TEST_DEPS@,$TEST_DEPS,;t t
23463 s,@TEST_LIBS@,$TEST_LIBS,;t t
23464 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23465 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23466 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23467 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23468 s,@includesubdir@,$includesubdir,;t t
23469 s,@FGREP@,$FGREP,;t t
23470 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23471 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
23472 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23473 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23474 s,@ECHO_LT@,$ECHO_LT,;t t
23475 s,@ECHO_LD@,$ECHO_LD,;t t
23476 s,@RULE_CC@,$RULE_CC,;t t
23477 s,@SHOW_CC@,$SHOW_CC,;t t
23478 s,@ECHO_CC@,$ECHO_CC,;t t
23479 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23480 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23481 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23482 s,@X_CFLAGS@,$X_CFLAGS,;t t
23483 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23484 s,@X_LIBS@,$X_LIBS,;t t
23485 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23486 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23487 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23488 s,@RGB_PATH@,$RGB_PATH,;t t
23489 s,@no_x11_rgb@,$no_x11_rgb,;t t
23490 s,@FORM_NAME@,$FORM_NAME,;t t
23491 s,@MENU_NAME@,$MENU_NAME,;t t
23492 s,@PANEL_NAME@,$PANEL_NAME,;t t
23493 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23494 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23495 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23496 CEOF
23497
23498 EOF
23499
23500   cat >>"$CONFIG_STATUS" <<\EOF
23501   # Split the substitutions into bite-sized pieces for seds with
23502   # small command number limits, like on Digital OSF/1 and HP-UX.
23503   ac_max_sed_lines=48
23504   ac_sed_frag=1 # Number of current file.
23505   ac_beg=1 # First line for current file.
23506   ac_end=$ac_max_sed_lines # Line after last line for current file.
23507   ac_more_lines=:
23508   ac_sed_cmds=
23509   while "$ac_more_lines"; do
23510     if test "$ac_beg" -gt 1; then
23511       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23512     else
23513       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23514     fi
23515     if test ! -s $tmp/subs.frag; then
23516       ac_more_lines=false
23517     else
23518       # The purpose of the label and of the branching condition is to
23519       # speed up the sed processing (if there are no `@' at all, there
23520       # is no need to browse any of the substitutions).
23521       # These are the two extra sed commands mentioned above.
23522       (echo ':t
23523   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23524       # It is possible to make a multiline substitution using escaped newlines.
23525       # Ensure that we do not split the substitution between script fragments.
23526       ac_BEG=$ac_end
23527       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23528       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23529       if test -s $tmp/subs.next; then
23530         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23531         if test ! -s $tmp/subs.edit; then
23532           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23533           if test ! -s $tmp/subs.edit; then
23534             if test "$ac_beg" -gt 1; then
23535               ac_end=`expr "$ac_end" - 1`
23536               continue
23537             fi
23538           fi
23539         fi
23540       fi
23541
23542       if test -z "$ac_sed_cmds"; then
23543         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23544       else
23545         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23546       fi
23547       ac_sed_frag=`expr "$ac_sed_frag" + 1`
23548       ac_beg=$ac_end
23549       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
23550     fi
23551   done
23552   if test -z "$ac_sed_cmds"; then
23553     ac_sed_cmds=cat
23554   fi
23555 fi # test -n "$CONFIG_FILES"
23556
23557 EOF
23558 cat >>"$CONFIG_STATUS" <<\EOF
23559 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23560   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23561   case "$ac_file" in
23562   - | *:- | *:-:* ) # input from stdin
23563         cat >$tmp/stdin
23564         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23565         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23566   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23567         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23568   * )   ac_file_in=$ac_file.in ;;
23569   esac
23570
23571   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23572   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23573          X"$ac_file" : 'X\(//\)[^/]' \| \
23574          X"$ac_file" : 'X\(//\)$' \| \
23575          X"$ac_file" : 'X\(/\)' \| \
23576          .     : '\(.\)' 2>/dev/null ||
23577 echo X"$ac_file" |
23578     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23579           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23580           /^X\(\/\/\)$/{ s//\1/; q; }
23581           /^X\(\/\).*/{ s//\1/; q; }
23582           s/.*/./; q'`
23583   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23584     { case "$ac_dir" in
23585   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23586   *)                      as_incr_dir=.;;
23587 esac
23588 as_dummy="$ac_dir"
23589 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23590   case $as_mkdir_dir in
23591     # Skip DOS drivespec
23592     ?:) as_incr_dir=$as_mkdir_dir ;;
23593     *)
23594       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23595       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23596     ;;
23597   esac
23598 done; }
23599
23600     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23601     # A "../" for each directory in $ac_dir_suffix.
23602     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23603   else
23604     ac_dir_suffix= ac_dots=
23605   fi
23606
23607   case "$srcdir" in
23608   .)  ac_srcdir=.
23609       if test -z "$ac_dots"; then
23610          ac_top_srcdir=.
23611       else
23612          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
23613       fi ;;
23614   [\\/]* | ?:[\\/]* )
23615       ac_srcdir="$srcdir$ac_dir_suffix";
23616       ac_top_srcdir="$srcdir" ;;
23617   *) # Relative path.
23618     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
23619     ac_top_srcdir="$ac_dots$srcdir" ;;
23620   esac
23621
23622   case $INSTALL in
23623   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23624   *) ac_INSTALL=$ac_dots$INSTALL ;;
23625   esac
23626
23627   if test x"$ac_file" != x-; then
23628     { echo "$as_me:23628: creating $ac_file" >&5
23629 echo "$as_me: creating $ac_file" >&6;}
23630     rm -f "$ac_file"
23631   fi
23632   # Let's still pretend it is `configure' which instantiates (i.e., don't
23633   # use $as_me), people would be surprised to read:
23634   #    /* config.h.  Generated automatically by config.status.  */
23635   configure_input="Generated automatically from `echo $ac_file_in |
23636                                                  sed 's,.*/,,'` by configure."
23637
23638   # First look for the input files in the build tree, otherwise in the
23639   # src tree.
23640   ac_file_inputs=`IFS=:
23641     for f in $ac_file_in; do
23642       case $f in
23643       -) echo $tmp/stdin ;;
23644       [\\/$]*)
23645          # Absolute (can't be DOS-style, as IFS=:)
23646          test -f "$f" || { { echo "$as_me:23646: error: cannot find input file: $f" >&5
23647 echo "$as_me: error: cannot find input file: $f" >&2;}
23648    { (exit 1); exit 1; }; }
23649          echo $f;;
23650       *) # Relative
23651          if test -f "$f"; then
23652            # Build tree
23653            echo $f
23654          elif test -f "$srcdir/$f"; then
23655            # Source tree
23656            echo "$srcdir/$f"
23657          else
23658            # /dev/null tree
23659            { { echo "$as_me:23659: error: cannot find input file: $f" >&5
23660 echo "$as_me: error: cannot find input file: $f" >&2;}
23661    { (exit 1); exit 1; }; }
23662          fi;;
23663       esac
23664     done` || { (exit 1); exit 1; }
23665 EOF
23666 cat >>"$CONFIG_STATUS" <<\EOF
23667   ac_warn_datarootdir=no
23668   if test x"$ac_file" != x-; then
23669     for ac_item in $ac_file_inputs
23670     do
23671       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
23672       if test -n "$ac_seen"; then
23673         ac_used=`grep '@datarootdir@' "$ac_item"`
23674         if test -z "$ac_used"; then
23675           { echo "$as_me:23675: WARNING: datarootdir was used implicitly but not set:
23676 $ac_seen" >&5
23677 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23678 $ac_seen" >&2;}
23679           ac_warn_datarootdir=yes
23680         fi
23681       fi
23682       ac_seen=`grep '${datarootdir}' "$ac_item"`
23683       if test -n "$ac_seen"; then
23684         { echo "$as_me:23684: WARNING: datarootdir was used explicitly but not set:
23685 $ac_seen" >&5
23686 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23687 $ac_seen" >&2;}
23688         ac_warn_datarootdir=yes
23689       fi
23690     done
23691   fi
23692
23693 if test "x$ac_warn_datarootdir" = xyes; then
23694   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23695 fi
23696
23697 EOF
23698 cat >>"$CONFIG_STATUS" <<EOF
23699   sed "$ac_vpsub
23700 $extrasub
23701 EOF
23702 cat >>"$CONFIG_STATUS" <<\EOF
23703 :t
23704 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23705 s,@configure_input@,$configure_input,;t t
23706 s,@srcdir@,$ac_srcdir,;t t
23707 s,@top_srcdir@,$ac_top_srcdir,;t t
23708 s,@INSTALL@,$ac_INSTALL,;t t
23709 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23710   rm -f $tmp/stdin
23711   if test x"$ac_file" != x-; then
23712     cp "$tmp/out" "$ac_file"
23713
23714     for ac_name in prefix exec_prefix datarootdir
23715     do
23716         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
23717         if test -n "$ac_seen"; then
23718             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
23719             if test -z "$ac_init"; then
23720               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23721               { echo "$as_me:23721: WARNING: Variable $ac_name is used but was not set:
23722 $ac_seen" >&5
23723 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23724 $ac_seen" >&2;}
23725             fi
23726         fi
23727     done
23728     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
23729     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
23730     if test -s $tmp/out; then
23731       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23732       { echo "$as_me:23732: WARNING: Some variables may not be substituted:
23733 $ac_seen" >&5
23734 echo "$as_me: WARNING: Some variables may not be substituted:
23735 $ac_seen" >&2;}
23736     fi
23737   else
23738     cat $tmp/out
23739   fi
23740   rm -f $tmp/out
23741
23742 done
23743 EOF
23744 cat >>"$CONFIG_STATUS" <<\EOF
23745
23746 #
23747 # CONFIG_HEADER section.
23748 #
23749
23750 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23751 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23752 #
23753 # ac_d sets the value in "#define NAME VALUE" lines.
23754 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23755 ac_dB='[        ].*$,\1#\2'
23756 ac_dC=' '
23757 ac_dD=',;t'
23758 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23759 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23760 ac_iB='\([      ]\),\1#\2define\3'
23761 ac_iC=' '
23762 ac_iD='\4,;t'
23763 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23764 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23765 ac_uB='$,\1#\2define\3'
23766 ac_uC=' '
23767 ac_uD=',;t'
23768
23769 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23770   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23771   case "$ac_file" in
23772   - | *:- | *:-:* ) # input from stdin
23773         cat >$tmp/stdin
23774         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23775         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23776   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23777         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23778   * )   ac_file_in=$ac_file.in ;;
23779   esac
23780
23781   test x"$ac_file" != x- && { echo "$as_me:23781: creating $ac_file" >&5
23782 echo "$as_me: creating $ac_file" >&6;}
23783
23784   # First look for the input files in the build tree, otherwise in the
23785   # src tree.
23786   ac_file_inputs=`IFS=:
23787     for f in $ac_file_in; do
23788       case $f in
23789       -) echo $tmp/stdin ;;
23790       [\\/$]*)
23791          # Absolute (can't be DOS-style, as IFS=:)
23792          test -f "$f" || { { echo "$as_me:23792: error: cannot find input file: $f" >&5
23793 echo "$as_me: error: cannot find input file: $f" >&2;}
23794    { (exit 1); exit 1; }; }
23795          echo $f;;
23796       *) # Relative
23797          if test -f "$f"; then
23798            # Build tree
23799            echo $f
23800          elif test -f "$srcdir/$f"; then
23801            # Source tree
23802            echo "$srcdir/$f"
23803          else
23804            # /dev/null tree
23805            { { echo "$as_me:23805: error: cannot find input file: $f" >&5
23806 echo "$as_me: error: cannot find input file: $f" >&2;}
23807    { (exit 1); exit 1; }; }
23808          fi;;
23809       esac
23810     done` || { (exit 1); exit 1; }
23811   # Remove the trailing spaces.
23812   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23813
23814 EOF
23815
23816 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23817 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23818 # be either 'cat' or 'sort'.
23819 cat confdefs.h | uniq >conftest.vals
23820
23821 # Break up conftest.vals because some shells have a limit on
23822 # the size of here documents, and old seds have small limits too.
23823
23824 rm -f conftest.tail
23825 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
23826 while grep . conftest.vals >/dev/null
23827 do
23828   # Write chunks of a limited-size here document to conftest.frag.
23829   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
23830   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
23831   echo 'CEOF' >> "$CONFIG_STATUS"
23832   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
23833   rm -f conftest.vals
23834   mv conftest.tail conftest.vals
23835 done
23836 rm -f conftest.vals
23837
23838 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23839 # marker @DEFS@.
23840 echo '  cat >> conftest.edit <<CEOF
23841 /@DEFS@/r conftest.frag
23842 /@DEFS@/d
23843 CEOF
23844 sed -f conftest.edit $tmp/in > $tmp/out
23845 rm -f $tmp/in
23846 mv $tmp/out $tmp/in
23847 rm -f conftest.edit conftest.frag
23848 ' >> "$CONFIG_STATUS"
23849
23850 cat >>"$CONFIG_STATUS" <<\EOF
23851   # Let's still pretend it is `configure' which instantiates (i.e., don't
23852   # use $as_me), people would be surprised to read:
23853   #    /* config.h.  Generated automatically by config.status.  */
23854   if test x"$ac_file" = x-; then
23855     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23856   else
23857     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23858   fi
23859   cat $tmp/in >>$tmp/config.h
23860   rm -f $tmp/in
23861   if test x"$ac_file" != x-; then
23862     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
23863       { echo "$as_me:23863: $ac_file is unchanged" >&5
23864 echo "$as_me: $ac_file is unchanged" >&6;}
23865     else
23866       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23867          X"$ac_file" : 'X\(//\)[^/]' \| \
23868          X"$ac_file" : 'X\(//\)$' \| \
23869          X"$ac_file" : 'X\(/\)' \| \
23870          .     : '\(.\)' 2>/dev/null ||
23871 echo X"$ac_file" |
23872     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23873           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23874           /^X\(\/\/\)$/{ s//\1/; q; }
23875           /^X\(\/\).*/{ s//\1/; q; }
23876           s/.*/./; q'`
23877       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23878         { case "$ac_dir" in
23879   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23880   *)                      as_incr_dir=.;;
23881 esac
23882 as_dummy="$ac_dir"
23883 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23884   case $as_mkdir_dir in
23885     # Skip DOS drivespec
23886     ?:) as_incr_dir=$as_mkdir_dir ;;
23887     *)
23888       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23889       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23890     ;;
23891   esac
23892 done; }
23893
23894       fi
23895       rm -f "$ac_file"
23896       mv "$tmp/config.h" "$ac_file"
23897     fi
23898   else
23899     cat $tmp/config.h
23900     rm -f $tmp/config.h
23901   fi
23902 done
23903 EOF
23904 cat >>"$CONFIG_STATUS" <<\EOF
23905 #
23906 # CONFIG_COMMANDS section.
23907 #
23908 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23909   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23910   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23911
23912   case "$ac_dest" in
23913     default )
23914
23915 for cf_dir in .
23916 do
23917         if test ! -d "$srcdir/$cf_dir" ; then
23918                 continue
23919         elif test -f "$srcdir/$cf_dir/programs" ; then
23920                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
23921         fi
23922 done
23923
23924         cat >>Makefile <<TEST_EOF
23925
23926 # These rules are generated so we do not rely on suffix rules, which do not
23927 # work consistently for different make-programs (the '\$(MODEL)/' confuses
23928 # some, and the '\$x' confuses others).
23929 TEST_EOF
23930
23931 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
23932 for N in $LIST
23933 do
23934         cat >>Makefile <<TEST_EOF
23935
23936 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
23937         \$(srcdir)/test.priv.h \\
23938         ncurses_cfg.h
23939         $SHOW_CC
23940         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
23941 TEST_EOF
23942 done
23943
23944 if test -f ../config.guess && test -f ../config.sub
23945 then
23946         cat >>Makefile <<TEST_EOF
23947
23948 # if we used CF_INHERIT for getting these files, we can remove them
23949 distclean::
23950         rm -f config.guess config.sub
23951 TEST_EOF
23952 fi
23953  ;;
23954   esac
23955 done
23956 EOF
23957
23958 cat >>"$CONFIG_STATUS" <<\EOF
23959
23960 { (exit 0); exit 0; }
23961 EOF
23962 chmod +x "$CONFIG_STATUS"
23963 ac_clean_files=$ac_clean_files_save
23964
23965 # configure is writing to config.log, and then calls config.status.
23966 # config.status does its own redirection, appending to config.log.
23967 # Unfortunately, on DOS this fails, as config.log is still kept open
23968 # by configure, so config.status won't be able to write to it; its
23969 # output is simply discarded.  So we exec the FD to /dev/null,
23970 # effectively closing config.log, so it can be properly (re)opened and
23971 # appended to by config.status.  When coming back to configure, we
23972 # need to make the FD available again.
23973 if test "$no_create" != yes; then
23974   ac_cs_success=:
23975   exec 5>/dev/null
23976   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
23977   exec 5>>config.log
23978   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
23979   # would make configure fail if this is the last instruction.
23980   "$ac_cs_success" || { (exit 1); exit 1; }
23981 fi
23982