]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.4 - patch 20230107
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20221202.
4 #
5 # Copyright 2003-2021,2022      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-2021,2022        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.20221202.  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 for \".PHONY\" make-support" >&5
3001 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3002 if test "${cf_cv_make_PHONY+set}" = set; then
3003   echo $ECHO_N "(cached) $ECHO_C" >&6
3004 else
3005
3006         rm -rf conftest*
3007         (
3008                 mkdir conftest || exit 1
3009                 cd conftest
3010                 cat >makefile <<'CF_EOF'
3011 .PHONY: always
3012 DATA=0
3013 always: always.out
3014         @echo "** making $@ $(DATA)"
3015 once: once.out
3016         @echo "** making $@ $(DATA)"
3017 always.out:
3018         @echo "** making $@ $(DATA)"
3019         echo $(DATA) > $@
3020 once.out:
3021         @echo "** making $@ $(DATA)"
3022         echo $(DATA) > $@
3023 CF_EOF
3024                 for cf_data in 1 2 3
3025                 do
3026                         ${MAKE:-make} always DATA=$cf_data
3027                         ${MAKE:-make} once   DATA=$cf_data
3028                         ${MAKE:-make} -t always once
3029                         if test -f always ; then
3030                                 echo "no (case 1)" > ../conftest.tmp
3031                         elif test ! -f always.out ; then
3032                                 echo "no (case 2)" > ../conftest.tmp
3033                         elif test ! -f once.out ; then
3034                                 echo "no (case 3)" > ../conftest.tmp
3035                         elif ! cmp -s always.out once.out ; then
3036                                 echo "no (case 4)" > ../conftest.tmp
3037                                 diff always.out once.out
3038                         else
3039                                 cf_check="`cat always.out`"
3040                                 if test "x$cf_check" != "x$cf_data" ; then
3041                                         echo "no (case 5)" > ../conftest.tmp
3042                                 else
3043                                         echo yes > ../conftest.tmp
3044                                         rm -f ./*.out
3045                                         continue
3046                                 fi
3047                         fi
3048                         break
3049                 done
3050         ) >&5 2>&1
3051         cf_cv_make_PHONY="`cat conftest.tmp`"
3052         rm -rf conftest*
3053
3054 fi
3055 echo "$as_me:3055: result: $cf_cv_make_PHONY" >&5
3056 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3057 MAKE_NO_PHONY="#"
3058 MAKE_PHONY="#"
3059 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3060 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3061
3062 echo "$as_me:3062: checking if filesystem supports mixed-case filenames" >&5
3063 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3064 if test "${cf_cv_mixedcase+set}" = set; then
3065   echo $ECHO_N "(cached) $ECHO_C" >&6
3066 else
3067
3068 if test "$cross_compiling" = yes ; then
3069         case "$target_alias" in
3070         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3071                 cf_cv_mixedcase=no
3072                 ;;
3073         (*)
3074                 cf_cv_mixedcase=yes
3075                 ;;
3076         esac
3077 else
3078         rm -f conftest CONFTEST
3079         echo test >conftest
3080         if test -f CONFTEST ; then
3081                 cf_cv_mixedcase=no
3082         else
3083                 cf_cv_mixedcase=yes
3084         fi
3085         rm -f conftest CONFTEST
3086 fi
3087
3088 fi
3089 echo "$as_me:3089: result: $cf_cv_mixedcase" >&5
3090 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3091 test "$cf_cv_mixedcase" = yes &&
3092 cat >>confdefs.h <<\EOF
3093 #define MIXEDCASE_FILENAMES 1
3094 EOF
3095
3096 for ac_prog in exctags ctags
3097 do
3098   # Extract the first word of "$ac_prog", so it can be a program name with args.
3099 set dummy $ac_prog; ac_word=$2
3100 echo "$as_me:3100: checking for $ac_word" >&5
3101 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3102 if test "${ac_cv_prog_CTAGS+set}" = set; then
3103   echo $ECHO_N "(cached) $ECHO_C" >&6
3104 else
3105   if test -n "$CTAGS"; then
3106   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3107 else
3108   ac_save_IFS=$IFS; IFS=$ac_path_separator
3109 ac_dummy="$PATH"
3110 for ac_dir in $ac_dummy; do
3111   IFS=$ac_save_IFS
3112   test -z "$ac_dir" && ac_dir=.
3113   $as_executable_p "$ac_dir/$ac_word" || continue
3114 ac_cv_prog_CTAGS="$ac_prog"
3115 echo "$as_me:3115: found $ac_dir/$ac_word" >&5
3116 break
3117 done
3118
3119 fi
3120 fi
3121 CTAGS=$ac_cv_prog_CTAGS
3122 if test -n "$CTAGS"; then
3123   echo "$as_me:3123: result: $CTAGS" >&5
3124 echo "${ECHO_T}$CTAGS" >&6
3125 else
3126   echo "$as_me:3126: result: no" >&5
3127 echo "${ECHO_T}no" >&6
3128 fi
3129
3130   test -n "$CTAGS" && break
3131 done
3132
3133 for ac_prog in exetags etags
3134 do
3135   # Extract the first word of "$ac_prog", so it can be a program name with args.
3136 set dummy $ac_prog; ac_word=$2
3137 echo "$as_me:3137: checking for $ac_word" >&5
3138 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3139 if test "${ac_cv_prog_ETAGS+set}" = set; then
3140   echo $ECHO_N "(cached) $ECHO_C" >&6
3141 else
3142   if test -n "$ETAGS"; then
3143   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3144 else
3145   ac_save_IFS=$IFS; IFS=$ac_path_separator
3146 ac_dummy="$PATH"
3147 for ac_dir in $ac_dummy; do
3148   IFS=$ac_save_IFS
3149   test -z "$ac_dir" && ac_dir=.
3150   $as_executable_p "$ac_dir/$ac_word" || continue
3151 ac_cv_prog_ETAGS="$ac_prog"
3152 echo "$as_me:3152: found $ac_dir/$ac_word" >&5
3153 break
3154 done
3155
3156 fi
3157 fi
3158 ETAGS=$ac_cv_prog_ETAGS
3159 if test -n "$ETAGS"; then
3160   echo "$as_me:3160: result: $ETAGS" >&5
3161 echo "${ECHO_T}$ETAGS" >&6
3162 else
3163   echo "$as_me:3163: result: no" >&5
3164 echo "${ECHO_T}no" >&6
3165 fi
3166
3167   test -n "$ETAGS" && break
3168 done
3169
3170 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3171 set dummy ${CTAGS:-ctags}; ac_word=$2
3172 echo "$as_me:3172: checking for $ac_word" >&5
3173 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3174 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3175   echo $ECHO_N "(cached) $ECHO_C" >&6
3176 else
3177   if test -n "$MAKE_LOWER_TAGS"; then
3178   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3179 else
3180   ac_save_IFS=$IFS; IFS=$ac_path_separator
3181 ac_dummy="$PATH"
3182 for ac_dir in $ac_dummy; do
3183   IFS=$ac_save_IFS
3184   test -z "$ac_dir" && ac_dir=.
3185   $as_executable_p "$ac_dir/$ac_word" || continue
3186 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3187 echo "$as_me:3187: found $ac_dir/$ac_word" >&5
3188 break
3189 done
3190
3191   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3192 fi
3193 fi
3194 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3195 if test -n "$MAKE_LOWER_TAGS"; then
3196   echo "$as_me:3196: result: $MAKE_LOWER_TAGS" >&5
3197 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3198 else
3199   echo "$as_me:3199: result: no" >&5
3200 echo "${ECHO_T}no" >&6
3201 fi
3202
3203 if test "$cf_cv_mixedcase" = yes ; then
3204         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3205 set dummy ${ETAGS:-etags}; ac_word=$2
3206 echo "$as_me:3206: checking for $ac_word" >&5
3207 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3208 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3209   echo $ECHO_N "(cached) $ECHO_C" >&6
3210 else
3211   if test -n "$MAKE_UPPER_TAGS"; then
3212   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3213 else
3214   ac_save_IFS=$IFS; IFS=$ac_path_separator
3215 ac_dummy="$PATH"
3216 for ac_dir in $ac_dummy; do
3217   IFS=$ac_save_IFS
3218   test -z "$ac_dir" && ac_dir=.
3219   $as_executable_p "$ac_dir/$ac_word" || continue
3220 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3221 echo "$as_me:3221: found $ac_dir/$ac_word" >&5
3222 break
3223 done
3224
3225   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3226 fi
3227 fi
3228 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3229 if test -n "$MAKE_UPPER_TAGS"; then
3230   echo "$as_me:3230: result: $MAKE_UPPER_TAGS" >&5
3231 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3232 else
3233   echo "$as_me:3233: result: no" >&5
3234 echo "${ECHO_T}no" >&6
3235 fi
3236
3237 else
3238         MAKE_UPPER_TAGS=no
3239 fi
3240
3241 if test "$MAKE_UPPER_TAGS" = yes ; then
3242         MAKE_UPPER_TAGS=
3243 else
3244         MAKE_UPPER_TAGS="#"
3245 fi
3246
3247 if test "$MAKE_LOWER_TAGS" = yes ; then
3248         MAKE_LOWER_TAGS=
3249 else
3250         MAKE_LOWER_TAGS="#"
3251 fi
3252
3253 echo "$as_me:3253: checking if -lm needed for math functions" >&5
3254 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3255 if test "${cf_cv_need_libm+set}" = set; then
3256   echo $ECHO_N "(cached) $ECHO_C" >&6
3257 else
3258
3259         cat >"conftest.$ac_ext" <<_ACEOF
3260 #line 3260 "configure"
3261 #include "confdefs.h"
3262
3263                 #include <stdio.h>
3264                 #include <stdlib.h>
3265                 #include <math.h>
3266
3267 int
3268 main (void)
3269 {
3270 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3271   ;
3272   return 0;
3273 }
3274 _ACEOF
3275 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3276 if { (eval echo "$as_me:3276: \"$ac_link\"") >&5
3277   (eval $ac_link) 2>&5
3278   ac_status=$?
3279   echo "$as_me:3279: \$? = $ac_status" >&5
3280   (exit "$ac_status"); } &&
3281          { ac_try='test -s "conftest$ac_exeext"'
3282   { (eval echo "$as_me:3282: \"$ac_try\"") >&5
3283   (eval $ac_try) 2>&5
3284   ac_status=$?
3285   echo "$as_me:3285: \$? = $ac_status" >&5
3286   (exit "$ac_status"); }; }; then
3287   cf_cv_need_libm=no
3288 else
3289   echo "$as_me: failed program was:" >&5
3290 cat "conftest.$ac_ext" >&5
3291 cf_cv_need_libm=yes
3292 fi
3293 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3294 fi
3295 echo "$as_me:3295: result: $cf_cv_need_libm" >&5
3296 echo "${ECHO_T}$cf_cv_need_libm" >&6
3297
3298 if test "$cf_cv_need_libm" = yes
3299 then
3300
3301         cf_save_LIBS="$LIBS"
3302         LIBS="$LIBS -lm"
3303         echo "$as_me:3303: checking if -lm is available for math functions" >&5
3304 echo $ECHO_N "checking if -lm is available for math functions... $ECHO_C" >&6
3305 if test "${cf_cv_have_libm+set}" = set; then
3306   echo $ECHO_N "(cached) $ECHO_C" >&6
3307 else
3308
3309         cat >"conftest.$ac_ext" <<_ACEOF
3310 #line 3310 "configure"
3311 #include "confdefs.h"
3312
3313                 #include <stdio.h>
3314                 #include <stdlib.h>
3315                 #include <math.h>
3316
3317 int
3318 main (void)
3319 {
3320 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3321   ;
3322   return 0;
3323 }
3324 _ACEOF
3325 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3326 if { (eval echo "$as_me:3326: \"$ac_link\"") >&5
3327   (eval $ac_link) 2>&5
3328   ac_status=$?
3329   echo "$as_me:3329: \$? = $ac_status" >&5
3330   (exit "$ac_status"); } &&
3331          { ac_try='test -s "conftest$ac_exeext"'
3332   { (eval echo "$as_me:3332: \"$ac_try\"") >&5
3333   (eval $ac_try) 2>&5
3334   ac_status=$?
3335   echo "$as_me:3335: \$? = $ac_status" >&5
3336   (exit "$ac_status"); }; }; then
3337   cf_cv_have_libm=yes
3338 else
3339   echo "$as_me: failed program was:" >&5
3340 cat "conftest.$ac_ext" >&5
3341 cf_cv_have_libm=no
3342 fi
3343 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3344 fi
3345 echo "$as_me:3345: result: $cf_cv_have_libm" >&5
3346 echo "${ECHO_T}$cf_cv_have_libm" >&6
3347         LIBS="$cf_save_LIBS"
3348
3349         if test "$cf_cv_have_libm" = yes
3350         then
3351                 MATH_LIB=-lm
3352         fi
3353 else
3354         cf_cv_have_libm=yes
3355 fi
3356
3357 if test "$cf_cv_have_libm" = yes
3358 then
3359
3360 cat >>confdefs.h <<\EOF
3361 #define HAVE_MATH_FUNCS 1
3362 EOF
3363
3364 fi
3365
3366 top_builddir=`pwd`
3367
3368 CC_G_OPT="-g"
3369 CC_SHARED_OPTS=unknown
3370 CPPFLAGS="$CPPFLAGS"
3371 DFT_DEP_SUFFIX=""
3372 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3373 DFT_UPR_MODEL="NORMAL"
3374 LD="ld"
3375 LDFLAGS_SHARED=""
3376 LDFLAGS_STATIC=""
3377 LD_MODEL=""
3378 LD_SHARED_OPTS=""
3379 LIBTOOL=""
3380 LIBTOOL_OPTS=""
3381 LIB_CLEAN=""
3382 LIB_COMPILE=""
3383 LIB_LINK='${CC}'
3384 LINK_TESTS=""
3385 LOCAL_LDFLAGS=""
3386 PACKAGE="ncurses-examples"
3387 PTHREAD="-lm"
3388 TEST_ARGS=""
3389 TEST_DEPS=""
3390 TEST_LIBS=""
3391 TINFO_LDFLAGS=''
3392 TINFO_LIBS='$(LIBS_CURSES)'
3393 cf_cv_abi_version=""
3394 cf_cv_rel_version=""
3395 includesubdir=""
3396
3397 cf_cv_screen=curses
3398 cf_cv_libtype=
3399
3400 echo "$as_me:3400: checking for fgrep" >&5
3401 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3402 if test "${ac_cv_path_FGREP+set}" = set; then
3403   echo $ECHO_N "(cached) $ECHO_C" >&6
3404 else
3405   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3406    then ac_cv_path_FGREP="$GREP -F"
3407    else
3408      for ac_prog in gfgrep fgrep
3409 do
3410   # Extract the first word of "$ac_prog", so it can be a program name with args.
3411 set dummy $ac_prog; ac_word=$2
3412 echo "$as_me:3412: checking for $ac_word" >&5
3413 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3414 if test "${ac_cv_path_FGREP+set}" = set; then
3415   echo $ECHO_N "(cached) $ECHO_C" >&6
3416 else
3417   case $FGREP in
3418   [\\/]* | ?:[\\/]*)
3419   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3420   ;;
3421   *)
3422   ac_save_IFS=$IFS; IFS=$ac_path_separator
3423 ac_dummy="$PATH"
3424 for ac_dir in $ac_dummy; do
3425   IFS=$ac_save_IFS
3426   test -z "$ac_dir" && ac_dir=.
3427   if $as_executable_p "$ac_dir/$ac_word"; then
3428    ac_cv_path_FGREP="$ac_dir/$ac_word"
3429    echo "$as_me:3429: found $ac_dir/$ac_word" >&5
3430    break
3431 fi
3432 done
3433
3434   ;;
3435 esac
3436 fi
3437 FGREP=$ac_cv_path_FGREP
3438
3439 if test -n "$FGREP"; then
3440   echo "$as_me:3440: result: $FGREP" >&5
3441 echo "${ECHO_T}$FGREP" >&6
3442 else
3443   echo "$as_me:3443: result: no" >&5
3444 echo "${ECHO_T}no" >&6
3445 fi
3446
3447   test -n "$FGREP" && break
3448 done
3449 test -n "$FGREP" || FGREP=": "
3450
3451      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3451: error: cannot find workable fgrep" >&5
3452 echo "$as_me: error: cannot find workable fgrep" >&2;}
3453    { (exit 1); exit 1; }; }
3454    fi
3455 fi
3456 echo "$as_me:3456: result: $ac_cv_path_FGREP" >&5
3457 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3458  FGREP="$ac_cv_path_FGREP"
3459
3460 echo "$as_me:3460: checking if you want to use C11 _Noreturn feature" >&5
3461 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
3462
3463 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
3464 if test "${enable_stdnoreturn+set}" = set; then
3465   enableval="$enable_stdnoreturn"
3466   test "$enableval" != yes && enableval=no
3467         if test "$enableval" != "no" ; then
3468     enable_stdnoreturn=yes
3469         else
3470                 enable_stdnoreturn=no
3471         fi
3472 else
3473   enableval=no
3474         enable_stdnoreturn=no
3475
3476 fi;
3477 echo "$as_me:3477: result: $enable_stdnoreturn" >&5
3478 echo "${ECHO_T}$enable_stdnoreturn" >&6
3479
3480 if test $enable_stdnoreturn = yes; then
3481 echo "$as_me:3481: checking for C11 _Noreturn feature" >&5
3482 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3483 if test "${cf_cv_c11_noreturn+set}" = set; then
3484   echo $ECHO_N "(cached) $ECHO_C" >&6
3485 else
3486   cat >"conftest.$ac_ext" <<_ACEOF
3487 #line 3487 "configure"
3488 #include "confdefs.h"
3489
3490 #include <stdio.h>
3491 #include <stdlib.h>
3492 #include <stdnoreturn.h>
3493 static _Noreturn void giveup(void) { exit(0); }
3494
3495 int
3496 main (void)
3497 {
3498 if (feof(stdin)) giveup()
3499   ;
3500   return 0;
3501 }
3502 _ACEOF
3503 rm -f "conftest.$ac_objext"
3504 if { (eval echo "$as_me:3504: \"$ac_compile\"") >&5
3505   (eval $ac_compile) 2>&5
3506   ac_status=$?
3507   echo "$as_me:3507: \$? = $ac_status" >&5
3508   (exit "$ac_status"); } &&
3509          { ac_try='test -s "conftest.$ac_objext"'
3510   { (eval echo "$as_me:3510: \"$ac_try\"") >&5
3511   (eval $ac_try) 2>&5
3512   ac_status=$?
3513   echo "$as_me:3513: \$? = $ac_status" >&5
3514   (exit "$ac_status"); }; }; then
3515   cf_cv_c11_noreturn=yes
3516 else
3517   echo "$as_me: failed program was:" >&5
3518 cat "conftest.$ac_ext" >&5
3519 cf_cv_c11_noreturn=no
3520 fi
3521 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3522
3523 fi
3524 echo "$as_me:3524: result: $cf_cv_c11_noreturn" >&5
3525 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3526 else
3527         cf_cv_c11_noreturn=no,
3528 fi
3529
3530 if test "$cf_cv_c11_noreturn" = yes; then
3531
3532 cat >>confdefs.h <<\EOF
3533 #define HAVE_STDNORETURN_H 1
3534 EOF
3535
3536 cat >>confdefs.h <<EOF
3537 #define STDC_NORETURN _Noreturn
3538 EOF
3539
3540         HAVE_STDNORETURN_H=1
3541 else
3542         HAVE_STDNORETURN_H=0
3543 fi
3544
3545 if test "$GCC" = yes || test "$GXX" = yes
3546 then
3547 cat > conftest.i <<EOF
3548 #ifndef GCC_PRINTF
3549 #define GCC_PRINTF 0
3550 #endif
3551 #ifndef GCC_SCANF
3552 #define GCC_SCANF 0
3553 #endif
3554 #ifndef GCC_NORETURN
3555 #define GCC_NORETURN /* nothing */
3556 #endif
3557 #ifndef GCC_UNUSED
3558 #define GCC_UNUSED /* nothing */
3559 #endif
3560 EOF
3561 if test "$GCC" = yes
3562 then
3563         { echo "$as_me:3563: checking for $CC __attribute__ directives..." >&5
3564 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3565 cat > "conftest.$ac_ext" <<EOF
3566 #line 3566 "${as_me:-configure}"
3567 #include <stdio.h>
3568 #include "confdefs.h"
3569 #include "conftest.h"
3570 #include "conftest.i"
3571 #if     GCC_PRINTF
3572 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3573 #else
3574 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3575 #endif
3576 #if     GCC_SCANF
3577 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3578 #else
3579 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3580 #endif
3581 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3582 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3583 extern GCC_NORETURN void foo(void);
3584 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3585 EOF
3586         cf_printf_attribute=no
3587         cf_scanf_attribute=no
3588         for cf_attribute in scanf printf unused noreturn
3589         do
3590
3591 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3592
3593                 cf_directive="__attribute__(($cf_attribute))"
3594                 echo "checking for $CC $cf_directive" 1>&5
3595
3596                 case "$cf_attribute" in
3597                 (printf)
3598                         cf_printf_attribute=yes
3599                         cat >conftest.h <<EOF
3600 #define GCC_$cf_ATTRIBUTE 1
3601 EOF
3602                         ;;
3603                 (scanf)
3604                         cf_scanf_attribute=yes
3605                         cat >conftest.h <<EOF
3606 #define GCC_$cf_ATTRIBUTE 1
3607 EOF
3608                         ;;
3609                 (*)
3610                         cat >conftest.h <<EOF
3611 #define GCC_$cf_ATTRIBUTE $cf_directive
3612 EOF
3613                         ;;
3614                 esac
3615
3616                 if { (eval echo "$as_me:3616: \"$ac_compile\"") >&5
3617   (eval $ac_compile) 2>&5
3618   ac_status=$?
3619   echo "$as_me:3619: \$? = $ac_status" >&5
3620   (exit "$ac_status"); }; then
3621                         test -n "$verbose" && echo "$as_me:3621: result: ... $cf_attribute" >&5
3622 echo "${ECHO_T}... $cf_attribute" >&6
3623                         cat conftest.h >>confdefs.h
3624                         case "$cf_attribute" in
3625                         (noreturn)
3626
3627 cat >>confdefs.h <<EOF
3628 #define GCC_NORETURN $cf_directive
3629 EOF
3630
3631                                 ;;
3632                         (printf)
3633                                 cf_value='/* nothing */'
3634                                 if test "$cf_printf_attribute" != no ; then
3635                                         cf_value='__attribute__((format(printf,fmt,var)))'
3636
3637 cat >>confdefs.h <<\EOF
3638 #define GCC_PRINTF 1
3639 EOF
3640
3641                                 fi
3642
3643 cat >>confdefs.h <<EOF
3644 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3645 EOF
3646
3647                                 ;;
3648                         (scanf)
3649                                 cf_value='/* nothing */'
3650                                 if test "$cf_scanf_attribute" != no ; then
3651                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3652
3653 cat >>confdefs.h <<\EOF
3654 #define GCC_SCANF 1
3655 EOF
3656
3657                                 fi
3658
3659 cat >>confdefs.h <<EOF
3660 #define GCC_SCANFLIKE(fmt,var) $cf_value
3661 EOF
3662
3663                                 ;;
3664                         (unused)
3665
3666 cat >>confdefs.h <<EOF
3667 #define GCC_UNUSED $cf_directive
3668 EOF
3669
3670                                 ;;
3671                         esac
3672                 fi
3673         done
3674 else
3675         ${FGREP-fgrep} define conftest.i >>confdefs.h
3676 fi
3677 rm -rf ./conftest*
3678 fi
3679
3680 echo "$as_me:3680: checking if you want to work around bogus compiler/loader warnings" >&5
3681 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3682
3683 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3684 if test "${enable_string_hacks+set}" = set; then
3685   enableval="$enable_string_hacks"
3686   enable_string_hacks=$enableval
3687 else
3688   enable_string_hacks=no
3689 fi;
3690 echo "$as_me:3690: result: $enable_string_hacks" >&5
3691 echo "${ECHO_T}$enable_string_hacks" >&6
3692
3693 if test "x$enable_string_hacks" = "xyes"; then
3694
3695 cat >>confdefs.h <<\EOF
3696 #define USE_STRING_HACKS 1
3697 EOF
3698
3699         { echo "$as_me:3699: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3700 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3701         echo "$as_me:3701: checking for strlcat" >&5
3702 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3703 if test "${ac_cv_func_strlcat+set}" = set; then
3704   echo $ECHO_N "(cached) $ECHO_C" >&6
3705 else
3706   cat >"conftest.$ac_ext" <<_ACEOF
3707 #line 3707 "configure"
3708 #include "confdefs.h"
3709 #define strlcat autoconf_temporary
3710 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3711 #undef strlcat
3712
3713 #ifdef __cplusplus
3714 extern "C"
3715 #endif
3716
3717 /* We use char because int might match the return type of a gcc2
3718    builtin and then its argument prototype would still apply.  */
3719 char strlcat (void);
3720
3721 int
3722 main (void)
3723 {
3724
3725 /* The GNU C library defines stubs for functions which it implements
3726     to always fail with ENOSYS.  Some functions are actually named
3727     something starting with __ and the normal name is an alias.  */
3728 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3729 #error found stub for strlcat
3730 #endif
3731
3732         return strlcat ();
3733   ;
3734   return 0;
3735 }
3736 _ACEOF
3737 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3738 if { (eval echo "$as_me:3738: \"$ac_link\"") >&5
3739   (eval $ac_link) 2>&5
3740   ac_status=$?
3741   echo "$as_me:3741: \$? = $ac_status" >&5
3742   (exit "$ac_status"); } &&
3743          { ac_try='test -s "conftest$ac_exeext"'
3744   { (eval echo "$as_me:3744: \"$ac_try\"") >&5
3745   (eval $ac_try) 2>&5
3746   ac_status=$?
3747   echo "$as_me:3747: \$? = $ac_status" >&5
3748   (exit "$ac_status"); }; }; then
3749   ac_cv_func_strlcat=yes
3750 else
3751   echo "$as_me: failed program was:" >&5
3752 cat "conftest.$ac_ext" >&5
3753 ac_cv_func_strlcat=no
3754 fi
3755 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3756 fi
3757 echo "$as_me:3757: result: $ac_cv_func_strlcat" >&5
3758 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3759 if test "$ac_cv_func_strlcat" = yes; then
3760
3761 cat >>confdefs.h <<\EOF
3762 #define HAVE_STRLCAT 1
3763 EOF
3764
3765 else
3766
3767                 echo "$as_me:3767: checking for strlcat in -lbsd" >&5
3768 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3769 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3770   echo $ECHO_N "(cached) $ECHO_C" >&6
3771 else
3772   ac_check_lib_save_LIBS=$LIBS
3773 LIBS="-lbsd  $LIBS"
3774 cat >"conftest.$ac_ext" <<_ACEOF
3775 #line 3775 "configure"
3776 #include "confdefs.h"
3777
3778 /* Override any gcc2 internal prototype to avoid an error.  */
3779 #ifdef __cplusplus
3780 extern "C"
3781 #endif
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 strlcat ();
3785 int
3786 main (void)
3787 {
3788 strlcat ();
3789   ;
3790   return 0;
3791 }
3792 _ACEOF
3793 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3794 if { (eval echo "$as_me:3794: \"$ac_link\"") >&5
3795   (eval $ac_link) 2>&5
3796   ac_status=$?
3797   echo "$as_me:3797: \$? = $ac_status" >&5
3798   (exit "$ac_status"); } &&
3799          { ac_try='test -s "conftest$ac_exeext"'
3800   { (eval echo "$as_me:3800: \"$ac_try\"") >&5
3801   (eval $ac_try) 2>&5
3802   ac_status=$?
3803   echo "$as_me:3803: \$? = $ac_status" >&5
3804   (exit "$ac_status"); }; }; then
3805   ac_cv_lib_bsd_strlcat=yes
3806 else
3807   echo "$as_me: failed program was:" >&5
3808 cat "conftest.$ac_ext" >&5
3809 ac_cv_lib_bsd_strlcat=no
3810 fi
3811 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3812 LIBS=$ac_check_lib_save_LIBS
3813 fi
3814 echo "$as_me:3814: result: $ac_cv_lib_bsd_strlcat" >&5
3815 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3816 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3817
3818 cf_add_libs="$LIBS"
3819 # reverse order
3820 cf_add_0lib=
3821 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3822 # filter duplicates
3823 for cf_add_1lib in $cf_add_0lib; do
3824         for cf_add_2lib in $cf_add_libs; do
3825                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3826                         cf_add_1lib=
3827                         break
3828                 fi
3829         done
3830         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3831 done
3832 LIBS="$cf_add_libs"
3833
3834 for ac_header in bsd/string.h
3835 do
3836 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3837 echo "$as_me:3837: checking for $ac_header" >&5
3838 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3839 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3840   echo $ECHO_N "(cached) $ECHO_C" >&6
3841 else
3842   cat >"conftest.$ac_ext" <<_ACEOF
3843 #line 3843 "configure"
3844 #include "confdefs.h"
3845 #include <$ac_header>
3846 _ACEOF
3847 if { (eval echo "$as_me:3847: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3848   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3849   ac_status=$?
3850   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3851   rm -f conftest.er1
3852   cat conftest.err >&5
3853   echo "$as_me:3853: \$? = $ac_status" >&5
3854   (exit "$ac_status"); } >/dev/null; then
3855   if test -s conftest.err; then
3856     ac_cpp_err=$ac_c_preproc_warn_flag
3857   else
3858     ac_cpp_err=
3859   fi
3860 else
3861   ac_cpp_err=yes
3862 fi
3863 if test -z "$ac_cpp_err"; then
3864   eval "$as_ac_Header=yes"
3865 else
3866   echo "$as_me: failed program was:" >&5
3867   cat "conftest.$ac_ext" >&5
3868   eval "$as_ac_Header=no"
3869 fi
3870 rm -f conftest.err "conftest.$ac_ext"
3871 fi
3872 echo "$as_me:3872: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3873 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3874 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3875   cat >>confdefs.h <<EOF
3876 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3877 EOF
3878
3879 fi
3880 done
3881
3882 cat >>confdefs.h <<\EOF
3883 #define HAVE_STRLCAT 1
3884 EOF
3885
3886 fi
3887
3888 fi
3889
3890 for ac_func in strlcpy snprintf
3891 do
3892 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3893 echo "$as_me:3893: checking for $ac_func" >&5
3894 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3895 if eval "test \"\${$as_ac_var+set}\" = set"; then
3896   echo $ECHO_N "(cached) $ECHO_C" >&6
3897 else
3898   cat >"conftest.$ac_ext" <<_ACEOF
3899 #line 3899 "configure"
3900 #include "confdefs.h"
3901 #define $ac_func autoconf_temporary
3902 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3903 #undef $ac_func
3904
3905 #ifdef __cplusplus
3906 extern "C"
3907 #endif
3908
3909 /* We use char because int might match the return type of a gcc2
3910    builtin and then its argument prototype would still apply.  */
3911 char $ac_func (void);
3912
3913 int
3914 main (void)
3915 {
3916
3917 /* The GNU C library defines stubs for functions which it implements
3918     to always fail with ENOSYS.  Some functions are actually named
3919     something starting with __ and the normal name is an alias.  */
3920 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3921 #error found stub for $ac_func
3922 #endif
3923
3924         return $ac_func ();
3925   ;
3926   return 0;
3927 }
3928 _ACEOF
3929 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3930 if { (eval echo "$as_me:3930: \"$ac_link\"") >&5
3931   (eval $ac_link) 2>&5
3932   ac_status=$?
3933   echo "$as_me:3933: \$? = $ac_status" >&5
3934   (exit "$ac_status"); } &&
3935          { ac_try='test -s "conftest$ac_exeext"'
3936   { (eval echo "$as_me:3936: \"$ac_try\"") >&5
3937   (eval $ac_try) 2>&5
3938   ac_status=$?
3939   echo "$as_me:3939: \$? = $ac_status" >&5
3940   (exit "$ac_status"); }; }; then
3941   eval "$as_ac_var=yes"
3942 else
3943   echo "$as_me: failed program was:" >&5
3944 cat "conftest.$ac_ext" >&5
3945 eval "$as_ac_var=no"
3946 fi
3947 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3948 fi
3949 echo "$as_me:3949: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3950 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3951 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3952   cat >>confdefs.h <<EOF
3953 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3954 EOF
3955
3956 fi
3957 done
3958
3959 fi
3960
3961 echo "$as_me:3961: checking if the POSIX test-macros are already defined" >&5
3962 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3963 if test "${cf_cv_posix_visible+set}" = set; then
3964   echo $ECHO_N "(cached) $ECHO_C" >&6
3965 else
3966
3967 cat >"conftest.$ac_ext" <<_ACEOF
3968 #line 3968 "configure"
3969 #include "confdefs.h"
3970 #include <stdio.h>
3971 int
3972 main (void)
3973 {
3974
3975 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3976         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3977         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3978         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3979 #error conflicting symbols found
3980 #endif
3981
3982   ;
3983   return 0;
3984 }
3985 _ACEOF
3986 rm -f "conftest.$ac_objext"
3987 if { (eval echo "$as_me:3987: \"$ac_compile\"") >&5
3988   (eval $ac_compile) 2>&5
3989   ac_status=$?
3990   echo "$as_me:3990: \$? = $ac_status" >&5
3991   (exit "$ac_status"); } &&
3992          { ac_try='test -s "conftest.$ac_objext"'
3993   { (eval echo "$as_me:3993: \"$ac_try\"") >&5
3994   (eval $ac_try) 2>&5
3995   ac_status=$?
3996   echo "$as_me:3996: \$? = $ac_status" >&5
3997   (exit "$ac_status"); }; }; then
3998   cf_cv_posix_visible=no
3999 else
4000   echo "$as_me: failed program was:" >&5
4001 cat "conftest.$ac_ext" >&5
4002 cf_cv_posix_visible=yes
4003 fi
4004 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4005
4006 fi
4007 echo "$as_me:4007: result: $cf_cv_posix_visible" >&5
4008 echo "${ECHO_T}$cf_cv_posix_visible" >&6
4009
4010 if test "$cf_cv_posix_visible" = no; then
4011
4012 cf_XOPEN_SOURCE=600
4013 cf_POSIX_C_SOURCE=199506L
4014 cf_xopen_source=
4015
4016 case "$host_os" in
4017 (aix[4-7]*)
4018         cf_xopen_source="-D_ALL_SOURCE"
4019         ;;
4020 (msys)
4021         cf_XOPEN_SOURCE=600
4022         ;;
4023 (darwin[0-8].*)
4024         cf_xopen_source="-D_APPLE_C_SOURCE"
4025         ;;
4026 (darwin*)
4027         cf_xopen_source="-D_DARWIN_C_SOURCE"
4028         cf_XOPEN_SOURCE=
4029         ;;
4030 (freebsd*|dragonfly*|midnightbsd*)
4031         # 5.x headers associate
4032         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
4033         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
4034         cf_POSIX_C_SOURCE=200112L
4035         cf_XOPEN_SOURCE=600
4036         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4037         ;;
4038 (hpux11*)
4039         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
4040         ;;
4041 (hpux*)
4042         cf_xopen_source="-D_HPUX_SOURCE"
4043         ;;
4044 (irix[56].*)
4045         cf_xopen_source="-D_SGI_SOURCE"
4046         cf_XOPEN_SOURCE=
4047         ;;
4048 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
4049
4050 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
4051
4052 echo "$as_me:4052: checking if this is the GNU C library" >&5
4053 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
4054 if test "${cf_cv_gnu_library+set}" = set; then
4055   echo $ECHO_N "(cached) $ECHO_C" >&6
4056 else
4057
4058 cat >"conftest.$ac_ext" <<_ACEOF
4059 #line 4059 "configure"
4060 #include "confdefs.h"
4061 #include <sys/types.h>
4062 int
4063 main (void)
4064 {
4065
4066         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
4067                 return 0;
4068         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
4069                 return 0;
4070         #else
4071         #       error not GNU C library
4072         #endif
4073   ;
4074   return 0;
4075 }
4076 _ACEOF
4077 rm -f "conftest.$ac_objext"
4078 if { (eval echo "$as_me:4078: \"$ac_compile\"") >&5
4079   (eval $ac_compile) 2>&5
4080   ac_status=$?
4081   echo "$as_me:4081: \$? = $ac_status" >&5
4082   (exit "$ac_status"); } &&
4083          { ac_try='test -s "conftest.$ac_objext"'
4084   { (eval echo "$as_me:4084: \"$ac_try\"") >&5
4085   (eval $ac_try) 2>&5
4086   ac_status=$?
4087   echo "$as_me:4087: \$? = $ac_status" >&5
4088   (exit "$ac_status"); }; }; then
4089   cf_cv_gnu_library=yes
4090 else
4091   echo "$as_me: failed program was:" >&5
4092 cat "conftest.$ac_ext" >&5
4093 cf_cv_gnu_library=no
4094 fi
4095 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4096
4097 fi
4098 echo "$as_me:4098: result: $cf_cv_gnu_library" >&5
4099 echo "${ECHO_T}$cf_cv_gnu_library" >&6
4100
4101 if test x$cf_cv_gnu_library = xyes; then
4102
4103         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
4104         # was changed to help a little.  newlib incorporated the change about 4
4105         # years later.
4106         echo "$as_me:4106: checking if _DEFAULT_SOURCE can be used as a basis" >&5
4107 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
4108 if test "${cf_cv_gnu_library_219+set}" = set; then
4109   echo $ECHO_N "(cached) $ECHO_C" >&6
4110 else
4111
4112                 cf_save="$CPPFLAGS"
4113
4114         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4115         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4116
4117                 cat >"conftest.$ac_ext" <<_ACEOF
4118 #line 4118 "configure"
4119 #include "confdefs.h"
4120 #include <sys/types.h>
4121 int
4122 main (void)
4123 {
4124
4125                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
4126                                 return 0;
4127                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4128                                 return 0;
4129                         #else
4130                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4131                         #endif
4132   ;
4133   return 0;
4134 }
4135 _ACEOF
4136 rm -f "conftest.$ac_objext"
4137 if { (eval echo "$as_me:4137: \"$ac_compile\"") >&5
4138   (eval $ac_compile) 2>&5
4139   ac_status=$?
4140   echo "$as_me:4140: \$? = $ac_status" >&5
4141   (exit "$ac_status"); } &&
4142          { ac_try='test -s "conftest.$ac_objext"'
4143   { (eval echo "$as_me:4143: \"$ac_try\"") >&5
4144   (eval $ac_try) 2>&5
4145   ac_status=$?
4146   echo "$as_me:4146: \$? = $ac_status" >&5
4147   (exit "$ac_status"); }; }; then
4148   cf_cv_gnu_library_219=yes
4149 else
4150   echo "$as_me: failed program was:" >&5
4151 cat "conftest.$ac_ext" >&5
4152 cf_cv_gnu_library_219=no
4153 fi
4154 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4155                 CPPFLAGS="$cf_save"
4156
4157 fi
4158 echo "$as_me:4158: result: $cf_cv_gnu_library_219" >&5
4159 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4160
4161         if test "x$cf_cv_gnu_library_219" = xyes; then
4162                 cf_save="$CPPFLAGS"
4163                 echo "$as_me:4163: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4164 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4165 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4166   echo $ECHO_N "(cached) $ECHO_C" >&6
4167 else
4168
4169 cf_fix_cppflags=no
4170 cf_new_cflags=
4171 cf_new_cppflags=
4172 cf_new_extra_cppflags=
4173
4174 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4175 do
4176 case "$cf_fix_cppflags" in
4177 (no)
4178         case "$cf_add_cflags" in
4179         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4180                 case "$cf_add_cflags" in
4181                 (-D*)
4182                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4183
4184                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4185                                 && test -z "${cf_tst_cflags}" \
4186                                 && cf_fix_cppflags=yes
4187
4188                         if test "$cf_fix_cppflags" = yes ; then
4189
4190         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4191         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4192
4193                                 continue
4194                         elif test "${cf_tst_cflags}" = "\"'" ; then
4195
4196         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4197         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4198
4199                                 continue
4200                         fi
4201                         ;;
4202                 esac
4203                 case "$CPPFLAGS" in
4204                 (*$cf_add_cflags)
4205                         ;;
4206                 (*)
4207                         case "$cf_add_cflags" in
4208                         (-D*)
4209                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4210
4211 CPPFLAGS=`echo "$CPPFLAGS" | \
4212         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4213                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4214
4215                                 ;;
4216                         esac
4217
4218         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4219         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4220
4221                         ;;
4222                 esac
4223                 ;;
4224         (*)
4225
4226         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4227         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4228
4229                 ;;
4230         esac
4231         ;;
4232 (yes)
4233
4234         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4235         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4236
4237         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4238
4239         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4240                 && test -z "${cf_tst_cflags}" \
4241                 && cf_fix_cppflags=no
4242         ;;
4243 esac
4244 done
4245
4246 if test -n "$cf_new_cflags" ; then
4247
4248         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4249         CFLAGS="${CFLAGS}$cf_new_cflags"
4250
4251 fi
4252
4253 if test -n "$cf_new_cppflags" ; then
4254
4255         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4256         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4257
4258 fi
4259
4260 if test -n "$cf_new_extra_cppflags" ; then
4261
4262         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4263         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4264
4265 fi
4266
4267                         cat >"conftest.$ac_ext" <<_ACEOF
4268 #line 4268 "configure"
4269 #include "confdefs.h"
4270
4271                                 #include <limits.h>
4272                                 #include <sys/types.h>
4273
4274 int
4275 main (void)
4276 {
4277
4278                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4279                                         return 0;
4280                                 #else
4281                                 #       error GNU C library is too old
4282                                 #endif
4283   ;
4284   return 0;
4285 }
4286 _ACEOF
4287 rm -f "conftest.$ac_objext"
4288 if { (eval echo "$as_me:4288: \"$ac_compile\"") >&5
4289   (eval $ac_compile) 2>&5
4290   ac_status=$?
4291   echo "$as_me:4291: \$? = $ac_status" >&5
4292   (exit "$ac_status"); } &&
4293          { ac_try='test -s "conftest.$ac_objext"'
4294   { (eval echo "$as_me:4294: \"$ac_try\"") >&5
4295   (eval $ac_try) 2>&5
4296   ac_status=$?
4297   echo "$as_me:4297: \$? = $ac_status" >&5
4298   (exit "$ac_status"); }; }; then
4299   cf_cv_gnu_dftsrc_219=yes
4300 else
4301   echo "$as_me: failed program was:" >&5
4302 cat "conftest.$ac_ext" >&5
4303 cf_cv_gnu_dftsrc_219=no
4304 fi
4305 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4306
4307 fi
4308 echo "$as_me:4308: result: $cf_cv_gnu_dftsrc_219" >&5
4309 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4310                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4311         else
4312                 cf_cv_gnu_dftsrc_219=maybe
4313         fi
4314
4315         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4316
4317                 echo "$as_me:4317: checking if we must define _GNU_SOURCE" >&5
4318 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4319 if test "${cf_cv_gnu_source+set}" = set; then
4320   echo $ECHO_N "(cached) $ECHO_C" >&6
4321 else
4322
4323                 cat >"conftest.$ac_ext" <<_ACEOF
4324 #line 4324 "configure"
4325 #include "confdefs.h"
4326 #include <sys/types.h>
4327 int
4328 main (void)
4329 {
4330
4331                         #ifndef _XOPEN_SOURCE
4332                         #error  expected _XOPEN_SOURCE to be defined
4333                         #endif
4334   ;
4335   return 0;
4336 }
4337 _ACEOF
4338 rm -f "conftest.$ac_objext"
4339 if { (eval echo "$as_me:4339: \"$ac_compile\"") >&5
4340   (eval $ac_compile) 2>&5
4341   ac_status=$?
4342   echo "$as_me:4342: \$? = $ac_status" >&5
4343   (exit "$ac_status"); } &&
4344          { ac_try='test -s "conftest.$ac_objext"'
4345   { (eval echo "$as_me:4345: \"$ac_try\"") >&5
4346   (eval $ac_try) 2>&5
4347   ac_status=$?
4348   echo "$as_me:4348: \$? = $ac_status" >&5
4349   (exit "$ac_status"); }; }; then
4350   cf_cv_gnu_source=no
4351 else
4352   echo "$as_me: failed program was:" >&5
4353 cat "conftest.$ac_ext" >&5
4354 cf_save="$CPPFLAGS"
4355
4356 cf_fix_cppflags=no
4357 cf_new_cflags=
4358 cf_new_cppflags=
4359 cf_new_extra_cppflags=
4360
4361 for cf_add_cflags in -D_GNU_SOURCE
4362 do
4363 case "$cf_fix_cppflags" in
4364 (no)
4365         case "$cf_add_cflags" in
4366         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4367                 case "$cf_add_cflags" in
4368                 (-D*)
4369                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4370
4371                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4372                                 && test -z "${cf_tst_cflags}" \
4373                                 && cf_fix_cppflags=yes
4374
4375                         if test "$cf_fix_cppflags" = yes ; then
4376
4377         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4378         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4379
4380                                 continue
4381                         elif test "${cf_tst_cflags}" = "\"'" ; then
4382
4383         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4384         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4385
4386                                 continue
4387                         fi
4388                         ;;
4389                 esac
4390                 case "$CPPFLAGS" in
4391                 (*$cf_add_cflags)
4392                         ;;
4393                 (*)
4394                         case "$cf_add_cflags" in
4395                         (-D*)
4396                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4397
4398 CPPFLAGS=`echo "$CPPFLAGS" | \
4399         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4400                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4401
4402                                 ;;
4403                         esac
4404
4405         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4406         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4407
4408                         ;;
4409                 esac
4410                 ;;
4411         (*)
4412
4413         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4414         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4415
4416                 ;;
4417         esac
4418         ;;
4419 (yes)
4420
4421         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4422         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4423
4424         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4425
4426         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4427                 && test -z "${cf_tst_cflags}" \
4428                 && cf_fix_cppflags=no
4429         ;;
4430 esac
4431 done
4432
4433 if test -n "$cf_new_cflags" ; then
4434
4435         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4436         CFLAGS="${CFLAGS}$cf_new_cflags"
4437
4438 fi
4439
4440 if test -n "$cf_new_cppflags" ; then
4441
4442         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4443         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4444
4445 fi
4446
4447 if test -n "$cf_new_extra_cppflags" ; then
4448
4449         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4450         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4451
4452 fi
4453
4454                          cat >"conftest.$ac_ext" <<_ACEOF
4455 #line 4455 "configure"
4456 #include "confdefs.h"
4457 #include <sys/types.h>
4458 int
4459 main (void)
4460 {
4461
4462                                 #ifdef _XOPEN_SOURCE
4463                                 #error  expected _XOPEN_SOURCE to be undefined
4464                                 #endif
4465   ;
4466   return 0;
4467 }
4468 _ACEOF
4469 rm -f "conftest.$ac_objext"
4470 if { (eval echo "$as_me:4470: \"$ac_compile\"") >&5
4471   (eval $ac_compile) 2>&5
4472   ac_status=$?
4473   echo "$as_me:4473: \$? = $ac_status" >&5
4474   (exit "$ac_status"); } &&
4475          { ac_try='test -s "conftest.$ac_objext"'
4476   { (eval echo "$as_me:4476: \"$ac_try\"") >&5
4477   (eval $ac_try) 2>&5
4478   ac_status=$?
4479   echo "$as_me:4479: \$? = $ac_status" >&5
4480   (exit "$ac_status"); }; }; then
4481   cf_cv_gnu_source=no
4482 else
4483   echo "$as_me: failed program was:" >&5
4484 cat "conftest.$ac_ext" >&5
4485 cf_cv_gnu_source=yes
4486 fi
4487 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4488                         CPPFLAGS="$cf_save"
4489
4490 fi
4491 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4492
4493 fi
4494 echo "$as_me:4494: result: $cf_cv_gnu_source" >&5
4495 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4496
4497                 if test "$cf_cv_gnu_source" = yes
4498                 then
4499                 echo "$as_me:4499: checking if we should also define _DEFAULT_SOURCE" >&5
4500 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4501 if test "${cf_cv_default_source+set}" = set; then
4502   echo $ECHO_N "(cached) $ECHO_C" >&6
4503 else
4504
4505         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4506         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4507
4508                         cat >"conftest.$ac_ext" <<_ACEOF
4509 #line 4509 "configure"
4510 #include "confdefs.h"
4511 #include <sys/types.h>
4512 int
4513 main (void)
4514 {
4515
4516                                 #ifdef _DEFAULT_SOURCE
4517                                 #error  expected _DEFAULT_SOURCE to be undefined
4518                                 #endif
4519   ;
4520   return 0;
4521 }
4522 _ACEOF
4523 rm -f "conftest.$ac_objext"
4524 if { (eval echo "$as_me:4524: \"$ac_compile\"") >&5
4525   (eval $ac_compile) 2>&5
4526   ac_status=$?
4527   echo "$as_me:4527: \$? = $ac_status" >&5
4528   (exit "$ac_status"); } &&
4529          { ac_try='test -s "conftest.$ac_objext"'
4530   { (eval echo "$as_me:4530: \"$ac_try\"") >&5
4531   (eval $ac_try) 2>&5
4532   ac_status=$?
4533   echo "$as_me:4533: \$? = $ac_status" >&5
4534   (exit "$ac_status"); }; }; then
4535   cf_cv_default_source=no
4536 else
4537   echo "$as_me: failed program was:" >&5
4538 cat "conftest.$ac_ext" >&5
4539 cf_cv_default_source=yes
4540 fi
4541 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4542
4543 fi
4544 echo "$as_me:4544: result: $cf_cv_default_source" >&5
4545 echo "${ECHO_T}$cf_cv_default_source" >&6
4546                         if test "$cf_cv_default_source" = yes
4547                         then
4548
4549         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4550         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4551
4552                         fi
4553                 fi
4554         fi
4555
4556 fi
4557
4558         ;;
4559 (minix*)
4560         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4561         ;;
4562 (mirbsd*)
4563         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4564         cf_XOPEN_SOURCE=
4565
4566 if test "$cf_cv_posix_visible" = no; then
4567
4568 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4569
4570 cf_save_CFLAGS="$CFLAGS"
4571 cf_save_CPPFLAGS="$CPPFLAGS"
4572
4573 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4574         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4575                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4576
4577 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4578         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4579                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4580
4581 echo "$as_me:4581: checking if we should define _POSIX_C_SOURCE" >&5
4582 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4583 if test "${cf_cv_posix_c_source+set}" = set; then
4584   echo $ECHO_N "(cached) $ECHO_C" >&6
4585 else
4586
4587 echo "${as_me:-configure}:4587: testing if the symbol is already defined go no further ..." 1>&5
4588
4589         cat >"conftest.$ac_ext" <<_ACEOF
4590 #line 4590 "configure"
4591 #include "confdefs.h"
4592 #include <sys/types.h>
4593 int
4594 main (void)
4595 {
4596
4597 #ifndef _POSIX_C_SOURCE
4598 make an error
4599 #endif
4600   ;
4601   return 0;
4602 }
4603 _ACEOF
4604 rm -f "conftest.$ac_objext"
4605 if { (eval echo "$as_me:4605: \"$ac_compile\"") >&5
4606   (eval $ac_compile) 2>&5
4607   ac_status=$?
4608   echo "$as_me:4608: \$? = $ac_status" >&5
4609   (exit "$ac_status"); } &&
4610          { ac_try='test -s "conftest.$ac_objext"'
4611   { (eval echo "$as_me:4611: \"$ac_try\"") >&5
4612   (eval $ac_try) 2>&5
4613   ac_status=$?
4614   echo "$as_me:4614: \$? = $ac_status" >&5
4615   (exit "$ac_status"); }; }; then
4616   cf_cv_posix_c_source=no
4617 else
4618   echo "$as_me: failed program was:" >&5
4619 cat "conftest.$ac_ext" >&5
4620 cf_want_posix_source=no
4621          case .$cf_POSIX_C_SOURCE in
4622          (.[12]??*)
4623                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4624                 ;;
4625          (.2)
4626                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4627                 cf_want_posix_source=yes
4628                 ;;
4629          (.*)
4630                 cf_want_posix_source=yes
4631                 ;;
4632          esac
4633          if test "$cf_want_posix_source" = yes ; then
4634                 cat >"conftest.$ac_ext" <<_ACEOF
4635 #line 4635 "configure"
4636 #include "confdefs.h"
4637 #include <sys/types.h>
4638 int
4639 main (void)
4640 {
4641
4642 #ifdef _POSIX_SOURCE
4643 make an error
4644 #endif
4645   ;
4646   return 0;
4647 }
4648 _ACEOF
4649 rm -f "conftest.$ac_objext"
4650 if { (eval echo "$as_me:4650: \"$ac_compile\"") >&5
4651   (eval $ac_compile) 2>&5
4652   ac_status=$?
4653   echo "$as_me:4653: \$? = $ac_status" >&5
4654   (exit "$ac_status"); } &&
4655          { ac_try='test -s "conftest.$ac_objext"'
4656   { (eval echo "$as_me:4656: \"$ac_try\"") >&5
4657   (eval $ac_try) 2>&5
4658   ac_status=$?
4659   echo "$as_me:4659: \$? = $ac_status" >&5
4660   (exit "$ac_status"); }; }; then
4661   :
4662 else
4663   echo "$as_me: failed program was:" >&5
4664 cat "conftest.$ac_ext" >&5
4665 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4666 fi
4667 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4668          fi
4669
4670 echo "${as_me:-configure}:4670: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4671
4672          CFLAGS="$cf_trim_CFLAGS"
4673          CPPFLAGS="$cf_trim_CPPFLAGS"
4674
4675         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4676         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4677
4678 echo "${as_me:-configure}:4678: testing if the second compile does not leave our definition intact error ..." 1>&5
4679
4680          cat >"conftest.$ac_ext" <<_ACEOF
4681 #line 4681 "configure"
4682 #include "confdefs.h"
4683 #include <sys/types.h>
4684 int
4685 main (void)
4686 {
4687
4688 #ifndef _POSIX_C_SOURCE
4689 make an error
4690 #endif
4691   ;
4692   return 0;
4693 }
4694 _ACEOF
4695 rm -f "conftest.$ac_objext"
4696 if { (eval echo "$as_me:4696: \"$ac_compile\"") >&5
4697   (eval $ac_compile) 2>&5
4698   ac_status=$?
4699   echo "$as_me:4699: \$? = $ac_status" >&5
4700   (exit "$ac_status"); } &&
4701          { ac_try='test -s "conftest.$ac_objext"'
4702   { (eval echo "$as_me:4702: \"$ac_try\"") >&5
4703   (eval $ac_try) 2>&5
4704   ac_status=$?
4705   echo "$as_me:4705: \$? = $ac_status" >&5
4706   (exit "$ac_status"); }; }; then
4707   :
4708 else
4709   echo "$as_me: failed program was:" >&5
4710 cat "conftest.$ac_ext" >&5
4711 cf_cv_posix_c_source=no
4712 fi
4713 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4714          CFLAGS="$cf_save_CFLAGS"
4715          CPPFLAGS="$cf_save_CPPFLAGS"
4716
4717 fi
4718 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4719
4720 fi
4721 echo "$as_me:4721: result: $cf_cv_posix_c_source" >&5
4722 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4723
4724 if test "$cf_cv_posix_c_source" != no ; then
4725         CFLAGS="$cf_trim_CFLAGS"
4726         CPPFLAGS="$cf_trim_CPPFLAGS"
4727
4728 cf_fix_cppflags=no
4729 cf_new_cflags=
4730 cf_new_cppflags=
4731 cf_new_extra_cppflags=
4732
4733 for cf_add_cflags in $cf_cv_posix_c_source
4734 do
4735 case "$cf_fix_cppflags" in
4736 (no)
4737         case "$cf_add_cflags" in
4738         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4739                 case "$cf_add_cflags" in
4740                 (-D*)
4741                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4742
4743                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4744                                 && test -z "${cf_tst_cflags}" \
4745                                 && cf_fix_cppflags=yes
4746
4747                         if test "$cf_fix_cppflags" = yes ; then
4748
4749         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4750         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4751
4752                                 continue
4753                         elif test "${cf_tst_cflags}" = "\"'" ; then
4754
4755         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4756         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4757
4758                                 continue
4759                         fi
4760                         ;;
4761                 esac
4762                 case "$CPPFLAGS" in
4763                 (*$cf_add_cflags)
4764                         ;;
4765                 (*)
4766                         case "$cf_add_cflags" in
4767                         (-D*)
4768                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4769
4770 CPPFLAGS=`echo "$CPPFLAGS" | \
4771         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4772                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4773
4774                                 ;;
4775                         esac
4776
4777         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4778         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4779
4780                         ;;
4781                 esac
4782                 ;;
4783         (*)
4784
4785         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4786         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4787
4788                 ;;
4789         esac
4790         ;;
4791 (yes)
4792
4793         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4794         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4795
4796         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4797
4798         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4799                 && test -z "${cf_tst_cflags}" \
4800                 && cf_fix_cppflags=no
4801         ;;
4802 esac
4803 done
4804
4805 if test -n "$cf_new_cflags" ; then
4806
4807         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4808         CFLAGS="${CFLAGS}$cf_new_cflags"
4809
4810 fi
4811
4812 if test -n "$cf_new_cppflags" ; then
4813
4814         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4815         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4816
4817 fi
4818
4819 if test -n "$cf_new_extra_cppflags" ; then
4820
4821         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4822         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4823
4824 fi
4825
4826 fi
4827
4828 fi # cf_cv_posix_visible
4829
4830         ;;
4831 (netbsd*)
4832         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4833         ;;
4834 (openbsd[6-9]*)
4835         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
4836         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
4837         # Abusing the conformance level is a workaround.
4838         { echo "$as_me:4838: WARNING: this system does not provide usable locale support" >&5
4839 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
4840         cf_xopen_source="-D_BSD_SOURCE"
4841         cf_XOPEN_SOURCE=700
4842         ;;
4843 (openbsd[4-5]*)
4844         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4845         cf_xopen_source="-D_BSD_SOURCE"
4846         cf_XOPEN_SOURCE=600
4847         ;;
4848 (openbsd*)
4849         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4850         ;;
4851 (osf[45]*)
4852         cf_xopen_source="-D_OSF_SOURCE"
4853         ;;
4854 (nto-qnx*)
4855         cf_xopen_source="-D_QNX_SOURCE"
4856         ;;
4857 (sco*)
4858         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4859         ;;
4860 (solaris2.*)
4861         cf_xopen_source="-D__EXTENSIONS__"
4862         cf_cv_xopen_source=broken
4863         ;;
4864 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4865         cf_XOPEN_SOURCE=
4866         cf_POSIX_C_SOURCE=
4867         ;;
4868 (*)
4869
4870 echo "$as_me:4870: checking if we should define _XOPEN_SOURCE" >&5
4871 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4872 if test "${cf_cv_xopen_source+set}" = set; then
4873   echo $ECHO_N "(cached) $ECHO_C" >&6
4874 else
4875
4876         cat >"conftest.$ac_ext" <<_ACEOF
4877 #line 4877 "configure"
4878 #include "confdefs.h"
4879
4880 #include <stdlib.h>
4881 #include <string.h>
4882 #include <sys/types.h>
4883
4884 int
4885 main (void)
4886 {
4887
4888 #ifndef _XOPEN_SOURCE
4889 make an error
4890 #endif
4891
4892   ;
4893   return 0;
4894 }
4895 _ACEOF
4896 rm -f "conftest.$ac_objext"
4897 if { (eval echo "$as_me:4897: \"$ac_compile\"") >&5
4898   (eval $ac_compile) 2>&5
4899   ac_status=$?
4900   echo "$as_me:4900: \$? = $ac_status" >&5
4901   (exit "$ac_status"); } &&
4902          { ac_try='test -s "conftest.$ac_objext"'
4903   { (eval echo "$as_me:4903: \"$ac_try\"") >&5
4904   (eval $ac_try) 2>&5
4905   ac_status=$?
4906   echo "$as_me:4906: \$? = $ac_status" >&5
4907   (exit "$ac_status"); }; }; then
4908   cf_cv_xopen_source=no
4909 else
4910   echo "$as_me: failed program was:" >&5
4911 cat "conftest.$ac_ext" >&5
4912 cf_save="$CPPFLAGS"
4913
4914         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4915         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4916
4917          cat >"conftest.$ac_ext" <<_ACEOF
4918 #line 4918 "configure"
4919 #include "confdefs.h"
4920
4921 #include <stdlib.h>
4922 #include <string.h>
4923 #include <sys/types.h>
4924
4925 int
4926 main (void)
4927 {
4928
4929 #ifndef _XOPEN_SOURCE
4930 make an error
4931 #endif
4932
4933   ;
4934   return 0;
4935 }
4936 _ACEOF
4937 rm -f "conftest.$ac_objext"
4938 if { (eval echo "$as_me:4938: \"$ac_compile\"") >&5
4939   (eval $ac_compile) 2>&5
4940   ac_status=$?
4941   echo "$as_me:4941: \$? = $ac_status" >&5
4942   (exit "$ac_status"); } &&
4943          { ac_try='test -s "conftest.$ac_objext"'
4944   { (eval echo "$as_me:4944: \"$ac_try\"") >&5
4945   (eval $ac_try) 2>&5
4946   ac_status=$?
4947   echo "$as_me:4947: \$? = $ac_status" >&5
4948   (exit "$ac_status"); }; }; then
4949   cf_cv_xopen_source=no
4950 else
4951   echo "$as_me: failed program was:" >&5
4952 cat "conftest.$ac_ext" >&5
4953 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4954 fi
4955 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4956                 CPPFLAGS="$cf_save"
4957
4958 fi
4959 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4960
4961 fi
4962 echo "$as_me:4962: result: $cf_cv_xopen_source" >&5
4963 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4964
4965 if test "$cf_cv_xopen_source" != no ; then
4966
4967 CFLAGS=`echo "$CFLAGS" | \
4968         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4969                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4970
4971 CPPFLAGS=`echo "$CPPFLAGS" | \
4972         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4973                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4974
4975         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4976
4977 for cf_add_cflags in $cf_temp_xopen_source
4978 do
4979         case "x$cf_add_cflags" in
4980         (x-[DU]*)
4981
4982 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4983 while true
4984 do
4985         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4986         test "$CFLAGS" != "$cf_old_cflag" || break
4987
4988         CFLAGS="$cf_old_cflag"
4989 done
4990
4991 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4992 while true
4993 do
4994         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4995         test "$CPPFLAGS" != "$cf_old_cflag" || break
4996
4997         CPPFLAGS="$cf_old_cflag"
4998 done
4999
5000                 ;;
5001         esac
5002
5003 cf_fix_cppflags=no
5004 cf_new_cflags=
5005 cf_new_cppflags=
5006 cf_new_extra_cppflags=
5007
5008 for cf_add_cflags in $cf_add_cflags
5009 do
5010 case "$cf_fix_cppflags" in
5011 (no)
5012         case "$cf_add_cflags" in
5013         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5014                 case "$cf_add_cflags" in
5015                 (-D*)
5016                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5017
5018                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5019                                 && test -z "${cf_tst_cflags}" \
5020                                 && cf_fix_cppflags=yes
5021
5022                         if test "$cf_fix_cppflags" = yes ; then
5023
5024         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5025         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5026
5027                                 continue
5028                         elif test "${cf_tst_cflags}" = "\"'" ; then
5029
5030         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5031         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5032
5033                                 continue
5034                         fi
5035                         ;;
5036                 esac
5037                 case "$CPPFLAGS" in
5038                 (*$cf_add_cflags)
5039                         ;;
5040                 (*)
5041                         case "$cf_add_cflags" in
5042                         (-D*)
5043                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5044
5045 CPPFLAGS=`echo "$CPPFLAGS" | \
5046         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5047                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5048
5049                                 ;;
5050                         esac
5051
5052         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5053         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5054
5055                         ;;
5056                 esac
5057                 ;;
5058         (*)
5059
5060         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5061         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5062
5063                 ;;
5064         esac
5065         ;;
5066 (yes)
5067
5068         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5069         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5070
5071         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5072
5073         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5074                 && test -z "${cf_tst_cflags}" \
5075                 && cf_fix_cppflags=no
5076         ;;
5077 esac
5078 done
5079
5080 if test -n "$cf_new_cflags" ; then
5081
5082         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5083         CFLAGS="${CFLAGS}$cf_new_cflags"
5084
5085 fi
5086
5087 if test -n "$cf_new_cppflags" ; then
5088
5089         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5090         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5091
5092 fi
5093
5094 if test -n "$cf_new_extra_cppflags" ; then
5095
5096         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5097         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5098
5099 fi
5100
5101 done
5102
5103 fi
5104
5105         cf_save_xopen_cppflags="$CPPFLAGS"
5106
5107 if test "$cf_cv_posix_visible" = no; then
5108
5109 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
5110
5111 cf_save_CFLAGS="$CFLAGS"
5112 cf_save_CPPFLAGS="$CPPFLAGS"
5113
5114 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
5115         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5116                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5117
5118 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
5119         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5120                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5121
5122 echo "$as_me:5122: checking if we should define _POSIX_C_SOURCE" >&5
5123 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
5124 if test "${cf_cv_posix_c_source+set}" = set; then
5125   echo $ECHO_N "(cached) $ECHO_C" >&6
5126 else
5127
5128 echo "${as_me:-configure}:5128: testing if the symbol is already defined go no further ..." 1>&5
5129
5130         cat >"conftest.$ac_ext" <<_ACEOF
5131 #line 5131 "configure"
5132 #include "confdefs.h"
5133 #include <sys/types.h>
5134 int
5135 main (void)
5136 {
5137
5138 #ifndef _POSIX_C_SOURCE
5139 make an error
5140 #endif
5141   ;
5142   return 0;
5143 }
5144 _ACEOF
5145 rm -f "conftest.$ac_objext"
5146 if { (eval echo "$as_me:5146: \"$ac_compile\"") >&5
5147   (eval $ac_compile) 2>&5
5148   ac_status=$?
5149   echo "$as_me:5149: \$? = $ac_status" >&5
5150   (exit "$ac_status"); } &&
5151          { ac_try='test -s "conftest.$ac_objext"'
5152   { (eval echo "$as_me:5152: \"$ac_try\"") >&5
5153   (eval $ac_try) 2>&5
5154   ac_status=$?
5155   echo "$as_me:5155: \$? = $ac_status" >&5
5156   (exit "$ac_status"); }; }; then
5157   cf_cv_posix_c_source=no
5158 else
5159   echo "$as_me: failed program was:" >&5
5160 cat "conftest.$ac_ext" >&5
5161 cf_want_posix_source=no
5162          case .$cf_POSIX_C_SOURCE in
5163          (.[12]??*)
5164                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5165                 ;;
5166          (.2)
5167                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5168                 cf_want_posix_source=yes
5169                 ;;
5170          (.*)
5171                 cf_want_posix_source=yes
5172                 ;;
5173          esac
5174          if test "$cf_want_posix_source" = yes ; then
5175                 cat >"conftest.$ac_ext" <<_ACEOF
5176 #line 5176 "configure"
5177 #include "confdefs.h"
5178 #include <sys/types.h>
5179 int
5180 main (void)
5181 {
5182
5183 #ifdef _POSIX_SOURCE
5184 make an error
5185 #endif
5186   ;
5187   return 0;
5188 }
5189 _ACEOF
5190 rm -f "conftest.$ac_objext"
5191 if { (eval echo "$as_me:5191: \"$ac_compile\"") >&5
5192   (eval $ac_compile) 2>&5
5193   ac_status=$?
5194   echo "$as_me:5194: \$? = $ac_status" >&5
5195   (exit "$ac_status"); } &&
5196          { ac_try='test -s "conftest.$ac_objext"'
5197   { (eval echo "$as_me:5197: \"$ac_try\"") >&5
5198   (eval $ac_try) 2>&5
5199   ac_status=$?
5200   echo "$as_me:5200: \$? = $ac_status" >&5
5201   (exit "$ac_status"); }; }; then
5202   :
5203 else
5204   echo "$as_me: failed program was:" >&5
5205 cat "conftest.$ac_ext" >&5
5206 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5207 fi
5208 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5209          fi
5210
5211 echo "${as_me:-configure}:5211: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5212
5213          CFLAGS="$cf_trim_CFLAGS"
5214          CPPFLAGS="$cf_trim_CPPFLAGS"
5215
5216         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5217         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5218
5219 echo "${as_me:-configure}:5219: testing if the second compile does not leave our definition intact error ..." 1>&5
5220
5221          cat >"conftest.$ac_ext" <<_ACEOF
5222 #line 5222 "configure"
5223 #include "confdefs.h"
5224 #include <sys/types.h>
5225 int
5226 main (void)
5227 {
5228
5229 #ifndef _POSIX_C_SOURCE
5230 make an error
5231 #endif
5232   ;
5233   return 0;
5234 }
5235 _ACEOF
5236 rm -f "conftest.$ac_objext"
5237 if { (eval echo "$as_me:5237: \"$ac_compile\"") >&5
5238   (eval $ac_compile) 2>&5
5239   ac_status=$?
5240   echo "$as_me:5240: \$? = $ac_status" >&5
5241   (exit "$ac_status"); } &&
5242          { ac_try='test -s "conftest.$ac_objext"'
5243   { (eval echo "$as_me:5243: \"$ac_try\"") >&5
5244   (eval $ac_try) 2>&5
5245   ac_status=$?
5246   echo "$as_me:5246: \$? = $ac_status" >&5
5247   (exit "$ac_status"); }; }; then
5248   :
5249 else
5250   echo "$as_me: failed program was:" >&5
5251 cat "conftest.$ac_ext" >&5
5252 cf_cv_posix_c_source=no
5253 fi
5254 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5255          CFLAGS="$cf_save_CFLAGS"
5256          CPPFLAGS="$cf_save_CPPFLAGS"
5257
5258 fi
5259 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5260
5261 fi
5262 echo "$as_me:5262: result: $cf_cv_posix_c_source" >&5
5263 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5264
5265 if test "$cf_cv_posix_c_source" != no ; then
5266         CFLAGS="$cf_trim_CFLAGS"
5267         CPPFLAGS="$cf_trim_CPPFLAGS"
5268
5269 cf_fix_cppflags=no
5270 cf_new_cflags=
5271 cf_new_cppflags=
5272 cf_new_extra_cppflags=
5273
5274 for cf_add_cflags in $cf_cv_posix_c_source
5275 do
5276 case "$cf_fix_cppflags" in
5277 (no)
5278         case "$cf_add_cflags" in
5279         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5280                 case "$cf_add_cflags" in
5281                 (-D*)
5282                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5283
5284                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5285                                 && test -z "${cf_tst_cflags}" \
5286                                 && cf_fix_cppflags=yes
5287
5288                         if test "$cf_fix_cppflags" = yes ; then
5289
5290         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5291         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5292
5293                                 continue
5294                         elif test "${cf_tst_cflags}" = "\"'" ; then
5295
5296         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5297         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5298
5299                                 continue
5300                         fi
5301                         ;;
5302                 esac
5303                 case "$CPPFLAGS" in
5304                 (*$cf_add_cflags)
5305                         ;;
5306                 (*)
5307                         case "$cf_add_cflags" in
5308                         (-D*)
5309                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5310
5311 CPPFLAGS=`echo "$CPPFLAGS" | \
5312         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5313                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5314
5315                                 ;;
5316                         esac
5317
5318         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5319         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5320
5321                         ;;
5322                 esac
5323                 ;;
5324         (*)
5325
5326         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5327         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5328
5329                 ;;
5330         esac
5331         ;;
5332 (yes)
5333
5334         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5335         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5336
5337         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5338
5339         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5340                 && test -z "${cf_tst_cflags}" \
5341                 && cf_fix_cppflags=no
5342         ;;
5343 esac
5344 done
5345
5346 if test -n "$cf_new_cflags" ; then
5347
5348         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5349         CFLAGS="${CFLAGS}$cf_new_cflags"
5350
5351 fi
5352
5353 if test -n "$cf_new_cppflags" ; then
5354
5355         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5356         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5357
5358 fi
5359
5360 if test -n "$cf_new_extra_cppflags" ; then
5361
5362         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5363         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5364
5365 fi
5366
5367 fi
5368
5369 fi # cf_cv_posix_visible
5370
5371         # Some of these niche implementations use copy/paste, double-check...
5372         if test "$cf_cv_xopen_source" != no ; then
5373                 test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
5374
5375 echo "${as_me:-configure}:5375: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
5376
5377                 cat >"conftest.$ac_ext" <<_ACEOF
5378 #line 5378 "configure"
5379 #include "confdefs.h"
5380
5381 #include <stdlib.h>
5382 #include <string.h>
5383 #include <sys/types.h>
5384
5385 int
5386 main (void)
5387 {
5388
5389 #ifndef _XOPEN_SOURCE
5390 make an error
5391 #endif
5392
5393   ;
5394   return 0;
5395 }
5396 _ACEOF
5397 rm -f "conftest.$ac_objext"
5398 if { (eval echo "$as_me:5398: \"$ac_compile\"") >&5
5399   (eval $ac_compile) 2>&5
5400   ac_status=$?
5401   echo "$as_me:5401: \$? = $ac_status" >&5
5402   (exit "$ac_status"); } &&
5403          { ac_try='test -s "conftest.$ac_objext"'
5404   { (eval echo "$as_me:5404: \"$ac_try\"") >&5
5405   (eval $ac_try) 2>&5
5406   ac_status=$?
5407   echo "$as_me:5407: \$? = $ac_status" >&5
5408   (exit "$ac_status"); }; }; then
5409   :
5410 else
5411   echo "$as_me: failed program was:" >&5
5412 cat "conftest.$ac_ext" >&5
5413
5414                         { echo "$as_me:5414: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
5415 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
5416                         CPPFLAGS="$cf_save_xopen_cppflags"
5417 fi
5418 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5419         fi
5420         ;;
5421 esac
5422
5423 if test -n "$cf_xopen_source" ; then
5424
5425 for cf_add_cflags in $cf_xopen_source
5426 do
5427         case "x$cf_add_cflags" in
5428         (x-[DU]*)
5429
5430 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5431 while true
5432 do
5433         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5434         test "$CFLAGS" != "$cf_old_cflag" || break
5435         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
5436
5437 echo "${as_me:-configure}:5437: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
5438
5439         CFLAGS="$cf_old_cflag"
5440 done
5441
5442 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5443 while true
5444 do
5445         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5446         test "$CPPFLAGS" != "$cf_old_cflag" || break
5447         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
5448
5449 echo "${as_me:-configure}:5449: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
5450
5451         CPPFLAGS="$cf_old_cflag"
5452 done
5453
5454                 ;;
5455         esac
5456
5457 cf_fix_cppflags=no
5458 cf_new_cflags=
5459 cf_new_cppflags=
5460 cf_new_extra_cppflags=
5461
5462 for cf_add_cflags in $cf_add_cflags
5463 do
5464 case "$cf_fix_cppflags" in
5465 (no)
5466         case "$cf_add_cflags" in
5467         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5468                 case "$cf_add_cflags" in
5469                 (-D*)
5470                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5471
5472                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5473                                 && test -z "${cf_tst_cflags}" \
5474                                 && cf_fix_cppflags=yes
5475
5476                         if test "$cf_fix_cppflags" = yes ; then
5477
5478         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5479         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5480
5481                                 continue
5482                         elif test "${cf_tst_cflags}" = "\"'" ; then
5483
5484         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5485         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5486
5487                                 continue
5488                         fi
5489                         ;;
5490                 esac
5491                 case "$CPPFLAGS" in
5492                 (*$cf_add_cflags)
5493                         ;;
5494                 (*)
5495                         case "$cf_add_cflags" in
5496                         (-D*)
5497                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5498
5499 CPPFLAGS=`echo "$CPPFLAGS" | \
5500         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5501                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5502
5503                                 ;;
5504                         esac
5505
5506         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5507         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5508
5509                         ;;
5510                 esac
5511                 ;;
5512         (*)
5513
5514         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5515         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5516
5517                 ;;
5518         esac
5519         ;;
5520 (yes)
5521
5522         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5523         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5524
5525         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5526
5527         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5528                 && test -z "${cf_tst_cflags}" \
5529                 && cf_fix_cppflags=no
5530         ;;
5531 esac
5532 done
5533
5534 if test -n "$cf_new_cflags" ; then
5535         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5536
5537 echo "${as_me:-configure}:5537: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5538
5539         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5540         CFLAGS="${CFLAGS}$cf_new_cflags"
5541
5542 fi
5543
5544 if test -n "$cf_new_cppflags" ; then
5545         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5546
5547 echo "${as_me:-configure}:5547: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5548
5549         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5550         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5551
5552 fi
5553
5554 if test -n "$cf_new_extra_cppflags" ; then
5555         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5556
5557 echo "${as_me:-configure}:5557: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5558
5559         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5560         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5561
5562 fi
5563
5564 done
5565
5566 fi
5567
5568 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5569         echo "$as_me:5569: checking if _XOPEN_SOURCE really is set" >&5
5570 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5571         cat >"conftest.$ac_ext" <<_ACEOF
5572 #line 5572 "configure"
5573 #include "confdefs.h"
5574 #include <stdlib.h>
5575 int
5576 main (void)
5577 {
5578
5579 #ifndef _XOPEN_SOURCE
5580 make an error
5581 #endif
5582   ;
5583   return 0;
5584 }
5585 _ACEOF
5586 rm -f "conftest.$ac_objext"
5587 if { (eval echo "$as_me:5587: \"$ac_compile\"") >&5
5588   (eval $ac_compile) 2>&5
5589   ac_status=$?
5590   echo "$as_me:5590: \$? = $ac_status" >&5
5591   (exit "$ac_status"); } &&
5592          { ac_try='test -s "conftest.$ac_objext"'
5593   { (eval echo "$as_me:5593: \"$ac_try\"") >&5
5594   (eval $ac_try) 2>&5
5595   ac_status=$?
5596   echo "$as_me:5596: \$? = $ac_status" >&5
5597   (exit "$ac_status"); }; }; then
5598   cf_XOPEN_SOURCE_set=yes
5599 else
5600   echo "$as_me: failed program was:" >&5
5601 cat "conftest.$ac_ext" >&5
5602 cf_XOPEN_SOURCE_set=no
5603 fi
5604 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5605         echo "$as_me:5605: result: $cf_XOPEN_SOURCE_set" >&5
5606 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5607         if test "$cf_XOPEN_SOURCE_set" = yes
5608         then
5609                 cat >"conftest.$ac_ext" <<_ACEOF
5610 #line 5610 "configure"
5611 #include "confdefs.h"
5612 #include <stdlib.h>
5613 int
5614 main (void)
5615 {
5616
5617 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5618 make an error
5619 #endif
5620   ;
5621   return 0;
5622 }
5623 _ACEOF
5624 rm -f "conftest.$ac_objext"
5625 if { (eval echo "$as_me:5625: \"$ac_compile\"") >&5
5626   (eval $ac_compile) 2>&5
5627   ac_status=$?
5628   echo "$as_me:5628: \$? = $ac_status" >&5
5629   (exit "$ac_status"); } &&
5630          { ac_try='test -s "conftest.$ac_objext"'
5631   { (eval echo "$as_me:5631: \"$ac_try\"") >&5
5632   (eval $ac_try) 2>&5
5633   ac_status=$?
5634   echo "$as_me:5634: \$? = $ac_status" >&5
5635   (exit "$ac_status"); }; }; then
5636   cf_XOPEN_SOURCE_set_ok=yes
5637 else
5638   echo "$as_me: failed program was:" >&5
5639 cat "conftest.$ac_ext" >&5
5640 cf_XOPEN_SOURCE_set_ok=no
5641 fi
5642 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5643                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5644                 then
5645                         { echo "$as_me:5645: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5646 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5647                 fi
5648         else
5649
5650 echo "$as_me:5650: checking if we should define _XOPEN_SOURCE" >&5
5651 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5652 if test "${cf_cv_xopen_source+set}" = set; then
5653   echo $ECHO_N "(cached) $ECHO_C" >&6
5654 else
5655
5656         cat >"conftest.$ac_ext" <<_ACEOF
5657 #line 5657 "configure"
5658 #include "confdefs.h"
5659
5660 #include <stdlib.h>
5661 #include <string.h>
5662 #include <sys/types.h>
5663
5664 int
5665 main (void)
5666 {
5667
5668 #ifndef _XOPEN_SOURCE
5669 make an error
5670 #endif
5671
5672   ;
5673   return 0;
5674 }
5675 _ACEOF
5676 rm -f "conftest.$ac_objext"
5677 if { (eval echo "$as_me:5677: \"$ac_compile\"") >&5
5678   (eval $ac_compile) 2>&5
5679   ac_status=$?
5680   echo "$as_me:5680: \$? = $ac_status" >&5
5681   (exit "$ac_status"); } &&
5682          { ac_try='test -s "conftest.$ac_objext"'
5683   { (eval echo "$as_me:5683: \"$ac_try\"") >&5
5684   (eval $ac_try) 2>&5
5685   ac_status=$?
5686   echo "$as_me:5686: \$? = $ac_status" >&5
5687   (exit "$ac_status"); }; }; then
5688   cf_cv_xopen_source=no
5689 else
5690   echo "$as_me: failed program was:" >&5
5691 cat "conftest.$ac_ext" >&5
5692 cf_save="$CPPFLAGS"
5693
5694         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5695         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5696
5697          cat >"conftest.$ac_ext" <<_ACEOF
5698 #line 5698 "configure"
5699 #include "confdefs.h"
5700
5701 #include <stdlib.h>
5702 #include <string.h>
5703 #include <sys/types.h>
5704
5705 int
5706 main (void)
5707 {
5708
5709 #ifndef _XOPEN_SOURCE
5710 make an error
5711 #endif
5712
5713   ;
5714   return 0;
5715 }
5716 _ACEOF
5717 rm -f "conftest.$ac_objext"
5718 if { (eval echo "$as_me:5718: \"$ac_compile\"") >&5
5719   (eval $ac_compile) 2>&5
5720   ac_status=$?
5721   echo "$as_me:5721: \$? = $ac_status" >&5
5722   (exit "$ac_status"); } &&
5723          { ac_try='test -s "conftest.$ac_objext"'
5724   { (eval echo "$as_me:5724: \"$ac_try\"") >&5
5725   (eval $ac_try) 2>&5
5726   ac_status=$?
5727   echo "$as_me:5727: \$? = $ac_status" >&5
5728   (exit "$ac_status"); }; }; then
5729   cf_cv_xopen_source=no
5730 else
5731   echo "$as_me: failed program was:" >&5
5732 cat "conftest.$ac_ext" >&5
5733 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5734 fi
5735 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5736                 CPPFLAGS="$cf_save"
5737
5738 fi
5739 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5740
5741 fi
5742 echo "$as_me:5742: result: $cf_cv_xopen_source" >&5
5743 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5744
5745 if test "$cf_cv_xopen_source" != no ; then
5746
5747 CFLAGS=`echo "$CFLAGS" | \
5748         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5749                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5750
5751 CPPFLAGS=`echo "$CPPFLAGS" | \
5752         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5753                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5754
5755         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5756
5757 for cf_add_cflags in $cf_temp_xopen_source
5758 do
5759         case "x$cf_add_cflags" in
5760         (x-[DU]*)
5761
5762 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5763 while true
5764 do
5765         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5766         test "$CFLAGS" != "$cf_old_cflag" || break
5767
5768         CFLAGS="$cf_old_cflag"
5769 done
5770
5771 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5772 while true
5773 do
5774         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5775         test "$CPPFLAGS" != "$cf_old_cflag" || break
5776
5777         CPPFLAGS="$cf_old_cflag"
5778 done
5779
5780                 ;;
5781         esac
5782
5783 cf_fix_cppflags=no
5784 cf_new_cflags=
5785 cf_new_cppflags=
5786 cf_new_extra_cppflags=
5787
5788 for cf_add_cflags in $cf_add_cflags
5789 do
5790 case "$cf_fix_cppflags" in
5791 (no)
5792         case "$cf_add_cflags" in
5793         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5794                 case "$cf_add_cflags" in
5795                 (-D*)
5796                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5797
5798                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5799                                 && test -z "${cf_tst_cflags}" \
5800                                 && cf_fix_cppflags=yes
5801
5802                         if test "$cf_fix_cppflags" = yes ; then
5803
5804         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5805         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5806
5807                                 continue
5808                         elif test "${cf_tst_cflags}" = "\"'" ; then
5809
5810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5812
5813                                 continue
5814                         fi
5815                         ;;
5816                 esac
5817                 case "$CPPFLAGS" in
5818                 (*$cf_add_cflags)
5819                         ;;
5820                 (*)
5821                         case "$cf_add_cflags" in
5822                         (-D*)
5823                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5824
5825 CPPFLAGS=`echo "$CPPFLAGS" | \
5826         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5827                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5828
5829                                 ;;
5830                         esac
5831
5832         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5833         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5834
5835                         ;;
5836                 esac
5837                 ;;
5838         (*)
5839
5840         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5841         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5842
5843                 ;;
5844         esac
5845         ;;
5846 (yes)
5847
5848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5850
5851         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5852
5853         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5854                 && test -z "${cf_tst_cflags}" \
5855                 && cf_fix_cppflags=no
5856         ;;
5857 esac
5858 done
5859
5860 if test -n "$cf_new_cflags" ; then
5861
5862         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5863         CFLAGS="${CFLAGS}$cf_new_cflags"
5864
5865 fi
5866
5867 if test -n "$cf_new_cppflags" ; then
5868
5869         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5870         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5871
5872 fi
5873
5874 if test -n "$cf_new_extra_cppflags" ; then
5875
5876         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5877         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5878
5879 fi
5880
5881 done
5882
5883 fi
5884
5885         fi
5886 fi
5887 fi # cf_cv_posix_visible
5888
5889 echo "$as_me:5889: checking for signal global datatype" >&5
5890 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5891 if test "${cf_cv_sig_atomic_t+set}" = set; then
5892   echo $ECHO_N "(cached) $ECHO_C" >&6
5893 else
5894
5895         for cf_type in \
5896                 "volatile sig_atomic_t" \
5897                 "sig_atomic_t" \
5898                 "int"
5899         do
5900         cat >"conftest.$ac_ext" <<_ACEOF
5901 #line 5901 "configure"
5902 #include "confdefs.h"
5903
5904 #include <sys/types.h>
5905 #include <signal.h>
5906 #include <stdio.h>
5907
5908 extern $cf_type x;
5909 $cf_type x;
5910 static void handler(int sig)
5911 {
5912         (void)sig;
5913         x = 5;
5914 }
5915 int
5916 main (void)
5917 {
5918 signal(SIGINT, handler);
5919                  x = 1
5920   ;
5921   return 0;
5922 }
5923 _ACEOF
5924 rm -f "conftest.$ac_objext"
5925 if { (eval echo "$as_me:5925: \"$ac_compile\"") >&5
5926   (eval $ac_compile) 2>&5
5927   ac_status=$?
5928   echo "$as_me:5928: \$? = $ac_status" >&5
5929   (exit "$ac_status"); } &&
5930          { ac_try='test -s "conftest.$ac_objext"'
5931   { (eval echo "$as_me:5931: \"$ac_try\"") >&5
5932   (eval $ac_try) 2>&5
5933   ac_status=$?
5934   echo "$as_me:5934: \$? = $ac_status" >&5
5935   (exit "$ac_status"); }; }; then
5936   cf_cv_sig_atomic_t=$cf_type
5937 else
5938   echo "$as_me: failed program was:" >&5
5939 cat "conftest.$ac_ext" >&5
5940 cf_cv_sig_atomic_t=no
5941 fi
5942 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5943                 test "$cf_cv_sig_atomic_t" != no && break
5944         done
5945
5946 fi
5947
5948 echo "$as_me:5948: result: $cf_cv_sig_atomic_t" >&5
5949 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5950 test "$cf_cv_sig_atomic_t" != no &&
5951 cat >>confdefs.h <<EOF
5952 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5953 EOF
5954
5955 # Work around breakage on OS X
5956
5957 echo "$as_me:5957: checking if SIGWINCH is defined" >&5
5958 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5959 if test "${cf_cv_define_sigwinch+set}" = set; then
5960   echo $ECHO_N "(cached) $ECHO_C" >&6
5961 else
5962
5963         cat >"conftest.$ac_ext" <<_ACEOF
5964 #line 5964 "configure"
5965 #include "confdefs.h"
5966
5967 #include <sys/types.h>
5968 #include <sys/signal.h>
5969
5970 int
5971 main (void)
5972 {
5973 int x = SIGWINCH; (void)x
5974   ;
5975   return 0;
5976 }
5977 _ACEOF
5978 rm -f "conftest.$ac_objext"
5979 if { (eval echo "$as_me:5979: \"$ac_compile\"") >&5
5980   (eval $ac_compile) 2>&5
5981   ac_status=$?
5982   echo "$as_me:5982: \$? = $ac_status" >&5
5983   (exit "$ac_status"); } &&
5984          { ac_try='test -s "conftest.$ac_objext"'
5985   { (eval echo "$as_me:5985: \"$ac_try\"") >&5
5986   (eval $ac_try) 2>&5
5987   ac_status=$?
5988   echo "$as_me:5988: \$? = $ac_status" >&5
5989   (exit "$ac_status"); }; }; then
5990   cf_cv_define_sigwinch=yes
5991 else
5992   echo "$as_me: failed program was:" >&5
5993 cat "conftest.$ac_ext" >&5
5994 cat >"conftest.$ac_ext" <<_ACEOF
5995 #line 5995 "configure"
5996 #include "confdefs.h"
5997
5998 #undef _XOPEN_SOURCE
5999 #undef _POSIX_SOURCE
6000 #undef _POSIX_C_SOURCE
6001 #include <sys/types.h>
6002 #include <sys/signal.h>
6003
6004 int
6005 main (void)
6006 {
6007 int x = SIGWINCH; (void)x
6008   ;
6009   return 0;
6010 }
6011 _ACEOF
6012 rm -f "conftest.$ac_objext"
6013 if { (eval echo "$as_me:6013: \"$ac_compile\"") >&5
6014   (eval $ac_compile) 2>&5
6015   ac_status=$?
6016   echo "$as_me:6016: \$? = $ac_status" >&5
6017   (exit "$ac_status"); } &&
6018          { ac_try='test -s "conftest.$ac_objext"'
6019   { (eval echo "$as_me:6019: \"$ac_try\"") >&5
6020   (eval $ac_try) 2>&5
6021   ac_status=$?
6022   echo "$as_me:6022: \$? = $ac_status" >&5
6023   (exit "$ac_status"); }; }; then
6024   cf_cv_define_sigwinch=maybe
6025 else
6026   echo "$as_me: failed program was:" >&5
6027 cat "conftest.$ac_ext" >&5
6028 cf_cv_define_sigwinch=no
6029 fi
6030 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6031
6032 fi
6033 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6034
6035 fi
6036 echo "$as_me:6036: result: $cf_cv_define_sigwinch" >&5
6037 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
6038
6039 if test "$cf_cv_define_sigwinch" = maybe ; then
6040 echo "$as_me:6040: checking for actual SIGWINCH definition" >&5
6041 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
6042 if test "${cf_cv_fixup_sigwinch+set}" = set; then
6043   echo $ECHO_N "(cached) $ECHO_C" >&6
6044 else
6045
6046 cf_cv_fixup_sigwinch=unknown
6047 cf_sigwinch=32
6048 while test "$cf_sigwinch" != 1
6049 do
6050         cat >"conftest.$ac_ext" <<_ACEOF
6051 #line 6051 "configure"
6052 #include "confdefs.h"
6053
6054 #undef _XOPEN_SOURCE
6055 #undef _POSIX_SOURCE
6056 #undef _POSIX_C_SOURCE
6057 #include <sys/types.h>
6058 #include <sys/signal.h>
6059
6060 int
6061 main (void)
6062 {
6063
6064 #if SIGWINCH != $cf_sigwinch
6065 make an error
6066 #endif
6067 int x = SIGWINCH; (void)x
6068   ;
6069   return 0;
6070 }
6071 _ACEOF
6072 rm -f "conftest.$ac_objext"
6073 if { (eval echo "$as_me:6073: \"$ac_compile\"") >&5
6074   (eval $ac_compile) 2>&5
6075   ac_status=$?
6076   echo "$as_me:6076: \$? = $ac_status" >&5
6077   (exit "$ac_status"); } &&
6078          { ac_try='test -s "conftest.$ac_objext"'
6079   { (eval echo "$as_me:6079: \"$ac_try\"") >&5
6080   (eval $ac_try) 2>&5
6081   ac_status=$?
6082   echo "$as_me:6082: \$? = $ac_status" >&5
6083   (exit "$ac_status"); }; }; then
6084   cf_cv_fixup_sigwinch=$cf_sigwinch
6085          break
6086 else
6087   echo "$as_me: failed program was:" >&5
6088 cat "conftest.$ac_ext" >&5
6089 fi
6090 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6091
6092 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
6093 done
6094
6095 fi
6096 echo "$as_me:6096: result: $cf_cv_fixup_sigwinch" >&5
6097 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
6098
6099         if test "$cf_cv_fixup_sigwinch" != unknown ; then
6100                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
6101         fi
6102 fi
6103
6104 # Checks for CODESET support.
6105
6106 echo "$as_me:6106: checking for nl_langinfo and CODESET" >&5
6107 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
6108 if test "${am_cv_langinfo_codeset+set}" = set; then
6109   echo $ECHO_N "(cached) $ECHO_C" >&6
6110 else
6111   cat >"conftest.$ac_ext" <<_ACEOF
6112 #line 6112 "configure"
6113 #include "confdefs.h"
6114 #include <langinfo.h>
6115 int
6116 main (void)
6117 {
6118 char* cs = nl_langinfo(CODESET); (void)cs
6119   ;
6120   return 0;
6121 }
6122 _ACEOF
6123 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6124 if { (eval echo "$as_me:6124: \"$ac_link\"") >&5
6125   (eval $ac_link) 2>&5
6126   ac_status=$?
6127   echo "$as_me:6127: \$? = $ac_status" >&5
6128   (exit "$ac_status"); } &&
6129          { ac_try='test -s "conftest$ac_exeext"'
6130   { (eval echo "$as_me:6130: \"$ac_try\"") >&5
6131   (eval $ac_try) 2>&5
6132   ac_status=$?
6133   echo "$as_me:6133: \$? = $ac_status" >&5
6134   (exit "$ac_status"); }; }; then
6135   am_cv_langinfo_codeset=yes
6136 else
6137   echo "$as_me: failed program was:" >&5
6138 cat "conftest.$ac_ext" >&5
6139 am_cv_langinfo_codeset=no
6140 fi
6141 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6142
6143 fi
6144 echo "$as_me:6144: result: $am_cv_langinfo_codeset" >&5
6145 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
6146         if test "$am_cv_langinfo_codeset" = yes; then
6147
6148 cat >>confdefs.h <<\EOF
6149 #define HAVE_LANGINFO_CODESET 1
6150 EOF
6151
6152         fi
6153
6154 echo "$as_me:6154: checking if you want to use pkg-config" >&5
6155 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
6156
6157 # Check whether --with-pkg-config or --without-pkg-config was given.
6158 if test "${with_pkg_config+set}" = set; then
6159   withval="$with_pkg_config"
6160   cf_pkg_config=$withval
6161 else
6162   cf_pkg_config=yes
6163 fi;
6164 echo "$as_me:6164: result: $cf_pkg_config" >&5
6165 echo "${ECHO_T}$cf_pkg_config" >&6
6166
6167 case "$cf_pkg_config" in
6168 (no)
6169         PKG_CONFIG=none
6170         ;;
6171 (yes)
6172
6173 if test -n "$ac_tool_prefix"; then
6174   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
6175 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
6176 echo "$as_me:6176: checking for $ac_word" >&5
6177 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6178 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
6179   echo $ECHO_N "(cached) $ECHO_C" >&6
6180 else
6181   case $PKG_CONFIG in
6182   [\\/]* | ?:[\\/]*)
6183   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
6184   ;;
6185   *)
6186   ac_save_IFS=$IFS; IFS=$ac_path_separator
6187 ac_dummy="$PATH"
6188 for ac_dir in $ac_dummy; do
6189   IFS=$ac_save_IFS
6190   test -z "$ac_dir" && ac_dir=.
6191   if $as_executable_p "$ac_dir/$ac_word"; then
6192    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
6193    echo "$as_me:6193: found $ac_dir/$ac_word" >&5
6194    break
6195 fi
6196 done
6197
6198   ;;
6199 esac
6200 fi
6201 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
6202
6203 if test -n "$PKG_CONFIG"; then
6204   echo "$as_me:6204: result: $PKG_CONFIG" >&5
6205 echo "${ECHO_T}$PKG_CONFIG" >&6
6206 else
6207   echo "$as_me:6207: result: no" >&5
6208 echo "${ECHO_T}no" >&6
6209 fi
6210
6211 fi
6212 if test -z "$ac_cv_path_PKG_CONFIG"; then
6213   ac_pt_PKG_CONFIG=$PKG_CONFIG
6214   # Extract the first word of "pkg-config", so it can be a program name with args.
6215 set dummy pkg-config; ac_word=$2
6216 echo "$as_me:6216: checking for $ac_word" >&5
6217 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6218 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
6219   echo $ECHO_N "(cached) $ECHO_C" >&6
6220 else
6221   case $ac_pt_PKG_CONFIG in
6222   [\\/]* | ?:[\\/]*)
6223   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
6224   ;;
6225   *)
6226   ac_save_IFS=$IFS; IFS=$ac_path_separator
6227 ac_dummy="$PATH"
6228 for ac_dir in $ac_dummy; do
6229   IFS=$ac_save_IFS
6230   test -z "$ac_dir" && ac_dir=.
6231   if $as_executable_p "$ac_dir/$ac_word"; then
6232    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
6233    echo "$as_me:6233: found $ac_dir/$ac_word" >&5
6234    break
6235 fi
6236 done
6237
6238   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
6239   ;;
6240 esac
6241 fi
6242 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6243
6244 if test -n "$ac_pt_PKG_CONFIG"; then
6245   echo "$as_me:6245: result: $ac_pt_PKG_CONFIG" >&5
6246 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
6247 else
6248   echo "$as_me:6248: result: no" >&5
6249 echo "${ECHO_T}no" >&6
6250 fi
6251
6252   PKG_CONFIG=$ac_pt_PKG_CONFIG
6253 else
6254   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6255 fi
6256
6257         ;;
6258 (*)
6259         PKG_CONFIG=$withval
6260         ;;
6261 esac
6262
6263 test -z "$PKG_CONFIG" && PKG_CONFIG=none
6264 if test "$PKG_CONFIG" != none ; then
6265
6266 if test "x$prefix" != xNONE; then
6267         cf_path_syntax="$prefix"
6268 else
6269         cf_path_syntax="$ac_default_prefix"
6270 fi
6271
6272 case ".$PKG_CONFIG" in
6273 (.\$\(*\)*|.\'*\'*)
6274         ;;
6275 (..|./*|.\\*)
6276         ;;
6277 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6278         ;;
6279 (.\$\{*prefix\}*|.\$\{*dir\}*)
6280         eval PKG_CONFIG="$PKG_CONFIG"
6281         case ".$PKG_CONFIG" in
6282         (.NONE/*)
6283                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6284                 ;;
6285         esac
6286         ;;
6287 (.no|.NONE/*)
6288         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6289         ;;
6290 (*)
6291         { { echo "$as_me:6291: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6292 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6293    { (exit 1); exit 1; }; }
6294         ;;
6295 esac
6296
6297 elif test "x$cf_pkg_config" != xno ; then
6298         { echo "$as_me:6298: WARNING: pkg-config is not installed" >&5
6299 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6300 fi
6301
6302 echo "$as_me:6302: checking if you want to see long compiling messages" >&5
6303 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6304
6305 # Check whether --enable-echo or --disable-echo was given.
6306 if test "${enable_echo+set}" = set; then
6307   enableval="$enable_echo"
6308   test "$enableval" != no && enableval=yes
6309         if test "$enableval" != "yes" ; then
6310
6311         ECHO_LT='--silent'
6312         ECHO_LD='@echo linking $@;'
6313         RULE_CC='@echo compiling $<'
6314         SHOW_CC='@echo compiling $@'
6315         ECHO_CC='@'
6316
6317         else
6318
6319         ECHO_LT=''
6320         ECHO_LD=''
6321         RULE_CC=''
6322         SHOW_CC=''
6323         ECHO_CC=''
6324
6325         fi
6326 else
6327   enableval=yes
6328
6329         ECHO_LT=''
6330         ECHO_LD=''
6331         RULE_CC=''
6332         SHOW_CC=''
6333         ECHO_CC=''
6334
6335 fi;
6336 echo "$as_me:6336: result: $enableval" >&5
6337 echo "${ECHO_T}$enableval" >&6
6338
6339 echo "$as_me:6339: checking for ncurses wrap-prefix" >&5
6340 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6341
6342 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6343 if test "${with_ncurses_wrap_prefix+set}" = set; then
6344   withval="$with_ncurses_wrap_prefix"
6345   NCURSES_WRAP_PREFIX=$withval
6346 else
6347   NCURSES_WRAP_PREFIX=_nc_
6348 fi;
6349 echo "$as_me:6349: result: $NCURSES_WRAP_PREFIX" >&5
6350 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6351
6352 echo "$as_me:6352: checking if you want to check for wide-character functions" >&5
6353 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6354
6355 # Check whether --enable-widec or --disable-widec was given.
6356 if test "${enable_widec+set}" = set; then
6357   enableval="$enable_widec"
6358   test "$enableval" != no && enableval=yes
6359         if test "$enableval" != "yes" ; then
6360     cf_enable_widec=no
6361         else
6362                 cf_enable_widec=yes
6363         fi
6364 else
6365   enableval=yes
6366         cf_enable_widec=yes
6367
6368 fi;
6369 echo "$as_me:6369: result: $cf_enable_widec" >&5
6370 echo "${ECHO_T}$cf_enable_widec" >&6
6371
6372 echo "$as_me:6372: checking for specific curses-directory" >&5
6373 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6374
6375 # Check whether --with-curses-dir or --without-curses-dir was given.
6376 if test "${with_curses_dir+set}" = set; then
6377   withval="$with_curses_dir"
6378   cf_cv_curses_dir=$withval
6379 else
6380   cf_cv_curses_dir=no
6381 fi;
6382 echo "$as_me:6382: result: $cf_cv_curses_dir" >&5
6383 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6384
6385 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6386 then
6387
6388 if test "x$prefix" != xNONE; then
6389         cf_path_syntax="$prefix"
6390 else
6391         cf_path_syntax="$ac_default_prefix"
6392 fi
6393
6394 case ".$withval" in
6395 (.\$\(*\)*|.\'*\'*)
6396         ;;
6397 (..|./*|.\\*)
6398         ;;
6399 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6400         ;;
6401 (.\$\{*prefix\}*|.\$\{*dir\}*)
6402         eval withval="$withval"
6403         case ".$withval" in
6404         (.NONE/*)
6405                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6406                 ;;
6407         esac
6408         ;;
6409 (.no|.NONE/*)
6410         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6411         ;;
6412 (*)
6413         { { echo "$as_me:6413: error: expected a pathname, not \"$withval\"" >&5
6414 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6415    { (exit 1); exit 1; }; }
6416         ;;
6417 esac
6418
6419         if test -d "$cf_cv_curses_dir"
6420         then
6421
6422 if test -n "$cf_cv_curses_dir/include" ; then
6423   for cf_add_incdir in $cf_cv_curses_dir/include
6424   do
6425         while test "$cf_add_incdir" != /usr/include
6426         do
6427           if test -d "$cf_add_incdir"
6428           then
6429                 cf_have_incdir=no
6430                 if test -n "$CFLAGS$CPPFLAGS" ; then
6431                   # a loop is needed to ensure we can add subdirs of existing dirs
6432                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6433                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6434                           cf_have_incdir=yes; break
6435                         fi
6436                   done
6437                 fi
6438
6439                 if test "$cf_have_incdir" = no ; then
6440                   if test "$cf_add_incdir" = /usr/local/include ; then
6441                         if test "$GCC" = yes
6442                         then
6443                           cf_save_CPPFLAGS=$CPPFLAGS
6444
6445         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6446         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6447
6448                           cat >"conftest.$ac_ext" <<_ACEOF
6449 #line 6449 "configure"
6450 #include "confdefs.h"
6451 #include <stdio.h>
6452 int
6453 main (void)
6454 {
6455 printf("Hello")
6456   ;
6457   return 0;
6458 }
6459 _ACEOF
6460 rm -f "conftest.$ac_objext"
6461 if { (eval echo "$as_me:6461: \"$ac_compile\"") >&5
6462   (eval $ac_compile) 2>&5
6463   ac_status=$?
6464   echo "$as_me:6464: \$? = $ac_status" >&5
6465   (exit "$ac_status"); } &&
6466          { ac_try='test -s "conftest.$ac_objext"'
6467   { (eval echo "$as_me:6467: \"$ac_try\"") >&5
6468   (eval $ac_try) 2>&5
6469   ac_status=$?
6470   echo "$as_me:6470: \$? = $ac_status" >&5
6471   (exit "$ac_status"); }; }; then
6472   :
6473 else
6474   echo "$as_me: failed program was:" >&5
6475 cat "conftest.$ac_ext" >&5
6476 cf_have_incdir=yes
6477 fi
6478 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6479                           CPPFLAGS=$cf_save_CPPFLAGS
6480                         fi
6481                   fi
6482                 fi
6483
6484                 if test "$cf_have_incdir" = no ; then
6485                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6486
6487 echo "${as_me:-configure}:6487: testing adding $cf_add_incdir to include-path ..." 1>&5
6488
6489                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6490
6491                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6492                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6493                   cf_add_incdir="$cf_top_incdir"
6494                 else
6495                   break
6496                 fi
6497           else
6498                 break
6499           fi
6500         done
6501   done
6502 fi
6503
6504 if test -n "$cf_cv_curses_dir/lib" ; then
6505         for cf_add_libdir in $cf_cv_curses_dir/lib
6506         do
6507                 if test "$cf_add_libdir" = /usr/lib ; then
6508                         :
6509                 elif test -d "$cf_add_libdir"
6510                 then
6511                         cf_have_libdir=no
6512                         if test -n "$LDFLAGS$LIBS" ; then
6513                                 # a loop is needed to ensure we can add subdirs of existing dirs
6514                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6515                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6516                                                 cf_have_libdir=yes; break
6517                                         fi
6518                                 done
6519                         fi
6520                         if test "$cf_have_libdir" = no ; then
6521                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6522
6523 echo "${as_me:-configure}:6523: testing adding $cf_add_libdir to library-path ..." 1>&5
6524
6525                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6526                         fi
6527                 fi
6528         done
6529 fi
6530
6531         fi
6532 fi
6533
6534 cf_cv_screen=curses
6535
6536 echo "$as_me:6536: checking for specified curses library type" >&5
6537 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6538
6539 # Check whether --with-screen or --without-screen was given.
6540 if test "${with_screen+set}" = set; then
6541   withval="$with_screen"
6542   cf_cv_screen=$withval
6543 else
6544
6545 # Check whether --with-ncursesw or --without-ncursesw was given.
6546 if test "${with_ncursesw+set}" = set; then
6547   withval="$with_ncursesw"
6548   cf_cv_screen=ncursesw
6549 else
6550
6551 # Check whether --with-ncurses or --without-ncurses was given.
6552 if test "${with_ncurses+set}" = set; then
6553   withval="$with_ncurses"
6554   cf_cv_screen=ncurses
6555 else
6556
6557 # Check whether --with-pdcurses or --without-pdcurses was given.
6558 if test "${with_pdcurses+set}" = set; then
6559   withval="$with_pdcurses"
6560   cf_cv_screen=pdcurses
6561 else
6562
6563 # Check whether --with-curses-colr or --without-curses-colr was given.
6564 if test "${with_curses_colr+set}" = set; then
6565   withval="$with_curses_colr"
6566   cf_cv_screen=curses_colr
6567 else
6568
6569 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6570 if test "${with_curses_5lib+set}" = set; then
6571   withval="$with_curses_5lib"
6572   cf_cv_screen=curses_5lib
6573 fi;
6574 fi;
6575 fi;
6576 fi;
6577 fi;
6578 fi;
6579
6580 echo "$as_me:6580: result: $cf_cv_screen" >&5
6581 echo "${ECHO_T}$cf_cv_screen" >&6
6582
6583 case $cf_cv_screen in
6584 (curses|curses_*)
6585
6586 echo "$as_me:6586: checking for extra include directories" >&5
6587 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6588 if test "${cf_cv_curses_incdir+set}" = set; then
6589   echo $ECHO_N "(cached) $ECHO_C" >&6
6590 else
6591
6592 cf_cv_curses_incdir=no
6593 case "$host_os" in
6594 (hpux10.*)
6595         if test "x$cf_cv_screen" = "xcurses_colr"
6596         then
6597                 test -d /usr/include/curses_colr && \
6598                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6599         fi
6600         ;;
6601 (sunos3*|sunos4*)
6602         if test "x$cf_cv_screen" = "xcurses_5lib"
6603         then
6604                 test -d /usr/5lib && \
6605                 test -d /usr/5include && \
6606                 cf_cv_curses_incdir="-I/usr/5include"
6607         fi
6608         ;;
6609 esac
6610
6611 fi
6612 echo "$as_me:6612: result: $cf_cv_curses_incdir" >&5
6613 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6614 if test "$cf_cv_curses_incdir" != no
6615 then
6616
6617         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6618         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6619
6620 fi
6621
6622 echo "$as_me:6622: checking if we have identified curses headers" >&5
6623 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6624 if test "${cf_cv_ncurses_header+set}" = set; then
6625   echo $ECHO_N "(cached) $ECHO_C" >&6
6626 else
6627
6628 cf_cv_ncurses_header=none
6629 for cf_header in \
6630         ncurses.h  \
6631         curses.h  ncurses/ncurses.h ncurses/curses.h
6632 do
6633 cat >"conftest.$ac_ext" <<_ACEOF
6634 #line 6634 "configure"
6635 #include "confdefs.h"
6636 #include <${cf_header}>
6637 int
6638 main (void)
6639 {
6640 initscr(); endwin()
6641   ;
6642   return 0;
6643 }
6644 _ACEOF
6645 rm -f "conftest.$ac_objext"
6646 if { (eval echo "$as_me:6646: \"$ac_compile\"") >&5
6647   (eval $ac_compile) 2>&5
6648   ac_status=$?
6649   echo "$as_me:6649: \$? = $ac_status" >&5
6650   (exit "$ac_status"); } &&
6651          { ac_try='test -s "conftest.$ac_objext"'
6652   { (eval echo "$as_me:6652: \"$ac_try\"") >&5
6653   (eval $ac_try) 2>&5
6654   ac_status=$?
6655   echo "$as_me:6655: \$? = $ac_status" >&5
6656   (exit "$ac_status"); }; }; then
6657   cf_cv_ncurses_header=$cf_header; break
6658 else
6659   echo "$as_me: failed program was:" >&5
6660 cat "conftest.$ac_ext" >&5
6661 fi
6662 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6663 done
6664
6665 fi
6666 echo "$as_me:6666: result: $cf_cv_ncurses_header" >&5
6667 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6668
6669 if test "$cf_cv_ncurses_header" = none ; then
6670         { { echo "$as_me:6670: error: No curses header-files found" >&5
6671 echo "$as_me: error: No curses header-files found" >&2;}
6672    { (exit 1); exit 1; }; }
6673 fi
6674
6675 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6676
6677 for ac_header in $cf_cv_ncurses_header
6678 do
6679 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6680 echo "$as_me:6680: checking for $ac_header" >&5
6681 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6682 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6683   echo $ECHO_N "(cached) $ECHO_C" >&6
6684 else
6685   cat >"conftest.$ac_ext" <<_ACEOF
6686 #line 6686 "configure"
6687 #include "confdefs.h"
6688 #include <$ac_header>
6689 _ACEOF
6690 if { (eval echo "$as_me:6690: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6691   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6692   ac_status=$?
6693   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6694   rm -f conftest.er1
6695   cat conftest.err >&5
6696   echo "$as_me:6696: \$? = $ac_status" >&5
6697   (exit "$ac_status"); } >/dev/null; then
6698   if test -s conftest.err; then
6699     ac_cpp_err=$ac_c_preproc_warn_flag
6700   else
6701     ac_cpp_err=
6702   fi
6703 else
6704   ac_cpp_err=yes
6705 fi
6706 if test -z "$ac_cpp_err"; then
6707   eval "$as_ac_Header=yes"
6708 else
6709   echo "$as_me: failed program was:" >&5
6710   cat "conftest.$ac_ext" >&5
6711   eval "$as_ac_Header=no"
6712 fi
6713 rm -f conftest.err "conftest.$ac_ext"
6714 fi
6715 echo "$as_me:6715: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6716 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6717 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6718   cat >>confdefs.h <<EOF
6719 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6720 EOF
6721
6722 fi
6723 done
6724
6725 echo "$as_me:6725: checking for terminfo header" >&5
6726 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6727 if test "${cf_cv_term_header+set}" = set; then
6728   echo $ECHO_N "(cached) $ECHO_C" >&6
6729 else
6730
6731 case "${cf_cv_ncurses_header}" in
6732 (*/ncurses.h|*/ncursesw.h)
6733         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6734         ;;
6735 (*)
6736         cf_term_header=term.h
6737         ;;
6738 esac
6739
6740 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6741 do
6742 cat >"conftest.$ac_ext" <<_ACEOF
6743 #line 6743 "configure"
6744 #include "confdefs.h"
6745 #include <stdio.h>
6746 #include <${cf_cv_ncurses_header:-curses.h}>
6747 #include <$cf_test>
6748
6749 int
6750 main (void)
6751 {
6752 int x = auto_left_margin; (void)x
6753   ;
6754   return 0;
6755 }
6756 _ACEOF
6757 rm -f "conftest.$ac_objext"
6758 if { (eval echo "$as_me:6758: \"$ac_compile\"") >&5
6759   (eval $ac_compile) 2>&5
6760   ac_status=$?
6761   echo "$as_me:6761: \$? = $ac_status" >&5
6762   (exit "$ac_status"); } &&
6763          { ac_try='test -s "conftest.$ac_objext"'
6764   { (eval echo "$as_me:6764: \"$ac_try\"") >&5
6765   (eval $ac_try) 2>&5
6766   ac_status=$?
6767   echo "$as_me:6767: \$? = $ac_status" >&5
6768   (exit "$ac_status"); }; }; then
6769
6770         cf_cv_term_header="$cf_test"
6771 else
6772   echo "$as_me: failed program was:" >&5
6773 cat "conftest.$ac_ext" >&5
6774
6775         cf_cv_term_header=unknown
6776
6777 fi
6778 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6779         test "$cf_cv_term_header" != unknown && break
6780 done
6781
6782 fi
6783 echo "$as_me:6783: result: $cf_cv_term_header" >&5
6784 echo "${ECHO_T}$cf_cv_term_header" >&6
6785
6786 # Set definitions to allow ifdef'ing to accommodate subdirectories
6787
6788 case "$cf_cv_term_header" in
6789 (*term.h)
6790
6791 cat >>confdefs.h <<\EOF
6792 #define HAVE_TERM_H 1
6793 EOF
6794
6795         ;;
6796 esac
6797
6798 case "$cf_cv_term_header" in
6799 (ncurses/term.h)
6800
6801 cat >>confdefs.h <<\EOF
6802 #define HAVE_NCURSES_TERM_H 1
6803 EOF
6804
6805         ;;
6806 (ncursesw/term.h)
6807
6808 cat >>confdefs.h <<\EOF
6809 #define HAVE_NCURSESW_TERM_H 1
6810 EOF
6811
6812         ;;
6813 esac
6814
6815 echo "$as_me:6815: checking for ncurses version" >&5
6816 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6817 if test "${cf_cv_ncurses_version+set}" = set; then
6818   echo $ECHO_N "(cached) $ECHO_C" >&6
6819 else
6820
6821         cf_cv_ncurses_version=no
6822         cf_tempfile=out$$
6823         rm -f "$cf_tempfile"
6824         if test "$cross_compiling" = yes; then
6825
6826         # This will not work if the preprocessor splits the line after the
6827         # Autoconf token.  The 'unproto' program does that.
6828         cat > "conftest.$ac_ext" <<EOF
6829 #include <${cf_cv_ncurses_header:-curses.h}>
6830 #undef Autoconf
6831 #ifdef NCURSES_VERSION
6832 Autoconf NCURSES_VERSION
6833 #else
6834 #ifdef __NCURSES_H
6835 Autoconf "old"
6836 #endif
6837 ;
6838 #endif
6839 EOF
6840         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6841         { (eval echo "$as_me:6841: \"$cf_try\"") >&5
6842   (eval $cf_try) 2>&5
6843   ac_status=$?
6844   echo "$as_me:6844: \$? = $ac_status" >&5
6845   (exit "$ac_status"); }
6846         if test -f conftest.out ; then
6847                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6848                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6849                 rm -f conftest.out
6850         fi
6851
6852 else
6853   cat >"conftest.$ac_ext" <<_ACEOF
6854 #line 6854 "configure"
6855 #include "confdefs.h"
6856
6857 $ac_includes_default
6858
6859 #include <${cf_cv_ncurses_header:-curses.h}>
6860
6861 int main(void)
6862 {
6863         FILE *fp = fopen("$cf_tempfile", "w");
6864 #ifdef NCURSES_VERSION
6865 # ifdef NCURSES_VERSION_PATCH
6866         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6867 # else
6868         fprintf(fp, "%s\\n", NCURSES_VERSION);
6869 # endif
6870 #else
6871 # ifdef __NCURSES_H
6872         fprintf(fp, "old\\n");
6873 # else
6874         make an error
6875 # endif
6876 #endif
6877         ${cf_cv_main_return:-return}(0);
6878 }
6879 _ACEOF
6880 rm -f "conftest$ac_exeext"
6881 if { (eval echo "$as_me:6881: \"$ac_link\"") >&5
6882   (eval $ac_link) 2>&5
6883   ac_status=$?
6884   echo "$as_me:6884: \$? = $ac_status" >&5
6885   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6886   { (eval echo "$as_me:6886: \"$ac_try\"") >&5
6887   (eval $ac_try) 2>&5
6888   ac_status=$?
6889   echo "$as_me:6889: \$? = $ac_status" >&5
6890   (exit "$ac_status"); }; }; then
6891
6892         cf_cv_ncurses_version=`cat $cf_tempfile`
6893 else
6894   echo "$as_me: program exited with status $ac_status" >&5
6895 echo "$as_me: failed program was:" >&5
6896 cat "conftest.$ac_ext" >&5
6897 fi
6898 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6899 fi
6900         rm -f "$cf_tempfile"
6901
6902 fi
6903 echo "$as_me:6903: result: $cf_cv_ncurses_version" >&5
6904 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6905 test "$cf_cv_ncurses_version" = no ||
6906 cat >>confdefs.h <<\EOF
6907 #define NCURSES 1
6908 EOF
6909
6910 echo "$as_me:6910: checking if we have identified curses libraries" >&5
6911 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6912 cat >"conftest.$ac_ext" <<_ACEOF
6913 #line 6913 "configure"
6914 #include "confdefs.h"
6915 #include <${cf_cv_ncurses_header:-curses.h}>
6916 int
6917 main (void)
6918 {
6919 initscr(); endwin()
6920   ;
6921   return 0;
6922 }
6923 _ACEOF
6924 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6925 if { (eval echo "$as_me:6925: \"$ac_link\"") >&5
6926   (eval $ac_link) 2>&5
6927   ac_status=$?
6928   echo "$as_me:6928: \$? = $ac_status" >&5
6929   (exit "$ac_status"); } &&
6930          { ac_try='test -s "conftest$ac_exeext"'
6931   { (eval echo "$as_me:6931: \"$ac_try\"") >&5
6932   (eval $ac_try) 2>&5
6933   ac_status=$?
6934   echo "$as_me:6934: \$? = $ac_status" >&5
6935   (exit "$ac_status"); }; }; then
6936   cf_result=yes
6937 else
6938   echo "$as_me: failed program was:" >&5
6939 cat "conftest.$ac_ext" >&5
6940 cf_result=no
6941 fi
6942 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6943 echo "$as_me:6943: result: $cf_result" >&5
6944 echo "${ECHO_T}$cf_result" >&6
6945
6946 if test "$cf_result" = no ; then
6947 case "$host_os" in
6948 (freebsd*)
6949         echo "$as_me:6949: checking for tgoto in -lmytinfo" >&5
6950 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6951 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6952   echo $ECHO_N "(cached) $ECHO_C" >&6
6953 else
6954   ac_check_lib_save_LIBS=$LIBS
6955 LIBS="-lmytinfo  $LIBS"
6956 cat >"conftest.$ac_ext" <<_ACEOF
6957 #line 6957 "configure"
6958 #include "confdefs.h"
6959
6960 /* Override any gcc2 internal prototype to avoid an error.  */
6961 #ifdef __cplusplus
6962 extern "C"
6963 #endif
6964 /* We use char because int might match the return type of a gcc2
6965    builtin and then its argument prototype would still apply.  */
6966 char tgoto ();
6967 int
6968 main (void)
6969 {
6970 tgoto ();
6971   ;
6972   return 0;
6973 }
6974 _ACEOF
6975 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6976 if { (eval echo "$as_me:6976: \"$ac_link\"") >&5
6977   (eval $ac_link) 2>&5
6978   ac_status=$?
6979   echo "$as_me:6979: \$? = $ac_status" >&5
6980   (exit "$ac_status"); } &&
6981          { ac_try='test -s "conftest$ac_exeext"'
6982   { (eval echo "$as_me:6982: \"$ac_try\"") >&5
6983   (eval $ac_try) 2>&5
6984   ac_status=$?
6985   echo "$as_me:6985: \$? = $ac_status" >&5
6986   (exit "$ac_status"); }; }; then
6987   ac_cv_lib_mytinfo_tgoto=yes
6988 else
6989   echo "$as_me: failed program was:" >&5
6990 cat "conftest.$ac_ext" >&5
6991 ac_cv_lib_mytinfo_tgoto=no
6992 fi
6993 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6994 LIBS=$ac_check_lib_save_LIBS
6995 fi
6996 echo "$as_me:6996: result: $ac_cv_lib_mytinfo_tgoto" >&5
6997 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6998 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6999
7000 cf_add_libs="$LIBS"
7001 # reverse order
7002 cf_add_0lib=
7003 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7004 # filter duplicates
7005 for cf_add_1lib in $cf_add_0lib; do
7006         for cf_add_2lib in $cf_add_libs; do
7007                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7008                         cf_add_1lib=
7009                         break
7010                 fi
7011         done
7012         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7013 done
7014 LIBS="$cf_add_libs"
7015
7016 fi
7017
7018         ;;
7019 (hpux10.*)
7020         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
7021         # next (1998), and xcurses "newer" (2000).  There is no header file for
7022         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
7023         # term.h) for cur_colr
7024         if test "x$cf_cv_screen" = "xcurses_colr"
7025         then
7026                 echo "$as_me:7026: checking for initscr in -lcur_colr" >&5
7027 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
7028 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
7029   echo $ECHO_N "(cached) $ECHO_C" >&6
7030 else
7031   ac_check_lib_save_LIBS=$LIBS
7032 LIBS="-lcur_colr  $LIBS"
7033 cat >"conftest.$ac_ext" <<_ACEOF
7034 #line 7034 "configure"
7035 #include "confdefs.h"
7036
7037 /* Override any gcc2 internal prototype to avoid an error.  */
7038 #ifdef __cplusplus
7039 extern "C"
7040 #endif
7041 /* We use char because int might match the return type of a gcc2
7042    builtin and then its argument prototype would still apply.  */
7043 char initscr ();
7044 int
7045 main (void)
7046 {
7047 initscr ();
7048   ;
7049   return 0;
7050 }
7051 _ACEOF
7052 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7053 if { (eval echo "$as_me:7053: \"$ac_link\"") >&5
7054   (eval $ac_link) 2>&5
7055   ac_status=$?
7056   echo "$as_me:7056: \$? = $ac_status" >&5
7057   (exit "$ac_status"); } &&
7058          { ac_try='test -s "conftest$ac_exeext"'
7059   { (eval echo "$as_me:7059: \"$ac_try\"") >&5
7060   (eval $ac_try) 2>&5
7061   ac_status=$?
7062   echo "$as_me:7062: \$? = $ac_status" >&5
7063   (exit "$ac_status"); }; }; then
7064   ac_cv_lib_cur_colr_initscr=yes
7065 else
7066   echo "$as_me: failed program was:" >&5
7067 cat "conftest.$ac_ext" >&5
7068 ac_cv_lib_cur_colr_initscr=no
7069 fi
7070 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7071 LIBS=$ac_check_lib_save_LIBS
7072 fi
7073 echo "$as_me:7073: result: $ac_cv_lib_cur_colr_initscr" >&5
7074 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
7075 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
7076
7077 cf_add_libs="$LIBS"
7078 # reverse order
7079 cf_add_0lib=
7080 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7081 # filter duplicates
7082 for cf_add_1lib in $cf_add_0lib; do
7083         for cf_add_2lib in $cf_add_libs; do
7084                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7085                         cf_add_1lib=
7086                         break
7087                 fi
7088         done
7089         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7090 done
7091 LIBS="$cf_add_libs"
7092
7093                         ac_cv_func_initscr=yes
7094
7095 else
7096
7097                 echo "$as_me:7097: checking for initscr in -lHcurses" >&5
7098 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
7099 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
7100   echo $ECHO_N "(cached) $ECHO_C" >&6
7101 else
7102   ac_check_lib_save_LIBS=$LIBS
7103 LIBS="-lHcurses  $LIBS"
7104 cat >"conftest.$ac_ext" <<_ACEOF
7105 #line 7105 "configure"
7106 #include "confdefs.h"
7107
7108 /* Override any gcc2 internal prototype to avoid an error.  */
7109 #ifdef __cplusplus
7110 extern "C"
7111 #endif
7112 /* We use char because int might match the return type of a gcc2
7113    builtin and then its argument prototype would still apply.  */
7114 char initscr ();
7115 int
7116 main (void)
7117 {
7118 initscr ();
7119   ;
7120   return 0;
7121 }
7122 _ACEOF
7123 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7124 if { (eval echo "$as_me:7124: \"$ac_link\"") >&5
7125   (eval $ac_link) 2>&5
7126   ac_status=$?
7127   echo "$as_me:7127: \$? = $ac_status" >&5
7128   (exit "$ac_status"); } &&
7129          { ac_try='test -s "conftest$ac_exeext"'
7130   { (eval echo "$as_me:7130: \"$ac_try\"") >&5
7131   (eval $ac_try) 2>&5
7132   ac_status=$?
7133   echo "$as_me:7133: \$? = $ac_status" >&5
7134   (exit "$ac_status"); }; }; then
7135   ac_cv_lib_Hcurses_initscr=yes
7136 else
7137   echo "$as_me: failed program was:" >&5
7138 cat "conftest.$ac_ext" >&5
7139 ac_cv_lib_Hcurses_initscr=no
7140 fi
7141 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7142 LIBS=$ac_check_lib_save_LIBS
7143 fi
7144 echo "$as_me:7144: result: $ac_cv_lib_Hcurses_initscr" >&5
7145 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
7146 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
7147
7148                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
7149
7150 cf_add_libs="$LIBS"
7151 # reverse order
7152 cf_add_0lib=
7153 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7154 # filter duplicates
7155 for cf_add_1lib in $cf_add_0lib; do
7156         for cf_add_2lib in $cf_add_libs; do
7157                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7158                         cf_add_1lib=
7159                         break
7160                 fi
7161         done
7162         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7163 done
7164 LIBS="$cf_add_libs"
7165
7166         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7167         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
7168
7169                         ac_cv_func_initscr=yes
7170
7171 fi
7172
7173 fi
7174
7175         fi
7176         ;;
7177 (linux*)
7178         case `arch 2>/dev/null` in
7179         (x86_64)
7180                 if test -d /lib64
7181                 then
7182
7183 if test -n "/lib64" ; then
7184         for cf_add_libdir in /lib64
7185         do
7186                 if test "$cf_add_libdir" = /usr/lib ; then
7187                         :
7188                 elif test -d "$cf_add_libdir"
7189                 then
7190                         cf_have_libdir=no
7191                         if test -n "$LDFLAGS$LIBS" ; then
7192                                 # a loop is needed to ensure we can add subdirs of existing dirs
7193                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7194                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7195                                                 cf_have_libdir=yes; break
7196                                         fi
7197                                 done
7198                         fi
7199                         if test "$cf_have_libdir" = no ; then
7200                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7201
7202 echo "${as_me:-configure}:7202: testing adding $cf_add_libdir to library-path ..." 1>&5
7203
7204                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7205                         fi
7206                 fi
7207         done
7208 fi
7209
7210                 else
7211
7212 if test -n "/lib" ; then
7213         for cf_add_libdir in /lib
7214         do
7215                 if test "$cf_add_libdir" = /usr/lib ; then
7216                         :
7217                 elif test -d "$cf_add_libdir"
7218                 then
7219                         cf_have_libdir=no
7220                         if test -n "$LDFLAGS$LIBS" ; then
7221                                 # a loop is needed to ensure we can add subdirs of existing dirs
7222                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7223                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7224                                                 cf_have_libdir=yes; break
7225                                         fi
7226                                 done
7227                         fi
7228                         if test "$cf_have_libdir" = no ; then
7229                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7230
7231 echo "${as_me:-configure}:7231: testing adding $cf_add_libdir to library-path ..." 1>&5
7232
7233                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7234                         fi
7235                 fi
7236         done
7237 fi
7238
7239                 fi
7240                 ;;
7241         (*)
7242
7243 if test -n "/lib" ; then
7244         for cf_add_libdir in /lib
7245         do
7246                 if test "$cf_add_libdir" = /usr/lib ; then
7247                         :
7248                 elif test -d "$cf_add_libdir"
7249                 then
7250                         cf_have_libdir=no
7251                         if test -n "$LDFLAGS$LIBS" ; then
7252                                 # a loop is needed to ensure we can add subdirs of existing dirs
7253                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7254                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7255                                                 cf_have_libdir=yes; break
7256                                         fi
7257                                 done
7258                         fi
7259                         if test "$cf_have_libdir" = no ; then
7260                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7261
7262 echo "${as_me:-configure}:7262: testing adding $cf_add_libdir to library-path ..." 1>&5
7263
7264                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7265                         fi
7266                 fi
7267         done
7268 fi
7269
7270                 ;;
7271         esac
7272         ;;
7273 (sunos3*|sunos4*)
7274         if test "x$cf_cv_screen" = "xcurses_5lib"
7275         then
7276                 if test -d /usr/5lib ; then
7277
7278 if test -n "/usr/5lib" ; then
7279         for cf_add_libdir in /usr/5lib
7280         do
7281                 if test "$cf_add_libdir" = /usr/lib ; then
7282                         :
7283                 elif test -d "$cf_add_libdir"
7284                 then
7285                         cf_have_libdir=no
7286                         if test -n "$LDFLAGS$LIBS" ; then
7287                                 # a loop is needed to ensure we can add subdirs of existing dirs
7288                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7289                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7290                                                 cf_have_libdir=yes; break
7291                                         fi
7292                                 done
7293                         fi
7294                         if test "$cf_have_libdir" = no ; then
7295                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7296
7297 echo "${as_me:-configure}:7297: testing adding $cf_add_libdir to library-path ..." 1>&5
7298
7299                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7300                         fi
7301                 fi
7302         done
7303 fi
7304
7305 cf_add_libs="$LIBS"
7306 # reverse order
7307 cf_add_0lib=
7308 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7309 # filter duplicates
7310 for cf_add_1lib in $cf_add_0lib; do
7311         for cf_add_2lib in $cf_add_libs; do
7312                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7313                         cf_add_1lib=
7314                         break
7315                 fi
7316         done
7317         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7318 done
7319 LIBS="$cf_add_libs"
7320
7321                 fi
7322         fi
7323         ac_cv_func_initscr=yes
7324         ;;
7325 esac
7326
7327 if test ".$ac_cv_func_initscr" != .yes ; then
7328         cf_save_LIBS="$LIBS"
7329
7330         if test ".${cf_cv_ncurses_version:-no}" != .no
7331         then
7332                 cf_check_list="ncurses curses cursesX"
7333         else
7334                 cf_check_list="cursesX curses ncurses"
7335         fi
7336
7337         # Check for library containing tgoto.  Do this before curses library
7338         # because it may be needed to link the test-case for initscr.
7339         if test "x$cf_term_lib" = x
7340         then
7341                 echo "$as_me:7341: checking for tgoto" >&5
7342 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7343 if test "${ac_cv_func_tgoto+set}" = set; then
7344   echo $ECHO_N "(cached) $ECHO_C" >&6
7345 else
7346   cat >"conftest.$ac_ext" <<_ACEOF
7347 #line 7347 "configure"
7348 #include "confdefs.h"
7349 #define tgoto autoconf_temporary
7350 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7351 #undef tgoto
7352
7353 #ifdef __cplusplus
7354 extern "C"
7355 #endif
7356
7357 /* We use char because int might match the return type of a gcc2
7358    builtin and then its argument prototype would still apply.  */
7359 char tgoto (void);
7360
7361 int
7362 main (void)
7363 {
7364
7365 /* The GNU C library defines stubs for functions which it implements
7366     to always fail with ENOSYS.  Some functions are actually named
7367     something starting with __ and the normal name is an alias.  */
7368 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7369 #error found stub for tgoto
7370 #endif
7371
7372         return tgoto ();
7373   ;
7374   return 0;
7375 }
7376 _ACEOF
7377 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7378 if { (eval echo "$as_me:7378: \"$ac_link\"") >&5
7379   (eval $ac_link) 2>&5
7380   ac_status=$?
7381   echo "$as_me:7381: \$? = $ac_status" >&5
7382   (exit "$ac_status"); } &&
7383          { ac_try='test -s "conftest$ac_exeext"'
7384   { (eval echo "$as_me:7384: \"$ac_try\"") >&5
7385   (eval $ac_try) 2>&5
7386   ac_status=$?
7387   echo "$as_me:7387: \$? = $ac_status" >&5
7388   (exit "$ac_status"); }; }; then
7389   ac_cv_func_tgoto=yes
7390 else
7391   echo "$as_me: failed program was:" >&5
7392 cat "conftest.$ac_ext" >&5
7393 ac_cv_func_tgoto=no
7394 fi
7395 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7396 fi
7397 echo "$as_me:7397: result: $ac_cv_func_tgoto" >&5
7398 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7399 if test "$ac_cv_func_tgoto" = yes; then
7400   cf_term_lib=predefined
7401 else
7402
7403                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7404                         do
7405                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7406 echo "$as_me:7406: checking for tgoto in -l$cf_term_lib" >&5
7407 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7408 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7409   echo $ECHO_N "(cached) $ECHO_C" >&6
7410 else
7411   ac_check_lib_save_LIBS=$LIBS
7412 LIBS="-l$cf_term_lib  $LIBS"
7413 cat >"conftest.$ac_ext" <<_ACEOF
7414 #line 7414 "configure"
7415 #include "confdefs.h"
7416
7417 /* Override any gcc2 internal prototype to avoid an error.  */
7418 #ifdef __cplusplus
7419 extern "C"
7420 #endif
7421 /* We use char because int might match the return type of a gcc2
7422    builtin and then its argument prototype would still apply.  */
7423 char tgoto ();
7424 int
7425 main (void)
7426 {
7427 tgoto ();
7428   ;
7429   return 0;
7430 }
7431 _ACEOF
7432 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7433 if { (eval echo "$as_me:7433: \"$ac_link\"") >&5
7434   (eval $ac_link) 2>&5
7435   ac_status=$?
7436   echo "$as_me:7436: \$? = $ac_status" >&5
7437   (exit "$ac_status"); } &&
7438          { ac_try='test -s "conftest$ac_exeext"'
7439   { (eval echo "$as_me:7439: \"$ac_try\"") >&5
7440   (eval $ac_try) 2>&5
7441   ac_status=$?
7442   echo "$as_me:7442: \$? = $ac_status" >&5
7443   (exit "$ac_status"); }; }; then
7444   eval "$as_ac_Lib=yes"
7445 else
7446   echo "$as_me: failed program was:" >&5
7447 cat "conftest.$ac_ext" >&5
7448 eval "$as_ac_Lib=no"
7449 fi
7450 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7451 LIBS=$ac_check_lib_save_LIBS
7452 fi
7453 echo "$as_me:7453: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7454 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7455 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7456
7457                                         : "${cf_nculib_root:=$cf_term_lib}"
7458                                         break
7459
7460 fi
7461
7462                         done
7463
7464 fi
7465
7466         fi
7467
7468         # Check for library containing initscr
7469         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7470         if test "x$cf_curs_lib" = x
7471         then
7472                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7473                 do
7474                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7475                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7476                                 echo "$as_me:7476: checking if we can link with $cf_curs_lib library" >&5
7477 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7478                                 cat >"conftest.$ac_ext" <<_ACEOF
7479 #line 7479 "configure"
7480 #include "confdefs.h"
7481 #include <${cf_cv_ncurses_header:-curses.h}>
7482 int
7483 main (void)
7484 {
7485 initscr()
7486   ;
7487   return 0;
7488 }
7489 _ACEOF
7490 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7491 if { (eval echo "$as_me:7491: \"$ac_link\"") >&5
7492   (eval $ac_link) 2>&5
7493   ac_status=$?
7494   echo "$as_me:7494: \$? = $ac_status" >&5
7495   (exit "$ac_status"); } &&
7496          { ac_try='test -s "conftest$ac_exeext"'
7497   { (eval echo "$as_me:7497: \"$ac_try\"") >&5
7498   (eval $ac_try) 2>&5
7499   ac_status=$?
7500   echo "$as_me:7500: \$? = $ac_status" >&5
7501   (exit "$ac_status"); }; }; then
7502   cf_result=yes
7503 else
7504   echo "$as_me: failed program was:" >&5
7505 cat "conftest.$ac_ext" >&5
7506 cf_result=no
7507 fi
7508 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7509                                 echo "$as_me:7509: result: $cf_result" >&5
7510 echo "${ECHO_T}$cf_result" >&6
7511                                 test "$cf_result" = yes && break
7512                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7513                                 cf_result=no
7514                         elif test "$cf_term_lib" != predefined ; then
7515                                 echo "$as_me:7515: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7516 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7517                                 cat >"conftest.$ac_ext" <<_ACEOF
7518 #line 7518 "configure"
7519 #include "confdefs.h"
7520 #include <${cf_cv_ncurses_header:-curses.h}>
7521 int
7522 main (void)
7523 {
7524 initscr(); endwin();
7525   ;
7526   return 0;
7527 }
7528 _ACEOF
7529 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7530 if { (eval echo "$as_me:7530: \"$ac_link\"") >&5
7531   (eval $ac_link) 2>&5
7532   ac_status=$?
7533   echo "$as_me:7533: \$? = $ac_status" >&5
7534   (exit "$ac_status"); } &&
7535          { ac_try='test -s "conftest$ac_exeext"'
7536   { (eval echo "$as_me:7536: \"$ac_try\"") >&5
7537   (eval $ac_try) 2>&5
7538   ac_status=$?
7539   echo "$as_me:7539: \$? = $ac_status" >&5
7540   (exit "$ac_status"); }; }; then
7541   cf_result=no
7542 else
7543   echo "$as_me: failed program was:" >&5
7544 cat "conftest.$ac_ext" >&5
7545
7546                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7547                                         cat >"conftest.$ac_ext" <<_ACEOF
7548 #line 7548 "configure"
7549 #include "confdefs.h"
7550 #include <${cf_cv_ncurses_header:-curses.h}>
7551 int
7552 main (void)
7553 {
7554 initscr()
7555   ;
7556   return 0;
7557 }
7558 _ACEOF
7559 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7560 if { (eval echo "$as_me:7560: \"$ac_link\"") >&5
7561   (eval $ac_link) 2>&5
7562   ac_status=$?
7563   echo "$as_me:7563: \$? = $ac_status" >&5
7564   (exit "$ac_status"); } &&
7565          { ac_try='test -s "conftest$ac_exeext"'
7566   { (eval echo "$as_me:7566: \"$ac_try\"") >&5
7567   (eval $ac_try) 2>&5
7568   ac_status=$?
7569   echo "$as_me:7569: \$? = $ac_status" >&5
7570   (exit "$ac_status"); }; }; then
7571   cf_result=yes
7572 else
7573   echo "$as_me: failed program was:" >&5
7574 cat "conftest.$ac_ext" >&5
7575 cf_result=error
7576 fi
7577 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7578
7579 fi
7580 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7581                                 echo "$as_me:7581: result: $cf_result" >&5
7582 echo "${ECHO_T}$cf_result" >&6
7583                                 test "$cf_result" != error && break
7584                         fi
7585                 done
7586         fi
7587         test "$cf_curs_lib" = unknown && { { echo "$as_me:7587: error: no curses library found" >&5
7588 echo "$as_me: error: no curses library found" >&2;}
7589    { (exit 1); exit 1; }; }
7590 fi
7591 fi
7592
7593         ;;
7594 (ncursesw*)
7595
7596 for ac_header in wchar.h
7597 do
7598 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7599 echo "$as_me:7599: checking for $ac_header" >&5
7600 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7601 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7602   echo $ECHO_N "(cached) $ECHO_C" >&6
7603 else
7604   cat >"conftest.$ac_ext" <<_ACEOF
7605 #line 7605 "configure"
7606 #include "confdefs.h"
7607 #include <$ac_header>
7608 _ACEOF
7609 if { (eval echo "$as_me:7609: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7610   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7611   ac_status=$?
7612   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7613   rm -f conftest.er1
7614   cat conftest.err >&5
7615   echo "$as_me:7615: \$? = $ac_status" >&5
7616   (exit "$ac_status"); } >/dev/null; then
7617   if test -s conftest.err; then
7618     ac_cpp_err=$ac_c_preproc_warn_flag
7619   else
7620     ac_cpp_err=
7621   fi
7622 else
7623   ac_cpp_err=yes
7624 fi
7625 if test -z "$ac_cpp_err"; then
7626   eval "$as_ac_Header=yes"
7627 else
7628   echo "$as_me: failed program was:" >&5
7629   cat "conftest.$ac_ext" >&5
7630   eval "$as_ac_Header=no"
7631 fi
7632 rm -f conftest.err "conftest.$ac_ext"
7633 fi
7634 echo "$as_me:7634: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7635 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7636 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7637   cat >>confdefs.h <<EOF
7638 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7639 EOF
7640
7641 fi
7642 done
7643
7644 echo "$as_me:7644: checking for multibyte character support" >&5
7645 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7646 if test "${cf_cv_utf8_lib+set}" = set; then
7647   echo $ECHO_N "(cached) $ECHO_C" >&6
7648 else
7649
7650         cf_save_LIBS="$LIBS"
7651         cat >"conftest.$ac_ext" <<_ACEOF
7652 #line 7652 "configure"
7653 #include "confdefs.h"
7654
7655 #include <stdlib.h>
7656 #include <stdio.h>
7657 #ifdef HAVE_WCHAR_H
7658 #include <wchar.h>
7659 #endif
7660
7661 int
7662 main (void)
7663 {
7664 putwc(0,0);
7665   ;
7666   return 0;
7667 }
7668 _ACEOF
7669 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7670 if { (eval echo "$as_me:7670: \"$ac_link\"") >&5
7671   (eval $ac_link) 2>&5
7672   ac_status=$?
7673   echo "$as_me:7673: \$? = $ac_status" >&5
7674   (exit "$ac_status"); } &&
7675          { ac_try='test -s "conftest$ac_exeext"'
7676   { (eval echo "$as_me:7676: \"$ac_try\"") >&5
7677   (eval $ac_try) 2>&5
7678   ac_status=$?
7679   echo "$as_me:7679: \$? = $ac_status" >&5
7680   (exit "$ac_status"); }; }; then
7681   cf_cv_utf8_lib=yes
7682 else
7683   echo "$as_me: failed program was:" >&5
7684 cat "conftest.$ac_ext" >&5
7685
7686 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7687 # will be set on completion of the AC_TRY_LINK below.
7688 cf_cv_header_path_utf8=
7689 cf_cv_library_path_utf8=
7690
7691 echo "${as_me:-configure}:7691: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7692
7693 cf_save_LIBS="$LIBS"
7694
7695 cat >"conftest.$ac_ext" <<_ACEOF
7696 #line 7696 "configure"
7697 #include "confdefs.h"
7698
7699 #include <libutf8.h>
7700 int
7701 main (void)
7702 {
7703 putwc(0,0);
7704   ;
7705   return 0;
7706 }
7707 _ACEOF
7708 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7709 if { (eval echo "$as_me:7709: \"$ac_link\"") >&5
7710   (eval $ac_link) 2>&5
7711   ac_status=$?
7712   echo "$as_me:7712: \$? = $ac_status" >&5
7713   (exit "$ac_status"); } &&
7714          { ac_try='test -s "conftest$ac_exeext"'
7715   { (eval echo "$as_me:7715: \"$ac_try\"") >&5
7716   (eval $ac_try) 2>&5
7717   ac_status=$?
7718   echo "$as_me:7718: \$? = $ac_status" >&5
7719   (exit "$ac_status"); }; }; then
7720
7721         cf_cv_find_linkage_utf8=yes
7722         cf_cv_header_path_utf8=/usr/include
7723         cf_cv_library_path_utf8=/usr/lib
7724
7725 else
7726   echo "$as_me: failed program was:" >&5
7727 cat "conftest.$ac_ext" >&5
7728
7729 LIBS="-lutf8  $cf_save_LIBS"
7730
7731 cat >"conftest.$ac_ext" <<_ACEOF
7732 #line 7732 "configure"
7733 #include "confdefs.h"
7734
7735 #include <libutf8.h>
7736 int
7737 main (void)
7738 {
7739 putwc(0,0);
7740   ;
7741   return 0;
7742 }
7743 _ACEOF
7744 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7745 if { (eval echo "$as_me:7745: \"$ac_link\"") >&5
7746   (eval $ac_link) 2>&5
7747   ac_status=$?
7748   echo "$as_me:7748: \$? = $ac_status" >&5
7749   (exit "$ac_status"); } &&
7750          { ac_try='test -s "conftest$ac_exeext"'
7751   { (eval echo "$as_me:7751: \"$ac_try\"") >&5
7752   (eval $ac_try) 2>&5
7753   ac_status=$?
7754   echo "$as_me:7754: \$? = $ac_status" >&5
7755   (exit "$ac_status"); }; }; then
7756
7757         cf_cv_find_linkage_utf8=yes
7758         cf_cv_header_path_utf8=/usr/include
7759         cf_cv_library_path_utf8=/usr/lib
7760         cf_cv_library_file_utf8="-lutf8"
7761
7762 else
7763   echo "$as_me: failed program was:" >&5
7764 cat "conftest.$ac_ext" >&5
7765
7766         cf_cv_find_linkage_utf8=no
7767         LIBS="$cf_save_LIBS"
7768
7769         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7770
7771 echo "${as_me:-configure}:7771: testing find linkage for utf8 library ..." 1>&5
7772
7773 echo "${as_me:-configure}:7773: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7774
7775         cf_save_CPPFLAGS="$CPPFLAGS"
7776         cf_test_CPPFLAGS="$CPPFLAGS"
7777
7778 cf_search=
7779
7780 # collect the current set of include-directories from compiler flags
7781 cf_header_path_list=""
7782 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7783         for cf_header_path in $CPPFLAGS $CFLAGS
7784         do
7785                 case "$cf_header_path" in
7786                 (-I*)
7787                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7788
7789 test "x$cf_header_path" != "xNONE" && \
7790 test -d "$cf_header_path" && \
7791  {
7792         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7793         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7794         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7795         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7796         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7797         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7798 }
7799
7800                         cf_header_path_list="$cf_header_path_list $cf_search"
7801                         ;;
7802                 esac
7803         done
7804 fi
7805
7806 # add the variations for the package we are looking for
7807
7808 cf_search=
7809
7810 test "x$prefix" != "xNONE" && \
7811 test -d "$prefix" && \
7812  {
7813         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7814         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7815         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7816         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7817         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7818         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7819 }
7820
7821 for cf_subdir_prefix in \
7822         /usr \
7823         /usr/local \
7824         /usr/pkg \
7825         /opt \
7826         /opt/local \
7827         $HOME
7828 do
7829
7830 test "x$cf_subdir_prefix" != "x$prefix" && \
7831 test -d "$cf_subdir_prefix" && \
7832 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7833         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7834         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7835         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7836         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7837         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7838         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7839 }
7840
7841 done
7842
7843 test "$includedir" != NONE && \
7844 test "$includedir" != "/usr/include" && \
7845 test -d "$includedir" && {
7846         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7847         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7848 }
7849
7850 test "$oldincludedir" != NONE && \
7851 test "$oldincludedir" != "/usr/include" && \
7852 test -d "$oldincludedir" && {
7853         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7854         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7855 }
7856
7857 cf_search="$cf_search $cf_header_path_list"
7858
7859         for cf_cv_header_path_utf8 in $cf_search
7860         do
7861                 if test -d "$cf_cv_header_path_utf8" ; then
7862                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7863
7864 echo "${as_me:-configure}:7864: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7865
7866                         CPPFLAGS="$cf_save_CPPFLAGS"
7867
7868         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7869         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7870
7871                         cat >"conftest.$ac_ext" <<_ACEOF
7872 #line 7872 "configure"
7873 #include "confdefs.h"
7874
7875 #include <libutf8.h>
7876 int
7877 main (void)
7878 {
7879 putwc(0,0);
7880   ;
7881   return 0;
7882 }
7883 _ACEOF
7884 rm -f "conftest.$ac_objext"
7885 if { (eval echo "$as_me:7885: \"$ac_compile\"") >&5
7886   (eval $ac_compile) 2>&5
7887   ac_status=$?
7888   echo "$as_me:7888: \$? = $ac_status" >&5
7889   (exit "$ac_status"); } &&
7890          { ac_try='test -s "conftest.$ac_objext"'
7891   { (eval echo "$as_me:7891: \"$ac_try\"") >&5
7892   (eval $ac_try) 2>&5
7893   ac_status=$?
7894   echo "$as_me:7894: \$? = $ac_status" >&5
7895   (exit "$ac_status"); }; }; then
7896
7897                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7898
7899 echo "${as_me:-configure}:7899: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7900
7901                                 cf_cv_find_linkage_utf8=maybe
7902                                 cf_test_CPPFLAGS="$CPPFLAGS"
7903                                 break
7904 else
7905   echo "$as_me: failed program was:" >&5
7906 cat "conftest.$ac_ext" >&5
7907
7908                                 CPPFLAGS="$cf_save_CPPFLAGS"
7909
7910 fi
7911 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7912                 fi
7913         done
7914
7915         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7916
7917 echo "${as_me:-configure}:7917: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7918
7919                 cf_save_LIBS="$LIBS"
7920                 cf_save_LDFLAGS="$LDFLAGS"
7921
7922                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7923
7924 cf_search=
7925 cf_library_path_list=""
7926 if test -n "${LDFLAGS}${LIBS}" ; then
7927         for cf_library_path in $LDFLAGS $LIBS
7928         do
7929                 case "$cf_library_path" in
7930                 (-L*)
7931                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7932
7933 test "x$cf_library_path" != "xNONE" && \
7934 test -d "$cf_library_path" && \
7935  {
7936         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7937         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7938         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7939         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7940         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7941         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7942 }
7943
7944                         cf_library_path_list="$cf_library_path_list $cf_search"
7945                         ;;
7946                 esac
7947         done
7948 fi
7949
7950 cf_search=
7951
7952 test "x$prefix" != "xNONE" && \
7953 test -d "$prefix" && \
7954  {
7955         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7956         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7957         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7958         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7959         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7960         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7961 }
7962
7963 for cf_subdir_prefix in \
7964         /usr \
7965         /usr/local \
7966         /usr/pkg \
7967         /opt \
7968         /opt/local \
7969         $HOME
7970 do
7971
7972 test "x$cf_subdir_prefix" != "x$prefix" && \
7973 test -d "$cf_subdir_prefix" && \
7974 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7975         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7976         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7977         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7978         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7979         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7980         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7981 }
7982
7983 done
7984
7985 cf_search="$cf_library_path_list $cf_search"
7986
7987                         for cf_cv_library_path_utf8 in $cf_search
7988                         do
7989                                 if test -d "$cf_cv_library_path_utf8" ; then
7990                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7991
7992 echo "${as_me:-configure}:7992: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7993
7994                                         CPPFLAGS="$cf_test_CPPFLAGS"
7995                                         LIBS="-lutf8  $cf_save_LIBS"
7996                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7997                                         cat >"conftest.$ac_ext" <<_ACEOF
7998 #line 7998 "configure"
7999 #include "confdefs.h"
8000
8001 #include <libutf8.h>
8002 int
8003 main (void)
8004 {
8005 putwc(0,0);
8006   ;
8007   return 0;
8008 }
8009 _ACEOF
8010 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8011 if { (eval echo "$as_me:8011: \"$ac_link\"") >&5
8012   (eval $ac_link) 2>&5
8013   ac_status=$?
8014   echo "$as_me:8014: \$? = $ac_status" >&5
8015   (exit "$ac_status"); } &&
8016          { ac_try='test -s "conftest$ac_exeext"'
8017   { (eval echo "$as_me:8017: \"$ac_try\"") >&5
8018   (eval $ac_try) 2>&5
8019   ac_status=$?
8020   echo "$as_me:8020: \$? = $ac_status" >&5
8021   (exit "$ac_status"); }; }; then
8022
8023                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8024
8025 echo "${as_me:-configure}:8025: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8026
8027                                         cf_cv_find_linkage_utf8=yes
8028                                         cf_cv_library_file_utf8="-lutf8"
8029                                         break
8030 else
8031   echo "$as_me: failed program was:" >&5
8032 cat "conftest.$ac_ext" >&5
8033
8034                                         CPPFLAGS="$cf_save_CPPFLAGS"
8035                                         LIBS="$cf_save_LIBS"
8036                                         LDFLAGS="$cf_save_LDFLAGS"
8037
8038 fi
8039 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8040                                 fi
8041                         done
8042                         CPPFLAGS="$cf_save_CPPFLAGS"
8043                         LDFLAGS="$cf_save_LDFLAGS"
8044                 fi
8045
8046         else
8047                 cf_cv_find_linkage_utf8=no
8048         fi
8049
8050 fi
8051 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8052
8053 fi
8054 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8055
8056 LIBS="$cf_save_LIBS"
8057
8058 if test "$cf_cv_find_linkage_utf8" = yes ; then
8059 cf_cv_utf8_lib=add-on
8060 else
8061 cf_cv_utf8_lib=no
8062 fi
8063
8064 fi
8065 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8066 fi
8067 echo "$as_me:8067: result: $cf_cv_utf8_lib" >&5
8068 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8069
8070 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8071 # ncurses/ncursesw:
8072 if test "$cf_cv_utf8_lib" = "add-on" ; then
8073
8074 cat >>confdefs.h <<\EOF
8075 #define HAVE_LIBUTF8_H 1
8076 EOF
8077
8078 if test -n "$cf_cv_header_path_utf8" ; then
8079   for cf_add_incdir in $cf_cv_header_path_utf8
8080   do
8081         while test "$cf_add_incdir" != /usr/include
8082         do
8083           if test -d "$cf_add_incdir"
8084           then
8085                 cf_have_incdir=no
8086                 if test -n "$CFLAGS$CPPFLAGS" ; then
8087                   # a loop is needed to ensure we can add subdirs of existing dirs
8088                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8089                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8090                           cf_have_incdir=yes; break
8091                         fi
8092                   done
8093                 fi
8094
8095                 if test "$cf_have_incdir" = no ; then
8096                   if test "$cf_add_incdir" = /usr/local/include ; then
8097                         if test "$GCC" = yes
8098                         then
8099                           cf_save_CPPFLAGS=$CPPFLAGS
8100
8101         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8102         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8103
8104                           cat >"conftest.$ac_ext" <<_ACEOF
8105 #line 8105 "configure"
8106 #include "confdefs.h"
8107 #include <stdio.h>
8108 int
8109 main (void)
8110 {
8111 printf("Hello")
8112   ;
8113   return 0;
8114 }
8115 _ACEOF
8116 rm -f "conftest.$ac_objext"
8117 if { (eval echo "$as_me:8117: \"$ac_compile\"") >&5
8118   (eval $ac_compile) 2>&5
8119   ac_status=$?
8120   echo "$as_me:8120: \$? = $ac_status" >&5
8121   (exit "$ac_status"); } &&
8122          { ac_try='test -s "conftest.$ac_objext"'
8123   { (eval echo "$as_me:8123: \"$ac_try\"") >&5
8124   (eval $ac_try) 2>&5
8125   ac_status=$?
8126   echo "$as_me:8126: \$? = $ac_status" >&5
8127   (exit "$ac_status"); }; }; then
8128   :
8129 else
8130   echo "$as_me: failed program was:" >&5
8131 cat "conftest.$ac_ext" >&5
8132 cf_have_incdir=yes
8133 fi
8134 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8135                           CPPFLAGS=$cf_save_CPPFLAGS
8136                         fi
8137                   fi
8138                 fi
8139
8140                 if test "$cf_have_incdir" = no ; then
8141                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8142
8143 echo "${as_me:-configure}:8143: testing adding $cf_add_incdir to include-path ..." 1>&5
8144
8145                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8146
8147                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8148                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8149                   cf_add_incdir="$cf_top_incdir"
8150                 else
8151                   break
8152                 fi
8153           else
8154                 break
8155           fi
8156         done
8157   done
8158 fi
8159
8160 if test -n "$cf_cv_library_path_utf8" ; then
8161         for cf_add_libdir in $cf_cv_library_path_utf8
8162         do
8163                 if test "$cf_add_libdir" = /usr/lib ; then
8164                         :
8165                 elif test -d "$cf_add_libdir"
8166                 then
8167                         cf_have_libdir=no
8168                         if test -n "$LDFLAGS$LIBS" ; then
8169                                 # a loop is needed to ensure we can add subdirs of existing dirs
8170                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
8171                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8172                                                 cf_have_libdir=yes; break
8173                                         fi
8174                                 done
8175                         fi
8176                         if test "$cf_have_libdir" = no ; then
8177                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8178
8179 echo "${as_me:-configure}:8179: testing adding $cf_add_libdir to library-path ..." 1>&5
8180
8181                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8182                         fi
8183                 fi
8184         done
8185 fi
8186
8187 cf_add_libs="$LIBS"
8188 # reverse order
8189 cf_add_0lib=
8190 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8191 # filter duplicates
8192 for cf_add_1lib in $cf_add_0lib; do
8193         for cf_add_2lib in $cf_add_libs; do
8194                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8195                         cf_add_1lib=
8196                         break
8197                 fi
8198         done
8199         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8200 done
8201 LIBS="$cf_add_libs"
8202
8203 fi
8204
8205 cf_ncuconfig_root=$cf_cv_screen
8206 cf_have_ncuconfig=no
8207
8208 if test "x${PKG_CONFIG:=none}" != xnone; then
8209         echo "$as_me:8209: checking pkg-config for $cf_ncuconfig_root" >&5
8210 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8211         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8212                 echo "$as_me:8212: result: yes" >&5
8213 echo "${ECHO_T}yes" >&6
8214
8215                 echo "$as_me:8215: checking if the $cf_ncuconfig_root package files work" >&5
8216 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8217                 cf_have_ncuconfig=unknown
8218
8219                 cf_save_CFLAGS="$CFLAGS"
8220                 cf_save_CPPFLAGS="$CPPFLAGS"
8221                 cf_save_LIBS="$LIBS"
8222
8223                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8224                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8225
8226                 # while -W for passing linker flags is prevalent, it is not "standard".
8227                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8228                 # incompatible _and_ non-standard -W option which gives an error.  Work
8229                 # around that pitfall.
8230                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8231                 (x*c[89]9@@*-W*)
8232
8233 cf_fix_cppflags=no
8234 cf_new_cflags=
8235 cf_new_cppflags=
8236 cf_new_extra_cppflags=
8237
8238 for cf_add_cflags in $cf_pkg_cflags
8239 do
8240 case "$cf_fix_cppflags" in
8241 (no)
8242         case "$cf_add_cflags" in
8243         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8244                 case "$cf_add_cflags" in
8245                 (-D*)
8246                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8247
8248                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8249                                 && test -z "${cf_tst_cflags}" \
8250                                 && cf_fix_cppflags=yes
8251
8252                         if test "$cf_fix_cppflags" = yes ; then
8253
8254         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8255         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8256
8257                                 continue
8258                         elif test "${cf_tst_cflags}" = "\"'" ; then
8259
8260         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8261         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8262
8263                                 continue
8264                         fi
8265                         ;;
8266                 esac
8267                 case "$CPPFLAGS" in
8268                 (*$cf_add_cflags)
8269                         ;;
8270                 (*)
8271                         case "$cf_add_cflags" in
8272                         (-D*)
8273                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8274
8275 CPPFLAGS=`echo "$CPPFLAGS" | \
8276         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8277                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8278
8279                                 ;;
8280                         esac
8281
8282         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8283         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8284
8285                         ;;
8286                 esac
8287                 ;;
8288         (*)
8289
8290         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8291         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8292
8293                 ;;
8294         esac
8295         ;;
8296 (yes)
8297
8298         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8299         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8300
8301         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8302
8303         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8304                 && test -z "${cf_tst_cflags}" \
8305                 && cf_fix_cppflags=no
8306         ;;
8307 esac
8308 done
8309
8310 if test -n "$cf_new_cflags" ; then
8311
8312         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8313         CFLAGS="${CFLAGS}$cf_new_cflags"
8314
8315 fi
8316
8317 if test -n "$cf_new_cppflags" ; then
8318
8319         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8320         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8321
8322 fi
8323
8324 if test -n "$cf_new_extra_cppflags" ; then
8325
8326         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8327         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8328
8329 fi
8330
8331 cf_add_libs="$LIBS"
8332 # reverse order
8333 cf_add_0lib=
8334 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8335 # filter duplicates
8336 for cf_add_1lib in $cf_add_0lib; do
8337         for cf_add_2lib in $cf_add_libs; do
8338                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8339                         cf_add_1lib=
8340                         break
8341                 fi
8342         done
8343         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8344 done
8345 LIBS="$cf_add_libs"
8346
8347                         cat >"conftest.$ac_ext" <<_ACEOF
8348 #line 8348 "configure"
8349 #include "confdefs.h"
8350 #include <${cf_cv_ncurses_header:-curses.h}>
8351 int
8352 main (void)
8353 {
8354 initscr(); mousemask(0,0); tigetstr((char *)0);
8355   ;
8356   return 0;
8357 }
8358 _ACEOF
8359 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8360 if { (eval echo "$as_me:8360: \"$ac_link\"") >&5
8361   (eval $ac_link) 2>&5
8362   ac_status=$?
8363   echo "$as_me:8363: \$? = $ac_status" >&5
8364   (exit "$ac_status"); } &&
8365          { ac_try='test -s "conftest$ac_exeext"'
8366   { (eval echo "$as_me:8366: \"$ac_try\"") >&5
8367   (eval $ac_try) 2>&5
8368   ac_status=$?
8369   echo "$as_me:8369: \$? = $ac_status" >&5
8370   (exit "$ac_status"); }; }; then
8371   if test "$cross_compiling" = yes; then
8372   cf_test_ncuconfig=maybe
8373 else
8374   cat >"conftest.$ac_ext" <<_ACEOF
8375 #line 8375 "configure"
8376 #include "confdefs.h"
8377 #include <${cf_cv_ncurses_header:-curses.h}>
8378                                         int main(void)
8379                                         { const char *xx = curses_version(); return (xx == 0); }
8380 _ACEOF
8381 rm -f "conftest$ac_exeext"
8382 if { (eval echo "$as_me:8382: \"$ac_link\"") >&5
8383   (eval $ac_link) 2>&5
8384   ac_status=$?
8385   echo "$as_me:8385: \$? = $ac_status" >&5
8386   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8387   { (eval echo "$as_me:8387: \"$ac_try\"") >&5
8388   (eval $ac_try) 2>&5
8389   ac_status=$?
8390   echo "$as_me:8390: \$? = $ac_status" >&5
8391   (exit "$ac_status"); }; }; then
8392   cf_test_ncuconfig=yes
8393 else
8394   echo "$as_me: program exited with status $ac_status" >&5
8395 echo "$as_me: failed program was:" >&5
8396 cat "conftest.$ac_ext" >&5
8397 cf_test_ncuconfig=no
8398 fi
8399 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8400 fi
8401 else
8402   echo "$as_me: failed program was:" >&5
8403 cat "conftest.$ac_ext" >&5
8404 cf_test_ncuconfig=no
8405 fi
8406 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8407
8408                         CFLAGS="$cf_save_CFLAGS"
8409                         CPPFLAGS="$cf_save_CPPFLAGS"
8410                         LIBS="$cf_save_LIBS"
8411
8412                         if test "x$cf_test_ncuconfig" != xyes; then
8413                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8414                                 cf_pkg_cflags="$cf_temp"
8415                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8416                                 cf_pkg_libs="$cf_temp"
8417                         fi
8418                         ;;
8419                 esac
8420
8421 for cf_add_cflags in $cf_pkg_cflags
8422 do
8423         case "x$cf_add_cflags" in
8424         (x-[DU]*)
8425
8426 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8427 while true
8428 do
8429         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8430         test "$CFLAGS" != "$cf_old_cflag" || break
8431
8432         CFLAGS="$cf_old_cflag"
8433 done
8434
8435 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8436 while true
8437 do
8438         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8439         test "$CPPFLAGS" != "$cf_old_cflag" || break
8440
8441         CPPFLAGS="$cf_old_cflag"
8442 done
8443
8444                 ;;
8445         esac
8446
8447 cf_fix_cppflags=no
8448 cf_new_cflags=
8449 cf_new_cppflags=
8450 cf_new_extra_cppflags=
8451
8452 for cf_add_cflags in $cf_add_cflags
8453 do
8454 case "$cf_fix_cppflags" in
8455 (no)
8456         case "$cf_add_cflags" in
8457         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8458                 case "$cf_add_cflags" in
8459                 (-D*)
8460                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8461
8462                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8463                                 && test -z "${cf_tst_cflags}" \
8464                                 && cf_fix_cppflags=yes
8465
8466                         if test "$cf_fix_cppflags" = yes ; then
8467
8468         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8469         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8470
8471                                 continue
8472                         elif test "${cf_tst_cflags}" = "\"'" ; then
8473
8474         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8475         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8476
8477                                 continue
8478                         fi
8479                         ;;
8480                 esac
8481                 case "$CPPFLAGS" in
8482                 (*$cf_add_cflags)
8483                         ;;
8484                 (*)
8485                         case "$cf_add_cflags" in
8486                         (-D*)
8487                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8488
8489 CPPFLAGS=`echo "$CPPFLAGS" | \
8490         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8491                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8492
8493                                 ;;
8494                         esac
8495
8496         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8497         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8498
8499                         ;;
8500                 esac
8501                 ;;
8502         (*)
8503
8504         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8505         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8506
8507                 ;;
8508         esac
8509         ;;
8510 (yes)
8511
8512         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8513         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8514
8515         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8516
8517         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8518                 && test -z "${cf_tst_cflags}" \
8519                 && cf_fix_cppflags=no
8520         ;;
8521 esac
8522 done
8523
8524 if test -n "$cf_new_cflags" ; then
8525
8526         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8527         CFLAGS="${CFLAGS}$cf_new_cflags"
8528
8529 fi
8530
8531 if test -n "$cf_new_cppflags" ; then
8532
8533         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8534         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8535
8536 fi
8537
8538 if test -n "$cf_new_extra_cppflags" ; then
8539
8540         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8541         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8542
8543 fi
8544
8545 done
8546
8547 cf_add_libs="$LIBS"
8548 # reverse order
8549 cf_add_0lib=
8550 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8551 # filter duplicates
8552 for cf_add_1lib in $cf_add_0lib; do
8553         for cf_add_2lib in $cf_add_libs; do
8554                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8555                         cf_add_1lib=
8556                         break
8557                 fi
8558         done
8559         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8560 done
8561 LIBS="$cf_add_libs"
8562
8563                 cat >"conftest.$ac_ext" <<_ACEOF
8564 #line 8564 "configure"
8565 #include "confdefs.h"
8566 #include <${cf_cv_ncurses_header:-curses.h}>
8567 int
8568 main (void)
8569 {
8570 initscr(); mousemask(0,0); tigetstr((char *)0);
8571   ;
8572   return 0;
8573 }
8574 _ACEOF
8575 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8576 if { (eval echo "$as_me:8576: \"$ac_link\"") >&5
8577   (eval $ac_link) 2>&5
8578   ac_status=$?
8579   echo "$as_me:8579: \$? = $ac_status" >&5
8580   (exit "$ac_status"); } &&
8581          { ac_try='test -s "conftest$ac_exeext"'
8582   { (eval echo "$as_me:8582: \"$ac_try\"") >&5
8583   (eval $ac_try) 2>&5
8584   ac_status=$?
8585   echo "$as_me:8585: \$? = $ac_status" >&5
8586   (exit "$ac_status"); }; }; then
8587   if test "$cross_compiling" = yes; then
8588   cf_have_ncuconfig=maybe
8589 else
8590   cat >"conftest.$ac_ext" <<_ACEOF
8591 #line 8591 "configure"
8592 #include "confdefs.h"
8593 #include <${cf_cv_ncurses_header:-curses.h}>
8594                                 int main(void)
8595                                 { const char *xx = curses_version(); return (xx == 0); }
8596 _ACEOF
8597 rm -f "conftest$ac_exeext"
8598 if { (eval echo "$as_me:8598: \"$ac_link\"") >&5
8599   (eval $ac_link) 2>&5
8600   ac_status=$?
8601   echo "$as_me:8601: \$? = $ac_status" >&5
8602   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8603   { (eval echo "$as_me:8603: \"$ac_try\"") >&5
8604   (eval $ac_try) 2>&5
8605   ac_status=$?
8606   echo "$as_me:8606: \$? = $ac_status" >&5
8607   (exit "$ac_status"); }; }; then
8608   cf_have_ncuconfig=yes
8609 else
8610   echo "$as_me: program exited with status $ac_status" >&5
8611 echo "$as_me: failed program was:" >&5
8612 cat "conftest.$ac_ext" >&5
8613 cf_have_ncuconfig=no
8614 fi
8615 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8616 fi
8617 else
8618   echo "$as_me: failed program was:" >&5
8619 cat "conftest.$ac_ext" >&5
8620 cf_have_ncuconfig=no
8621 fi
8622 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8623                 echo "$as_me:8623: result: $cf_have_ncuconfig" >&5
8624 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8625                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8626                 if test "$cf_have_ncuconfig" != "yes"
8627                 then
8628                         CPPFLAGS="$cf_save_CPPFLAGS"
8629                         LIBS="$cf_save_LIBS"
8630                         NCURSES_CONFIG_PKG=none
8631                 else
8632
8633 cat >>confdefs.h <<\EOF
8634 #define NCURSES 1
8635 EOF
8636
8637                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8638
8639 echo "$as_me:8639: checking for terminfo header" >&5
8640 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8641 if test "${cf_cv_term_header+set}" = set; then
8642   echo $ECHO_N "(cached) $ECHO_C" >&6
8643 else
8644
8645 case "${cf_cv_ncurses_header}" in
8646 (*/ncurses.h|*/ncursesw.h)
8647         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8648         ;;
8649 (*)
8650         cf_term_header=term.h
8651         ;;
8652 esac
8653
8654 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8655 do
8656 cat >"conftest.$ac_ext" <<_ACEOF
8657 #line 8657 "configure"
8658 #include "confdefs.h"
8659 #include <stdio.h>
8660 #include <${cf_cv_ncurses_header:-curses.h}>
8661 #include <$cf_test>
8662
8663 int
8664 main (void)
8665 {
8666 int x = auto_left_margin; (void)x
8667   ;
8668   return 0;
8669 }
8670 _ACEOF
8671 rm -f "conftest.$ac_objext"
8672 if { (eval echo "$as_me:8672: \"$ac_compile\"") >&5
8673   (eval $ac_compile) 2>&5
8674   ac_status=$?
8675   echo "$as_me:8675: \$? = $ac_status" >&5
8676   (exit "$ac_status"); } &&
8677          { ac_try='test -s "conftest.$ac_objext"'
8678   { (eval echo "$as_me:8678: \"$ac_try\"") >&5
8679   (eval $ac_try) 2>&5
8680   ac_status=$?
8681   echo "$as_me:8681: \$? = $ac_status" >&5
8682   (exit "$ac_status"); }; }; then
8683
8684         cf_cv_term_header="$cf_test"
8685 else
8686   echo "$as_me: failed program was:" >&5
8687 cat "conftest.$ac_ext" >&5
8688
8689         cf_cv_term_header=unknown
8690
8691 fi
8692 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8693         test "$cf_cv_term_header" != unknown && break
8694 done
8695
8696 fi
8697 echo "$as_me:8697: result: $cf_cv_term_header" >&5
8698 echo "${ECHO_T}$cf_cv_term_header" >&6
8699
8700 # Set definitions to allow ifdef'ing to accommodate subdirectories
8701
8702 case "$cf_cv_term_header" in
8703 (*term.h)
8704
8705 cat >>confdefs.h <<\EOF
8706 #define HAVE_TERM_H 1
8707 EOF
8708
8709         ;;
8710 esac
8711
8712 case "$cf_cv_term_header" in
8713 (ncurses/term.h)
8714
8715 cat >>confdefs.h <<\EOF
8716 #define HAVE_NCURSES_TERM_H 1
8717 EOF
8718
8719         ;;
8720 (ncursesw/term.h)
8721
8722 cat >>confdefs.h <<\EOF
8723 #define HAVE_NCURSESW_TERM_H 1
8724 EOF
8725
8726         ;;
8727 esac
8728
8729                 fi
8730
8731         else
8732                 echo "$as_me:8732: result: no" >&5
8733 echo "${ECHO_T}no" >&6
8734                 NCURSES_CONFIG_PKG=none
8735         fi
8736 else
8737         NCURSES_CONFIG_PKG=none
8738 fi
8739
8740 if test "x$cf_have_ncuconfig" = "xno"; then
8741         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8742
8743 if test -n "$ac_tool_prefix"; then
8744   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8745   do
8746     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8747 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8748 echo "$as_me:8748: checking for $ac_word" >&5
8749 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8750 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8751   echo $ECHO_N "(cached) $ECHO_C" >&6
8752 else
8753   if test -n "$NCURSES_CONFIG"; then
8754   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8755 else
8756   ac_save_IFS=$IFS; IFS=$ac_path_separator
8757 ac_dummy="$PATH"
8758 for ac_dir in $ac_dummy; do
8759   IFS=$ac_save_IFS
8760   test -z "$ac_dir" && ac_dir=.
8761   $as_executable_p "$ac_dir/$ac_word" || continue
8762 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8763 echo "$as_me:8763: found $ac_dir/$ac_word" >&5
8764 break
8765 done
8766
8767 fi
8768 fi
8769 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8770 if test -n "$NCURSES_CONFIG"; then
8771   echo "$as_me:8771: result: $NCURSES_CONFIG" >&5
8772 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8773 else
8774   echo "$as_me:8774: result: no" >&5
8775 echo "${ECHO_T}no" >&6
8776 fi
8777
8778     test -n "$NCURSES_CONFIG" && break
8779   done
8780 fi
8781 if test -z "$NCURSES_CONFIG"; then
8782   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8783   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8784 do
8785   # Extract the first word of "$ac_prog", so it can be a program name with args.
8786 set dummy $ac_prog; ac_word=$2
8787 echo "$as_me:8787: checking for $ac_word" >&5
8788 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8789 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8790   echo $ECHO_N "(cached) $ECHO_C" >&6
8791 else
8792   if test -n "$ac_ct_NCURSES_CONFIG"; then
8793   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8794 else
8795   ac_save_IFS=$IFS; IFS=$ac_path_separator
8796 ac_dummy="$PATH"
8797 for ac_dir in $ac_dummy; do
8798   IFS=$ac_save_IFS
8799   test -z "$ac_dir" && ac_dir=.
8800   $as_executable_p "$ac_dir/$ac_word" || continue
8801 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8802 echo "$as_me:8802: found $ac_dir/$ac_word" >&5
8803 break
8804 done
8805
8806 fi
8807 fi
8808 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8809 if test -n "$ac_ct_NCURSES_CONFIG"; then
8810   echo "$as_me:8810: result: $ac_ct_NCURSES_CONFIG" >&5
8811 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8812 else
8813   echo "$as_me:8813: result: no" >&5
8814 echo "${ECHO_T}no" >&6
8815 fi
8816
8817   test -n "$ac_ct_NCURSES_CONFIG" && break
8818 done
8819 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8820
8821   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8822 fi
8823
8824         if test "$NCURSES_CONFIG" != none ; then
8825
8826 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8827 do
8828         case "x$cf_add_cflags" in
8829         (x-[DU]*)
8830
8831 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8832 while true
8833 do
8834         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8835         test "$CFLAGS" != "$cf_old_cflag" || break
8836
8837         CFLAGS="$cf_old_cflag"
8838 done
8839
8840 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8841 while true
8842 do
8843         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8844         test "$CPPFLAGS" != "$cf_old_cflag" || break
8845
8846         CPPFLAGS="$cf_old_cflag"
8847 done
8848
8849                 ;;
8850         esac
8851
8852 cf_fix_cppflags=no
8853 cf_new_cflags=
8854 cf_new_cppflags=
8855 cf_new_extra_cppflags=
8856
8857 for cf_add_cflags in $cf_add_cflags
8858 do
8859 case "$cf_fix_cppflags" in
8860 (no)
8861         case "$cf_add_cflags" in
8862         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8863                 case "$cf_add_cflags" in
8864                 (-D*)
8865                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8866
8867                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8868                                 && test -z "${cf_tst_cflags}" \
8869                                 && cf_fix_cppflags=yes
8870
8871                         if test "$cf_fix_cppflags" = yes ; then
8872
8873         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8874         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8875
8876                                 continue
8877                         elif test "${cf_tst_cflags}" = "\"'" ; then
8878
8879         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8880         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8881
8882                                 continue
8883                         fi
8884                         ;;
8885                 esac
8886                 case "$CPPFLAGS" in
8887                 (*$cf_add_cflags)
8888                         ;;
8889                 (*)
8890                         case "$cf_add_cflags" in
8891                         (-D*)
8892                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8893
8894 CPPFLAGS=`echo "$CPPFLAGS" | \
8895         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8896                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8897
8898                                 ;;
8899                         esac
8900
8901         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8902         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8903
8904                         ;;
8905                 esac
8906                 ;;
8907         (*)
8908
8909         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8910         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8911
8912                 ;;
8913         esac
8914         ;;
8915 (yes)
8916
8917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8919
8920         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8921
8922         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8923                 && test -z "${cf_tst_cflags}" \
8924                 && cf_fix_cppflags=no
8925         ;;
8926 esac
8927 done
8928
8929 if test -n "$cf_new_cflags" ; then
8930
8931         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8932         CFLAGS="${CFLAGS}$cf_new_cflags"
8933
8934 fi
8935
8936 if test -n "$cf_new_cppflags" ; then
8937
8938         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8939         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8940
8941 fi
8942
8943 if test -n "$cf_new_extra_cppflags" ; then
8944
8945         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8946         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8947
8948 fi
8949
8950 done
8951
8952 cf_add_libs="$LIBS"
8953 # reverse order
8954 cf_add_0lib=
8955 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8956 # filter duplicates
8957 for cf_add_1lib in $cf_add_0lib; do
8958         for cf_add_2lib in $cf_add_libs; do
8959                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8960                         cf_add_1lib=
8961                         break
8962                 fi
8963         done
8964         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8965 done
8966 LIBS="$cf_add_libs"
8967
8968                 # even with config script, some packages use no-override for curses.h
8969
8970 echo "$as_me:8970: checking if we have identified curses headers" >&5
8971 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8972 if test "${cf_cv_ncurses_header+set}" = set; then
8973   echo $ECHO_N "(cached) $ECHO_C" >&6
8974 else
8975
8976 cf_cv_ncurses_header=none
8977 for cf_header in \
8978         ncurses.h $cf_cv_screen/ncurses.h \
8979         curses.h $cf_cv_screen/curses.h
8980 do
8981 cat >"conftest.$ac_ext" <<_ACEOF
8982 #line 8982 "configure"
8983 #include "confdefs.h"
8984 #include <${cf_header}>
8985 int
8986 main (void)
8987 {
8988 initscr(); endwin()
8989   ;
8990   return 0;
8991 }
8992 _ACEOF
8993 rm -f "conftest.$ac_objext"
8994 if { (eval echo "$as_me:8994: \"$ac_compile\"") >&5
8995   (eval $ac_compile) 2>&5
8996   ac_status=$?
8997   echo "$as_me:8997: \$? = $ac_status" >&5
8998   (exit "$ac_status"); } &&
8999          { ac_try='test -s "conftest.$ac_objext"'
9000   { (eval echo "$as_me:9000: \"$ac_try\"") >&5
9001   (eval $ac_try) 2>&5
9002   ac_status=$?
9003   echo "$as_me:9003: \$? = $ac_status" >&5
9004   (exit "$ac_status"); }; }; then
9005   cf_cv_ncurses_header=$cf_header; break
9006 else
9007   echo "$as_me: failed program was:" >&5
9008 cat "conftest.$ac_ext" >&5
9009 fi
9010 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9011 done
9012
9013 fi
9014 echo "$as_me:9014: result: $cf_cv_ncurses_header" >&5
9015 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9016
9017 if test "$cf_cv_ncurses_header" = none ; then
9018         { { echo "$as_me:9018: error: No curses header-files found" >&5
9019 echo "$as_me: error: No curses header-files found" >&2;}
9020    { (exit 1); exit 1; }; }
9021 fi
9022
9023 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9024
9025 for ac_header in $cf_cv_ncurses_header
9026 do
9027 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9028 echo "$as_me:9028: checking for $ac_header" >&5
9029 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9030 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9031   echo $ECHO_N "(cached) $ECHO_C" >&6
9032 else
9033   cat >"conftest.$ac_ext" <<_ACEOF
9034 #line 9034 "configure"
9035 #include "confdefs.h"
9036 #include <$ac_header>
9037 _ACEOF
9038 if { (eval echo "$as_me:9038: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9039   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9040   ac_status=$?
9041   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9042   rm -f conftest.er1
9043   cat conftest.err >&5
9044   echo "$as_me:9044: \$? = $ac_status" >&5
9045   (exit "$ac_status"); } >/dev/null; then
9046   if test -s conftest.err; then
9047     ac_cpp_err=$ac_c_preproc_warn_flag
9048   else
9049     ac_cpp_err=
9050   fi
9051 else
9052   ac_cpp_err=yes
9053 fi
9054 if test -z "$ac_cpp_err"; then
9055   eval "$as_ac_Header=yes"
9056 else
9057   echo "$as_me: failed program was:" >&5
9058   cat "conftest.$ac_ext" >&5
9059   eval "$as_ac_Header=no"
9060 fi
9061 rm -f conftest.err "conftest.$ac_ext"
9062 fi
9063 echo "$as_me:9063: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9064 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9065 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9066   cat >>confdefs.h <<EOF
9067 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9068 EOF
9069
9070 fi
9071 done
9072
9073 cat >>confdefs.h <<\EOF
9074 #define NCURSES 1
9075 EOF
9076
9077 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9078
9079                 cat >>confdefs.h <<EOF
9080 #define $cf_nculib_ROOT 1
9081 EOF
9082
9083                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9084
9085         else
9086
9087 cf_ncuhdr_root=$cf_cv_screen
9088
9089 test -n "$cf_cv_curses_dir" && \
9090 test "$cf_cv_curses_dir" != "no" && { \
9091
9092 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9093   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9094   do
9095         while test "$cf_add_incdir" != /usr/include
9096         do
9097           if test -d "$cf_add_incdir"
9098           then
9099                 cf_have_incdir=no
9100                 if test -n "$CFLAGS$CPPFLAGS" ; then
9101                   # a loop is needed to ensure we can add subdirs of existing dirs
9102                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9103                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9104                           cf_have_incdir=yes; break
9105                         fi
9106                   done
9107                 fi
9108
9109                 if test "$cf_have_incdir" = no ; then
9110                   if test "$cf_add_incdir" = /usr/local/include ; then
9111                         if test "$GCC" = yes
9112                         then
9113                           cf_save_CPPFLAGS=$CPPFLAGS
9114
9115         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9116         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9117
9118                           cat >"conftest.$ac_ext" <<_ACEOF
9119 #line 9119 "configure"
9120 #include "confdefs.h"
9121 #include <stdio.h>
9122 int
9123 main (void)
9124 {
9125 printf("Hello")
9126   ;
9127   return 0;
9128 }
9129 _ACEOF
9130 rm -f "conftest.$ac_objext"
9131 if { (eval echo "$as_me:9131: \"$ac_compile\"") >&5
9132   (eval $ac_compile) 2>&5
9133   ac_status=$?
9134   echo "$as_me:9134: \$? = $ac_status" >&5
9135   (exit "$ac_status"); } &&
9136          { ac_try='test -s "conftest.$ac_objext"'
9137   { (eval echo "$as_me:9137: \"$ac_try\"") >&5
9138   (eval $ac_try) 2>&5
9139   ac_status=$?
9140   echo "$as_me:9140: \$? = $ac_status" >&5
9141   (exit "$ac_status"); }; }; then
9142   :
9143 else
9144   echo "$as_me: failed program was:" >&5
9145 cat "conftest.$ac_ext" >&5
9146 cf_have_incdir=yes
9147 fi
9148 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9149                           CPPFLAGS=$cf_save_CPPFLAGS
9150                         fi
9151                   fi
9152                 fi
9153
9154                 if test "$cf_have_incdir" = no ; then
9155                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9156
9157 echo "${as_me:-configure}:9157: testing adding $cf_add_incdir to include-path ..." 1>&5
9158
9159                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9160
9161                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9162                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9163                   cf_add_incdir="$cf_top_incdir"
9164                 else
9165                   break
9166                 fi
9167           else
9168                 break
9169           fi
9170         done
9171   done
9172 fi
9173
9174 }
9175
9176 echo "$as_me:9176: checking for $cf_ncuhdr_root header in include-path" >&5
9177 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9178 if test "${cf_cv_ncurses_h+set}" = set; then
9179   echo $ECHO_N "(cached) $ECHO_C" >&6
9180 else
9181
9182         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9183         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
9184         for cf_header in $cf_header_list
9185         do
9186
9187         cat >"conftest.$ac_ext" <<_ACEOF
9188 #line 9188 "configure"
9189 #include "confdefs.h"
9190
9191 #include <$cf_header>
9192 int
9193 main (void)
9194 {
9195
9196 #ifdef NCURSES_VERSION
9197
9198 printf("%s\\n", NCURSES_VERSION);
9199 #else
9200 #ifdef __NCURSES_H
9201 printf("old\\n");
9202 #else
9203         make an error
9204 #endif
9205 #endif
9206
9207   ;
9208   return 0;
9209 }
9210 _ACEOF
9211 rm -f "conftest.$ac_objext"
9212 if { (eval echo "$as_me:9212: \"$ac_compile\"") >&5
9213   (eval $ac_compile) 2>&5
9214   ac_status=$?
9215   echo "$as_me:9215: \$? = $ac_status" >&5
9216   (exit "$ac_status"); } &&
9217          { ac_try='test -s "conftest.$ac_objext"'
9218   { (eval echo "$as_me:9218: \"$ac_try\"") >&5
9219   (eval $ac_try) 2>&5
9220   ac_status=$?
9221   echo "$as_me:9221: \$? = $ac_status" >&5
9222   (exit "$ac_status"); }; }; then
9223   cf_cv_ncurses_h=$cf_header
9224
9225 else
9226   echo "$as_me: failed program was:" >&5
9227 cat "conftest.$ac_ext" >&5
9228 cf_cv_ncurses_h=no
9229 fi
9230 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9231
9232                 test "$cf_cv_ncurses_h" != no && break
9233         done
9234
9235 fi
9236 echo "$as_me:9236: result: $cf_cv_ncurses_h" >&5
9237 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9238
9239 if test "$cf_cv_ncurses_h" != no ; then
9240         cf_cv_ncurses_header=$cf_cv_ncurses_h
9241 else
9242
9243 echo "$as_me:9243: checking for $cf_ncuhdr_root include-path" >&5
9244 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9245 if test "${cf_cv_ncurses_h2+set}" = set; then
9246   echo $ECHO_N "(cached) $ECHO_C" >&6
9247 else
9248
9249         test -n "$verbose" && echo
9250
9251 cf_search=
9252
9253 # collect the current set of include-directories from compiler flags
9254 cf_header_path_list=""
9255 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9256         for cf_header_path in $CPPFLAGS $CFLAGS
9257         do
9258                 case "$cf_header_path" in
9259                 (-I*)
9260                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9261
9262 test "x$cf_header_path" != "xNONE" && \
9263 test -d "$cf_header_path" && \
9264  {
9265         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9266         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
9267         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9268         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9269         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9270         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"
9271 }
9272
9273                         cf_header_path_list="$cf_header_path_list $cf_search"
9274                         ;;
9275                 esac
9276         done
9277 fi
9278
9279 # add the variations for the package we are looking for
9280
9281 cf_search=
9282
9283 test "x$prefix" != "xNONE" && \
9284 test -d "$prefix" && \
9285  {
9286         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9287         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
9288         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9289         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9290         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9291         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9292 }
9293
9294 for cf_subdir_prefix in \
9295         /usr \
9296         /usr/local \
9297         /usr/pkg \
9298         /opt \
9299         /opt/local \
9300         $HOME
9301 do
9302
9303 test "x$cf_subdir_prefix" != "x$prefix" && \
9304 test -d "$cf_subdir_prefix" && \
9305 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9306         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9307         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
9308         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9309         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9310         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9311         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"
9312 }
9313
9314 done
9315
9316 test "$includedir" != NONE && \
9317 test "$includedir" != "/usr/include" && \
9318 test -d "$includedir" && {
9319         test -d "$includedir" &&    cf_search="$cf_search $includedir"
9320         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9321 }
9322
9323 test "$oldincludedir" != NONE && \
9324 test "$oldincludedir" != "/usr/include" && \
9325 test -d "$oldincludedir" && {
9326         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
9327         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9328 }
9329
9330 cf_search="$cf_search $cf_header_path_list"
9331
9332         test -n "$verbose" && echo "search path $cf_search"
9333         cf_save2_CPPFLAGS="$CPPFLAGS"
9334         for cf_incdir in $cf_search
9335         do
9336
9337 if test -n "$cf_incdir" ; then
9338   for cf_add_incdir in $cf_incdir
9339   do
9340         while test "$cf_add_incdir" != /usr/include
9341         do
9342           if test -d "$cf_add_incdir"
9343           then
9344                 cf_have_incdir=no
9345                 if test -n "$CFLAGS$CPPFLAGS" ; then
9346                   # a loop is needed to ensure we can add subdirs of existing dirs
9347                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9348                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9349                           cf_have_incdir=yes; break
9350                         fi
9351                   done
9352                 fi
9353
9354                 if test "$cf_have_incdir" = no ; then
9355                   if test "$cf_add_incdir" = /usr/local/include ; then
9356                         if test "$GCC" = yes
9357                         then
9358                           cf_save_CPPFLAGS=$CPPFLAGS
9359
9360         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9361         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9362
9363                           cat >"conftest.$ac_ext" <<_ACEOF
9364 #line 9364 "configure"
9365 #include "confdefs.h"
9366 #include <stdio.h>
9367 int
9368 main (void)
9369 {
9370 printf("Hello")
9371   ;
9372   return 0;
9373 }
9374 _ACEOF
9375 rm -f "conftest.$ac_objext"
9376 if { (eval echo "$as_me:9376: \"$ac_compile\"") >&5
9377   (eval $ac_compile) 2>&5
9378   ac_status=$?
9379   echo "$as_me:9379: \$? = $ac_status" >&5
9380   (exit "$ac_status"); } &&
9381          { ac_try='test -s "conftest.$ac_objext"'
9382   { (eval echo "$as_me:9382: \"$ac_try\"") >&5
9383   (eval $ac_try) 2>&5
9384   ac_status=$?
9385   echo "$as_me:9385: \$? = $ac_status" >&5
9386   (exit "$ac_status"); }; }; then
9387   :
9388 else
9389   echo "$as_me: failed program was:" >&5
9390 cat "conftest.$ac_ext" >&5
9391 cf_have_incdir=yes
9392 fi
9393 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9394                           CPPFLAGS=$cf_save_CPPFLAGS
9395                         fi
9396                   fi
9397                 fi
9398
9399                 if test "$cf_have_incdir" = no ; then
9400                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9401
9402 echo "${as_me:-configure}:9402: testing adding $cf_add_incdir to include-path ..." 1>&5
9403
9404                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9405
9406                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9407                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9408                   cf_add_incdir="$cf_top_incdir"
9409                 else
9410                   break
9411                 fi
9412           else
9413                 break
9414           fi
9415         done
9416   done
9417 fi
9418
9419                 for cf_header in \
9420                         ncurses.h \
9421                         curses.h
9422                 do
9423
9424         cat >"conftest.$ac_ext" <<_ACEOF
9425 #line 9425 "configure"
9426 #include "confdefs.h"
9427
9428 #include <$cf_header>
9429 int
9430 main (void)
9431 {
9432
9433 #ifdef NCURSES_VERSION
9434
9435 printf("%s\\n", NCURSES_VERSION);
9436 #else
9437 #ifdef __NCURSES_H
9438 printf("old\\n");
9439 #else
9440         make an error
9441 #endif
9442 #endif
9443
9444   ;
9445   return 0;
9446 }
9447 _ACEOF
9448 rm -f "conftest.$ac_objext"
9449 if { (eval echo "$as_me:9449: \"$ac_compile\"") >&5
9450   (eval $ac_compile) 2>&5
9451   ac_status=$?
9452   echo "$as_me:9452: \$? = $ac_status" >&5
9453   (exit "$ac_status"); } &&
9454          { ac_try='test -s "conftest.$ac_objext"'
9455   { (eval echo "$as_me:9455: \"$ac_try\"") >&5
9456   (eval $ac_try) 2>&5
9457   ac_status=$?
9458   echo "$as_me:9458: \$? = $ac_status" >&5
9459   (exit "$ac_status"); }; }; then
9460   cf_cv_ncurses_h2=$cf_header
9461
9462 else
9463   echo "$as_me: failed program was:" >&5
9464 cat "conftest.$ac_ext" >&5
9465 cf_cv_ncurses_h2=no
9466 fi
9467 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9468
9469                         if test "$cf_cv_ncurses_h2" != no ; then
9470                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9471                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9472                                 break
9473                         fi
9474                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9475                 done
9476                 CPPFLAGS="$cf_save2_CPPFLAGS"
9477                 test "$cf_cv_ncurses_h2" != no && break
9478         done
9479         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9479: error: not found" >&5
9480 echo "$as_me: error: not found" >&2;}
9481    { (exit 1); exit 1; }; }
9482
9483 fi
9484 echo "$as_me:9484: result: $cf_cv_ncurses_h2" >&5
9485 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9486
9487         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9488         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9489         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9490                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9491         fi
9492
9493 if test -n "$cf_1st_incdir" ; then
9494   for cf_add_incdir in $cf_1st_incdir
9495   do
9496         while test "$cf_add_incdir" != /usr/include
9497         do
9498           if test -d "$cf_add_incdir"
9499           then
9500                 cf_have_incdir=no
9501                 if test -n "$CFLAGS$CPPFLAGS" ; then
9502                   # a loop is needed to ensure we can add subdirs of existing dirs
9503                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9504                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9505                           cf_have_incdir=yes; break
9506                         fi
9507                   done
9508                 fi
9509
9510                 if test "$cf_have_incdir" = no ; then
9511                   if test "$cf_add_incdir" = /usr/local/include ; then
9512                         if test "$GCC" = yes
9513                         then
9514                           cf_save_CPPFLAGS=$CPPFLAGS
9515
9516         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9517         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9518
9519                           cat >"conftest.$ac_ext" <<_ACEOF
9520 #line 9520 "configure"
9521 #include "confdefs.h"
9522 #include <stdio.h>
9523 int
9524 main (void)
9525 {
9526 printf("Hello")
9527   ;
9528   return 0;
9529 }
9530 _ACEOF
9531 rm -f "conftest.$ac_objext"
9532 if { (eval echo "$as_me:9532: \"$ac_compile\"") >&5
9533   (eval $ac_compile) 2>&5
9534   ac_status=$?
9535   echo "$as_me:9535: \$? = $ac_status" >&5
9536   (exit "$ac_status"); } &&
9537          { ac_try='test -s "conftest.$ac_objext"'
9538   { (eval echo "$as_me:9538: \"$ac_try\"") >&5
9539   (eval $ac_try) 2>&5
9540   ac_status=$?
9541   echo "$as_me:9541: \$? = $ac_status" >&5
9542   (exit "$ac_status"); }; }; then
9543   :
9544 else
9545   echo "$as_me: failed program was:" >&5
9546 cat "conftest.$ac_ext" >&5
9547 cf_have_incdir=yes
9548 fi
9549 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9550                           CPPFLAGS=$cf_save_CPPFLAGS
9551                         fi
9552                   fi
9553                 fi
9554
9555                 if test "$cf_have_incdir" = no ; then
9556                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9557
9558 echo "${as_me:-configure}:9558: testing adding $cf_add_incdir to include-path ..." 1>&5
9559
9560                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9561
9562                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9563                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9564                   cf_add_incdir="$cf_top_incdir"
9565                 else
9566                   break
9567                 fi
9568           else
9569                 break
9570           fi
9571         done
9572   done
9573 fi
9574
9575 fi
9576
9577 # Set definitions to allow ifdef'ing for ncurses.h
9578
9579 case "$cf_cv_ncurses_header" in
9580 (*ncurses.h)
9581
9582 cat >>confdefs.h <<\EOF
9583 #define HAVE_NCURSES_H 1
9584 EOF
9585
9586         ;;
9587 esac
9588
9589 case "$cf_cv_ncurses_header" in
9590 (ncurses/curses.h|ncurses/ncurses.h)
9591
9592 cat >>confdefs.h <<\EOF
9593 #define HAVE_NCURSES_NCURSES_H 1
9594 EOF
9595
9596         ;;
9597 (ncursesw/curses.h|ncursesw/ncurses.h)
9598
9599 cat >>confdefs.h <<\EOF
9600 #define HAVE_NCURSESW_NCURSES_H 1
9601 EOF
9602
9603         ;;
9604 esac
9605
9606 echo "$as_me:9606: checking for terminfo header" >&5
9607 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9608 if test "${cf_cv_term_header+set}" = set; then
9609   echo $ECHO_N "(cached) $ECHO_C" >&6
9610 else
9611
9612 case "${cf_cv_ncurses_header}" in
9613 (*/ncurses.h|*/ncursesw.h)
9614         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9615         ;;
9616 (*)
9617         cf_term_header=term.h
9618         ;;
9619 esac
9620
9621 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9622 do
9623 cat >"conftest.$ac_ext" <<_ACEOF
9624 #line 9624 "configure"
9625 #include "confdefs.h"
9626 #include <stdio.h>
9627 #include <${cf_cv_ncurses_header:-curses.h}>
9628 #include <$cf_test>
9629
9630 int
9631 main (void)
9632 {
9633 int x = auto_left_margin; (void)x
9634   ;
9635   return 0;
9636 }
9637 _ACEOF
9638 rm -f "conftest.$ac_objext"
9639 if { (eval echo "$as_me:9639: \"$ac_compile\"") >&5
9640   (eval $ac_compile) 2>&5
9641   ac_status=$?
9642   echo "$as_me:9642: \$? = $ac_status" >&5
9643   (exit "$ac_status"); } &&
9644          { ac_try='test -s "conftest.$ac_objext"'
9645   { (eval echo "$as_me:9645: \"$ac_try\"") >&5
9646   (eval $ac_try) 2>&5
9647   ac_status=$?
9648   echo "$as_me:9648: \$? = $ac_status" >&5
9649   (exit "$ac_status"); }; }; then
9650
9651         cf_cv_term_header="$cf_test"
9652 else
9653   echo "$as_me: failed program was:" >&5
9654 cat "conftest.$ac_ext" >&5
9655
9656         cf_cv_term_header=unknown
9657
9658 fi
9659 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9660         test "$cf_cv_term_header" != unknown && break
9661 done
9662
9663 fi
9664 echo "$as_me:9664: result: $cf_cv_term_header" >&5
9665 echo "${ECHO_T}$cf_cv_term_header" >&6
9666
9667 # Set definitions to allow ifdef'ing to accommodate subdirectories
9668
9669 case "$cf_cv_term_header" in
9670 (*term.h)
9671
9672 cat >>confdefs.h <<\EOF
9673 #define HAVE_TERM_H 1
9674 EOF
9675
9676         ;;
9677 esac
9678
9679 case "$cf_cv_term_header" in
9680 (ncurses/term.h)
9681
9682 cat >>confdefs.h <<\EOF
9683 #define HAVE_NCURSES_TERM_H 1
9684 EOF
9685
9686         ;;
9687 (ncursesw/term.h)
9688
9689 cat >>confdefs.h <<\EOF
9690 #define HAVE_NCURSESW_TERM_H 1
9691 EOF
9692
9693         ;;
9694 esac
9695
9696 # some applications need this, but should check for NCURSES_VERSION
9697
9698 cat >>confdefs.h <<\EOF
9699 #define NCURSES 1
9700 EOF
9701
9702 echo "$as_me:9702: checking for ncurses version" >&5
9703 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9704 if test "${cf_cv_ncurses_version+set}" = set; then
9705   echo $ECHO_N "(cached) $ECHO_C" >&6
9706 else
9707
9708         cf_cv_ncurses_version=no
9709         cf_tempfile=out$$
9710         rm -f "$cf_tempfile"
9711         if test "$cross_compiling" = yes; then
9712
9713         # This will not work if the preprocessor splits the line after the
9714         # Autoconf token.  The 'unproto' program does that.
9715         cat > "conftest.$ac_ext" <<EOF
9716 #include <${cf_cv_ncurses_header:-curses.h}>
9717 #undef Autoconf
9718 #ifdef NCURSES_VERSION
9719 Autoconf NCURSES_VERSION
9720 #else
9721 #ifdef __NCURSES_H
9722 Autoconf "old"
9723 #endif
9724 ;
9725 #endif
9726 EOF
9727         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9728         { (eval echo "$as_me:9728: \"$cf_try\"") >&5
9729   (eval $cf_try) 2>&5
9730   ac_status=$?
9731   echo "$as_me:9731: \$? = $ac_status" >&5
9732   (exit "$ac_status"); }
9733         if test -f conftest.out ; then
9734                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9735                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9736                 rm -f conftest.out
9737         fi
9738
9739 else
9740   cat >"conftest.$ac_ext" <<_ACEOF
9741 #line 9741 "configure"
9742 #include "confdefs.h"
9743
9744 $ac_includes_default
9745
9746 #include <${cf_cv_ncurses_header:-curses.h}>
9747
9748 int main(void)
9749 {
9750         FILE *fp = fopen("$cf_tempfile", "w");
9751 #ifdef NCURSES_VERSION
9752 # ifdef NCURSES_VERSION_PATCH
9753         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9754 # else
9755         fprintf(fp, "%s\\n", NCURSES_VERSION);
9756 # endif
9757 #else
9758 # ifdef __NCURSES_H
9759         fprintf(fp, "old\\n");
9760 # else
9761         make an error
9762 # endif
9763 #endif
9764         ${cf_cv_main_return:-return}(0);
9765 }
9766 _ACEOF
9767 rm -f "conftest$ac_exeext"
9768 if { (eval echo "$as_me:9768: \"$ac_link\"") >&5
9769   (eval $ac_link) 2>&5
9770   ac_status=$?
9771   echo "$as_me:9771: \$? = $ac_status" >&5
9772   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9773   { (eval echo "$as_me:9773: \"$ac_try\"") >&5
9774   (eval $ac_try) 2>&5
9775   ac_status=$?
9776   echo "$as_me:9776: \$? = $ac_status" >&5
9777   (exit "$ac_status"); }; }; then
9778
9779         cf_cv_ncurses_version=`cat $cf_tempfile`
9780 else
9781   echo "$as_me: program exited with status $ac_status" >&5
9782 echo "$as_me: failed program was:" >&5
9783 cat "conftest.$ac_ext" >&5
9784 fi
9785 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9786 fi
9787         rm -f "$cf_tempfile"
9788
9789 fi
9790 echo "$as_me:9790: result: $cf_cv_ncurses_version" >&5
9791 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9792 test "$cf_cv_ncurses_version" = no ||
9793 cat >>confdefs.h <<\EOF
9794 #define NCURSES 1
9795 EOF
9796
9797 cf_nculib_root=$cf_cv_screen
9798         # This works, except for the special case where we find gpm, but
9799         # ncurses is in a nonstandard location via $LIBS, and we really want
9800         # to link gpm.
9801 cf_ncurses_LIBS=""
9802 cf_ncurses_SAVE="$LIBS"
9803 echo "$as_me:9803: checking for Gpm_Open in -lgpm" >&5
9804 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9805 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9806   echo $ECHO_N "(cached) $ECHO_C" >&6
9807 else
9808   ac_check_lib_save_LIBS=$LIBS
9809 LIBS="-lgpm  $LIBS"
9810 cat >"conftest.$ac_ext" <<_ACEOF
9811 #line 9811 "configure"
9812 #include "confdefs.h"
9813
9814 /* Override any gcc2 internal prototype to avoid an error.  */
9815 #ifdef __cplusplus
9816 extern "C"
9817 #endif
9818 /* We use char because int might match the return type of a gcc2
9819    builtin and then its argument prototype would still apply.  */
9820 char Gpm_Open ();
9821 int
9822 main (void)
9823 {
9824 Gpm_Open ();
9825   ;
9826   return 0;
9827 }
9828 _ACEOF
9829 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9830 if { (eval echo "$as_me:9830: \"$ac_link\"") >&5
9831   (eval $ac_link) 2>&5
9832   ac_status=$?
9833   echo "$as_me:9833: \$? = $ac_status" >&5
9834   (exit "$ac_status"); } &&
9835          { ac_try='test -s "conftest$ac_exeext"'
9836   { (eval echo "$as_me:9836: \"$ac_try\"") >&5
9837   (eval $ac_try) 2>&5
9838   ac_status=$?
9839   echo "$as_me:9839: \$? = $ac_status" >&5
9840   (exit "$ac_status"); }; }; then
9841   ac_cv_lib_gpm_Gpm_Open=yes
9842 else
9843   echo "$as_me: failed program was:" >&5
9844 cat "conftest.$ac_ext" >&5
9845 ac_cv_lib_gpm_Gpm_Open=no
9846 fi
9847 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9848 LIBS=$ac_check_lib_save_LIBS
9849 fi
9850 echo "$as_me:9850: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9851 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9852 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9853   echo "$as_me:9853: checking for initscr in -lgpm" >&5
9854 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9855 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9856   echo $ECHO_N "(cached) $ECHO_C" >&6
9857 else
9858   ac_check_lib_save_LIBS=$LIBS
9859 LIBS="-lgpm  $LIBS"
9860 cat >"conftest.$ac_ext" <<_ACEOF
9861 #line 9861 "configure"
9862 #include "confdefs.h"
9863
9864 /* Override any gcc2 internal prototype to avoid an error.  */
9865 #ifdef __cplusplus
9866 extern "C"
9867 #endif
9868 /* We use char because int might match the return type of a gcc2
9869    builtin and then its argument prototype would still apply.  */
9870 char initscr ();
9871 int
9872 main (void)
9873 {
9874 initscr ();
9875   ;
9876   return 0;
9877 }
9878 _ACEOF
9879 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9880 if { (eval echo "$as_me:9880: \"$ac_link\"") >&5
9881   (eval $ac_link) 2>&5
9882   ac_status=$?
9883   echo "$as_me:9883: \$? = $ac_status" >&5
9884   (exit "$ac_status"); } &&
9885          { ac_try='test -s "conftest$ac_exeext"'
9886   { (eval echo "$as_me:9886: \"$ac_try\"") >&5
9887   (eval $ac_try) 2>&5
9888   ac_status=$?
9889   echo "$as_me:9889: \$? = $ac_status" >&5
9890   (exit "$ac_status"); }; }; then
9891   ac_cv_lib_gpm_initscr=yes
9892 else
9893   echo "$as_me: failed program was:" >&5
9894 cat "conftest.$ac_ext" >&5
9895 ac_cv_lib_gpm_initscr=no
9896 fi
9897 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9898 LIBS=$ac_check_lib_save_LIBS
9899 fi
9900 echo "$as_me:9900: result: $ac_cv_lib_gpm_initscr" >&5
9901 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9902 if test "$ac_cv_lib_gpm_initscr" = yes; then
9903   LIBS="$cf_ncurses_SAVE"
9904 else
9905   cf_ncurses_LIBS="-lgpm"
9906 fi
9907
9908 fi
9909
9910 case "$host_os" in
9911 (freebsd*)
9912         # This is only necessary if you are linking against an obsolete
9913         # version of ncurses (but it should do no harm, since it is static).
9914         if test "$cf_nculib_root" = ncurses ; then
9915                 echo "$as_me:9915: checking for tgoto in -lmytinfo" >&5
9916 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9917 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9918   echo $ECHO_N "(cached) $ECHO_C" >&6
9919 else
9920   ac_check_lib_save_LIBS=$LIBS
9921 LIBS="-lmytinfo  $LIBS"
9922 cat >"conftest.$ac_ext" <<_ACEOF
9923 #line 9923 "configure"
9924 #include "confdefs.h"
9925
9926 /* Override any gcc2 internal prototype to avoid an error.  */
9927 #ifdef __cplusplus
9928 extern "C"
9929 #endif
9930 /* We use char because int might match the return type of a gcc2
9931    builtin and then its argument prototype would still apply.  */
9932 char tgoto ();
9933 int
9934 main (void)
9935 {
9936 tgoto ();
9937   ;
9938   return 0;
9939 }
9940 _ACEOF
9941 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9942 if { (eval echo "$as_me:9942: \"$ac_link\"") >&5
9943   (eval $ac_link) 2>&5
9944   ac_status=$?
9945   echo "$as_me:9945: \$? = $ac_status" >&5
9946   (exit "$ac_status"); } &&
9947          { ac_try='test -s "conftest$ac_exeext"'
9948   { (eval echo "$as_me:9948: \"$ac_try\"") >&5
9949   (eval $ac_try) 2>&5
9950   ac_status=$?
9951   echo "$as_me:9951: \$? = $ac_status" >&5
9952   (exit "$ac_status"); }; }; then
9953   ac_cv_lib_mytinfo_tgoto=yes
9954 else
9955   echo "$as_me: failed program was:" >&5
9956 cat "conftest.$ac_ext" >&5
9957 ac_cv_lib_mytinfo_tgoto=no
9958 fi
9959 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9960 LIBS=$ac_check_lib_save_LIBS
9961 fi
9962 echo "$as_me:9962: result: $ac_cv_lib_mytinfo_tgoto" >&5
9963 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9964 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9965   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9966 fi
9967
9968         fi
9969         ;;
9970 esac
9971
9972 cf_add_libs="$LIBS"
9973 # reverse order
9974 cf_add_0lib=
9975 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9976 # filter duplicates
9977 for cf_add_1lib in $cf_add_0lib; do
9978         for cf_add_2lib in $cf_add_libs; do
9979                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9980                         cf_add_1lib=
9981                         break
9982                 fi
9983         done
9984         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9985 done
9986 LIBS="$cf_add_libs"
9987
9988 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9989 then
9990
9991 cf_add_libs="$LIBS"
9992 # reverse order
9993 cf_add_0lib=
9994 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9995 # filter duplicates
9996 for cf_add_1lib in $cf_add_0lib; do
9997         for cf_add_2lib in $cf_add_libs; do
9998                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9999                         cf_add_1lib=
10000                         break
10001                 fi
10002         done
10003         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10004 done
10005 LIBS="$cf_add_libs"
10006
10007 else
10008
10009         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
10010         cf_libdir=""
10011         echo "$as_me:10011: checking for initscr" >&5
10012 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10013 if test "${ac_cv_func_initscr+set}" = set; then
10014   echo $ECHO_N "(cached) $ECHO_C" >&6
10015 else
10016   cat >"conftest.$ac_ext" <<_ACEOF
10017 #line 10017 "configure"
10018 #include "confdefs.h"
10019 #define initscr autoconf_temporary
10020 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10021 #undef initscr
10022
10023 #ifdef __cplusplus
10024 extern "C"
10025 #endif
10026
10027 /* We use char because int might match the return type of a gcc2
10028    builtin and then its argument prototype would still apply.  */
10029 char initscr (void);
10030
10031 int
10032 main (void)
10033 {
10034
10035 /* The GNU C library defines stubs for functions which it implements
10036     to always fail with ENOSYS.  Some functions are actually named
10037     something starting with __ and the normal name is an alias.  */
10038 #if defined (__stub_initscr) || defined (__stub___initscr)
10039 #error found stub for initscr
10040 #endif
10041
10042         return initscr ();
10043   ;
10044   return 0;
10045 }
10046 _ACEOF
10047 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10048 if { (eval echo "$as_me:10048: \"$ac_link\"") >&5
10049   (eval $ac_link) 2>&5
10050   ac_status=$?
10051   echo "$as_me:10051: \$? = $ac_status" >&5
10052   (exit "$ac_status"); } &&
10053          { ac_try='test -s "conftest$ac_exeext"'
10054   { (eval echo "$as_me:10054: \"$ac_try\"") >&5
10055   (eval $ac_try) 2>&5
10056   ac_status=$?
10057   echo "$as_me:10057: \$? = $ac_status" >&5
10058   (exit "$ac_status"); }; }; then
10059   ac_cv_func_initscr=yes
10060 else
10061   echo "$as_me: failed program was:" >&5
10062 cat "conftest.$ac_ext" >&5
10063 ac_cv_func_initscr=no
10064 fi
10065 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10066 fi
10067 echo "$as_me:10067: result: $ac_cv_func_initscr" >&5
10068 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10069 if test "$ac_cv_func_initscr" = yes; then
10070   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10071 else
10072
10073                 cf_save_LIBS="$LIBS"
10074                 echo "$as_me:10074: checking for initscr in -l$cf_nculib_root" >&5
10075 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10076                 LIBS="-l$cf_nculib_root $LIBS"
10077                 cat >"conftest.$ac_ext" <<_ACEOF
10078 #line 10078 "configure"
10079 #include "confdefs.h"
10080 #include <${cf_cv_ncurses_header:-curses.h}>
10081 int
10082 main (void)
10083 {
10084 initscr()
10085   ;
10086   return 0;
10087 }
10088 _ACEOF
10089 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10090 if { (eval echo "$as_me:10090: \"$ac_link\"") >&5
10091   (eval $ac_link) 2>&5
10092   ac_status=$?
10093   echo "$as_me:10093: \$? = $ac_status" >&5
10094   (exit "$ac_status"); } &&
10095          { ac_try='test -s "conftest$ac_exeext"'
10096   { (eval echo "$as_me:10096: \"$ac_try\"") >&5
10097   (eval $ac_try) 2>&5
10098   ac_status=$?
10099   echo "$as_me:10099: \$? = $ac_status" >&5
10100   (exit "$ac_status"); }; }; then
10101   echo "$as_me:10101: result: yes" >&5
10102 echo "${ECHO_T}yes" >&6
10103                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10104
10105 else
10106   echo "$as_me: failed program was:" >&5
10107 cat "conftest.$ac_ext" >&5
10108 echo "$as_me:10108: result: no" >&5
10109 echo "${ECHO_T}no" >&6
10110
10111 cf_search=
10112 cf_library_path_list=""
10113 if test -n "${LDFLAGS}${LIBS}" ; then
10114         for cf_library_path in $LDFLAGS $LIBS
10115         do
10116                 case "$cf_library_path" in
10117                 (-L*)
10118                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10119
10120 test "x$cf_library_path" != "xNONE" && \
10121 test -d "$cf_library_path" && \
10122  {
10123         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10124         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10125         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10126         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10127         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10128         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"
10129 }
10130
10131                         cf_library_path_list="$cf_library_path_list $cf_search"
10132                         ;;
10133                 esac
10134         done
10135 fi
10136
10137 cf_search=
10138
10139 test "x$prefix" != "xNONE" && \
10140 test -d "$prefix" && \
10141  {
10142         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10143         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10144         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10145         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10146         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10147         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10148 }
10149
10150 for cf_subdir_prefix in \
10151         /usr \
10152         /usr/local \
10153         /usr/pkg \
10154         /opt \
10155         /opt/local \
10156         $HOME
10157 do
10158
10159 test "x$cf_subdir_prefix" != "x$prefix" && \
10160 test -d "$cf_subdir_prefix" && \
10161 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10162         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10163         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10164         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10165         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10166         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10167         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"
10168 }
10169
10170 done
10171
10172 cf_search="$cf_library_path_list $cf_search"
10173
10174                         for cf_libdir in $cf_search
10175                         do
10176                                 echo "$as_me:10176: checking for -l$cf_nculib_root in $cf_libdir" >&5
10177 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10178                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10179                                 cat >"conftest.$ac_ext" <<_ACEOF
10180 #line 10180 "configure"
10181 #include "confdefs.h"
10182 #include <${cf_cv_ncurses_header:-curses.h}>
10183 int
10184 main (void)
10185 {
10186 initscr()
10187   ;
10188   return 0;
10189 }
10190 _ACEOF
10191 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10192 if { (eval echo "$as_me:10192: \"$ac_link\"") >&5
10193   (eval $ac_link) 2>&5
10194   ac_status=$?
10195   echo "$as_me:10195: \$? = $ac_status" >&5
10196   (exit "$ac_status"); } &&
10197          { ac_try='test -s "conftest$ac_exeext"'
10198   { (eval echo "$as_me:10198: \"$ac_try\"") >&5
10199   (eval $ac_try) 2>&5
10200   ac_status=$?
10201   echo "$as_me:10201: \$? = $ac_status" >&5
10202   (exit "$ac_status"); }; }; then
10203   echo "$as_me:10203: result: yes" >&5
10204 echo "${ECHO_T}yes" >&6
10205                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10206                                          break
10207 else
10208   echo "$as_me: failed program was:" >&5
10209 cat "conftest.$ac_ext" >&5
10210 echo "$as_me:10210: result: no" >&5
10211 echo "${ECHO_T}no" >&6
10212                                          LIBS="$cf_save_LIBS"
10213 fi
10214 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10215                         done
10216
10217 fi
10218 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10219
10220 fi
10221
10222 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
10223
10224 if test "$cf_found_library" = no ; then
10225         { { echo "$as_me:10225: error: Cannot link $cf_nculib_root library" >&5
10226 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10227    { (exit 1); exit 1; }; }
10228 fi
10229
10230 fi
10231
10232 if test -n "$cf_ncurses_LIBS" ; then
10233         echo "$as_me:10233: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10234 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10235         cf_ncurses_SAVE="$LIBS"
10236         for p in $cf_ncurses_LIBS ; do
10237                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
10238                 if test "$q" != "$LIBS" ; then
10239                         LIBS="$q"
10240                 fi
10241         done
10242         cat >"conftest.$ac_ext" <<_ACEOF
10243 #line 10243 "configure"
10244 #include "confdefs.h"
10245 #include <${cf_cv_ncurses_header:-curses.h}>
10246 int
10247 main (void)
10248 {
10249 initscr(); mousemask(0,0); tigetstr((char *)0);
10250   ;
10251   return 0;
10252 }
10253 _ACEOF
10254 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10255 if { (eval echo "$as_me:10255: \"$ac_link\"") >&5
10256   (eval $ac_link) 2>&5
10257   ac_status=$?
10258   echo "$as_me:10258: \$? = $ac_status" >&5
10259   (exit "$ac_status"); } &&
10260          { ac_try='test -s "conftest$ac_exeext"'
10261   { (eval echo "$as_me:10261: \"$ac_try\"") >&5
10262   (eval $ac_try) 2>&5
10263   ac_status=$?
10264   echo "$as_me:10264: \$? = $ac_status" >&5
10265   (exit "$ac_status"); }; }; then
10266   echo "$as_me:10266: result: yes" >&5
10267 echo "${ECHO_T}yes" >&6
10268 else
10269   echo "$as_me: failed program was:" >&5
10270 cat "conftest.$ac_ext" >&5
10271 echo "$as_me:10271: result: no" >&5
10272 echo "${ECHO_T}no" >&6
10273                  LIBS="$cf_ncurses_SAVE"
10274 fi
10275 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10276 fi
10277
10278 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10279
10280 cat >>confdefs.h <<EOF
10281 #define $cf_nculib_ROOT 1
10282 EOF
10283
10284         fi
10285 else
10286         NCURSES_CONFIG=none
10287 fi
10288
10289         ;;
10290 (ncurses*)
10291
10292 cf_ncuconfig_root=$cf_cv_screen
10293 cf_have_ncuconfig=no
10294
10295 if test "x${PKG_CONFIG:=none}" != xnone; then
10296         echo "$as_me:10296: checking pkg-config for $cf_ncuconfig_root" >&5
10297 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
10298         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
10299                 echo "$as_me:10299: result: yes" >&5
10300 echo "${ECHO_T}yes" >&6
10301
10302                 echo "$as_me:10302: checking if the $cf_ncuconfig_root package files work" >&5
10303 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
10304                 cf_have_ncuconfig=unknown
10305
10306                 cf_save_CFLAGS="$CFLAGS"
10307                 cf_save_CPPFLAGS="$CPPFLAGS"
10308                 cf_save_LIBS="$LIBS"
10309
10310                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
10311                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
10312
10313                 # while -W for passing linker flags is prevalent, it is not "standard".
10314                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
10315                 # incompatible _and_ non-standard -W option which gives an error.  Work
10316                 # around that pitfall.
10317                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
10318                 (x*c[89]9@@*-W*)
10319
10320 cf_fix_cppflags=no
10321 cf_new_cflags=
10322 cf_new_cppflags=
10323 cf_new_extra_cppflags=
10324
10325 for cf_add_cflags in $cf_pkg_cflags
10326 do
10327 case "$cf_fix_cppflags" in
10328 (no)
10329         case "$cf_add_cflags" in
10330         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10331                 case "$cf_add_cflags" in
10332                 (-D*)
10333                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10334
10335                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10336                                 && test -z "${cf_tst_cflags}" \
10337                                 && cf_fix_cppflags=yes
10338
10339                         if test "$cf_fix_cppflags" = yes ; then
10340
10341         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10342         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10343
10344                                 continue
10345                         elif test "${cf_tst_cflags}" = "\"'" ; then
10346
10347         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10348         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10349
10350                                 continue
10351                         fi
10352                         ;;
10353                 esac
10354                 case "$CPPFLAGS" in
10355                 (*$cf_add_cflags)
10356                         ;;
10357                 (*)
10358                         case "$cf_add_cflags" in
10359                         (-D*)
10360                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10361
10362 CPPFLAGS=`echo "$CPPFLAGS" | \
10363         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10364                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10365
10366                                 ;;
10367                         esac
10368
10369         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10370         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10371
10372                         ;;
10373                 esac
10374                 ;;
10375         (*)
10376
10377         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10378         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10379
10380                 ;;
10381         esac
10382         ;;
10383 (yes)
10384
10385         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10386         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10387
10388         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10389
10390         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10391                 && test -z "${cf_tst_cflags}" \
10392                 && cf_fix_cppflags=no
10393         ;;
10394 esac
10395 done
10396
10397 if test -n "$cf_new_cflags" ; then
10398
10399         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10400         CFLAGS="${CFLAGS}$cf_new_cflags"
10401
10402 fi
10403
10404 if test -n "$cf_new_cppflags" ; then
10405
10406         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10407         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10408
10409 fi
10410
10411 if test -n "$cf_new_extra_cppflags" ; then
10412
10413         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10414         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10415
10416 fi
10417
10418 cf_add_libs="$LIBS"
10419 # reverse order
10420 cf_add_0lib=
10421 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10422 # filter duplicates
10423 for cf_add_1lib in $cf_add_0lib; do
10424         for cf_add_2lib in $cf_add_libs; do
10425                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10426                         cf_add_1lib=
10427                         break
10428                 fi
10429         done
10430         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10431 done
10432 LIBS="$cf_add_libs"
10433
10434                         cat >"conftest.$ac_ext" <<_ACEOF
10435 #line 10435 "configure"
10436 #include "confdefs.h"
10437 #include <${cf_cv_ncurses_header:-curses.h}>
10438 int
10439 main (void)
10440 {
10441 initscr(); mousemask(0,0); tigetstr((char *)0);
10442   ;
10443   return 0;
10444 }
10445 _ACEOF
10446 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10447 if { (eval echo "$as_me:10447: \"$ac_link\"") >&5
10448   (eval $ac_link) 2>&5
10449   ac_status=$?
10450   echo "$as_me:10450: \$? = $ac_status" >&5
10451   (exit "$ac_status"); } &&
10452          { ac_try='test -s "conftest$ac_exeext"'
10453   { (eval echo "$as_me:10453: \"$ac_try\"") >&5
10454   (eval $ac_try) 2>&5
10455   ac_status=$?
10456   echo "$as_me:10456: \$? = $ac_status" >&5
10457   (exit "$ac_status"); }; }; then
10458   if test "$cross_compiling" = yes; then
10459   cf_test_ncuconfig=maybe
10460 else
10461   cat >"conftest.$ac_ext" <<_ACEOF
10462 #line 10462 "configure"
10463 #include "confdefs.h"
10464 #include <${cf_cv_ncurses_header:-curses.h}>
10465                                         int main(void)
10466                                         { const char *xx = curses_version(); return (xx == 0); }
10467 _ACEOF
10468 rm -f "conftest$ac_exeext"
10469 if { (eval echo "$as_me:10469: \"$ac_link\"") >&5
10470   (eval $ac_link) 2>&5
10471   ac_status=$?
10472   echo "$as_me:10472: \$? = $ac_status" >&5
10473   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10474   { (eval echo "$as_me:10474: \"$ac_try\"") >&5
10475   (eval $ac_try) 2>&5
10476   ac_status=$?
10477   echo "$as_me:10477: \$? = $ac_status" >&5
10478   (exit "$ac_status"); }; }; then
10479   cf_test_ncuconfig=yes
10480 else
10481   echo "$as_me: program exited with status $ac_status" >&5
10482 echo "$as_me: failed program was:" >&5
10483 cat "conftest.$ac_ext" >&5
10484 cf_test_ncuconfig=no
10485 fi
10486 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10487 fi
10488 else
10489   echo "$as_me: failed program was:" >&5
10490 cat "conftest.$ac_ext" >&5
10491 cf_test_ncuconfig=no
10492 fi
10493 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10494
10495                         CFLAGS="$cf_save_CFLAGS"
10496                         CPPFLAGS="$cf_save_CPPFLAGS"
10497                         LIBS="$cf_save_LIBS"
10498
10499                         if test "x$cf_test_ncuconfig" != xyes; then
10500                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10501                                 cf_pkg_cflags="$cf_temp"
10502                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10503                                 cf_pkg_libs="$cf_temp"
10504                         fi
10505                         ;;
10506                 esac
10507
10508 for cf_add_cflags in $cf_pkg_cflags
10509 do
10510         case "x$cf_add_cflags" in
10511         (x-[DU]*)
10512
10513 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10514 while true
10515 do
10516         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10517         test "$CFLAGS" != "$cf_old_cflag" || break
10518
10519         CFLAGS="$cf_old_cflag"
10520 done
10521
10522 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10523 while true
10524 do
10525         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10526         test "$CPPFLAGS" != "$cf_old_cflag" || break
10527
10528         CPPFLAGS="$cf_old_cflag"
10529 done
10530
10531                 ;;
10532         esac
10533
10534 cf_fix_cppflags=no
10535 cf_new_cflags=
10536 cf_new_cppflags=
10537 cf_new_extra_cppflags=
10538
10539 for cf_add_cflags in $cf_add_cflags
10540 do
10541 case "$cf_fix_cppflags" in
10542 (no)
10543         case "$cf_add_cflags" in
10544         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10545                 case "$cf_add_cflags" in
10546                 (-D*)
10547                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10548
10549                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10550                                 && test -z "${cf_tst_cflags}" \
10551                                 && cf_fix_cppflags=yes
10552
10553                         if test "$cf_fix_cppflags" = yes ; then
10554
10555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10557
10558                                 continue
10559                         elif test "${cf_tst_cflags}" = "\"'" ; then
10560
10561         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10562         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10563
10564                                 continue
10565                         fi
10566                         ;;
10567                 esac
10568                 case "$CPPFLAGS" in
10569                 (*$cf_add_cflags)
10570                         ;;
10571                 (*)
10572                         case "$cf_add_cflags" in
10573                         (-D*)
10574                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10575
10576 CPPFLAGS=`echo "$CPPFLAGS" | \
10577         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10578                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10579
10580                                 ;;
10581                         esac
10582
10583         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10584         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10585
10586                         ;;
10587                 esac
10588                 ;;
10589         (*)
10590
10591         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10592         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10593
10594                 ;;
10595         esac
10596         ;;
10597 (yes)
10598
10599         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10600         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10601
10602         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10603
10604         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10605                 && test -z "${cf_tst_cflags}" \
10606                 && cf_fix_cppflags=no
10607         ;;
10608 esac
10609 done
10610
10611 if test -n "$cf_new_cflags" ; then
10612
10613         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10614         CFLAGS="${CFLAGS}$cf_new_cflags"
10615
10616 fi
10617
10618 if test -n "$cf_new_cppflags" ; then
10619
10620         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10621         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10622
10623 fi
10624
10625 if test -n "$cf_new_extra_cppflags" ; then
10626
10627         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10628         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10629
10630 fi
10631
10632 done
10633
10634 cf_add_libs="$LIBS"
10635 # reverse order
10636 cf_add_0lib=
10637 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10638 # filter duplicates
10639 for cf_add_1lib in $cf_add_0lib; do
10640         for cf_add_2lib in $cf_add_libs; do
10641                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10642                         cf_add_1lib=
10643                         break
10644                 fi
10645         done
10646         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10647 done
10648 LIBS="$cf_add_libs"
10649
10650                 cat >"conftest.$ac_ext" <<_ACEOF
10651 #line 10651 "configure"
10652 #include "confdefs.h"
10653 #include <${cf_cv_ncurses_header:-curses.h}>
10654 int
10655 main (void)
10656 {
10657 initscr(); mousemask(0,0); tigetstr((char *)0);
10658   ;
10659   return 0;
10660 }
10661 _ACEOF
10662 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10663 if { (eval echo "$as_me:10663: \"$ac_link\"") >&5
10664   (eval $ac_link) 2>&5
10665   ac_status=$?
10666   echo "$as_me:10666: \$? = $ac_status" >&5
10667   (exit "$ac_status"); } &&
10668          { ac_try='test -s "conftest$ac_exeext"'
10669   { (eval echo "$as_me:10669: \"$ac_try\"") >&5
10670   (eval $ac_try) 2>&5
10671   ac_status=$?
10672   echo "$as_me:10672: \$? = $ac_status" >&5
10673   (exit "$ac_status"); }; }; then
10674   if test "$cross_compiling" = yes; then
10675   cf_have_ncuconfig=maybe
10676 else
10677   cat >"conftest.$ac_ext" <<_ACEOF
10678 #line 10678 "configure"
10679 #include "confdefs.h"
10680 #include <${cf_cv_ncurses_header:-curses.h}>
10681                                 int main(void)
10682                                 { const char *xx = curses_version(); return (xx == 0); }
10683 _ACEOF
10684 rm -f "conftest$ac_exeext"
10685 if { (eval echo "$as_me:10685: \"$ac_link\"") >&5
10686   (eval $ac_link) 2>&5
10687   ac_status=$?
10688   echo "$as_me:10688: \$? = $ac_status" >&5
10689   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10690   { (eval echo "$as_me:10690: \"$ac_try\"") >&5
10691   (eval $ac_try) 2>&5
10692   ac_status=$?
10693   echo "$as_me:10693: \$? = $ac_status" >&5
10694   (exit "$ac_status"); }; }; then
10695   cf_have_ncuconfig=yes
10696 else
10697   echo "$as_me: program exited with status $ac_status" >&5
10698 echo "$as_me: failed program was:" >&5
10699 cat "conftest.$ac_ext" >&5
10700 cf_have_ncuconfig=no
10701 fi
10702 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10703 fi
10704 else
10705   echo "$as_me: failed program was:" >&5
10706 cat "conftest.$ac_ext" >&5
10707 cf_have_ncuconfig=no
10708 fi
10709 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10710                 echo "$as_me:10710: result: $cf_have_ncuconfig" >&5
10711 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10712                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10713                 if test "$cf_have_ncuconfig" != "yes"
10714                 then
10715                         CPPFLAGS="$cf_save_CPPFLAGS"
10716                         LIBS="$cf_save_LIBS"
10717                         NCURSES_CONFIG_PKG=none
10718                 else
10719
10720 cat >>confdefs.h <<\EOF
10721 #define NCURSES 1
10722 EOF
10723
10724                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10725
10726 echo "$as_me:10726: checking for terminfo header" >&5
10727 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10728 if test "${cf_cv_term_header+set}" = set; then
10729   echo $ECHO_N "(cached) $ECHO_C" >&6
10730 else
10731
10732 case "${cf_cv_ncurses_header}" in
10733 (*/ncurses.h|*/ncursesw.h)
10734         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10735         ;;
10736 (*)
10737         cf_term_header=term.h
10738         ;;
10739 esac
10740
10741 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10742 do
10743 cat >"conftest.$ac_ext" <<_ACEOF
10744 #line 10744 "configure"
10745 #include "confdefs.h"
10746 #include <stdio.h>
10747 #include <${cf_cv_ncurses_header:-curses.h}>
10748 #include <$cf_test>
10749
10750 int
10751 main (void)
10752 {
10753 int x = auto_left_margin; (void)x
10754   ;
10755   return 0;
10756 }
10757 _ACEOF
10758 rm -f "conftest.$ac_objext"
10759 if { (eval echo "$as_me:10759: \"$ac_compile\"") >&5
10760   (eval $ac_compile) 2>&5
10761   ac_status=$?
10762   echo "$as_me:10762: \$? = $ac_status" >&5
10763   (exit "$ac_status"); } &&
10764          { ac_try='test -s "conftest.$ac_objext"'
10765   { (eval echo "$as_me:10765: \"$ac_try\"") >&5
10766   (eval $ac_try) 2>&5
10767   ac_status=$?
10768   echo "$as_me:10768: \$? = $ac_status" >&5
10769   (exit "$ac_status"); }; }; then
10770
10771         cf_cv_term_header="$cf_test"
10772 else
10773   echo "$as_me: failed program was:" >&5
10774 cat "conftest.$ac_ext" >&5
10775
10776         cf_cv_term_header=unknown
10777
10778 fi
10779 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10780         test "$cf_cv_term_header" != unknown && break
10781 done
10782
10783 fi
10784 echo "$as_me:10784: result: $cf_cv_term_header" >&5
10785 echo "${ECHO_T}$cf_cv_term_header" >&6
10786
10787 # Set definitions to allow ifdef'ing to accommodate subdirectories
10788
10789 case "$cf_cv_term_header" in
10790 (*term.h)
10791
10792 cat >>confdefs.h <<\EOF
10793 #define HAVE_TERM_H 1
10794 EOF
10795
10796         ;;
10797 esac
10798
10799 case "$cf_cv_term_header" in
10800 (ncurses/term.h)
10801
10802 cat >>confdefs.h <<\EOF
10803 #define HAVE_NCURSES_TERM_H 1
10804 EOF
10805
10806         ;;
10807 (ncursesw/term.h)
10808
10809 cat >>confdefs.h <<\EOF
10810 #define HAVE_NCURSESW_TERM_H 1
10811 EOF
10812
10813         ;;
10814 esac
10815
10816                 fi
10817
10818         else
10819                 echo "$as_me:10819: result: no" >&5
10820 echo "${ECHO_T}no" >&6
10821                 NCURSES_CONFIG_PKG=none
10822         fi
10823 else
10824         NCURSES_CONFIG_PKG=none
10825 fi
10826
10827 if test "x$cf_have_ncuconfig" = "xno"; then
10828         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10829
10830 if test -n "$ac_tool_prefix"; then
10831   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10832   do
10833     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10834 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10835 echo "$as_me:10835: checking for $ac_word" >&5
10836 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10837 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10838   echo $ECHO_N "(cached) $ECHO_C" >&6
10839 else
10840   if test -n "$NCURSES_CONFIG"; then
10841   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10842 else
10843   ac_save_IFS=$IFS; IFS=$ac_path_separator
10844 ac_dummy="$PATH"
10845 for ac_dir in $ac_dummy; do
10846   IFS=$ac_save_IFS
10847   test -z "$ac_dir" && ac_dir=.
10848   $as_executable_p "$ac_dir/$ac_word" || continue
10849 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10850 echo "$as_me:10850: found $ac_dir/$ac_word" >&5
10851 break
10852 done
10853
10854 fi
10855 fi
10856 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10857 if test -n "$NCURSES_CONFIG"; then
10858   echo "$as_me:10858: result: $NCURSES_CONFIG" >&5
10859 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10860 else
10861   echo "$as_me:10861: result: no" >&5
10862 echo "${ECHO_T}no" >&6
10863 fi
10864
10865     test -n "$NCURSES_CONFIG" && break
10866   done
10867 fi
10868 if test -z "$NCURSES_CONFIG"; then
10869   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10870   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10871 do
10872   # Extract the first word of "$ac_prog", so it can be a program name with args.
10873 set dummy $ac_prog; ac_word=$2
10874 echo "$as_me:10874: checking for $ac_word" >&5
10875 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10876 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10877   echo $ECHO_N "(cached) $ECHO_C" >&6
10878 else
10879   if test -n "$ac_ct_NCURSES_CONFIG"; then
10880   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10881 else
10882   ac_save_IFS=$IFS; IFS=$ac_path_separator
10883 ac_dummy="$PATH"
10884 for ac_dir in $ac_dummy; do
10885   IFS=$ac_save_IFS
10886   test -z "$ac_dir" && ac_dir=.
10887   $as_executable_p "$ac_dir/$ac_word" || continue
10888 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10889 echo "$as_me:10889: found $ac_dir/$ac_word" >&5
10890 break
10891 done
10892
10893 fi
10894 fi
10895 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10896 if test -n "$ac_ct_NCURSES_CONFIG"; then
10897   echo "$as_me:10897: result: $ac_ct_NCURSES_CONFIG" >&5
10898 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10899 else
10900   echo "$as_me:10900: result: no" >&5
10901 echo "${ECHO_T}no" >&6
10902 fi
10903
10904   test -n "$ac_ct_NCURSES_CONFIG" && break
10905 done
10906 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10907
10908   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10909 fi
10910
10911         if test "$NCURSES_CONFIG" != none ; then
10912
10913 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10914 do
10915         case "x$cf_add_cflags" in
10916         (x-[DU]*)
10917
10918 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10919 while true
10920 do
10921         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10922         test "$CFLAGS" != "$cf_old_cflag" || break
10923
10924         CFLAGS="$cf_old_cflag"
10925 done
10926
10927 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10928 while true
10929 do
10930         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10931         test "$CPPFLAGS" != "$cf_old_cflag" || break
10932
10933         CPPFLAGS="$cf_old_cflag"
10934 done
10935
10936                 ;;
10937         esac
10938
10939 cf_fix_cppflags=no
10940 cf_new_cflags=
10941 cf_new_cppflags=
10942 cf_new_extra_cppflags=
10943
10944 for cf_add_cflags in $cf_add_cflags
10945 do
10946 case "$cf_fix_cppflags" in
10947 (no)
10948         case "$cf_add_cflags" in
10949         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10950                 case "$cf_add_cflags" in
10951                 (-D*)
10952                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10953
10954                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10955                                 && test -z "${cf_tst_cflags}" \
10956                                 && cf_fix_cppflags=yes
10957
10958                         if test "$cf_fix_cppflags" = yes ; then
10959
10960         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10961         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10962
10963                                 continue
10964                         elif test "${cf_tst_cflags}" = "\"'" ; then
10965
10966         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10967         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10968
10969                                 continue
10970                         fi
10971                         ;;
10972                 esac
10973                 case "$CPPFLAGS" in
10974                 (*$cf_add_cflags)
10975                         ;;
10976                 (*)
10977                         case "$cf_add_cflags" in
10978                         (-D*)
10979                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10980
10981 CPPFLAGS=`echo "$CPPFLAGS" | \
10982         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10983                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10984
10985                                 ;;
10986                         esac
10987
10988         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10989         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10990
10991                         ;;
10992                 esac
10993                 ;;
10994         (*)
10995
10996         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10997         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10998
10999                 ;;
11000         esac
11001         ;;
11002 (yes)
11003
11004         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11005         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11006
11007         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
11008
11009         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11010                 && test -z "${cf_tst_cflags}" \
11011                 && cf_fix_cppflags=no
11012         ;;
11013 esac
11014 done
11015
11016 if test -n "$cf_new_cflags" ; then
11017
11018         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11019         CFLAGS="${CFLAGS}$cf_new_cflags"
11020
11021 fi
11022
11023 if test -n "$cf_new_cppflags" ; then
11024
11025         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11026         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11027
11028 fi
11029
11030 if test -n "$cf_new_extra_cppflags" ; then
11031
11032         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11033         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11034
11035 fi
11036
11037 done
11038
11039 cf_add_libs="$LIBS"
11040 # reverse order
11041 cf_add_0lib=
11042 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11043 # filter duplicates
11044 for cf_add_1lib in $cf_add_0lib; do
11045         for cf_add_2lib in $cf_add_libs; do
11046                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11047                         cf_add_1lib=
11048                         break
11049                 fi
11050         done
11051         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11052 done
11053 LIBS="$cf_add_libs"
11054
11055                 # even with config script, some packages use no-override for curses.h
11056
11057 echo "$as_me:11057: checking if we have identified curses headers" >&5
11058 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
11059 if test "${cf_cv_ncurses_header+set}" = set; then
11060   echo $ECHO_N "(cached) $ECHO_C" >&6
11061 else
11062
11063 cf_cv_ncurses_header=none
11064 for cf_header in \
11065         ncurses.h $cf_cv_screen/ncurses.h \
11066         curses.h $cf_cv_screen/curses.h
11067 do
11068 cat >"conftest.$ac_ext" <<_ACEOF
11069 #line 11069 "configure"
11070 #include "confdefs.h"
11071 #include <${cf_header}>
11072 int
11073 main (void)
11074 {
11075 initscr(); endwin()
11076   ;
11077   return 0;
11078 }
11079 _ACEOF
11080 rm -f "conftest.$ac_objext"
11081 if { (eval echo "$as_me:11081: \"$ac_compile\"") >&5
11082   (eval $ac_compile) 2>&5
11083   ac_status=$?
11084   echo "$as_me:11084: \$? = $ac_status" >&5
11085   (exit "$ac_status"); } &&
11086          { ac_try='test -s "conftest.$ac_objext"'
11087   { (eval echo "$as_me:11087: \"$ac_try\"") >&5
11088   (eval $ac_try) 2>&5
11089   ac_status=$?
11090   echo "$as_me:11090: \$? = $ac_status" >&5
11091   (exit "$ac_status"); }; }; then
11092   cf_cv_ncurses_header=$cf_header; break
11093 else
11094   echo "$as_me: failed program was:" >&5
11095 cat "conftest.$ac_ext" >&5
11096 fi
11097 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11098 done
11099
11100 fi
11101 echo "$as_me:11101: result: $cf_cv_ncurses_header" >&5
11102 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
11103
11104 if test "$cf_cv_ncurses_header" = none ; then
11105         { { echo "$as_me:11105: error: No curses header-files found" >&5
11106 echo "$as_me: error: No curses header-files found" >&2;}
11107    { (exit 1); exit 1; }; }
11108 fi
11109
11110 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
11111
11112 for ac_header in $cf_cv_ncurses_header
11113 do
11114 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11115 echo "$as_me:11115: checking for $ac_header" >&5
11116 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11117 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11118   echo $ECHO_N "(cached) $ECHO_C" >&6
11119 else
11120   cat >"conftest.$ac_ext" <<_ACEOF
11121 #line 11121 "configure"
11122 #include "confdefs.h"
11123 #include <$ac_header>
11124 _ACEOF
11125 if { (eval echo "$as_me:11125: \"$ac_cpp "conftest.$ac_ext"\"") >&5
11126   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
11127   ac_status=$?
11128   $EGREP -v '^ *\+' conftest.er1 >conftest.err
11129   rm -f conftest.er1
11130   cat conftest.err >&5
11131   echo "$as_me:11131: \$? = $ac_status" >&5
11132   (exit "$ac_status"); } >/dev/null; then
11133   if test -s conftest.err; then
11134     ac_cpp_err=$ac_c_preproc_warn_flag
11135   else
11136     ac_cpp_err=
11137   fi
11138 else
11139   ac_cpp_err=yes
11140 fi
11141 if test -z "$ac_cpp_err"; then
11142   eval "$as_ac_Header=yes"
11143 else
11144   echo "$as_me: failed program was:" >&5
11145   cat "conftest.$ac_ext" >&5
11146   eval "$as_ac_Header=no"
11147 fi
11148 rm -f conftest.err "conftest.$ac_ext"
11149 fi
11150 echo "$as_me:11150: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
11151 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
11152 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
11153   cat >>confdefs.h <<EOF
11154 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11155 EOF
11156
11157 fi
11158 done
11159
11160 cat >>confdefs.h <<\EOF
11161 #define NCURSES 1
11162 EOF
11163
11164 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11165
11166                 cat >>confdefs.h <<EOF
11167 #define $cf_nculib_ROOT 1
11168 EOF
11169
11170                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
11171
11172         else
11173
11174 cf_ncuhdr_root=$cf_cv_screen
11175
11176 test -n "$cf_cv_curses_dir" && \
11177 test "$cf_cv_curses_dir" != "no" && { \
11178
11179 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
11180   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
11181   do
11182         while test "$cf_add_incdir" != /usr/include
11183         do
11184           if test -d "$cf_add_incdir"
11185           then
11186                 cf_have_incdir=no
11187                 if test -n "$CFLAGS$CPPFLAGS" ; then
11188                   # a loop is needed to ensure we can add subdirs of existing dirs
11189                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11190                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11191                           cf_have_incdir=yes; break
11192                         fi
11193                   done
11194                 fi
11195
11196                 if test "$cf_have_incdir" = no ; then
11197                   if test "$cf_add_incdir" = /usr/local/include ; then
11198                         if test "$GCC" = yes
11199                         then
11200                           cf_save_CPPFLAGS=$CPPFLAGS
11201
11202         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11203         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11204
11205                           cat >"conftest.$ac_ext" <<_ACEOF
11206 #line 11206 "configure"
11207 #include "confdefs.h"
11208 #include <stdio.h>
11209 int
11210 main (void)
11211 {
11212 printf("Hello")
11213   ;
11214   return 0;
11215 }
11216 _ACEOF
11217 rm -f "conftest.$ac_objext"
11218 if { (eval echo "$as_me:11218: \"$ac_compile\"") >&5
11219   (eval $ac_compile) 2>&5
11220   ac_status=$?
11221   echo "$as_me:11221: \$? = $ac_status" >&5
11222   (exit "$ac_status"); } &&
11223          { ac_try='test -s "conftest.$ac_objext"'
11224   { (eval echo "$as_me:11224: \"$ac_try\"") >&5
11225   (eval $ac_try) 2>&5
11226   ac_status=$?
11227   echo "$as_me:11227: \$? = $ac_status" >&5
11228   (exit "$ac_status"); }; }; then
11229   :
11230 else
11231   echo "$as_me: failed program was:" >&5
11232 cat "conftest.$ac_ext" >&5
11233 cf_have_incdir=yes
11234 fi
11235 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11236                           CPPFLAGS=$cf_save_CPPFLAGS
11237                         fi
11238                   fi
11239                 fi
11240
11241                 if test "$cf_have_incdir" = no ; then
11242                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11243
11244 echo "${as_me:-configure}:11244: testing adding $cf_add_incdir to include-path ..." 1>&5
11245
11246                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11247
11248                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11249                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11250                   cf_add_incdir="$cf_top_incdir"
11251                 else
11252                   break
11253                 fi
11254           else
11255                 break
11256           fi
11257         done
11258   done
11259 fi
11260
11261 }
11262
11263 echo "$as_me:11263: checking for $cf_ncuhdr_root header in include-path" >&5
11264 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
11265 if test "${cf_cv_ncurses_h+set}" = set; then
11266   echo $ECHO_N "(cached) $ECHO_C" >&6
11267 else
11268
11269         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
11270         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
11271         for cf_header in $cf_header_list
11272         do
11273
11274         cat >"conftest.$ac_ext" <<_ACEOF
11275 #line 11275 "configure"
11276 #include "confdefs.h"
11277
11278 #include <$cf_header>
11279 int
11280 main (void)
11281 {
11282
11283 #ifdef NCURSES_VERSION
11284
11285 printf("%s\\n", NCURSES_VERSION);
11286 #else
11287 #ifdef __NCURSES_H
11288 printf("old\\n");
11289 #else
11290         make an error
11291 #endif
11292 #endif
11293
11294   ;
11295   return 0;
11296 }
11297 _ACEOF
11298 rm -f "conftest.$ac_objext"
11299 if { (eval echo "$as_me:11299: \"$ac_compile\"") >&5
11300   (eval $ac_compile) 2>&5
11301   ac_status=$?
11302   echo "$as_me:11302: \$? = $ac_status" >&5
11303   (exit "$ac_status"); } &&
11304          { ac_try='test -s "conftest.$ac_objext"'
11305   { (eval echo "$as_me:11305: \"$ac_try\"") >&5
11306   (eval $ac_try) 2>&5
11307   ac_status=$?
11308   echo "$as_me:11308: \$? = $ac_status" >&5
11309   (exit "$ac_status"); }; }; then
11310   cf_cv_ncurses_h=$cf_header
11311
11312 else
11313   echo "$as_me: failed program was:" >&5
11314 cat "conftest.$ac_ext" >&5
11315 cf_cv_ncurses_h=no
11316 fi
11317 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11318
11319                 test "$cf_cv_ncurses_h" != no && break
11320         done
11321
11322 fi
11323 echo "$as_me:11323: result: $cf_cv_ncurses_h" >&5
11324 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
11325
11326 if test "$cf_cv_ncurses_h" != no ; then
11327         cf_cv_ncurses_header=$cf_cv_ncurses_h
11328 else
11329
11330 echo "$as_me:11330: checking for $cf_ncuhdr_root include-path" >&5
11331 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
11332 if test "${cf_cv_ncurses_h2+set}" = set; then
11333   echo $ECHO_N "(cached) $ECHO_C" >&6
11334 else
11335
11336         test -n "$verbose" && echo
11337
11338 cf_search=
11339
11340 # collect the current set of include-directories from compiler flags
11341 cf_header_path_list=""
11342 if test -n "${CFLAGS}${CPPFLAGS}" ; then
11343         for cf_header_path in $CPPFLAGS $CFLAGS
11344         do
11345                 case "$cf_header_path" in
11346                 (-I*)
11347                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
11348
11349 test "x$cf_header_path" != "xNONE" && \
11350 test -d "$cf_header_path" && \
11351  {
11352         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
11353         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
11354         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
11355         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
11356         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
11357         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"
11358 }
11359
11360                         cf_header_path_list="$cf_header_path_list $cf_search"
11361                         ;;
11362                 esac
11363         done
11364 fi
11365
11366 # add the variations for the package we are looking for
11367
11368 cf_search=
11369
11370 test "x$prefix" != "xNONE" && \
11371 test -d "$prefix" && \
11372  {
11373         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
11374         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
11375         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
11376         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
11377         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
11378         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
11379 }
11380
11381 for cf_subdir_prefix in \
11382         /usr \
11383         /usr/local \
11384         /usr/pkg \
11385         /opt \
11386         /opt/local \
11387         $HOME
11388 do
11389
11390 test "x$cf_subdir_prefix" != "x$prefix" && \
11391 test -d "$cf_subdir_prefix" && \
11392 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11393         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
11394         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
11395         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11396         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11397         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11398         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"
11399 }
11400
11401 done
11402
11403 test "$includedir" != NONE && \
11404 test "$includedir" != "/usr/include" && \
11405 test -d "$includedir" && {
11406         test -d "$includedir" &&    cf_search="$cf_search $includedir"
11407         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
11408 }
11409
11410 test "$oldincludedir" != NONE && \
11411 test "$oldincludedir" != "/usr/include" && \
11412 test -d "$oldincludedir" && {
11413         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
11414         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
11415 }
11416
11417 cf_search="$cf_search $cf_header_path_list"
11418
11419         test -n "$verbose" && echo "search path $cf_search"
11420         cf_save2_CPPFLAGS="$CPPFLAGS"
11421         for cf_incdir in $cf_search
11422         do
11423
11424 if test -n "$cf_incdir" ; then
11425   for cf_add_incdir in $cf_incdir
11426   do
11427         while test "$cf_add_incdir" != /usr/include
11428         do
11429           if test -d "$cf_add_incdir"
11430           then
11431                 cf_have_incdir=no
11432                 if test -n "$CFLAGS$CPPFLAGS" ; then
11433                   # a loop is needed to ensure we can add subdirs of existing dirs
11434                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11435                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11436                           cf_have_incdir=yes; break
11437                         fi
11438                   done
11439                 fi
11440
11441                 if test "$cf_have_incdir" = no ; then
11442                   if test "$cf_add_incdir" = /usr/local/include ; then
11443                         if test "$GCC" = yes
11444                         then
11445                           cf_save_CPPFLAGS=$CPPFLAGS
11446
11447         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11448         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11449
11450                           cat >"conftest.$ac_ext" <<_ACEOF
11451 #line 11451 "configure"
11452 #include "confdefs.h"
11453 #include <stdio.h>
11454 int
11455 main (void)
11456 {
11457 printf("Hello")
11458   ;
11459   return 0;
11460 }
11461 _ACEOF
11462 rm -f "conftest.$ac_objext"
11463 if { (eval echo "$as_me:11463: \"$ac_compile\"") >&5
11464   (eval $ac_compile) 2>&5
11465   ac_status=$?
11466   echo "$as_me:11466: \$? = $ac_status" >&5
11467   (exit "$ac_status"); } &&
11468          { ac_try='test -s "conftest.$ac_objext"'
11469   { (eval echo "$as_me:11469: \"$ac_try\"") >&5
11470   (eval $ac_try) 2>&5
11471   ac_status=$?
11472   echo "$as_me:11472: \$? = $ac_status" >&5
11473   (exit "$ac_status"); }; }; then
11474   :
11475 else
11476   echo "$as_me: failed program was:" >&5
11477 cat "conftest.$ac_ext" >&5
11478 cf_have_incdir=yes
11479 fi
11480 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11481                           CPPFLAGS=$cf_save_CPPFLAGS
11482                         fi
11483                   fi
11484                 fi
11485
11486                 if test "$cf_have_incdir" = no ; then
11487                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11488
11489 echo "${as_me:-configure}:11489: testing adding $cf_add_incdir to include-path ..." 1>&5
11490
11491                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11492
11493                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11494                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11495                   cf_add_incdir="$cf_top_incdir"
11496                 else
11497                   break
11498                 fi
11499           else
11500                 break
11501           fi
11502         done
11503   done
11504 fi
11505
11506                 for cf_header in \
11507                         ncurses.h \
11508                         curses.h
11509                 do
11510
11511         cat >"conftest.$ac_ext" <<_ACEOF
11512 #line 11512 "configure"
11513 #include "confdefs.h"
11514
11515 #include <$cf_header>
11516 int
11517 main (void)
11518 {
11519
11520 #ifdef NCURSES_VERSION
11521
11522 printf("%s\\n", NCURSES_VERSION);
11523 #else
11524 #ifdef __NCURSES_H
11525 printf("old\\n");
11526 #else
11527         make an error
11528 #endif
11529 #endif
11530
11531   ;
11532   return 0;
11533 }
11534 _ACEOF
11535 rm -f "conftest.$ac_objext"
11536 if { (eval echo "$as_me:11536: \"$ac_compile\"") >&5
11537   (eval $ac_compile) 2>&5
11538   ac_status=$?
11539   echo "$as_me:11539: \$? = $ac_status" >&5
11540   (exit "$ac_status"); } &&
11541          { ac_try='test -s "conftest.$ac_objext"'
11542   { (eval echo "$as_me:11542: \"$ac_try\"") >&5
11543   (eval $ac_try) 2>&5
11544   ac_status=$?
11545   echo "$as_me:11545: \$? = $ac_status" >&5
11546   (exit "$ac_status"); }; }; then
11547   cf_cv_ncurses_h2=$cf_header
11548
11549 else
11550   echo "$as_me: failed program was:" >&5
11551 cat "conftest.$ac_ext" >&5
11552 cf_cv_ncurses_h2=no
11553 fi
11554 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11555
11556                         if test "$cf_cv_ncurses_h2" != no ; then
11557                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11558                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11559                                 break
11560                         fi
11561                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11562                 done
11563                 CPPFLAGS="$cf_save2_CPPFLAGS"
11564                 test "$cf_cv_ncurses_h2" != no && break
11565         done
11566         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11566: error: not found" >&5
11567 echo "$as_me: error: not found" >&2;}
11568    { (exit 1); exit 1; }; }
11569
11570 fi
11571 echo "$as_me:11571: result: $cf_cv_ncurses_h2" >&5
11572 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11573
11574         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11575         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11576         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11577                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11578         fi
11579
11580 if test -n "$cf_1st_incdir" ; then
11581   for cf_add_incdir in $cf_1st_incdir
11582   do
11583         while test "$cf_add_incdir" != /usr/include
11584         do
11585           if test -d "$cf_add_incdir"
11586           then
11587                 cf_have_incdir=no
11588                 if test -n "$CFLAGS$CPPFLAGS" ; then
11589                   # a loop is needed to ensure we can add subdirs of existing dirs
11590                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11591                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11592                           cf_have_incdir=yes; break
11593                         fi
11594                   done
11595                 fi
11596
11597                 if test "$cf_have_incdir" = no ; then
11598                   if test "$cf_add_incdir" = /usr/local/include ; then
11599                         if test "$GCC" = yes
11600                         then
11601                           cf_save_CPPFLAGS=$CPPFLAGS
11602
11603         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11604         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11605
11606                           cat >"conftest.$ac_ext" <<_ACEOF
11607 #line 11607 "configure"
11608 #include "confdefs.h"
11609 #include <stdio.h>
11610 int
11611 main (void)
11612 {
11613 printf("Hello")
11614   ;
11615   return 0;
11616 }
11617 _ACEOF
11618 rm -f "conftest.$ac_objext"
11619 if { (eval echo "$as_me:11619: \"$ac_compile\"") >&5
11620   (eval $ac_compile) 2>&5
11621   ac_status=$?
11622   echo "$as_me:11622: \$? = $ac_status" >&5
11623   (exit "$ac_status"); } &&
11624          { ac_try='test -s "conftest.$ac_objext"'
11625   { (eval echo "$as_me:11625: \"$ac_try\"") >&5
11626   (eval $ac_try) 2>&5
11627   ac_status=$?
11628   echo "$as_me:11628: \$? = $ac_status" >&5
11629   (exit "$ac_status"); }; }; then
11630   :
11631 else
11632   echo "$as_me: failed program was:" >&5
11633 cat "conftest.$ac_ext" >&5
11634 cf_have_incdir=yes
11635 fi
11636 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11637                           CPPFLAGS=$cf_save_CPPFLAGS
11638                         fi
11639                   fi
11640                 fi
11641
11642                 if test "$cf_have_incdir" = no ; then
11643                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11644
11645 echo "${as_me:-configure}:11645: testing adding $cf_add_incdir to include-path ..." 1>&5
11646
11647                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11648
11649                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11650                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11651                   cf_add_incdir="$cf_top_incdir"
11652                 else
11653                   break
11654                 fi
11655           else
11656                 break
11657           fi
11658         done
11659   done
11660 fi
11661
11662 fi
11663
11664 # Set definitions to allow ifdef'ing for ncurses.h
11665
11666 case "$cf_cv_ncurses_header" in
11667 (*ncurses.h)
11668
11669 cat >>confdefs.h <<\EOF
11670 #define HAVE_NCURSES_H 1
11671 EOF
11672
11673         ;;
11674 esac
11675
11676 case "$cf_cv_ncurses_header" in
11677 (ncurses/curses.h|ncurses/ncurses.h)
11678
11679 cat >>confdefs.h <<\EOF
11680 #define HAVE_NCURSES_NCURSES_H 1
11681 EOF
11682
11683         ;;
11684 (ncursesw/curses.h|ncursesw/ncurses.h)
11685
11686 cat >>confdefs.h <<\EOF
11687 #define HAVE_NCURSESW_NCURSES_H 1
11688 EOF
11689
11690         ;;
11691 esac
11692
11693 echo "$as_me:11693: checking for terminfo header" >&5
11694 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11695 if test "${cf_cv_term_header+set}" = set; then
11696   echo $ECHO_N "(cached) $ECHO_C" >&6
11697 else
11698
11699 case "${cf_cv_ncurses_header}" in
11700 (*/ncurses.h|*/ncursesw.h)
11701         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11702         ;;
11703 (*)
11704         cf_term_header=term.h
11705         ;;
11706 esac
11707
11708 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11709 do
11710 cat >"conftest.$ac_ext" <<_ACEOF
11711 #line 11711 "configure"
11712 #include "confdefs.h"
11713 #include <stdio.h>
11714 #include <${cf_cv_ncurses_header:-curses.h}>
11715 #include <$cf_test>
11716
11717 int
11718 main (void)
11719 {
11720 int x = auto_left_margin; (void)x
11721   ;
11722   return 0;
11723 }
11724 _ACEOF
11725 rm -f "conftest.$ac_objext"
11726 if { (eval echo "$as_me:11726: \"$ac_compile\"") >&5
11727   (eval $ac_compile) 2>&5
11728   ac_status=$?
11729   echo "$as_me:11729: \$? = $ac_status" >&5
11730   (exit "$ac_status"); } &&
11731          { ac_try='test -s "conftest.$ac_objext"'
11732   { (eval echo "$as_me:11732: \"$ac_try\"") >&5
11733   (eval $ac_try) 2>&5
11734   ac_status=$?
11735   echo "$as_me:11735: \$? = $ac_status" >&5
11736   (exit "$ac_status"); }; }; then
11737
11738         cf_cv_term_header="$cf_test"
11739 else
11740   echo "$as_me: failed program was:" >&5
11741 cat "conftest.$ac_ext" >&5
11742
11743         cf_cv_term_header=unknown
11744
11745 fi
11746 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11747         test "$cf_cv_term_header" != unknown && break
11748 done
11749
11750 fi
11751 echo "$as_me:11751: result: $cf_cv_term_header" >&5
11752 echo "${ECHO_T}$cf_cv_term_header" >&6
11753
11754 # Set definitions to allow ifdef'ing to accommodate subdirectories
11755
11756 case "$cf_cv_term_header" in
11757 (*term.h)
11758
11759 cat >>confdefs.h <<\EOF
11760 #define HAVE_TERM_H 1
11761 EOF
11762
11763         ;;
11764 esac
11765
11766 case "$cf_cv_term_header" in
11767 (ncurses/term.h)
11768
11769 cat >>confdefs.h <<\EOF
11770 #define HAVE_NCURSES_TERM_H 1
11771 EOF
11772
11773         ;;
11774 (ncursesw/term.h)
11775
11776 cat >>confdefs.h <<\EOF
11777 #define HAVE_NCURSESW_TERM_H 1
11778 EOF
11779
11780         ;;
11781 esac
11782
11783 # some applications need this, but should check for NCURSES_VERSION
11784
11785 cat >>confdefs.h <<\EOF
11786 #define NCURSES 1
11787 EOF
11788
11789 echo "$as_me:11789: checking for ncurses version" >&5
11790 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11791 if test "${cf_cv_ncurses_version+set}" = set; then
11792   echo $ECHO_N "(cached) $ECHO_C" >&6
11793 else
11794
11795         cf_cv_ncurses_version=no
11796         cf_tempfile=out$$
11797         rm -f "$cf_tempfile"
11798         if test "$cross_compiling" = yes; then
11799
11800         # This will not work if the preprocessor splits the line after the
11801         # Autoconf token.  The 'unproto' program does that.
11802         cat > "conftest.$ac_ext" <<EOF
11803 #include <${cf_cv_ncurses_header:-curses.h}>
11804 #undef Autoconf
11805 #ifdef NCURSES_VERSION
11806 Autoconf NCURSES_VERSION
11807 #else
11808 #ifdef __NCURSES_H
11809 Autoconf "old"
11810 #endif
11811 ;
11812 #endif
11813 EOF
11814         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11815         { (eval echo "$as_me:11815: \"$cf_try\"") >&5
11816   (eval $cf_try) 2>&5
11817   ac_status=$?
11818   echo "$as_me:11818: \$? = $ac_status" >&5
11819   (exit "$ac_status"); }
11820         if test -f conftest.out ; then
11821                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11822                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11823                 rm -f conftest.out
11824         fi
11825
11826 else
11827   cat >"conftest.$ac_ext" <<_ACEOF
11828 #line 11828 "configure"
11829 #include "confdefs.h"
11830
11831 $ac_includes_default
11832
11833 #include <${cf_cv_ncurses_header:-curses.h}>
11834
11835 int main(void)
11836 {
11837         FILE *fp = fopen("$cf_tempfile", "w");
11838 #ifdef NCURSES_VERSION
11839 # ifdef NCURSES_VERSION_PATCH
11840         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11841 # else
11842         fprintf(fp, "%s\\n", NCURSES_VERSION);
11843 # endif
11844 #else
11845 # ifdef __NCURSES_H
11846         fprintf(fp, "old\\n");
11847 # else
11848         make an error
11849 # endif
11850 #endif
11851         ${cf_cv_main_return:-return}(0);
11852 }
11853 _ACEOF
11854 rm -f "conftest$ac_exeext"
11855 if { (eval echo "$as_me:11855: \"$ac_link\"") >&5
11856   (eval $ac_link) 2>&5
11857   ac_status=$?
11858   echo "$as_me:11858: \$? = $ac_status" >&5
11859   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11860   { (eval echo "$as_me:11860: \"$ac_try\"") >&5
11861   (eval $ac_try) 2>&5
11862   ac_status=$?
11863   echo "$as_me:11863: \$? = $ac_status" >&5
11864   (exit "$ac_status"); }; }; then
11865
11866         cf_cv_ncurses_version=`cat $cf_tempfile`
11867 else
11868   echo "$as_me: program exited with status $ac_status" >&5
11869 echo "$as_me: failed program was:" >&5
11870 cat "conftest.$ac_ext" >&5
11871 fi
11872 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11873 fi
11874         rm -f "$cf_tempfile"
11875
11876 fi
11877 echo "$as_me:11877: result: $cf_cv_ncurses_version" >&5
11878 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11879 test "$cf_cv_ncurses_version" = no ||
11880 cat >>confdefs.h <<\EOF
11881 #define NCURSES 1
11882 EOF
11883
11884 cf_nculib_root=$cf_cv_screen
11885         # This works, except for the special case where we find gpm, but
11886         # ncurses is in a nonstandard location via $LIBS, and we really want
11887         # to link gpm.
11888 cf_ncurses_LIBS=""
11889 cf_ncurses_SAVE="$LIBS"
11890 echo "$as_me:11890: checking for Gpm_Open in -lgpm" >&5
11891 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11892 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11893   echo $ECHO_N "(cached) $ECHO_C" >&6
11894 else
11895   ac_check_lib_save_LIBS=$LIBS
11896 LIBS="-lgpm  $LIBS"
11897 cat >"conftest.$ac_ext" <<_ACEOF
11898 #line 11898 "configure"
11899 #include "confdefs.h"
11900
11901 /* Override any gcc2 internal prototype to avoid an error.  */
11902 #ifdef __cplusplus
11903 extern "C"
11904 #endif
11905 /* We use char because int might match the return type of a gcc2
11906    builtin and then its argument prototype would still apply.  */
11907 char Gpm_Open ();
11908 int
11909 main (void)
11910 {
11911 Gpm_Open ();
11912   ;
11913   return 0;
11914 }
11915 _ACEOF
11916 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11917 if { (eval echo "$as_me:11917: \"$ac_link\"") >&5
11918   (eval $ac_link) 2>&5
11919   ac_status=$?
11920   echo "$as_me:11920: \$? = $ac_status" >&5
11921   (exit "$ac_status"); } &&
11922          { ac_try='test -s "conftest$ac_exeext"'
11923   { (eval echo "$as_me:11923: \"$ac_try\"") >&5
11924   (eval $ac_try) 2>&5
11925   ac_status=$?
11926   echo "$as_me:11926: \$? = $ac_status" >&5
11927   (exit "$ac_status"); }; }; then
11928   ac_cv_lib_gpm_Gpm_Open=yes
11929 else
11930   echo "$as_me: failed program was:" >&5
11931 cat "conftest.$ac_ext" >&5
11932 ac_cv_lib_gpm_Gpm_Open=no
11933 fi
11934 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11935 LIBS=$ac_check_lib_save_LIBS
11936 fi
11937 echo "$as_me:11937: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11938 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11939 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11940   echo "$as_me:11940: checking for initscr in -lgpm" >&5
11941 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11942 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11943   echo $ECHO_N "(cached) $ECHO_C" >&6
11944 else
11945   ac_check_lib_save_LIBS=$LIBS
11946 LIBS="-lgpm  $LIBS"
11947 cat >"conftest.$ac_ext" <<_ACEOF
11948 #line 11948 "configure"
11949 #include "confdefs.h"
11950
11951 /* Override any gcc2 internal prototype to avoid an error.  */
11952 #ifdef __cplusplus
11953 extern "C"
11954 #endif
11955 /* We use char because int might match the return type of a gcc2
11956    builtin and then its argument prototype would still apply.  */
11957 char initscr ();
11958 int
11959 main (void)
11960 {
11961 initscr ();
11962   ;
11963   return 0;
11964 }
11965 _ACEOF
11966 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11967 if { (eval echo "$as_me:11967: \"$ac_link\"") >&5
11968   (eval $ac_link) 2>&5
11969   ac_status=$?
11970   echo "$as_me:11970: \$? = $ac_status" >&5
11971   (exit "$ac_status"); } &&
11972          { ac_try='test -s "conftest$ac_exeext"'
11973   { (eval echo "$as_me:11973: \"$ac_try\"") >&5
11974   (eval $ac_try) 2>&5
11975   ac_status=$?
11976   echo "$as_me:11976: \$? = $ac_status" >&5
11977   (exit "$ac_status"); }; }; then
11978   ac_cv_lib_gpm_initscr=yes
11979 else
11980   echo "$as_me: failed program was:" >&5
11981 cat "conftest.$ac_ext" >&5
11982 ac_cv_lib_gpm_initscr=no
11983 fi
11984 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11985 LIBS=$ac_check_lib_save_LIBS
11986 fi
11987 echo "$as_me:11987: result: $ac_cv_lib_gpm_initscr" >&5
11988 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11989 if test "$ac_cv_lib_gpm_initscr" = yes; then
11990   LIBS="$cf_ncurses_SAVE"
11991 else
11992   cf_ncurses_LIBS="-lgpm"
11993 fi
11994
11995 fi
11996
11997 case "$host_os" in
11998 (freebsd*)
11999         # This is only necessary if you are linking against an obsolete
12000         # version of ncurses (but it should do no harm, since it is static).
12001         if test "$cf_nculib_root" = ncurses ; then
12002                 echo "$as_me:12002: checking for tgoto in -lmytinfo" >&5
12003 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
12004 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
12005   echo $ECHO_N "(cached) $ECHO_C" >&6
12006 else
12007   ac_check_lib_save_LIBS=$LIBS
12008 LIBS="-lmytinfo  $LIBS"
12009 cat >"conftest.$ac_ext" <<_ACEOF
12010 #line 12010 "configure"
12011 #include "confdefs.h"
12012
12013 /* Override any gcc2 internal prototype to avoid an error.  */
12014 #ifdef __cplusplus
12015 extern "C"
12016 #endif
12017 /* We use char because int might match the return type of a gcc2
12018    builtin and then its argument prototype would still apply.  */
12019 char tgoto ();
12020 int
12021 main (void)
12022 {
12023 tgoto ();
12024   ;
12025   return 0;
12026 }
12027 _ACEOF
12028 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12029 if { (eval echo "$as_me:12029: \"$ac_link\"") >&5
12030   (eval $ac_link) 2>&5
12031   ac_status=$?
12032   echo "$as_me:12032: \$? = $ac_status" >&5
12033   (exit "$ac_status"); } &&
12034          { ac_try='test -s "conftest$ac_exeext"'
12035   { (eval echo "$as_me:12035: \"$ac_try\"") >&5
12036   (eval $ac_try) 2>&5
12037   ac_status=$?
12038   echo "$as_me:12038: \$? = $ac_status" >&5
12039   (exit "$ac_status"); }; }; then
12040   ac_cv_lib_mytinfo_tgoto=yes
12041 else
12042   echo "$as_me: failed program was:" >&5
12043 cat "conftest.$ac_ext" >&5
12044 ac_cv_lib_mytinfo_tgoto=no
12045 fi
12046 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12047 LIBS=$ac_check_lib_save_LIBS
12048 fi
12049 echo "$as_me:12049: result: $ac_cv_lib_mytinfo_tgoto" >&5
12050 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
12051 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
12052   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
12053 fi
12054
12055         fi
12056         ;;
12057 esac
12058
12059 cf_add_libs="$LIBS"
12060 # reverse order
12061 cf_add_0lib=
12062 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12063 # filter duplicates
12064 for cf_add_1lib in $cf_add_0lib; do
12065         for cf_add_2lib in $cf_add_libs; do
12066                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12067                         cf_add_1lib=
12068                         break
12069                 fi
12070         done
12071         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12072 done
12073 LIBS="$cf_add_libs"
12074
12075 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
12076 then
12077
12078 cf_add_libs="$LIBS"
12079 # reverse order
12080 cf_add_0lib=
12081 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12082 # filter duplicates
12083 for cf_add_1lib in $cf_add_0lib; do
12084         for cf_add_2lib in $cf_add_libs; do
12085                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12086                         cf_add_1lib=
12087                         break
12088                 fi
12089         done
12090         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12091 done
12092 LIBS="$cf_add_libs"
12093
12094 else
12095
12096         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
12097         cf_libdir=""
12098         echo "$as_me:12098: checking for initscr" >&5
12099 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
12100 if test "${ac_cv_func_initscr+set}" = set; then
12101   echo $ECHO_N "(cached) $ECHO_C" >&6
12102 else
12103   cat >"conftest.$ac_ext" <<_ACEOF
12104 #line 12104 "configure"
12105 #include "confdefs.h"
12106 #define initscr autoconf_temporary
12107 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12108 #undef initscr
12109
12110 #ifdef __cplusplus
12111 extern "C"
12112 #endif
12113
12114 /* We use char because int might match the return type of a gcc2
12115    builtin and then its argument prototype would still apply.  */
12116 char initscr (void);
12117
12118 int
12119 main (void)
12120 {
12121
12122 /* The GNU C library defines stubs for functions which it implements
12123     to always fail with ENOSYS.  Some functions are actually named
12124     something starting with __ and the normal name is an alias.  */
12125 #if defined (__stub_initscr) || defined (__stub___initscr)
12126 #error found stub for initscr
12127 #endif
12128
12129         return initscr ();
12130   ;
12131   return 0;
12132 }
12133 _ACEOF
12134 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12135 if { (eval echo "$as_me:12135: \"$ac_link\"") >&5
12136   (eval $ac_link) 2>&5
12137   ac_status=$?
12138   echo "$as_me:12138: \$? = $ac_status" >&5
12139   (exit "$ac_status"); } &&
12140          { ac_try='test -s "conftest$ac_exeext"'
12141   { (eval echo "$as_me:12141: \"$ac_try\"") >&5
12142   (eval $ac_try) 2>&5
12143   ac_status=$?
12144   echo "$as_me:12144: \$? = $ac_status" >&5
12145   (exit "$ac_status"); }; }; then
12146   ac_cv_func_initscr=yes
12147 else
12148   echo "$as_me: failed program was:" >&5
12149 cat "conftest.$ac_ext" >&5
12150 ac_cv_func_initscr=no
12151 fi
12152 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12153 fi
12154 echo "$as_me:12154: result: $ac_cv_func_initscr" >&5
12155 echo "${ECHO_T}$ac_cv_func_initscr" >&6
12156 if test "$ac_cv_func_initscr" = yes; then
12157   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12158 else
12159
12160                 cf_save_LIBS="$LIBS"
12161                 echo "$as_me:12161: checking for initscr in -l$cf_nculib_root" >&5
12162 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
12163                 LIBS="-l$cf_nculib_root $LIBS"
12164                 cat >"conftest.$ac_ext" <<_ACEOF
12165 #line 12165 "configure"
12166 #include "confdefs.h"
12167 #include <${cf_cv_ncurses_header:-curses.h}>
12168 int
12169 main (void)
12170 {
12171 initscr()
12172   ;
12173   return 0;
12174 }
12175 _ACEOF
12176 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12177 if { (eval echo "$as_me:12177: \"$ac_link\"") >&5
12178   (eval $ac_link) 2>&5
12179   ac_status=$?
12180   echo "$as_me:12180: \$? = $ac_status" >&5
12181   (exit "$ac_status"); } &&
12182          { ac_try='test -s "conftest$ac_exeext"'
12183   { (eval echo "$as_me:12183: \"$ac_try\"") >&5
12184   (eval $ac_try) 2>&5
12185   ac_status=$?
12186   echo "$as_me:12186: \$? = $ac_status" >&5
12187   (exit "$ac_status"); }; }; then
12188   echo "$as_me:12188: result: yes" >&5
12189 echo "${ECHO_T}yes" >&6
12190                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12191
12192 else
12193   echo "$as_me: failed program was:" >&5
12194 cat "conftest.$ac_ext" >&5
12195 echo "$as_me:12195: result: no" >&5
12196 echo "${ECHO_T}no" >&6
12197
12198 cf_search=
12199 cf_library_path_list=""
12200 if test -n "${LDFLAGS}${LIBS}" ; then
12201         for cf_library_path in $LDFLAGS $LIBS
12202         do
12203                 case "$cf_library_path" in
12204                 (-L*)
12205                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
12206
12207 test "x$cf_library_path" != "xNONE" && \
12208 test -d "$cf_library_path" && \
12209  {
12210         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
12211         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
12212         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
12213         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
12214         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
12215         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"
12216 }
12217
12218                         cf_library_path_list="$cf_library_path_list $cf_search"
12219                         ;;
12220                 esac
12221         done
12222 fi
12223
12224 cf_search=
12225
12226 test "x$prefix" != "xNONE" && \
12227 test -d "$prefix" && \
12228  {
12229         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
12230         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
12231         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
12232         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
12233         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
12234         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
12235 }
12236
12237 for cf_subdir_prefix in \
12238         /usr \
12239         /usr/local \
12240         /usr/pkg \
12241         /opt \
12242         /opt/local \
12243         $HOME
12244 do
12245
12246 test "x$cf_subdir_prefix" != "x$prefix" && \
12247 test -d "$cf_subdir_prefix" && \
12248 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
12249         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
12250         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
12251         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
12252         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
12253         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
12254         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"
12255 }
12256
12257 done
12258
12259 cf_search="$cf_library_path_list $cf_search"
12260
12261                         for cf_libdir in $cf_search
12262                         do
12263                                 echo "$as_me:12263: checking for -l$cf_nculib_root in $cf_libdir" >&5
12264 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
12265                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
12266                                 cat >"conftest.$ac_ext" <<_ACEOF
12267 #line 12267 "configure"
12268 #include "confdefs.h"
12269 #include <${cf_cv_ncurses_header:-curses.h}>
12270 int
12271 main (void)
12272 {
12273 initscr()
12274   ;
12275   return 0;
12276 }
12277 _ACEOF
12278 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12279 if { (eval echo "$as_me:12279: \"$ac_link\"") >&5
12280   (eval $ac_link) 2>&5
12281   ac_status=$?
12282   echo "$as_me:12282: \$? = $ac_status" >&5
12283   (exit "$ac_status"); } &&
12284          { ac_try='test -s "conftest$ac_exeext"'
12285   { (eval echo "$as_me:12285: \"$ac_try\"") >&5
12286   (eval $ac_try) 2>&5
12287   ac_status=$?
12288   echo "$as_me:12288: \$? = $ac_status" >&5
12289   (exit "$ac_status"); }; }; then
12290   echo "$as_me:12290: result: yes" >&5
12291 echo "${ECHO_T}yes" >&6
12292                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12293                                          break
12294 else
12295   echo "$as_me: failed program was:" >&5
12296 cat "conftest.$ac_ext" >&5
12297 echo "$as_me:12297: result: no" >&5
12298 echo "${ECHO_T}no" >&6
12299                                          LIBS="$cf_save_LIBS"
12300 fi
12301 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12302                         done
12303
12304 fi
12305 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12306
12307 fi
12308
12309 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
12310
12311 if test "$cf_found_library" = no ; then
12312         { { echo "$as_me:12312: error: Cannot link $cf_nculib_root library" >&5
12313 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
12314    { (exit 1); exit 1; }; }
12315 fi
12316
12317 fi
12318
12319 if test -n "$cf_ncurses_LIBS" ; then
12320         echo "$as_me:12320: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
12321 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
12322         cf_ncurses_SAVE="$LIBS"
12323         for p in $cf_ncurses_LIBS ; do
12324                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
12325                 if test "$q" != "$LIBS" ; then
12326                         LIBS="$q"
12327                 fi
12328         done
12329         cat >"conftest.$ac_ext" <<_ACEOF
12330 #line 12330 "configure"
12331 #include "confdefs.h"
12332 #include <${cf_cv_ncurses_header:-curses.h}>
12333 int
12334 main (void)
12335 {
12336 initscr(); mousemask(0,0); tigetstr((char *)0);
12337   ;
12338   return 0;
12339 }
12340 _ACEOF
12341 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12342 if { (eval echo "$as_me:12342: \"$ac_link\"") >&5
12343   (eval $ac_link) 2>&5
12344   ac_status=$?
12345   echo "$as_me:12345: \$? = $ac_status" >&5
12346   (exit "$ac_status"); } &&
12347          { ac_try='test -s "conftest$ac_exeext"'
12348   { (eval echo "$as_me:12348: \"$ac_try\"") >&5
12349   (eval $ac_try) 2>&5
12350   ac_status=$?
12351   echo "$as_me:12351: \$? = $ac_status" >&5
12352   (exit "$ac_status"); }; }; then
12353   echo "$as_me:12353: result: yes" >&5
12354 echo "${ECHO_T}yes" >&6
12355 else
12356   echo "$as_me: failed program was:" >&5
12357 cat "conftest.$ac_ext" >&5
12358 echo "$as_me:12358: result: no" >&5
12359 echo "${ECHO_T}no" >&6
12360                  LIBS="$cf_ncurses_SAVE"
12361 fi
12362 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12363 fi
12364
12365 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12366
12367 cat >>confdefs.h <<EOF
12368 #define $cf_nculib_ROOT 1
12369 EOF
12370
12371         fi
12372 else
12373         NCURSES_CONFIG=none
12374 fi
12375
12376         ;;
12377 (pdcurses)
12378         echo "$as_me:12378: checking for X" >&5
12379 echo $ECHO_N "checking for X... $ECHO_C" >&6
12380
12381 # Check whether --with-x or --without-x was given.
12382 if test "${with_x+set}" = set; then
12383   withval="$with_x"
12384
12385 fi;
12386 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
12387 if test "x$with_x" = xno; then
12388   # The user explicitly disabled X.
12389   have_x=disabled
12390 else
12391   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12392     # Both variables are already set.
12393     have_x=yes
12394   else
12395     if test "${ac_cv_have_x+set}" = set; then
12396   echo $ECHO_N "(cached) $ECHO_C" >&6
12397 else
12398   # One or both of the vars are not set, and there is no cached value.
12399 ac_x_includes=no ac_x_libraries=no
12400 rm -fr conftest.dir
12401 if mkdir conftest.dir; then
12402   cd conftest.dir
12403   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12404   cat >Imakefile <<'EOF'
12405 acfindx:
12406         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12407 EOF
12408   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12409     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
12410     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
12411     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12412     for ac_extension in a so sl dylib dll; do
12413       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12414          test -f "$ac_im_libdir/libX11.$ac_extension"; then
12415         ac_im_usrlibdir=$ac_im_libdir; break
12416       fi
12417     done
12418     # Screen out bogus values from the imake configuration.  They are
12419     # bogus both because they are the default anyway, and because
12420     # using them would break gcc on systems where it needs fixed includes.
12421     case $ac_im_incroot in
12422         /usr/include) ;;
12423         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12424     esac
12425     case $ac_im_usrlibdir in
12426         /usr/lib | /lib) ;;
12427         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12428     esac
12429   fi
12430   cd ..
12431   rm -fr conftest.dir
12432 fi
12433
12434 # Standard set of common directories for X headers.
12435 # Check X11 before X11Rn because it is often a symlink to the current release.
12436 ac_x_header_dirs='
12437 /usr/X11/include
12438 /usr/X11R7/include
12439 /usr/X11R6/include
12440 /usr/X11R5/include
12441 /usr/X11R4/include
12442
12443 /opt/local/include
12444 /opt/X11/include
12445
12446 /usr/include/X11
12447 /usr/include/X11R7
12448 /usr/include/X11R6
12449 /usr/include/X11R5
12450 /usr/include/X11R4
12451
12452 /usr/local/X11/include
12453 /usr/local/X11R7/include
12454 /usr/local/X11R6/include
12455 /usr/local/X11R5/include
12456 /usr/local/X11R4/include
12457
12458 /usr/local/include/X11
12459 /usr/local/include/X11R7
12460 /usr/local/include/X11R6
12461 /usr/local/include/X11R5
12462 /usr/local/include/X11R4
12463
12464 /usr/X386/include
12465 /usr/x386/include
12466 /usr/XFree86/include/X11
12467
12468 /usr/include
12469 /usr/local/include
12470 /usr/unsupported/include
12471 /usr/athena/include
12472 /usr/local/x11r5/include
12473 /usr/lpp/Xamples/include
12474
12475 /usr/openwin/include
12476 /usr/openwin/share/include'
12477
12478 if test "$ac_x_includes" = no; then
12479   # Guess where to find include files, by looking for Intrinsic.h.
12480   # First, try using that file with no special directory specified.
12481   cat >"conftest.$ac_ext" <<_ACEOF
12482 #line 12482 "configure"
12483 #include "confdefs.h"
12484 #include <X11/Intrinsic.h>
12485 _ACEOF
12486 if { (eval echo "$as_me:12486: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12487   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12488   ac_status=$?
12489   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12490   rm -f conftest.er1
12491   cat conftest.err >&5
12492   echo "$as_me:12492: \$? = $ac_status" >&5
12493   (exit "$ac_status"); } >/dev/null; then
12494   if test -s conftest.err; then
12495     ac_cpp_err=$ac_c_preproc_warn_flag
12496   else
12497     ac_cpp_err=
12498   fi
12499 else
12500   ac_cpp_err=yes
12501 fi
12502 if test -z "$ac_cpp_err"; then
12503   # We can compile using X headers with no special include directory.
12504 ac_x_includes=
12505 else
12506   echo "$as_me: failed program was:" >&5
12507   cat "conftest.$ac_ext" >&5
12508   for ac_dir in $ac_x_header_dirs; do
12509   if test -r "$ac_dir/X11/Intrinsic.h"; then
12510     ac_x_includes=$ac_dir
12511     break
12512   fi
12513 done
12514 fi
12515 rm -f conftest.err "conftest.$ac_ext"
12516 fi # $ac_x_includes = no
12517
12518 if test "$ac_x_libraries" = no; then
12519   # Check for the libraries.
12520   # See if we find them without any special options.
12521   # Don't add to $LIBS permanently.
12522   ac_save_LIBS=$LIBS
12523   LIBS="-lXt $LIBS"
12524   cat >"conftest.$ac_ext" <<_ACEOF
12525 #line 12525 "configure"
12526 #include "confdefs.h"
12527 #include <X11/Intrinsic.h>
12528 int
12529 main (void)
12530 {
12531 XtMalloc (0)
12532   ;
12533   return 0;
12534 }
12535 _ACEOF
12536 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12537 if { (eval echo "$as_me:12537: \"$ac_link\"") >&5
12538   (eval $ac_link) 2>&5
12539   ac_status=$?
12540   echo "$as_me:12540: \$? = $ac_status" >&5
12541   (exit "$ac_status"); } &&
12542          { ac_try='test -s "conftest$ac_exeext"'
12543   { (eval echo "$as_me:12543: \"$ac_try\"") >&5
12544   (eval $ac_try) 2>&5
12545   ac_status=$?
12546   echo "$as_me:12546: \$? = $ac_status" >&5
12547   (exit "$ac_status"); }; }; then
12548   LIBS=$ac_save_LIBS
12549 # We can link X programs with no special library path.
12550 ac_x_libraries=
12551 else
12552   echo "$as_me: failed program was:" >&5
12553 cat "conftest.$ac_ext" >&5
12554 LIBS=$ac_save_LIBS
12555 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12556 do
12557   # Don't even attempt the hair of trying to link an X program!
12558   for ac_extension in a so sl dylib dll; do
12559     if test -r "$ac_dir/libXt.$ac_extension"; then
12560       ac_x_libraries=$ac_dir
12561       break 2
12562     fi
12563   done
12564 done
12565 fi
12566 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12567 fi # $ac_x_libraries = no
12568
12569 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12570   # Didn't find X anywhere.  Cache the known absence of X.
12571   ac_cv_have_x="have_x=no"
12572 else
12573   # Record where we found X for the cache.
12574   ac_cv_have_x="have_x=yes \
12575                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12576 fi
12577 fi
12578
12579   fi
12580   eval "$ac_cv_have_x"
12581 fi # $with_x != no
12582
12583 if test "$have_x" != yes; then
12584   echo "$as_me:12584: result: $have_x" >&5
12585 echo "${ECHO_T}$have_x" >&6
12586   no_x=yes
12587 else
12588   # If each of the values was on the command line, it overrides each guess.
12589   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12590   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12591   # Update the cache value to reflect the command line values.
12592   ac_cv_have_x="have_x=yes \
12593                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12594   echo "$as_me:12594: result: libraries $x_libraries, headers $x_includes" >&5
12595 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12596 fi
12597
12598 if test "$no_x" = yes; then
12599   # Not all programs may use this symbol, but it does not hurt to define it.
12600
12601 cat >>confdefs.h <<\EOF
12602 #define X_DISPLAY_MISSING 1
12603 EOF
12604
12605   X_CFLAGS=
12606   X_PRE_LIBS=
12607   X_LIBS=
12608   X_EXTRA_LIBS=
12609 else
12610   if test -n "$x_includes"; then
12611     X_CFLAGS="$X_CFLAGS -I$x_includes"
12612   fi
12613
12614   # It would also be nice to do this for all -L options, not just this one.
12615   if test -n "$x_libraries"; then
12616     X_LIBS="$X_LIBS -L$x_libraries"
12617     # For Solaris; some versions of Sun CC require a space after -R and
12618     # others require no space.  Words are not sufficient . . . .
12619     case `(uname -sr) 2>/dev/null` in
12620     "SunOS 5"*)
12621       echo "$as_me:12621: checking whether -R must be followed by a space" >&5
12622 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12623       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12624       cat >"conftest.$ac_ext" <<_ACEOF
12625 #line 12625 "configure"
12626 #include "confdefs.h"
12627
12628 int
12629 main (void)
12630 {
12631
12632   ;
12633   return 0;
12634 }
12635 _ACEOF
12636 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12637 if { (eval echo "$as_me:12637: \"$ac_link\"") >&5
12638   (eval $ac_link) 2>&5
12639   ac_status=$?
12640   echo "$as_me:12640: \$? = $ac_status" >&5
12641   (exit "$ac_status"); } &&
12642          { ac_try='test -s "conftest$ac_exeext"'
12643   { (eval echo "$as_me:12643: \"$ac_try\"") >&5
12644   (eval $ac_try) 2>&5
12645   ac_status=$?
12646   echo "$as_me:12646: \$? = $ac_status" >&5
12647   (exit "$ac_status"); }; }; then
12648   ac_R_nospace=yes
12649 else
12650   echo "$as_me: failed program was:" >&5
12651 cat "conftest.$ac_ext" >&5
12652 ac_R_nospace=no
12653 fi
12654 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12655       if test $ac_R_nospace = yes; then
12656         echo "$as_me:12656: result: no" >&5
12657 echo "${ECHO_T}no" >&6
12658         X_LIBS="$X_LIBS -R$x_libraries"
12659       else
12660         LIBS="$ac_xsave_LIBS -R $x_libraries"
12661         cat >"conftest.$ac_ext" <<_ACEOF
12662 #line 12662 "configure"
12663 #include "confdefs.h"
12664
12665 int
12666 main (void)
12667 {
12668
12669   ;
12670   return 0;
12671 }
12672 _ACEOF
12673 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12674 if { (eval echo "$as_me:12674: \"$ac_link\"") >&5
12675   (eval $ac_link) 2>&5
12676   ac_status=$?
12677   echo "$as_me:12677: \$? = $ac_status" >&5
12678   (exit "$ac_status"); } &&
12679          { ac_try='test -s "conftest$ac_exeext"'
12680   { (eval echo "$as_me:12680: \"$ac_try\"") >&5
12681   (eval $ac_try) 2>&5
12682   ac_status=$?
12683   echo "$as_me:12683: \$? = $ac_status" >&5
12684   (exit "$ac_status"); }; }; then
12685   ac_R_space=yes
12686 else
12687   echo "$as_me: failed program was:" >&5
12688 cat "conftest.$ac_ext" >&5
12689 ac_R_space=no
12690 fi
12691 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12692         if test $ac_R_space = yes; then
12693           echo "$as_me:12693: result: yes" >&5
12694 echo "${ECHO_T}yes" >&6
12695           X_LIBS="$X_LIBS -R $x_libraries"
12696         else
12697           echo "$as_me:12697: result: neither works" >&5
12698 echo "${ECHO_T}neither works" >&6
12699         fi
12700       fi
12701       LIBS=$ac_xsave_LIBS
12702     esac
12703   fi
12704
12705   # Check for system-dependent libraries X programs must link with.
12706   # Do this before checking for the system-independent R6 libraries
12707   # (-lICE), since we may need -lsocket or whatever for X linking.
12708
12709   if test "$ISC" = yes; then
12710     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12711   else
12712     # Martyn Johnson says this is needed for Ultrix, if the X
12713     # libraries were built with DECnet support.  And Karl Berry says
12714     # the Alpha needs dnet_stub (dnet does not exist).
12715     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12716     cat >"conftest.$ac_ext" <<_ACEOF
12717 #line 12717 "configure"
12718 #include "confdefs.h"
12719
12720 /* Override any gcc2 internal prototype to avoid an error.  */
12721 #ifdef __cplusplus
12722 extern "C"
12723 #endif
12724 /* We use char because int might match the return type of a gcc2
12725    builtin and then its argument prototype would still apply.  */
12726 char XOpenDisplay ();
12727 int
12728 main (void)
12729 {
12730 XOpenDisplay ();
12731   ;
12732   return 0;
12733 }
12734 _ACEOF
12735 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12736 if { (eval echo "$as_me:12736: \"$ac_link\"") >&5
12737   (eval $ac_link) 2>&5
12738   ac_status=$?
12739   echo "$as_me:12739: \$? = $ac_status" >&5
12740   (exit "$ac_status"); } &&
12741          { ac_try='test -s "conftest$ac_exeext"'
12742   { (eval echo "$as_me:12742: \"$ac_try\"") >&5
12743   (eval $ac_try) 2>&5
12744   ac_status=$?
12745   echo "$as_me:12745: \$? = $ac_status" >&5
12746   (exit "$ac_status"); }; }; then
12747   :
12748 else
12749   echo "$as_me: failed program was:" >&5
12750 cat "conftest.$ac_ext" >&5
12751 echo "$as_me:12751: checking for dnet_ntoa in -ldnet" >&5
12752 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12753 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12754   echo $ECHO_N "(cached) $ECHO_C" >&6
12755 else
12756   ac_check_lib_save_LIBS=$LIBS
12757 LIBS="-ldnet  $LIBS"
12758 cat >"conftest.$ac_ext" <<_ACEOF
12759 #line 12759 "configure"
12760 #include "confdefs.h"
12761
12762 /* Override any gcc2 internal prototype to avoid an error.  */
12763 #ifdef __cplusplus
12764 extern "C"
12765 #endif
12766 /* We use char because int might match the return type of a gcc2
12767    builtin and then its argument prototype would still apply.  */
12768 char dnet_ntoa ();
12769 int
12770 main (void)
12771 {
12772 dnet_ntoa ();
12773   ;
12774   return 0;
12775 }
12776 _ACEOF
12777 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12778 if { (eval echo "$as_me:12778: \"$ac_link\"") >&5
12779   (eval $ac_link) 2>&5
12780   ac_status=$?
12781   echo "$as_me:12781: \$? = $ac_status" >&5
12782   (exit "$ac_status"); } &&
12783          { ac_try='test -s "conftest$ac_exeext"'
12784   { (eval echo "$as_me:12784: \"$ac_try\"") >&5
12785   (eval $ac_try) 2>&5
12786   ac_status=$?
12787   echo "$as_me:12787: \$? = $ac_status" >&5
12788   (exit "$ac_status"); }; }; then
12789   ac_cv_lib_dnet_dnet_ntoa=yes
12790 else
12791   echo "$as_me: failed program was:" >&5
12792 cat "conftest.$ac_ext" >&5
12793 ac_cv_lib_dnet_dnet_ntoa=no
12794 fi
12795 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12796 LIBS=$ac_check_lib_save_LIBS
12797 fi
12798 echo "$as_me:12798: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12799 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12800 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12801   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12802 fi
12803
12804     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12805       echo "$as_me:12805: checking for dnet_ntoa in -ldnet_stub" >&5
12806 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12807 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12808   echo $ECHO_N "(cached) $ECHO_C" >&6
12809 else
12810   ac_check_lib_save_LIBS=$LIBS
12811 LIBS="-ldnet_stub  $LIBS"
12812 cat >"conftest.$ac_ext" <<_ACEOF
12813 #line 12813 "configure"
12814 #include "confdefs.h"
12815
12816 /* Override any gcc2 internal prototype to avoid an error.  */
12817 #ifdef __cplusplus
12818 extern "C"
12819 #endif
12820 /* We use char because int might match the return type of a gcc2
12821    builtin and then its argument prototype would still apply.  */
12822 char dnet_ntoa ();
12823 int
12824 main (void)
12825 {
12826 dnet_ntoa ();
12827   ;
12828   return 0;
12829 }
12830 _ACEOF
12831 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12832 if { (eval echo "$as_me:12832: \"$ac_link\"") >&5
12833   (eval $ac_link) 2>&5
12834   ac_status=$?
12835   echo "$as_me:12835: \$? = $ac_status" >&5
12836   (exit "$ac_status"); } &&
12837          { ac_try='test -s "conftest$ac_exeext"'
12838   { (eval echo "$as_me:12838: \"$ac_try\"") >&5
12839   (eval $ac_try) 2>&5
12840   ac_status=$?
12841   echo "$as_me:12841: \$? = $ac_status" >&5
12842   (exit "$ac_status"); }; }; then
12843   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12844 else
12845   echo "$as_me: failed program was:" >&5
12846 cat "conftest.$ac_ext" >&5
12847 ac_cv_lib_dnet_stub_dnet_ntoa=no
12848 fi
12849 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12850 LIBS=$ac_check_lib_save_LIBS
12851 fi
12852 echo "$as_me:12852: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12853 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12854 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12855   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12856 fi
12857
12858     fi
12859 fi
12860 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12861     LIBS="$ac_xsave_LIBS"
12862
12863     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12864     # to get the SysV transport functions.
12865     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12866     # needs -lnsl.
12867     # The nsl library prevents programs from opening the X display
12868     # on Irix 5.2, according to T.E. Dickey.
12869     # The functions gethostbyname, getservbyname, and inet_addr are
12870     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12871     echo "$as_me:12871: checking for gethostbyname" >&5
12872 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12873 if test "${ac_cv_func_gethostbyname+set}" = set; then
12874   echo $ECHO_N "(cached) $ECHO_C" >&6
12875 else
12876   cat >"conftest.$ac_ext" <<_ACEOF
12877 #line 12877 "configure"
12878 #include "confdefs.h"
12879 #define gethostbyname autoconf_temporary
12880 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12881 #undef gethostbyname
12882
12883 #ifdef __cplusplus
12884 extern "C"
12885 #endif
12886
12887 /* We use char because int might match the return type of a gcc2
12888    builtin and then its argument prototype would still apply.  */
12889 char gethostbyname (void);
12890
12891 int
12892 main (void)
12893 {
12894
12895 /* The GNU C library defines stubs for functions which it implements
12896     to always fail with ENOSYS.  Some functions are actually named
12897     something starting with __ and the normal name is an alias.  */
12898 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12899 #error found stub for gethostbyname
12900 #endif
12901
12902         return gethostbyname ();
12903   ;
12904   return 0;
12905 }
12906 _ACEOF
12907 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12908 if { (eval echo "$as_me:12908: \"$ac_link\"") >&5
12909   (eval $ac_link) 2>&5
12910   ac_status=$?
12911   echo "$as_me:12911: \$? = $ac_status" >&5
12912   (exit "$ac_status"); } &&
12913          { ac_try='test -s "conftest$ac_exeext"'
12914   { (eval echo "$as_me:12914: \"$ac_try\"") >&5
12915   (eval $ac_try) 2>&5
12916   ac_status=$?
12917   echo "$as_me:12917: \$? = $ac_status" >&5
12918   (exit "$ac_status"); }; }; then
12919   ac_cv_func_gethostbyname=yes
12920 else
12921   echo "$as_me: failed program was:" >&5
12922 cat "conftest.$ac_ext" >&5
12923 ac_cv_func_gethostbyname=no
12924 fi
12925 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12926 fi
12927 echo "$as_me:12927: result: $ac_cv_func_gethostbyname" >&5
12928 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12929
12930     if test $ac_cv_func_gethostbyname = no; then
12931       echo "$as_me:12931: checking for gethostbyname in -lnsl" >&5
12932 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12933 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12934   echo $ECHO_N "(cached) $ECHO_C" >&6
12935 else
12936   ac_check_lib_save_LIBS=$LIBS
12937 LIBS="-lnsl  $LIBS"
12938 cat >"conftest.$ac_ext" <<_ACEOF
12939 #line 12939 "configure"
12940 #include "confdefs.h"
12941
12942 /* Override any gcc2 internal prototype to avoid an error.  */
12943 #ifdef __cplusplus
12944 extern "C"
12945 #endif
12946 /* We use char because int might match the return type of a gcc2
12947    builtin and then its argument prototype would still apply.  */
12948 char gethostbyname ();
12949 int
12950 main (void)
12951 {
12952 gethostbyname ();
12953   ;
12954   return 0;
12955 }
12956 _ACEOF
12957 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12958 if { (eval echo "$as_me:12958: \"$ac_link\"") >&5
12959   (eval $ac_link) 2>&5
12960   ac_status=$?
12961   echo "$as_me:12961: \$? = $ac_status" >&5
12962   (exit "$ac_status"); } &&
12963          { ac_try='test -s "conftest$ac_exeext"'
12964   { (eval echo "$as_me:12964: \"$ac_try\"") >&5
12965   (eval $ac_try) 2>&5
12966   ac_status=$?
12967   echo "$as_me:12967: \$? = $ac_status" >&5
12968   (exit "$ac_status"); }; }; then
12969   ac_cv_lib_nsl_gethostbyname=yes
12970 else
12971   echo "$as_me: failed program was:" >&5
12972 cat "conftest.$ac_ext" >&5
12973 ac_cv_lib_nsl_gethostbyname=no
12974 fi
12975 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12976 LIBS=$ac_check_lib_save_LIBS
12977 fi
12978 echo "$as_me:12978: result: $ac_cv_lib_nsl_gethostbyname" >&5
12979 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12980 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12981   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12982 fi
12983
12984       if test $ac_cv_lib_nsl_gethostbyname = no; then
12985         echo "$as_me:12985: checking for gethostbyname in -lbsd" >&5
12986 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12987 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12988   echo $ECHO_N "(cached) $ECHO_C" >&6
12989 else
12990   ac_check_lib_save_LIBS=$LIBS
12991 LIBS="-lbsd  $LIBS"
12992 cat >"conftest.$ac_ext" <<_ACEOF
12993 #line 12993 "configure"
12994 #include "confdefs.h"
12995
12996 /* Override any gcc2 internal prototype to avoid an error.  */
12997 #ifdef __cplusplus
12998 extern "C"
12999 #endif
13000 /* We use char because int might match the return type of a gcc2
13001    builtin and then its argument prototype would still apply.  */
13002 char gethostbyname ();
13003 int
13004 main (void)
13005 {
13006 gethostbyname ();
13007   ;
13008   return 0;
13009 }
13010 _ACEOF
13011 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13012 if { (eval echo "$as_me:13012: \"$ac_link\"") >&5
13013   (eval $ac_link) 2>&5
13014   ac_status=$?
13015   echo "$as_me:13015: \$? = $ac_status" >&5
13016   (exit "$ac_status"); } &&
13017          { ac_try='test -s "conftest$ac_exeext"'
13018   { (eval echo "$as_me:13018: \"$ac_try\"") >&5
13019   (eval $ac_try) 2>&5
13020   ac_status=$?
13021   echo "$as_me:13021: \$? = $ac_status" >&5
13022   (exit "$ac_status"); }; }; then
13023   ac_cv_lib_bsd_gethostbyname=yes
13024 else
13025   echo "$as_me: failed program was:" >&5
13026 cat "conftest.$ac_ext" >&5
13027 ac_cv_lib_bsd_gethostbyname=no
13028 fi
13029 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13030 LIBS=$ac_check_lib_save_LIBS
13031 fi
13032 echo "$as_me:13032: result: $ac_cv_lib_bsd_gethostbyname" >&5
13033 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
13034 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
13035   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
13036 fi
13037
13038       fi
13039     fi
13040
13041     # lieder@skyler.mavd.honeywell.com says without -lsocket,
13042     # socket/setsockopt and other routines are undefined under SCO ODT
13043     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
13044     # on later versions), says Simon Leinen: it contains gethostby*
13045     # variants that don't use the nameserver (or something).  -lsocket
13046     # must be given before -lnsl if both are needed.  We assume that
13047     # if connect needs -lnsl, so does gethostbyname.
13048     echo "$as_me:13048: checking for connect" >&5
13049 echo $ECHO_N "checking for connect... $ECHO_C" >&6
13050 if test "${ac_cv_func_connect+set}" = set; then
13051   echo $ECHO_N "(cached) $ECHO_C" >&6
13052 else
13053   cat >"conftest.$ac_ext" <<_ACEOF
13054 #line 13054 "configure"
13055 #include "confdefs.h"
13056 #define connect autoconf_temporary
13057 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13058 #undef connect
13059
13060 #ifdef __cplusplus
13061 extern "C"
13062 #endif
13063
13064 /* We use char because int might match the return type of a gcc2
13065    builtin and then its argument prototype would still apply.  */
13066 char connect (void);
13067
13068 int
13069 main (void)
13070 {
13071
13072 /* The GNU C library defines stubs for functions which it implements
13073     to always fail with ENOSYS.  Some functions are actually named
13074     something starting with __ and the normal name is an alias.  */
13075 #if defined (__stub_connect) || defined (__stub___connect)
13076 #error found stub for connect
13077 #endif
13078
13079         return connect ();
13080   ;
13081   return 0;
13082 }
13083 _ACEOF
13084 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13085 if { (eval echo "$as_me:13085: \"$ac_link\"") >&5
13086   (eval $ac_link) 2>&5
13087   ac_status=$?
13088   echo "$as_me:13088: \$? = $ac_status" >&5
13089   (exit "$ac_status"); } &&
13090          { ac_try='test -s "conftest$ac_exeext"'
13091   { (eval echo "$as_me:13091: \"$ac_try\"") >&5
13092   (eval $ac_try) 2>&5
13093   ac_status=$?
13094   echo "$as_me:13094: \$? = $ac_status" >&5
13095   (exit "$ac_status"); }; }; then
13096   ac_cv_func_connect=yes
13097 else
13098   echo "$as_me: failed program was:" >&5
13099 cat "conftest.$ac_ext" >&5
13100 ac_cv_func_connect=no
13101 fi
13102 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13103 fi
13104 echo "$as_me:13104: result: $ac_cv_func_connect" >&5
13105 echo "${ECHO_T}$ac_cv_func_connect" >&6
13106
13107     if test $ac_cv_func_connect = no; then
13108       echo "$as_me:13108: checking for connect in -lsocket" >&5
13109 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
13110 if test "${ac_cv_lib_socket_connect+set}" = set; then
13111   echo $ECHO_N "(cached) $ECHO_C" >&6
13112 else
13113   ac_check_lib_save_LIBS=$LIBS
13114 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
13115 cat >"conftest.$ac_ext" <<_ACEOF
13116 #line 13116 "configure"
13117 #include "confdefs.h"
13118
13119 /* Override any gcc2 internal prototype to avoid an error.  */
13120 #ifdef __cplusplus
13121 extern "C"
13122 #endif
13123 /* We use char because int might match the return type of a gcc2
13124    builtin and then its argument prototype would still apply.  */
13125 char connect ();
13126 int
13127 main (void)
13128 {
13129 connect ();
13130   ;
13131   return 0;
13132 }
13133 _ACEOF
13134 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13135 if { (eval echo "$as_me:13135: \"$ac_link\"") >&5
13136   (eval $ac_link) 2>&5
13137   ac_status=$?
13138   echo "$as_me:13138: \$? = $ac_status" >&5
13139   (exit "$ac_status"); } &&
13140          { ac_try='test -s "conftest$ac_exeext"'
13141   { (eval echo "$as_me:13141: \"$ac_try\"") >&5
13142   (eval $ac_try) 2>&5
13143   ac_status=$?
13144   echo "$as_me:13144: \$? = $ac_status" >&5
13145   (exit "$ac_status"); }; }; then
13146   ac_cv_lib_socket_connect=yes
13147 else
13148   echo "$as_me: failed program was:" >&5
13149 cat "conftest.$ac_ext" >&5
13150 ac_cv_lib_socket_connect=no
13151 fi
13152 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13153 LIBS=$ac_check_lib_save_LIBS
13154 fi
13155 echo "$as_me:13155: result: $ac_cv_lib_socket_connect" >&5
13156 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
13157 if test "$ac_cv_lib_socket_connect" = yes; then
13158   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
13159 fi
13160
13161     fi
13162
13163     # Guillermo Gomez says -lposix is necessary on A/UX.
13164     echo "$as_me:13164: checking for remove" >&5
13165 echo $ECHO_N "checking for remove... $ECHO_C" >&6
13166 if test "${ac_cv_func_remove+set}" = set; then
13167   echo $ECHO_N "(cached) $ECHO_C" >&6
13168 else
13169   cat >"conftest.$ac_ext" <<_ACEOF
13170 #line 13170 "configure"
13171 #include "confdefs.h"
13172 #define remove autoconf_temporary
13173 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13174 #undef remove
13175
13176 #ifdef __cplusplus
13177 extern "C"
13178 #endif
13179
13180 /* We use char because int might match the return type of a gcc2
13181    builtin and then its argument prototype would still apply.  */
13182 char remove (void);
13183
13184 int
13185 main (void)
13186 {
13187
13188 /* The GNU C library defines stubs for functions which it implements
13189     to always fail with ENOSYS.  Some functions are actually named
13190     something starting with __ and the normal name is an alias.  */
13191 #if defined (__stub_remove) || defined (__stub___remove)
13192 #error found stub for remove
13193 #endif
13194
13195         return remove ();
13196   ;
13197   return 0;
13198 }
13199 _ACEOF
13200 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13201 if { (eval echo "$as_me:13201: \"$ac_link\"") >&5
13202   (eval $ac_link) 2>&5
13203   ac_status=$?
13204   echo "$as_me:13204: \$? = $ac_status" >&5
13205   (exit "$ac_status"); } &&
13206          { ac_try='test -s "conftest$ac_exeext"'
13207   { (eval echo "$as_me:13207: \"$ac_try\"") >&5
13208   (eval $ac_try) 2>&5
13209   ac_status=$?
13210   echo "$as_me:13210: \$? = $ac_status" >&5
13211   (exit "$ac_status"); }; }; then
13212   ac_cv_func_remove=yes
13213 else
13214   echo "$as_me: failed program was:" >&5
13215 cat "conftest.$ac_ext" >&5
13216 ac_cv_func_remove=no
13217 fi
13218 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13219 fi
13220 echo "$as_me:13220: result: $ac_cv_func_remove" >&5
13221 echo "${ECHO_T}$ac_cv_func_remove" >&6
13222
13223     if test $ac_cv_func_remove = no; then
13224       echo "$as_me:13224: checking for remove in -lposix" >&5
13225 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
13226 if test "${ac_cv_lib_posix_remove+set}" = set; then
13227   echo $ECHO_N "(cached) $ECHO_C" >&6
13228 else
13229   ac_check_lib_save_LIBS=$LIBS
13230 LIBS="-lposix  $LIBS"
13231 cat >"conftest.$ac_ext" <<_ACEOF
13232 #line 13232 "configure"
13233 #include "confdefs.h"
13234
13235 /* Override any gcc2 internal prototype to avoid an error.  */
13236 #ifdef __cplusplus
13237 extern "C"
13238 #endif
13239 /* We use char because int might match the return type of a gcc2
13240    builtin and then its argument prototype would still apply.  */
13241 char remove ();
13242 int
13243 main (void)
13244 {
13245 remove ();
13246   ;
13247   return 0;
13248 }
13249 _ACEOF
13250 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13251 if { (eval echo "$as_me:13251: \"$ac_link\"") >&5
13252   (eval $ac_link) 2>&5
13253   ac_status=$?
13254   echo "$as_me:13254: \$? = $ac_status" >&5
13255   (exit "$ac_status"); } &&
13256          { ac_try='test -s "conftest$ac_exeext"'
13257   { (eval echo "$as_me:13257: \"$ac_try\"") >&5
13258   (eval $ac_try) 2>&5
13259   ac_status=$?
13260   echo "$as_me:13260: \$? = $ac_status" >&5
13261   (exit "$ac_status"); }; }; then
13262   ac_cv_lib_posix_remove=yes
13263 else
13264   echo "$as_me: failed program was:" >&5
13265 cat "conftest.$ac_ext" >&5
13266 ac_cv_lib_posix_remove=no
13267 fi
13268 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13269 LIBS=$ac_check_lib_save_LIBS
13270 fi
13271 echo "$as_me:13271: result: $ac_cv_lib_posix_remove" >&5
13272 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
13273 if test "$ac_cv_lib_posix_remove" = yes; then
13274   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
13275 fi
13276
13277     fi
13278
13279     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
13280     echo "$as_me:13280: checking for shmat" >&5
13281 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
13282 if test "${ac_cv_func_shmat+set}" = set; then
13283   echo $ECHO_N "(cached) $ECHO_C" >&6
13284 else
13285   cat >"conftest.$ac_ext" <<_ACEOF
13286 #line 13286 "configure"
13287 #include "confdefs.h"
13288 #define shmat autoconf_temporary
13289 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13290 #undef shmat
13291
13292 #ifdef __cplusplus
13293 extern "C"
13294 #endif
13295
13296 /* We use char because int might match the return type of a gcc2
13297    builtin and then its argument prototype would still apply.  */
13298 char shmat (void);
13299
13300 int
13301 main (void)
13302 {
13303
13304 /* The GNU C library defines stubs for functions which it implements
13305     to always fail with ENOSYS.  Some functions are actually named
13306     something starting with __ and the normal name is an alias.  */
13307 #if defined (__stub_shmat) || defined (__stub___shmat)
13308 #error found stub for shmat
13309 #endif
13310
13311         return shmat ();
13312   ;
13313   return 0;
13314 }
13315 _ACEOF
13316 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13317 if { (eval echo "$as_me:13317: \"$ac_link\"") >&5
13318   (eval $ac_link) 2>&5
13319   ac_status=$?
13320   echo "$as_me:13320: \$? = $ac_status" >&5
13321   (exit "$ac_status"); } &&
13322          { ac_try='test -s "conftest$ac_exeext"'
13323   { (eval echo "$as_me:13323: \"$ac_try\"") >&5
13324   (eval $ac_try) 2>&5
13325   ac_status=$?
13326   echo "$as_me:13326: \$? = $ac_status" >&5
13327   (exit "$ac_status"); }; }; then
13328   ac_cv_func_shmat=yes
13329 else
13330   echo "$as_me: failed program was:" >&5
13331 cat "conftest.$ac_ext" >&5
13332 ac_cv_func_shmat=no
13333 fi
13334 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13335 fi
13336 echo "$as_me:13336: result: $ac_cv_func_shmat" >&5
13337 echo "${ECHO_T}$ac_cv_func_shmat" >&6
13338
13339     if test $ac_cv_func_shmat = no; then
13340       echo "$as_me:13340: checking for shmat in -lipc" >&5
13341 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
13342 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
13343   echo $ECHO_N "(cached) $ECHO_C" >&6
13344 else
13345   ac_check_lib_save_LIBS=$LIBS
13346 LIBS="-lipc  $LIBS"
13347 cat >"conftest.$ac_ext" <<_ACEOF
13348 #line 13348 "configure"
13349 #include "confdefs.h"
13350
13351 /* Override any gcc2 internal prototype to avoid an error.  */
13352 #ifdef __cplusplus
13353 extern "C"
13354 #endif
13355 /* We use char because int might match the return type of a gcc2
13356    builtin and then its argument prototype would still apply.  */
13357 char shmat ();
13358 int
13359 main (void)
13360 {
13361 shmat ();
13362   ;
13363   return 0;
13364 }
13365 _ACEOF
13366 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13367 if { (eval echo "$as_me:13367: \"$ac_link\"") >&5
13368   (eval $ac_link) 2>&5
13369   ac_status=$?
13370   echo "$as_me:13370: \$? = $ac_status" >&5
13371   (exit "$ac_status"); } &&
13372          { ac_try='test -s "conftest$ac_exeext"'
13373   { (eval echo "$as_me:13373: \"$ac_try\"") >&5
13374   (eval $ac_try) 2>&5
13375   ac_status=$?
13376   echo "$as_me:13376: \$? = $ac_status" >&5
13377   (exit "$ac_status"); }; }; then
13378   ac_cv_lib_ipc_shmat=yes
13379 else
13380   echo "$as_me: failed program was:" >&5
13381 cat "conftest.$ac_ext" >&5
13382 ac_cv_lib_ipc_shmat=no
13383 fi
13384 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13385 LIBS=$ac_check_lib_save_LIBS
13386 fi
13387 echo "$as_me:13387: result: $ac_cv_lib_ipc_shmat" >&5
13388 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
13389 if test "$ac_cv_lib_ipc_shmat" = yes; then
13390   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13391 fi
13392
13393     fi
13394   fi
13395
13396   # Check for libraries that X11R6 Xt/Xaw programs need.
13397   ac_save_LDFLAGS=$LDFLAGS
13398   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13399   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13400   # check for ICE first), but we must link in the order -lSM -lICE or
13401   # we get undefined symbols.  So assume we have SM if we have ICE.
13402   # These have to be linked with before -lX11, unlike the other
13403   # libraries we check for below, so use a different variable.
13404   # John Interrante, Karl Berry
13405   echo "$as_me:13405: checking for IceConnectionNumber in -lICE" >&5
13406 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13407 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13408   echo $ECHO_N "(cached) $ECHO_C" >&6
13409 else
13410   ac_check_lib_save_LIBS=$LIBS
13411 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
13412 cat >"conftest.$ac_ext" <<_ACEOF
13413 #line 13413 "configure"
13414 #include "confdefs.h"
13415
13416 /* Override any gcc2 internal prototype to avoid an error.  */
13417 #ifdef __cplusplus
13418 extern "C"
13419 #endif
13420 /* We use char because int might match the return type of a gcc2
13421    builtin and then its argument prototype would still apply.  */
13422 char IceConnectionNumber ();
13423 int
13424 main (void)
13425 {
13426 IceConnectionNumber ();
13427   ;
13428   return 0;
13429 }
13430 _ACEOF
13431 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13432 if { (eval echo "$as_me:13432: \"$ac_link\"") >&5
13433   (eval $ac_link) 2>&5
13434   ac_status=$?
13435   echo "$as_me:13435: \$? = $ac_status" >&5
13436   (exit "$ac_status"); } &&
13437          { ac_try='test -s "conftest$ac_exeext"'
13438   { (eval echo "$as_me:13438: \"$ac_try\"") >&5
13439   (eval $ac_try) 2>&5
13440   ac_status=$?
13441   echo "$as_me:13441: \$? = $ac_status" >&5
13442   (exit "$ac_status"); }; }; then
13443   ac_cv_lib_ICE_IceConnectionNumber=yes
13444 else
13445   echo "$as_me: failed program was:" >&5
13446 cat "conftest.$ac_ext" >&5
13447 ac_cv_lib_ICE_IceConnectionNumber=no
13448 fi
13449 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13450 LIBS=$ac_check_lib_save_LIBS
13451 fi
13452 echo "$as_me:13452: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13453 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13454 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13455   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13456 fi
13457
13458   LDFLAGS=$ac_save_LDFLAGS
13459
13460 fi
13461
13462 cf_x_athena=${cf_x_athena:-Xaw}
13463
13464 echo "$as_me:13464: checking if you want to link with Xaw 3d library" >&5
13465 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13466 withval=
13467
13468 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13469 if test "${with_Xaw3d+set}" = set; then
13470   withval="$with_Xaw3d"
13471
13472 fi;
13473 if test "$withval" = yes ; then
13474         cf_x_athena=Xaw3d
13475         echo "$as_me:13475: result: yes" >&5
13476 echo "${ECHO_T}yes" >&6
13477 else
13478         echo "$as_me:13478: result: no" >&5
13479 echo "${ECHO_T}no" >&6
13480 fi
13481
13482 echo "$as_me:13482: checking if you want to link with Xaw 3d xft library" >&5
13483 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13484 withval=
13485
13486 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13487 if test "${with_Xaw3dxft+set}" = set; then
13488   withval="$with_Xaw3dxft"
13489
13490 fi;
13491 if test "$withval" = yes ; then
13492         cf_x_athena=Xaw3dxft
13493         echo "$as_me:13493: result: yes" >&5
13494 echo "${ECHO_T}yes" >&6
13495 else
13496         echo "$as_me:13496: result: no" >&5
13497 echo "${ECHO_T}no" >&6
13498 fi
13499
13500 echo "$as_me:13500: checking if you want to link with neXT Athena library" >&5
13501 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13502 withval=
13503
13504 # Check whether --with-neXtaw or --without-neXtaw was given.
13505 if test "${with_neXtaw+set}" = set; then
13506   withval="$with_neXtaw"
13507
13508 fi;
13509 if test "$withval" = yes ; then
13510         cf_x_athena=neXtaw
13511         echo "$as_me:13511: result: yes" >&5
13512 echo "${ECHO_T}yes" >&6
13513 else
13514         echo "$as_me:13514: result: no" >&5
13515 echo "${ECHO_T}no" >&6
13516 fi
13517
13518 echo "$as_me:13518: checking if you want to link with Athena-Plus library" >&5
13519 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13520 withval=
13521
13522 # Check whether --with-XawPlus or --without-XawPlus was given.
13523 if test "${with_XawPlus+set}" = set; then
13524   withval="$with_XawPlus"
13525
13526 fi;
13527 if test "$withval" = yes ; then
13528         cf_x_athena=XawPlus
13529         echo "$as_me:13529: result: yes" >&5
13530 echo "${ECHO_T}yes" >&6
13531 else
13532         echo "$as_me:13532: result: no" >&5
13533 echo "${ECHO_T}no" >&6
13534 fi
13535
13536 cf_x_athena_lib=""
13537
13538 if test "$PKG_CONFIG" != none ; then
13539         cf_athena_list=
13540         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13541         for cf_athena_pkg in \
13542                 $cf_athena_list \
13543                 ${cf_x_athena} \
13544                 ${cf_x_athena}-devel \
13545                 lib${cf_x_athena} \
13546                 lib${cf_x_athena}-devel
13547         do
13548
13549 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13550         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13551
13552 echo "${as_me:-configure}:13552: testing found package $cf_athena_pkg ..." 1>&5
13553
13554         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13555         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13556         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13557
13558 echo "${as_me:-configure}:13558: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13559
13560         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13561
13562 echo "${as_me:-configure}:13562: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13563
13564 cf_fix_cppflags=no
13565 cf_new_cflags=
13566 cf_new_cppflags=
13567 cf_new_extra_cppflags=
13568
13569 for cf_add_cflags in $cf_pkgconfig_incs
13570 do
13571 case "$cf_fix_cppflags" in
13572 (no)
13573         case "$cf_add_cflags" in
13574         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13575                 case "$cf_add_cflags" in
13576                 (-D*)
13577                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13578
13579                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13580                                 && test -z "${cf_tst_cflags}" \
13581                                 && cf_fix_cppflags=yes
13582
13583                         if test "$cf_fix_cppflags" = yes ; then
13584
13585         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13586         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13587
13588                                 continue
13589                         elif test "${cf_tst_cflags}" = "\"'" ; then
13590
13591         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13592         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13593
13594                                 continue
13595                         fi
13596                         ;;
13597                 esac
13598                 case "$CPPFLAGS" in
13599                 (*$cf_add_cflags)
13600                         ;;
13601                 (*)
13602                         case "$cf_add_cflags" in
13603                         (-D*)
13604                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13605
13606 CPPFLAGS=`echo "$CPPFLAGS" | \
13607         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13608                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13609
13610                                 ;;
13611                         esac
13612
13613         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13614         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13615
13616                         ;;
13617                 esac
13618                 ;;
13619         (*)
13620
13621         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13622         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13623
13624                 ;;
13625         esac
13626         ;;
13627 (yes)
13628
13629         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13630         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13631
13632         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13633
13634         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13635                 && test -z "${cf_tst_cflags}" \
13636                 && cf_fix_cppflags=no
13637         ;;
13638 esac
13639 done
13640
13641 if test -n "$cf_new_cflags" ; then
13642
13643         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13644         CFLAGS="${CFLAGS}$cf_new_cflags"
13645
13646 fi
13647
13648 if test -n "$cf_new_cppflags" ; then
13649
13650         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13651         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13652
13653 fi
13654
13655 if test -n "$cf_new_extra_cppflags" ; then
13656
13657         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13658         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13659
13660 fi
13661
13662 cf_add_libs="$LIBS"
13663 # reverse order
13664 cf_add_0lib=
13665 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13666 # filter duplicates
13667 for cf_add_1lib in $cf_add_0lib; do
13668         for cf_add_2lib in $cf_add_libs; do
13669                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13670                         cf_add_1lib=
13671                         break
13672                 fi
13673         done
13674         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13675 done
13676 LIBS="$cf_add_libs"
13677
13678                         cf_x_athena_lib="$cf_pkgconfig_libs"
13679
13680 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13681
13682                         cat >>confdefs.h <<EOF
13683 #define $cf_x_athena_LIBS 1
13684 EOF
13685
13686         for cf_trim_lib in Xmu Xt X11
13687         do
13688                 case "$LIBS" in
13689                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13690                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13691                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13692
13693 echo "${as_me:-configure}:13693: testing ..trimmed $LIBS ..." 1>&5
13694
13695                         ;;
13696                 esac
13697         done
13698
13699 echo "$as_me:13699: checking for usable $cf_x_athena/Xmu package" >&5
13700 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13701 if test "${cf_cv_xaw_compat+set}" = set; then
13702   echo $ECHO_N "(cached) $ECHO_C" >&6
13703 else
13704
13705 cat >"conftest.$ac_ext" <<_ACEOF
13706 #line 13706 "configure"
13707 #include "confdefs.h"
13708
13709 #include <X11/Xmu/CharSet.h>
13710
13711 int
13712 main (void)
13713 {
13714
13715 int check = XmuCompareISOLatin1("big", "small");
13716 (void)check;
13717
13718   ;
13719   return 0;
13720 }
13721 _ACEOF
13722 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13723 if { (eval echo "$as_me:13723: \"$ac_link\"") >&5
13724   (eval $ac_link) 2>&5
13725   ac_status=$?
13726   echo "$as_me:13726: \$? = $ac_status" >&5
13727   (exit "$ac_status"); } &&
13728          { ac_try='test -s "conftest$ac_exeext"'
13729   { (eval echo "$as_me:13729: \"$ac_try\"") >&5
13730   (eval $ac_try) 2>&5
13731   ac_status=$?
13732   echo "$as_me:13732: \$? = $ac_status" >&5
13733   (exit "$ac_status"); }; }; then
13734   cf_cv_xaw_compat=yes
13735 else
13736   echo "$as_me: failed program was:" >&5
13737 cat "conftest.$ac_ext" >&5
13738 cf_cv_xaw_compat=no
13739 fi
13740 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13741 fi
13742 echo "$as_me:13742: result: $cf_cv_xaw_compat" >&5
13743 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13744
13745                         if test "$cf_cv_xaw_compat" = no
13746                         then
13747                                 # workaround for broken ".pc" files...
13748                                 case "$cf_x_athena_lib" in
13749                                 (*-lXmu*)
13750                                         ;;
13751                                 (*)
13752                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13753
13754 echo "${as_me:-configure}:13754: testing work around broken package ..." 1>&5
13755
13756                                         cf_save_xmu="$LIBS"
13757                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13758
13759 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13760         test -n "$verbose" && echo "    found package xmu" 1>&6
13761
13762 echo "${as_me:-configure}:13762: testing found package xmu ..." 1>&5
13763
13764         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13765         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13766         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13767
13768 echo "${as_me:-configure}:13768: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13769
13770         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13771
13772 echo "${as_me:-configure}:13772: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13773
13774 cf_fix_cppflags=no
13775 cf_new_cflags=
13776 cf_new_cppflags=
13777 cf_new_extra_cppflags=
13778
13779 for cf_add_cflags in $cf_pkgconfig_incs
13780 do
13781 case "$cf_fix_cppflags" in
13782 (no)
13783         case "$cf_add_cflags" in
13784         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13785                 case "$cf_add_cflags" in
13786                 (-D*)
13787                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13788
13789                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13790                                 && test -z "${cf_tst_cflags}" \
13791                                 && cf_fix_cppflags=yes
13792
13793                         if test "$cf_fix_cppflags" = yes ; then
13794
13795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13797
13798                                 continue
13799                         elif test "${cf_tst_cflags}" = "\"'" ; then
13800
13801         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13802         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13803
13804                                 continue
13805                         fi
13806                         ;;
13807                 esac
13808                 case "$CPPFLAGS" in
13809                 (*$cf_add_cflags)
13810                         ;;
13811                 (*)
13812                         case "$cf_add_cflags" in
13813                         (-D*)
13814                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13815
13816 CPPFLAGS=`echo "$CPPFLAGS" | \
13817         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13818                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13819
13820                                 ;;
13821                         esac
13822
13823         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13824         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13825
13826                         ;;
13827                 esac
13828                 ;;
13829         (*)
13830
13831         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13832         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13833
13834                 ;;
13835         esac
13836         ;;
13837 (yes)
13838
13839         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13840         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13841
13842         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13843
13844         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13845                 && test -z "${cf_tst_cflags}" \
13846                 && cf_fix_cppflags=no
13847         ;;
13848 esac
13849 done
13850
13851 if test -n "$cf_new_cflags" ; then
13852
13853         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13854         CFLAGS="${CFLAGS}$cf_new_cflags"
13855
13856 fi
13857
13858 if test -n "$cf_new_cppflags" ; then
13859
13860         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13861         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13862
13863 fi
13864
13865 if test -n "$cf_new_extra_cppflags" ; then
13866
13867         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13868         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13869
13870 fi
13871
13872 cf_add_libs="$LIBS"
13873 # reverse order
13874 cf_add_0lib=
13875 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13876 # filter duplicates
13877 for cf_add_1lib in $cf_add_0lib; do
13878         for cf_add_2lib in $cf_add_libs; do
13879                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13880                         cf_add_1lib=
13881                         break
13882                 fi
13883         done
13884         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13885 done
13886 LIBS="$cf_add_libs"
13887
13888                                                         LIBS="$cf_save_xmu"
13889
13890 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13891
13892 echo "${as_me:-configure}:13892: testing ...before $LIBS ..." 1>&5
13893
13894 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13895 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13896
13897 echo "${as_me:-configure}:13897: testing ...after  $LIBS ..." 1>&5
13898
13899 else
13900         cf_pkgconfig_incs=
13901         cf_pkgconfig_libs=
13902
13903 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13904
13905 echo "${as_me:-configure}:13905: testing ...before $LIBS ..." 1>&5
13906
13907 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13908 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13909
13910 echo "${as_me:-configure}:13910: testing ...after  $LIBS ..." 1>&5
13911
13912 fi
13913
13914         for cf_trim_lib in Xmu Xt X11
13915         do
13916                 case "$LIBS" in
13917                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13918                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13919                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13920
13921 echo "${as_me:-configure}:13921: testing ..trimmed $LIBS ..." 1>&5
13922
13923                         ;;
13924                 esac
13925         done
13926
13927                                         ;;
13928                                 esac
13929                         fi
13930
13931                         break
13932 else
13933         cf_pkgconfig_incs=
13934         cf_pkgconfig_libs=
13935         :
13936 fi
13937
13938         done
13939 fi
13940
13941 if test -z "$cf_x_athena_lib" ; then
13942
13943 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13944         test -n "$verbose" && echo "    found package Xext" 1>&6
13945
13946 echo "${as_me:-configure}:13946: testing found package Xext ..." 1>&5
13947
13948         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13949         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13950         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13951
13952 echo "${as_me:-configure}:13952: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13953
13954         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13955
13956 echo "${as_me:-configure}:13956: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13957
13958 cf_fix_cppflags=no
13959 cf_new_cflags=
13960 cf_new_cppflags=
13961 cf_new_extra_cppflags=
13962
13963 for cf_add_cflags in $cf_pkgconfig_incs
13964 do
13965 case "$cf_fix_cppflags" in
13966 (no)
13967         case "$cf_add_cflags" in
13968         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13969                 case "$cf_add_cflags" in
13970                 (-D*)
13971                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13972
13973                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13974                                 && test -z "${cf_tst_cflags}" \
13975                                 && cf_fix_cppflags=yes
13976
13977                         if test "$cf_fix_cppflags" = yes ; then
13978
13979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13981
13982                                 continue
13983                         elif test "${cf_tst_cflags}" = "\"'" ; then
13984
13985         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13986         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13987
13988                                 continue
13989                         fi
13990                         ;;
13991                 esac
13992                 case "$CPPFLAGS" in
13993                 (*$cf_add_cflags)
13994                         ;;
13995                 (*)
13996                         case "$cf_add_cflags" in
13997                         (-D*)
13998                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13999
14000 CPPFLAGS=`echo "$CPPFLAGS" | \
14001         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14002                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14003
14004                                 ;;
14005                         esac
14006
14007         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14008         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14009
14010                         ;;
14011                 esac
14012                 ;;
14013         (*)
14014
14015         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14016         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14017
14018                 ;;
14019         esac
14020         ;;
14021 (yes)
14022
14023         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14024         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14025
14026         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14027
14028         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14029                 && test -z "${cf_tst_cflags}" \
14030                 && cf_fix_cppflags=no
14031         ;;
14032 esac
14033 done
14034
14035 if test -n "$cf_new_cflags" ; then
14036
14037         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14038         CFLAGS="${CFLAGS}$cf_new_cflags"
14039
14040 fi
14041
14042 if test -n "$cf_new_cppflags" ; then
14043
14044         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14045         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14046
14047 fi
14048
14049 if test -n "$cf_new_extra_cppflags" ; then
14050
14051         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14052         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14053
14054 fi
14055
14056 cf_add_libs="$LIBS"
14057 # reverse order
14058 cf_add_0lib=
14059 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14060 # filter duplicates
14061 for cf_add_1lib in $cf_add_0lib; do
14062         for cf_add_2lib in $cf_add_libs; do
14063                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14064                         cf_add_1lib=
14065                         break
14066                 fi
14067         done
14068         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14069 done
14070 LIBS="$cf_add_libs"
14071
14072         :
14073 else
14074         cf_pkgconfig_incs=
14075         cf_pkgconfig_libs=
14076
14077         echo "$as_me:14077: checking for XextCreateExtension in -lXext" >&5
14078 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
14079 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
14080   echo $ECHO_N "(cached) $ECHO_C" >&6
14081 else
14082   ac_check_lib_save_LIBS=$LIBS
14083 LIBS="-lXext  $LIBS"
14084 cat >"conftest.$ac_ext" <<_ACEOF
14085 #line 14085 "configure"
14086 #include "confdefs.h"
14087
14088 /* Override any gcc2 internal prototype to avoid an error.  */
14089 #ifdef __cplusplus
14090 extern "C"
14091 #endif
14092 /* We use char because int might match the return type of a gcc2
14093    builtin and then its argument prototype would still apply.  */
14094 char XextCreateExtension ();
14095 int
14096 main (void)
14097 {
14098 XextCreateExtension ();
14099   ;
14100   return 0;
14101 }
14102 _ACEOF
14103 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14104 if { (eval echo "$as_me:14104: \"$ac_link\"") >&5
14105   (eval $ac_link) 2>&5
14106   ac_status=$?
14107   echo "$as_me:14107: \$? = $ac_status" >&5
14108   (exit "$ac_status"); } &&
14109          { ac_try='test -s "conftest$ac_exeext"'
14110   { (eval echo "$as_me:14110: \"$ac_try\"") >&5
14111   (eval $ac_try) 2>&5
14112   ac_status=$?
14113   echo "$as_me:14113: \$? = $ac_status" >&5
14114   (exit "$ac_status"); }; }; then
14115   ac_cv_lib_Xext_XextCreateExtension=yes
14116 else
14117   echo "$as_me: failed program was:" >&5
14118 cat "conftest.$ac_ext" >&5
14119 ac_cv_lib_Xext_XextCreateExtension=no
14120 fi
14121 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14122 LIBS=$ac_check_lib_save_LIBS
14123 fi
14124 echo "$as_me:14124: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
14125 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
14126 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
14127
14128 cf_add_libs="$LIBS"
14129 # reverse order
14130 cf_add_0lib=
14131 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14132 # filter duplicates
14133 for cf_add_1lib in $cf_add_0lib; do
14134         for cf_add_2lib in $cf_add_libs; do
14135                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14136                         cf_add_1lib=
14137                         break
14138                 fi
14139         done
14140         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14141 done
14142 LIBS="$cf_add_libs"
14143
14144 fi
14145
14146 fi
14147
14148 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
14149 # in some cases has installed dummy files in the former, other cases replaced
14150 # it with a link to the new location).  This complicates the configure script.
14151 # Check for that pitfall, and recover using pkg-config
14152 #
14153 # If none of these are set, the configuration is almost certainly broken.
14154 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
14155 then
14156
14157 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14158         test -n "$verbose" && echo "    found package x11" 1>&6
14159
14160 echo "${as_me:-configure}:14160: testing found package x11 ..." 1>&5
14161
14162         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14163         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14164         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14165
14166 echo "${as_me:-configure}:14166: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14167
14168         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14169
14170 echo "${as_me:-configure}:14170: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14171
14172 cf_fix_cppflags=no
14173 cf_new_cflags=
14174 cf_new_cppflags=
14175 cf_new_extra_cppflags=
14176
14177 for cf_add_cflags in $cf_pkgconfig_incs
14178 do
14179 case "$cf_fix_cppflags" in
14180 (no)
14181         case "$cf_add_cflags" in
14182         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14183                 case "$cf_add_cflags" in
14184                 (-D*)
14185                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14186
14187                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14188                                 && test -z "${cf_tst_cflags}" \
14189                                 && cf_fix_cppflags=yes
14190
14191                         if test "$cf_fix_cppflags" = yes ; then
14192
14193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14195
14196                                 continue
14197                         elif test "${cf_tst_cflags}" = "\"'" ; then
14198
14199         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14200         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14201
14202                                 continue
14203                         fi
14204                         ;;
14205                 esac
14206                 case "$CPPFLAGS" in
14207                 (*$cf_add_cflags)
14208                         ;;
14209                 (*)
14210                         case "$cf_add_cflags" in
14211                         (-D*)
14212                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14213
14214 CPPFLAGS=`echo "$CPPFLAGS" | \
14215         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14216                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14217
14218                                 ;;
14219                         esac
14220
14221         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14222         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14223
14224                         ;;
14225                 esac
14226                 ;;
14227         (*)
14228
14229         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14230         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14231
14232                 ;;
14233         esac
14234         ;;
14235 (yes)
14236
14237         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14238         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14239
14240         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14241
14242         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14243                 && test -z "${cf_tst_cflags}" \
14244                 && cf_fix_cppflags=no
14245         ;;
14246 esac
14247 done
14248
14249 if test -n "$cf_new_cflags" ; then
14250
14251         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14252         CFLAGS="${CFLAGS}$cf_new_cflags"
14253
14254 fi
14255
14256 if test -n "$cf_new_cppflags" ; then
14257
14258         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14259         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14260
14261 fi
14262
14263 if test -n "$cf_new_extra_cppflags" ; then
14264
14265         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14266         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14267
14268 fi
14269
14270 cf_add_libs="$LIBS"
14271 # reverse order
14272 cf_add_0lib=
14273 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14274 # filter duplicates
14275 for cf_add_1lib in $cf_add_0lib; do
14276         for cf_add_2lib in $cf_add_libs; do
14277                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14278                         cf_add_1lib=
14279                         break
14280                 fi
14281         done
14282         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14283 done
14284 LIBS="$cf_add_libs"
14285
14286         :
14287 else
14288         cf_pkgconfig_incs=
14289         cf_pkgconfig_libs=
14290         { echo "$as_me:14290: WARNING: unable to find X11 library" >&5
14291 echo "$as_me: WARNING: unable to find X11 library" >&2;}
14292 fi
14293
14294 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14295         test -n "$verbose" && echo "    found package ice" 1>&6
14296
14297 echo "${as_me:-configure}:14297: testing found package ice ..." 1>&5
14298
14299         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14300         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14301         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14302
14303 echo "${as_me:-configure}:14303: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14304
14305         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14306
14307 echo "${as_me:-configure}:14307: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14308
14309 cf_fix_cppflags=no
14310 cf_new_cflags=
14311 cf_new_cppflags=
14312 cf_new_extra_cppflags=
14313
14314 for cf_add_cflags in $cf_pkgconfig_incs
14315 do
14316 case "$cf_fix_cppflags" in
14317 (no)
14318         case "$cf_add_cflags" in
14319         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14320                 case "$cf_add_cflags" in
14321                 (-D*)
14322                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14323
14324                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14325                                 && test -z "${cf_tst_cflags}" \
14326                                 && cf_fix_cppflags=yes
14327
14328                         if test "$cf_fix_cppflags" = yes ; then
14329
14330         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14331         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14332
14333                                 continue
14334                         elif test "${cf_tst_cflags}" = "\"'" ; then
14335
14336         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14337         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14338
14339                                 continue
14340                         fi
14341                         ;;
14342                 esac
14343                 case "$CPPFLAGS" in
14344                 (*$cf_add_cflags)
14345                         ;;
14346                 (*)
14347                         case "$cf_add_cflags" in
14348                         (-D*)
14349                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14350
14351 CPPFLAGS=`echo "$CPPFLAGS" | \
14352         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14353                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14354
14355                                 ;;
14356                         esac
14357
14358         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14359         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14360
14361                         ;;
14362                 esac
14363                 ;;
14364         (*)
14365
14366         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14367         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14368
14369                 ;;
14370         esac
14371         ;;
14372 (yes)
14373
14374         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14375         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14376
14377         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14378
14379         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14380                 && test -z "${cf_tst_cflags}" \
14381                 && cf_fix_cppflags=no
14382         ;;
14383 esac
14384 done
14385
14386 if test -n "$cf_new_cflags" ; then
14387
14388         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14389         CFLAGS="${CFLAGS}$cf_new_cflags"
14390
14391 fi
14392
14393 if test -n "$cf_new_cppflags" ; then
14394
14395         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14396         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14397
14398 fi
14399
14400 if test -n "$cf_new_extra_cppflags" ; then
14401
14402         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14403         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14404
14405 fi
14406
14407 cf_add_libs="$LIBS"
14408 # reverse order
14409 cf_add_0lib=
14410 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14411 # filter duplicates
14412 for cf_add_1lib in $cf_add_0lib; do
14413         for cf_add_2lib in $cf_add_libs; do
14414                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14415                         cf_add_1lib=
14416                         break
14417                 fi
14418         done
14419         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14420 done
14421 LIBS="$cf_add_libs"
14422
14423         :
14424 else
14425         cf_pkgconfig_incs=
14426         cf_pkgconfig_libs=
14427         { echo "$as_me:14427: WARNING: unable to find ICE library" >&5
14428 echo "$as_me: WARNING: unable to find ICE library" >&2;}
14429 fi
14430
14431 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14432         test -n "$verbose" && echo "    found package sm" 1>&6
14433
14434 echo "${as_me:-configure}:14434: testing found package sm ..." 1>&5
14435
14436         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14437         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14438         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14439
14440 echo "${as_me:-configure}:14440: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14441
14442         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14443
14444 echo "${as_me:-configure}:14444: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14445
14446 cf_fix_cppflags=no
14447 cf_new_cflags=
14448 cf_new_cppflags=
14449 cf_new_extra_cppflags=
14450
14451 for cf_add_cflags in $cf_pkgconfig_incs
14452 do
14453 case "$cf_fix_cppflags" in
14454 (no)
14455         case "$cf_add_cflags" in
14456         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14457                 case "$cf_add_cflags" in
14458                 (-D*)
14459                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14460
14461                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14462                                 && test -z "${cf_tst_cflags}" \
14463                                 && cf_fix_cppflags=yes
14464
14465                         if test "$cf_fix_cppflags" = yes ; then
14466
14467         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14468         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14469
14470                                 continue
14471                         elif test "${cf_tst_cflags}" = "\"'" ; then
14472
14473         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14474         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14475
14476                                 continue
14477                         fi
14478                         ;;
14479                 esac
14480                 case "$CPPFLAGS" in
14481                 (*$cf_add_cflags)
14482                         ;;
14483                 (*)
14484                         case "$cf_add_cflags" in
14485                         (-D*)
14486                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14487
14488 CPPFLAGS=`echo "$CPPFLAGS" | \
14489         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14490                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14491
14492                                 ;;
14493                         esac
14494
14495         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14496         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14497
14498                         ;;
14499                 esac
14500                 ;;
14501         (*)
14502
14503         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14504         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14505
14506                 ;;
14507         esac
14508         ;;
14509 (yes)
14510
14511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14513
14514         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14515
14516         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14517                 && test -z "${cf_tst_cflags}" \
14518                 && cf_fix_cppflags=no
14519         ;;
14520 esac
14521 done
14522
14523 if test -n "$cf_new_cflags" ; then
14524
14525         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14526         CFLAGS="${CFLAGS}$cf_new_cflags"
14527
14528 fi
14529
14530 if test -n "$cf_new_cppflags" ; then
14531
14532         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14533         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14534
14535 fi
14536
14537 if test -n "$cf_new_extra_cppflags" ; then
14538
14539         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14540         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14541
14542 fi
14543
14544 cf_add_libs="$LIBS"
14545 # reverse order
14546 cf_add_0lib=
14547 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14548 # filter duplicates
14549 for cf_add_1lib in $cf_add_0lib; do
14550         for cf_add_2lib in $cf_add_libs; do
14551                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14552                         cf_add_1lib=
14553                         break
14554                 fi
14555         done
14556         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14557 done
14558 LIBS="$cf_add_libs"
14559
14560         :
14561 else
14562         cf_pkgconfig_incs=
14563         cf_pkgconfig_libs=
14564         { echo "$as_me:14564: WARNING: unable to find SM library" >&5
14565 echo "$as_me: WARNING: unable to find SM library" >&2;}
14566 fi
14567
14568 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14569         test -n "$verbose" && echo "    found package xt" 1>&6
14570
14571 echo "${as_me:-configure}:14571: testing found package xt ..." 1>&5
14572
14573         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14574         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14575         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14576
14577 echo "${as_me:-configure}:14577: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14578
14579         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14580
14581 echo "${as_me:-configure}:14581: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14582
14583 cf_fix_cppflags=no
14584 cf_new_cflags=
14585 cf_new_cppflags=
14586 cf_new_extra_cppflags=
14587
14588 for cf_add_cflags in $cf_pkgconfig_incs
14589 do
14590 case "$cf_fix_cppflags" in
14591 (no)
14592         case "$cf_add_cflags" in
14593         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14594                 case "$cf_add_cflags" in
14595                 (-D*)
14596                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14597
14598                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14599                                 && test -z "${cf_tst_cflags}" \
14600                                 && cf_fix_cppflags=yes
14601
14602                         if test "$cf_fix_cppflags" = yes ; then
14603
14604         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14605         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14606
14607                                 continue
14608                         elif test "${cf_tst_cflags}" = "\"'" ; then
14609
14610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14612
14613                                 continue
14614                         fi
14615                         ;;
14616                 esac
14617                 case "$CPPFLAGS" in
14618                 (*$cf_add_cflags)
14619                         ;;
14620                 (*)
14621                         case "$cf_add_cflags" in
14622                         (-D*)
14623                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14624
14625 CPPFLAGS=`echo "$CPPFLAGS" | \
14626         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14627                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14628
14629                                 ;;
14630                         esac
14631
14632         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14633         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14634
14635                         ;;
14636                 esac
14637                 ;;
14638         (*)
14639
14640         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14641         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14642
14643                 ;;
14644         esac
14645         ;;
14646 (yes)
14647
14648         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14649         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14650
14651         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14652
14653         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14654                 && test -z "${cf_tst_cflags}" \
14655                 && cf_fix_cppflags=no
14656         ;;
14657 esac
14658 done
14659
14660 if test -n "$cf_new_cflags" ; then
14661
14662         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14663         CFLAGS="${CFLAGS}$cf_new_cflags"
14664
14665 fi
14666
14667 if test -n "$cf_new_cppflags" ; then
14668
14669         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14670         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14671
14672 fi
14673
14674 if test -n "$cf_new_extra_cppflags" ; then
14675
14676         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14677         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14678
14679 fi
14680
14681 cf_add_libs="$LIBS"
14682 # reverse order
14683 cf_add_0lib=
14684 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14685 # filter duplicates
14686 for cf_add_1lib in $cf_add_0lib; do
14687         for cf_add_2lib in $cf_add_libs; do
14688                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14689                         cf_add_1lib=
14690                         break
14691                 fi
14692         done
14693         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14694 done
14695 LIBS="$cf_add_libs"
14696
14697         :
14698 else
14699         cf_pkgconfig_incs=
14700         cf_pkgconfig_libs=
14701         { echo "$as_me:14701: WARNING: unable to find Xt library" >&5
14702 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14703 fi
14704
14705 else
14706         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14707 fi
14708
14709 cf_have_X_LIBS=no
14710
14711 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14712         test -n "$verbose" && echo "    found package xt" 1>&6
14713
14714 echo "${as_me:-configure}:14714: testing found package xt ..." 1>&5
14715
14716         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14717         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14718         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14719
14720 echo "${as_me:-configure}:14720: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14721
14722         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14723
14724 echo "${as_me:-configure}:14724: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14725
14726 cf_fix_cppflags=no
14727 cf_new_cflags=
14728 cf_new_cppflags=
14729 cf_new_extra_cppflags=
14730
14731 for cf_add_cflags in $cf_pkgconfig_incs
14732 do
14733 case "$cf_fix_cppflags" in
14734 (no)
14735         case "$cf_add_cflags" in
14736         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14737                 case "$cf_add_cflags" in
14738                 (-D*)
14739                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14740
14741                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14742                                 && test -z "${cf_tst_cflags}" \
14743                                 && cf_fix_cppflags=yes
14744
14745                         if test "$cf_fix_cppflags" = yes ; then
14746
14747         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14748         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14749
14750                                 continue
14751                         elif test "${cf_tst_cflags}" = "\"'" ; then
14752
14753         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14754         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14755
14756                                 continue
14757                         fi
14758                         ;;
14759                 esac
14760                 case "$CPPFLAGS" in
14761                 (*$cf_add_cflags)
14762                         ;;
14763                 (*)
14764                         case "$cf_add_cflags" in
14765                         (-D*)
14766                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14767
14768 CPPFLAGS=`echo "$CPPFLAGS" | \
14769         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14770                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14771
14772                                 ;;
14773                         esac
14774
14775         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14776         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14777
14778                         ;;
14779                 esac
14780                 ;;
14781         (*)
14782
14783         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14784         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14785
14786                 ;;
14787         esac
14788         ;;
14789 (yes)
14790
14791         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14792         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14793
14794         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14795
14796         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14797                 && test -z "${cf_tst_cflags}" \
14798                 && cf_fix_cppflags=no
14799         ;;
14800 esac
14801 done
14802
14803 if test -n "$cf_new_cflags" ; then
14804
14805         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14806         CFLAGS="${CFLAGS}$cf_new_cflags"
14807
14808 fi
14809
14810 if test -n "$cf_new_cppflags" ; then
14811
14812         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14813         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14814
14815 fi
14816
14817 if test -n "$cf_new_extra_cppflags" ; then
14818
14819         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14820         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14821
14822 fi
14823
14824 cf_add_libs="$LIBS"
14825 # reverse order
14826 cf_add_0lib=
14827 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14828 # filter duplicates
14829 for cf_add_1lib in $cf_add_0lib; do
14830         for cf_add_2lib in $cf_add_libs; do
14831                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14832                         cf_add_1lib=
14833                         break
14834                 fi
14835         done
14836         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14837 done
14838 LIBS="$cf_add_libs"
14839
14840         case "x$LIBS" in
14841         (*-lX11*)
14842                 ;;
14843         (*)
14844 # we have an "xt" package, but it may omit Xt's dependency on X11
14845 echo "$as_me:14845: checking for usable X dependency" >&5
14846 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14847 if test "${cf_cv_xt_x11_compat+set}" = set; then
14848   echo $ECHO_N "(cached) $ECHO_C" >&6
14849 else
14850
14851 cat >"conftest.$ac_ext" <<_ACEOF
14852 #line 14852 "configure"
14853 #include "confdefs.h"
14854
14855 #include <X11/Xlib.h>
14856
14857 int
14858 main (void)
14859 {
14860
14861         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14862         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14863         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14864         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14865
14866   ;
14867   return 0;
14868 }
14869 _ACEOF
14870 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14871 if { (eval echo "$as_me:14871: \"$ac_link\"") >&5
14872   (eval $ac_link) 2>&5
14873   ac_status=$?
14874   echo "$as_me:14874: \$? = $ac_status" >&5
14875   (exit "$ac_status"); } &&
14876          { ac_try='test -s "conftest$ac_exeext"'
14877   { (eval echo "$as_me:14877: \"$ac_try\"") >&5
14878   (eval $ac_try) 2>&5
14879   ac_status=$?
14880   echo "$as_me:14880: \$? = $ac_status" >&5
14881   (exit "$ac_status"); }; }; then
14882   cf_cv_xt_x11_compat=yes
14883 else
14884   echo "$as_me: failed program was:" >&5
14885 cat "conftest.$ac_ext" >&5
14886 cf_cv_xt_x11_compat=no
14887 fi
14888 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14889 fi
14890 echo "$as_me:14890: result: $cf_cv_xt_x11_compat" >&5
14891 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14892                 if test "$cf_cv_xt_x11_compat" = no
14893                 then
14894                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14895
14896 echo "${as_me:-configure}:14896: testing work around broken X11 dependency ..." 1>&5
14897
14898                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14899
14900 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14901         test -n "$verbose" && echo "    found package x11" 1>&6
14902
14903 echo "${as_me:-configure}:14903: testing found package x11 ..." 1>&5
14904
14905         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14906         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14907         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14908
14909 echo "${as_me:-configure}:14909: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14910
14911         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14912
14913 echo "${as_me:-configure}:14913: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14914
14915 cf_fix_cppflags=no
14916 cf_new_cflags=
14917 cf_new_cppflags=
14918 cf_new_extra_cppflags=
14919
14920 for cf_add_cflags in $cf_pkgconfig_incs
14921 do
14922 case "$cf_fix_cppflags" in
14923 (no)
14924         case "$cf_add_cflags" in
14925         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14926                 case "$cf_add_cflags" in
14927                 (-D*)
14928                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14929
14930                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14931                                 && test -z "${cf_tst_cflags}" \
14932                                 && cf_fix_cppflags=yes
14933
14934                         if test "$cf_fix_cppflags" = yes ; then
14935
14936         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14937         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14938
14939                                 continue
14940                         elif test "${cf_tst_cflags}" = "\"'" ; then
14941
14942         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14943         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14944
14945                                 continue
14946                         fi
14947                         ;;
14948                 esac
14949                 case "$CPPFLAGS" in
14950                 (*$cf_add_cflags)
14951                         ;;
14952                 (*)
14953                         case "$cf_add_cflags" in
14954                         (-D*)
14955                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14956
14957 CPPFLAGS=`echo "$CPPFLAGS" | \
14958         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14959                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14960
14961                                 ;;
14962                         esac
14963
14964         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14965         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14966
14967                         ;;
14968                 esac
14969                 ;;
14970         (*)
14971
14972         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14973         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14974
14975                 ;;
14976         esac
14977         ;;
14978 (yes)
14979
14980         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14981         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14982
14983         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14984
14985         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14986                 && test -z "${cf_tst_cflags}" \
14987                 && cf_fix_cppflags=no
14988         ;;
14989 esac
14990 done
14991
14992 if test -n "$cf_new_cflags" ; then
14993
14994         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14995         CFLAGS="${CFLAGS}$cf_new_cflags"
14996
14997 fi
14998
14999 if test -n "$cf_new_cppflags" ; then
15000
15001         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15002         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15003
15004 fi
15005
15006 if test -n "$cf_new_extra_cppflags" ; then
15007
15008         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15009         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15010
15011 fi
15012
15013 cf_add_libs="$LIBS"
15014 # reverse order
15015 cf_add_0lib=
15016 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15017 # filter duplicates
15018 for cf_add_1lib in $cf_add_0lib; do
15019         for cf_add_2lib in $cf_add_libs; do
15020                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15021                         cf_add_1lib=
15022                         break
15023                 fi
15024         done
15025         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15026 done
15027 LIBS="$cf_add_libs"
15028
15029         :
15030 else
15031         cf_pkgconfig_incs=
15032         cf_pkgconfig_libs=
15033
15034 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15035
15036 echo "${as_me:-configure}:15036: testing ...before $LIBS ..." 1>&5
15037
15038 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
15039 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15040
15041 echo "${as_me:-configure}:15041: testing ...after  $LIBS ..." 1>&5
15042
15043 fi
15044
15045                 fi
15046                 ;;
15047         esac
15048
15049 echo "$as_me:15049: checking for usable X Toolkit package" >&5
15050 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
15051 if test "${cf_cv_xt_ice_compat+set}" = set; then
15052   echo $ECHO_N "(cached) $ECHO_C" >&6
15053 else
15054
15055 cat >"conftest.$ac_ext" <<_ACEOF
15056 #line 15056 "configure"
15057 #include "confdefs.h"
15058
15059 #include <X11/Shell.h>
15060
15061 int
15062 main (void)
15063 {
15064 int num = IceConnectionNumber(0); (void) num
15065
15066   ;
15067   return 0;
15068 }
15069 _ACEOF
15070 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15071 if { (eval echo "$as_me:15071: \"$ac_link\"") >&5
15072   (eval $ac_link) 2>&5
15073   ac_status=$?
15074   echo "$as_me:15074: \$? = $ac_status" >&5
15075   (exit "$ac_status"); } &&
15076          { ac_try='test -s "conftest$ac_exeext"'
15077   { (eval echo "$as_me:15077: \"$ac_try\"") >&5
15078   (eval $ac_try) 2>&5
15079   ac_status=$?
15080   echo "$as_me:15080: \$? = $ac_status" >&5
15081   (exit "$ac_status"); }; }; then
15082   cf_cv_xt_ice_compat=yes
15083 else
15084   echo "$as_me: failed program was:" >&5
15085 cat "conftest.$ac_ext" >&5
15086 cf_cv_xt_ice_compat=no
15087 fi
15088 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15089 fi
15090 echo "$as_me:15090: result: $cf_cv_xt_ice_compat" >&5
15091 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
15092
15093         if test "$cf_cv_xt_ice_compat" = no
15094         then
15095                 # workaround for broken ".pc" files used for X Toolkit.
15096                 case "x$X_PRE_LIBS" in
15097                 (*-lICE*)
15098                         case "x$LIBS" in
15099                         (*-lICE*)
15100                                 ;;
15101                         (*)
15102                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
15103
15104 echo "${as_me:-configure}:15104: testing work around broken ICE dependency ..." 1>&5
15105
15106 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
15107         test -n "$verbose" && echo "    found package ice" 1>&6
15108
15109 echo "${as_me:-configure}:15109: testing found package ice ..." 1>&5
15110
15111         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
15112         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
15113         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
15114
15115 echo "${as_me:-configure}:15115: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15116
15117         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
15118
15119 echo "${as_me:-configure}:15119: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
15120
15121 cf_fix_cppflags=no
15122 cf_new_cflags=
15123 cf_new_cppflags=
15124 cf_new_extra_cppflags=
15125
15126 for cf_add_cflags in $cf_pkgconfig_incs
15127 do
15128 case "$cf_fix_cppflags" in
15129 (no)
15130         case "$cf_add_cflags" in
15131         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15132                 case "$cf_add_cflags" in
15133                 (-D*)
15134                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15135
15136                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15137                                 && test -z "${cf_tst_cflags}" \
15138                                 && cf_fix_cppflags=yes
15139
15140                         if test "$cf_fix_cppflags" = yes ; then
15141
15142         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15143         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15144
15145                                 continue
15146                         elif test "${cf_tst_cflags}" = "\"'" ; then
15147
15148         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15149         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15150
15151                                 continue
15152                         fi
15153                         ;;
15154                 esac
15155                 case "$CPPFLAGS" in
15156                 (*$cf_add_cflags)
15157                         ;;
15158                 (*)
15159                         case "$cf_add_cflags" in
15160                         (-D*)
15161                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15162
15163 CPPFLAGS=`echo "$CPPFLAGS" | \
15164         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15165                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15166
15167                                 ;;
15168                         esac
15169
15170         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15171         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15172
15173                         ;;
15174                 esac
15175                 ;;
15176         (*)
15177
15178         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15179         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15180
15181                 ;;
15182         esac
15183         ;;
15184 (yes)
15185
15186         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15187         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15188
15189         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15190
15191         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15192                 && test -z "${cf_tst_cflags}" \
15193                 && cf_fix_cppflags=no
15194         ;;
15195 esac
15196 done
15197
15198 if test -n "$cf_new_cflags" ; then
15199
15200         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15201         CFLAGS="${CFLAGS}$cf_new_cflags"
15202
15203 fi
15204
15205 if test -n "$cf_new_cppflags" ; then
15206
15207         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15208         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15209
15210 fi
15211
15212 if test -n "$cf_new_extra_cppflags" ; then
15213
15214         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15215         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15216
15217 fi
15218
15219 cf_add_libs="$LIBS"
15220 # reverse order
15221 cf_add_0lib=
15222 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15223 # filter duplicates
15224 for cf_add_1lib in $cf_add_0lib; do
15225         for cf_add_2lib in $cf_add_libs; do
15226                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15227                         cf_add_1lib=
15228                         break
15229                 fi
15230         done
15231         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15232 done
15233 LIBS="$cf_add_libs"
15234
15235 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
15236         test -n "$verbose" && echo "    found package sm" 1>&6
15237
15238 echo "${as_me:-configure}:15238: testing found package sm ..." 1>&5
15239
15240         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
15241         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
15242         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
15243
15244 echo "${as_me:-configure}:15244: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15245
15246         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
15247
15248 echo "${as_me:-configure}:15248: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
15249
15250 cf_fix_cppflags=no
15251 cf_new_cflags=
15252 cf_new_cppflags=
15253 cf_new_extra_cppflags=
15254
15255 for cf_add_cflags in $cf_pkgconfig_incs
15256 do
15257 case "$cf_fix_cppflags" in
15258 (no)
15259         case "$cf_add_cflags" in
15260         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15261                 case "$cf_add_cflags" in
15262                 (-D*)
15263                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15264
15265                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15266                                 && test -z "${cf_tst_cflags}" \
15267                                 && cf_fix_cppflags=yes
15268
15269                         if test "$cf_fix_cppflags" = yes ; then
15270
15271         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15272         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15273
15274                                 continue
15275                         elif test "${cf_tst_cflags}" = "\"'" ; then
15276
15277         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15278         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15279
15280                                 continue
15281                         fi
15282                         ;;
15283                 esac
15284                 case "$CPPFLAGS" in
15285                 (*$cf_add_cflags)
15286                         ;;
15287                 (*)
15288                         case "$cf_add_cflags" in
15289                         (-D*)
15290                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15291
15292 CPPFLAGS=`echo "$CPPFLAGS" | \
15293         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15294                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15295
15296                                 ;;
15297                         esac
15298
15299         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15300         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15301
15302                         ;;
15303                 esac
15304                 ;;
15305         (*)
15306
15307         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15308         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15309
15310                 ;;
15311         esac
15312         ;;
15313 (yes)
15314
15315         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15316         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15317
15318         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15319
15320         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15321                 && test -z "${cf_tst_cflags}" \
15322                 && cf_fix_cppflags=no
15323         ;;
15324 esac
15325 done
15326
15327 if test -n "$cf_new_cflags" ; then
15328
15329         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15330         CFLAGS="${CFLAGS}$cf_new_cflags"
15331
15332 fi
15333
15334 if test -n "$cf_new_cppflags" ; then
15335
15336         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15337         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15338
15339 fi
15340
15341 if test -n "$cf_new_extra_cppflags" ; then
15342
15343         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15344         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15345
15346 fi
15347
15348 cf_add_libs="$LIBS"
15349 # reverse order
15350 cf_add_0lib=
15351 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15352 # filter duplicates
15353 for cf_add_1lib in $cf_add_0lib; do
15354         for cf_add_2lib in $cf_add_libs; do
15355                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15356                         cf_add_1lib=
15357                         break
15358                 fi
15359         done
15360         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15361 done
15362 LIBS="$cf_add_libs"
15363
15364         :
15365 else
15366         cf_pkgconfig_incs=
15367         cf_pkgconfig_libs=
15368         :
15369 fi
15370
15371 else
15372         cf_pkgconfig_incs=
15373         cf_pkgconfig_libs=
15374
15375 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15376
15377 echo "${as_me:-configure}:15377: testing ...before $LIBS ..." 1>&5
15378
15379 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
15380 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15381
15382 echo "${as_me:-configure}:15382: testing ...after  $LIBS ..." 1>&5
15383
15384 fi
15385
15386                                 ;;
15387                         esac
15388                         ;;
15389                 esac
15390         fi
15391
15392         cf_have_X_LIBS=yes
15393
15394 else
15395         cf_pkgconfig_incs=
15396         cf_pkgconfig_libs=
15397
15398         LDFLAGS="$X_LIBS $LDFLAGS"
15399
15400 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15401
15402 echo "${as_me:-configure}:15402: testing checking additions to CFLAGS ..." 1>&5
15403
15404 cf_check_cflags="$CFLAGS"
15405 cf_check_cppflags="$CPPFLAGS"
15406
15407 cf_fix_cppflags=no
15408 cf_new_cflags=
15409 cf_new_cppflags=
15410 cf_new_extra_cppflags=
15411
15412 for cf_add_cflags in $X_CFLAGS
15413 do
15414 case "$cf_fix_cppflags" in
15415 (no)
15416         case "$cf_add_cflags" in
15417         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15418                 case "$cf_add_cflags" in
15419                 (-D*)
15420                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15421
15422                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15423                                 && test -z "${cf_tst_cflags}" \
15424                                 && cf_fix_cppflags=yes
15425
15426                         if test "$cf_fix_cppflags" = yes ; then
15427
15428         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15429         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15430
15431                                 continue
15432                         elif test "${cf_tst_cflags}" = "\"'" ; then
15433
15434         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15435         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15436
15437                                 continue
15438                         fi
15439                         ;;
15440                 esac
15441                 case "$CPPFLAGS" in
15442                 (*$cf_add_cflags)
15443                         ;;
15444                 (*)
15445                         case "$cf_add_cflags" in
15446                         (-D*)
15447                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15448
15449 CPPFLAGS=`echo "$CPPFLAGS" | \
15450         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15451                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15452
15453                                 ;;
15454                         esac
15455
15456         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15457         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15458
15459                         ;;
15460                 esac
15461                 ;;
15462         (*)
15463
15464         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15465         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15466
15467                 ;;
15468         esac
15469         ;;
15470 (yes)
15471
15472         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15473         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15474
15475         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15476
15477         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15478                 && test -z "${cf_tst_cflags}" \
15479                 && cf_fix_cppflags=no
15480         ;;
15481 esac
15482 done
15483
15484 if test -n "$cf_new_cflags" ; then
15485         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15486
15487 echo "${as_me:-configure}:15487: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15488
15489         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15490         CFLAGS="${CFLAGS}$cf_new_cflags"
15491
15492 fi
15493
15494 if test -n "$cf_new_cppflags" ; then
15495         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15496
15497 echo "${as_me:-configure}:15497: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15498
15499         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15500         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15501
15502 fi
15503
15504 if test -n "$cf_new_extra_cppflags" ; then
15505         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15506
15507 echo "${as_me:-configure}:15507: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15508
15509         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15510         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15511
15512 fi
15513
15514 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15515 cat >"conftest.$ac_ext" <<_ACEOF
15516 #line 15516 "configure"
15517 #include "confdefs.h"
15518 #include <stdio.h>
15519 int
15520 main (void)
15521 {
15522 printf("Hello world");
15523   ;
15524   return 0;
15525 }
15526 _ACEOF
15527 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15528 if { (eval echo "$as_me:15528: \"$ac_link\"") >&5
15529   (eval $ac_link) 2>&5
15530   ac_status=$?
15531   echo "$as_me:15531: \$? = $ac_status" >&5
15532   (exit "$ac_status"); } &&
15533          { ac_try='test -s "conftest$ac_exeext"'
15534   { (eval echo "$as_me:15534: \"$ac_try\"") >&5
15535   (eval $ac_try) 2>&5
15536   ac_status=$?
15537   echo "$as_me:15537: \$? = $ac_status" >&5
15538   (exit "$ac_status"); }; }; then
15539   :
15540 else
15541   echo "$as_me: failed program was:" >&5
15542 cat "conftest.$ac_ext" >&5
15543 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15544
15545 echo "${as_me:-configure}:15545: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15546
15547          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15548                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15549
15550 echo "${as_me:-configure}:15550: testing but keeping change to \$CPPFLAGS ..." 1>&5
15551
15552          fi
15553          CFLAGS="$cf_check_cflags"
15554 fi
15555 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15556 fi
15557
15558         echo "$as_me:15558: checking for XOpenDisplay" >&5
15559 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15560 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15561   echo $ECHO_N "(cached) $ECHO_C" >&6
15562 else
15563   cat >"conftest.$ac_ext" <<_ACEOF
15564 #line 15564 "configure"
15565 #include "confdefs.h"
15566 #define XOpenDisplay autoconf_temporary
15567 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15568 #undef XOpenDisplay
15569
15570 #ifdef __cplusplus
15571 extern "C"
15572 #endif
15573
15574 /* We use char because int might match the return type of a gcc2
15575    builtin and then its argument prototype would still apply.  */
15576 char XOpenDisplay (void);
15577
15578 int
15579 main (void)
15580 {
15581
15582 /* The GNU C library defines stubs for functions which it implements
15583     to always fail with ENOSYS.  Some functions are actually named
15584     something starting with __ and the normal name is an alias.  */
15585 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15586 #error found stub for XOpenDisplay
15587 #endif
15588
15589         return XOpenDisplay ();
15590   ;
15591   return 0;
15592 }
15593 _ACEOF
15594 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15595 if { (eval echo "$as_me:15595: \"$ac_link\"") >&5
15596   (eval $ac_link) 2>&5
15597   ac_status=$?
15598   echo "$as_me:15598: \$? = $ac_status" >&5
15599   (exit "$ac_status"); } &&
15600          { ac_try='test -s "conftest$ac_exeext"'
15601   { (eval echo "$as_me:15601: \"$ac_try\"") >&5
15602   (eval $ac_try) 2>&5
15603   ac_status=$?
15604   echo "$as_me:15604: \$? = $ac_status" >&5
15605   (exit "$ac_status"); }; }; then
15606   ac_cv_func_XOpenDisplay=yes
15607 else
15608   echo "$as_me: failed program was:" >&5
15609 cat "conftest.$ac_ext" >&5
15610 ac_cv_func_XOpenDisplay=no
15611 fi
15612 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15613 fi
15614 echo "$as_me:15614: result: $ac_cv_func_XOpenDisplay" >&5
15615 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15616 if test "$ac_cv_func_XOpenDisplay" = yes; then
15617   :
15618 else
15619
15620         echo "$as_me:15620: checking for XOpenDisplay in -lX11" >&5
15621 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15622 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15623   echo $ECHO_N "(cached) $ECHO_C" >&6
15624 else
15625   ac_check_lib_save_LIBS=$LIBS
15626 LIBS="-lX11  $LIBS"
15627 cat >"conftest.$ac_ext" <<_ACEOF
15628 #line 15628 "configure"
15629 #include "confdefs.h"
15630
15631 /* Override any gcc2 internal prototype to avoid an error.  */
15632 #ifdef __cplusplus
15633 extern "C"
15634 #endif
15635 /* We use char because int might match the return type of a gcc2
15636    builtin and then its argument prototype would still apply.  */
15637 char XOpenDisplay ();
15638 int
15639 main (void)
15640 {
15641 XOpenDisplay ();
15642   ;
15643   return 0;
15644 }
15645 _ACEOF
15646 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15647 if { (eval echo "$as_me:15647: \"$ac_link\"") >&5
15648   (eval $ac_link) 2>&5
15649   ac_status=$?
15650   echo "$as_me:15650: \$? = $ac_status" >&5
15651   (exit "$ac_status"); } &&
15652          { ac_try='test -s "conftest$ac_exeext"'
15653   { (eval echo "$as_me:15653: \"$ac_try\"") >&5
15654   (eval $ac_try) 2>&5
15655   ac_status=$?
15656   echo "$as_me:15656: \$? = $ac_status" >&5
15657   (exit "$ac_status"); }; }; then
15658   ac_cv_lib_X11_XOpenDisplay=yes
15659 else
15660   echo "$as_me: failed program was:" >&5
15661 cat "conftest.$ac_ext" >&5
15662 ac_cv_lib_X11_XOpenDisplay=no
15663 fi
15664 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15665 LIBS=$ac_check_lib_save_LIBS
15666 fi
15667 echo "$as_me:15667: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15668 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15669 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15670
15671 cf_add_libs="$LIBS"
15672 # reverse order
15673 cf_add_0lib=
15674 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15675 # filter duplicates
15676 for cf_add_1lib in $cf_add_0lib; do
15677         for cf_add_2lib in $cf_add_libs; do
15678                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15679                         cf_add_1lib=
15680                         break
15681                 fi
15682         done
15683         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15684 done
15685 LIBS="$cf_add_libs"
15686
15687 fi
15688
15689 fi
15690
15691         echo "$as_me:15691: checking for XtAppInitialize" >&5
15692 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15693 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15694   echo $ECHO_N "(cached) $ECHO_C" >&6
15695 else
15696   cat >"conftest.$ac_ext" <<_ACEOF
15697 #line 15697 "configure"
15698 #include "confdefs.h"
15699 #define XtAppInitialize autoconf_temporary
15700 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15701 #undef XtAppInitialize
15702
15703 #ifdef __cplusplus
15704 extern "C"
15705 #endif
15706
15707 /* We use char because int might match the return type of a gcc2
15708    builtin and then its argument prototype would still apply.  */
15709 char XtAppInitialize (void);
15710
15711 int
15712 main (void)
15713 {
15714
15715 /* The GNU C library defines stubs for functions which it implements
15716     to always fail with ENOSYS.  Some functions are actually named
15717     something starting with __ and the normal name is an alias.  */
15718 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15719 #error found stub for XtAppInitialize
15720 #endif
15721
15722         return XtAppInitialize ();
15723   ;
15724   return 0;
15725 }
15726 _ACEOF
15727 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15728 if { (eval echo "$as_me:15728: \"$ac_link\"") >&5
15729   (eval $ac_link) 2>&5
15730   ac_status=$?
15731   echo "$as_me:15731: \$? = $ac_status" >&5
15732   (exit "$ac_status"); } &&
15733          { ac_try='test -s "conftest$ac_exeext"'
15734   { (eval echo "$as_me:15734: \"$ac_try\"") >&5
15735   (eval $ac_try) 2>&5
15736   ac_status=$?
15737   echo "$as_me:15737: \$? = $ac_status" >&5
15738   (exit "$ac_status"); }; }; then
15739   ac_cv_func_XtAppInitialize=yes
15740 else
15741   echo "$as_me: failed program was:" >&5
15742 cat "conftest.$ac_ext" >&5
15743 ac_cv_func_XtAppInitialize=no
15744 fi
15745 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15746 fi
15747 echo "$as_me:15747: result: $ac_cv_func_XtAppInitialize" >&5
15748 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15749 if test "$ac_cv_func_XtAppInitialize" = yes; then
15750   :
15751 else
15752
15753         echo "$as_me:15753: checking for XtAppInitialize in -lXt" >&5
15754 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15755 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15756   echo $ECHO_N "(cached) $ECHO_C" >&6
15757 else
15758   ac_check_lib_save_LIBS=$LIBS
15759 LIBS="-lXt  $LIBS"
15760 cat >"conftest.$ac_ext" <<_ACEOF
15761 #line 15761 "configure"
15762 #include "confdefs.h"
15763
15764 /* Override any gcc2 internal prototype to avoid an error.  */
15765 #ifdef __cplusplus
15766 extern "C"
15767 #endif
15768 /* We use char because int might match the return type of a gcc2
15769    builtin and then its argument prototype would still apply.  */
15770 char XtAppInitialize ();
15771 int
15772 main (void)
15773 {
15774 XtAppInitialize ();
15775   ;
15776   return 0;
15777 }
15778 _ACEOF
15779 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15780 if { (eval echo "$as_me:15780: \"$ac_link\"") >&5
15781   (eval $ac_link) 2>&5
15782   ac_status=$?
15783   echo "$as_me:15783: \$? = $ac_status" >&5
15784   (exit "$ac_status"); } &&
15785          { ac_try='test -s "conftest$ac_exeext"'
15786   { (eval echo "$as_me:15786: \"$ac_try\"") >&5
15787   (eval $ac_try) 2>&5
15788   ac_status=$?
15789   echo "$as_me:15789: \$? = $ac_status" >&5
15790   (exit "$ac_status"); }; }; then
15791   ac_cv_lib_Xt_XtAppInitialize=yes
15792 else
15793   echo "$as_me: failed program was:" >&5
15794 cat "conftest.$ac_ext" >&5
15795 ac_cv_lib_Xt_XtAppInitialize=no
15796 fi
15797 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15798 LIBS=$ac_check_lib_save_LIBS
15799 fi
15800 echo "$as_me:15800: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15801 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15802 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15803
15804 cat >>confdefs.h <<\EOF
15805 #define HAVE_LIBXT 1
15806 EOF
15807
15808                  cf_have_X_LIBS=Xt
15809                  LIBS="-lXt $LIBS"
15810 fi
15811
15812 fi
15813
15814 fi
15815
15816 if test "$cf_have_X_LIBS" = no ; then
15817         { echo "$as_me:15817: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15818 test program.  You will have to check and add the proper libraries by hand
15819 to makefile." >&5
15820 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15821 test program.  You will have to check and add the proper libraries by hand
15822 to makefile." >&2;}
15823 fi
15824
15825 cf_x_athena_root=$cf_x_athena
15826 cf_x_athena_inc=""
15827
15828 for cf_path in default \
15829         /usr/contrib/X11R6 \
15830         /usr/contrib/X11R5 \
15831         /usr/lib/X11R5 \
15832         /usr/local
15833 do
15834         if test -z "$cf_x_athena_inc" ; then
15835
15836 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15837 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15838 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15839 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15840 for cf_X_CFLAGS in $X_CFLAGS
15841 do
15842         case "x$cf_X_CFLAGS" in
15843         x-[IUD]*)
15844                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15845                 ;;
15846         *)
15847                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15848                 ;;
15849         esac
15850 done
15851
15852                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15853                 if test "$cf_path" != default ; then
15854
15855         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15856         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15857
15858                         echo "$as_me:15858: checking for $cf_test in $cf_path" >&5
15859 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15860                 else
15861                         echo "$as_me:15861: checking for $cf_test" >&5
15862 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15863                 fi
15864                 cat >"conftest.$ac_ext" <<_ACEOF
15865 #line 15865 "configure"
15866 #include "confdefs.h"
15867
15868 #include <X11/Intrinsic.h>
15869 #include <$cf_test>
15870 int
15871 main (void)
15872 {
15873
15874   ;
15875   return 0;
15876 }
15877 _ACEOF
15878 rm -f "conftest.$ac_objext"
15879 if { (eval echo "$as_me:15879: \"$ac_compile\"") >&5
15880   (eval $ac_compile) 2>&5
15881   ac_status=$?
15882   echo "$as_me:15882: \$? = $ac_status" >&5
15883   (exit "$ac_status"); } &&
15884          { ac_try='test -s "conftest.$ac_objext"'
15885   { (eval echo "$as_me:15885: \"$ac_try\"") >&5
15886   (eval $ac_try) 2>&5
15887   ac_status=$?
15888   echo "$as_me:15888: \$? = $ac_status" >&5
15889   (exit "$ac_status"); }; }; then
15890   cf_result=yes
15891 else
15892   echo "$as_me: failed program was:" >&5
15893 cat "conftest.$ac_ext" >&5
15894 cf_result=no
15895 fi
15896 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15897                 echo "$as_me:15897: result: $cf_result" >&5
15898 echo "${ECHO_T}$cf_result" >&6
15899
15900 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15901 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15902 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15903
15904                 if test "$cf_result" = yes ; then
15905                         test "$cf_path"  = default && cf_x_athena_inc=default
15906                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15907                         break
15908                 fi
15909         fi
15910 done
15911
15912 if test -z "$cf_x_athena_inc" ; then
15913         { echo "$as_me:15913: WARNING: Unable to find Athena header files" >&5
15914 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15915 elif test "$cf_x_athena_inc" != default ; then
15916
15917         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15918         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15919
15920 fi
15921
15922 cf_x_athena_root=$cf_x_athena
15923 cf_x_athena_lib=""
15924
15925 for cf_path in default \
15926         /usr/contrib/X11R6 \
15927         /usr/contrib/X11R5 \
15928         /usr/lib/X11R5 \
15929         /usr/local
15930 do
15931         for cf_lib in \
15932                 ${cf_x_athena_root} \
15933                 ${cf_x_athena_root}7 \
15934                 ${cf_x_athena_root}6
15935         do
15936         for cf_libs in \
15937                 "-l$cf_lib -lXmu" \
15938                 "-l$cf_lib -lXpm -lXmu" \
15939                 "-l${cf_lib}_s -lXmu_s"
15940         do
15941                 test -n "$cf_x_athena_lib" && break
15942
15943 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15944 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15945 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15946 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15947 for cf_X_CFLAGS in $X_CFLAGS
15948 do
15949         case "x$cf_X_CFLAGS" in
15950         x-[IUD]*)
15951                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15952                 ;;
15953         *)
15954                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15955                 ;;
15956         esac
15957 done
15958
15959                 cf_test=XawSimpleMenuAddGlobalActions
15960                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15961
15962 cf_add_libs="$LIBS"
15963 # reverse order
15964 cf_add_0lib=
15965 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15966 # filter duplicates
15967 for cf_add_1lib in $cf_add_0lib; do
15968         for cf_add_2lib in $cf_add_libs; do
15969                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15970                         cf_add_1lib=
15971                         break
15972                 fi
15973         done
15974         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15975 done
15976 LIBS="$cf_add_libs"
15977
15978                 echo "$as_me:15978: checking for $cf_test in $cf_libs" >&5
15979 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15980                 cat >"conftest.$ac_ext" <<_ACEOF
15981 #line 15981 "configure"
15982 #include "confdefs.h"
15983
15984 #include <X11/Intrinsic.h>
15985 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15986
15987 int
15988 main (void)
15989 {
15990
15991 $cf_test((XtAppContext) 0)
15992   ;
15993   return 0;
15994 }
15995 _ACEOF
15996 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15997 if { (eval echo "$as_me:15997: \"$ac_link\"") >&5
15998   (eval $ac_link) 2>&5
15999   ac_status=$?
16000   echo "$as_me:16000: \$? = $ac_status" >&5
16001   (exit "$ac_status"); } &&
16002          { ac_try='test -s "conftest$ac_exeext"'
16003   { (eval echo "$as_me:16003: \"$ac_try\"") >&5
16004   (eval $ac_try) 2>&5
16005   ac_status=$?
16006   echo "$as_me:16006: \$? = $ac_status" >&5
16007   (exit "$ac_status"); }; }; then
16008   cf_result=yes
16009 else
16010   echo "$as_me: failed program was:" >&5
16011 cat "conftest.$ac_ext" >&5
16012 cf_result=no
16013 fi
16014 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16015                 echo "$as_me:16015: result: $cf_result" >&5
16016 echo "${ECHO_T}$cf_result" >&6
16017
16018 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
16019 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
16020 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
16021
16022                 if test "$cf_result" = yes ; then
16023                         cf_x_athena_lib="$cf_libs"
16024                         break
16025                 fi
16026         done # cf_libs
16027                 test -n "$cf_x_athena_lib" && break
16028         done # cf_lib
16029 done
16030
16031 if test -z "$cf_x_athena_lib" ; then
16032         { { echo "$as_me:16032: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
16033 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
16034    { (exit 1); exit 1; }; }
16035 fi
16036
16037 cf_add_libs="$LIBS"
16038 # reverse order
16039 cf_add_0lib=
16040 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16041 # filter duplicates
16042 for cf_add_1lib in $cf_add_0lib; do
16043         for cf_add_2lib in $cf_add_libs; do
16044                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16045                         cf_add_1lib=
16046                         break
16047                 fi
16048         done
16049         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16050 done
16051 LIBS="$cf_add_libs"
16052
16053 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16054
16055 cat >>confdefs.h <<EOF
16056 #define $cf_x_athena_LIBS 1
16057 EOF
16058
16059 fi
16060
16061 if test -n "$ac_tool_prefix"; then
16062   for ac_prog in xcurses-config
16063   do
16064     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
16065 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
16066 echo "$as_me:16066: checking for $ac_word" >&5
16067 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16068 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
16069   echo $ECHO_N "(cached) $ECHO_C" >&6
16070 else
16071   if test -n "$XCURSES_CONFIG"; then
16072   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
16073 else
16074   ac_save_IFS=$IFS; IFS=$ac_path_separator
16075 ac_dummy="$PATH"
16076 for ac_dir in $ac_dummy; do
16077   IFS=$ac_save_IFS
16078   test -z "$ac_dir" && ac_dir=.
16079   $as_executable_p "$ac_dir/$ac_word" || continue
16080 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
16081 echo "$as_me:16081: found $ac_dir/$ac_word" >&5
16082 break
16083 done
16084
16085 fi
16086 fi
16087 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
16088 if test -n "$XCURSES_CONFIG"; then
16089   echo "$as_me:16089: result: $XCURSES_CONFIG" >&5
16090 echo "${ECHO_T}$XCURSES_CONFIG" >&6
16091 else
16092   echo "$as_me:16092: result: no" >&5
16093 echo "${ECHO_T}no" >&6
16094 fi
16095
16096     test -n "$XCURSES_CONFIG" && break
16097   done
16098 fi
16099 if test -z "$XCURSES_CONFIG"; then
16100   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
16101   for ac_prog in xcurses-config
16102 do
16103   # Extract the first word of "$ac_prog", so it can be a program name with args.
16104 set dummy $ac_prog; ac_word=$2
16105 echo "$as_me:16105: checking for $ac_word" >&5
16106 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16107 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
16108   echo $ECHO_N "(cached) $ECHO_C" >&6
16109 else
16110   if test -n "$ac_ct_XCURSES_CONFIG"; then
16111   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
16112 else
16113   ac_save_IFS=$IFS; IFS=$ac_path_separator
16114 ac_dummy="$PATH"
16115 for ac_dir in $ac_dummy; do
16116   IFS=$ac_save_IFS
16117   test -z "$ac_dir" && ac_dir=.
16118   $as_executable_p "$ac_dir/$ac_word" || continue
16119 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
16120 echo "$as_me:16120: found $ac_dir/$ac_word" >&5
16121 break
16122 done
16123
16124 fi
16125 fi
16126 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
16127 if test -n "$ac_ct_XCURSES_CONFIG"; then
16128   echo "$as_me:16128: result: $ac_ct_XCURSES_CONFIG" >&5
16129 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
16130 else
16131   echo "$as_me:16131: result: no" >&5
16132 echo "${ECHO_T}no" >&6
16133 fi
16134
16135   test -n "$ac_ct_XCURSES_CONFIG" && break
16136 done
16137 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
16138
16139   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
16140 fi
16141
16142 if test "$XCURSES_CONFIG" != none ; then
16143
16144 cf_fix_cppflags=no
16145 cf_new_cflags=
16146 cf_new_cppflags=
16147 cf_new_extra_cppflags=
16148
16149 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
16150 do
16151 case "$cf_fix_cppflags" in
16152 (no)
16153         case "$cf_add_cflags" in
16154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16155                 case "$cf_add_cflags" in
16156                 (-D*)
16157                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16158
16159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16160                                 && test -z "${cf_tst_cflags}" \
16161                                 && cf_fix_cppflags=yes
16162
16163                         if test "$cf_fix_cppflags" = yes ; then
16164
16165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16167
16168                                 continue
16169                         elif test "${cf_tst_cflags}" = "\"'" ; then
16170
16171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16173
16174                                 continue
16175                         fi
16176                         ;;
16177                 esac
16178                 case "$CPPFLAGS" in
16179                 (*$cf_add_cflags)
16180                         ;;
16181                 (*)
16182                         case "$cf_add_cflags" in
16183                         (-D*)
16184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16185
16186 CPPFLAGS=`echo "$CPPFLAGS" | \
16187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16189
16190                                 ;;
16191                         esac
16192
16193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16195
16196                         ;;
16197                 esac
16198                 ;;
16199         (*)
16200
16201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16203
16204                 ;;
16205         esac
16206         ;;
16207 (yes)
16208
16209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16211
16212         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16213
16214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16215                 && test -z "${cf_tst_cflags}" \
16216                 && cf_fix_cppflags=no
16217         ;;
16218 esac
16219 done
16220
16221 if test -n "$cf_new_cflags" ; then
16222
16223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16224         CFLAGS="${CFLAGS}$cf_new_cflags"
16225
16226 fi
16227
16228 if test -n "$cf_new_cppflags" ; then
16229
16230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16232
16233 fi
16234
16235 if test -n "$cf_new_extra_cppflags" ; then
16236
16237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16239
16240 fi
16241
16242 cf_add_libs="$LIBS"
16243 # reverse order
16244 cf_add_0lib=
16245 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16246 # filter duplicates
16247 for cf_add_1lib in $cf_add_0lib; do
16248         for cf_add_2lib in $cf_add_libs; do
16249                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16250                         cf_add_1lib=
16251                         break
16252                 fi
16253         done
16254         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16255 done
16256 LIBS="$cf_add_libs"
16257
16258 cf_cv_lib_XCurses=yes
16259
16260 else
16261
16262 LDFLAGS="$LDFLAGS $X_LIBS"
16263
16264 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
16265
16266 echo "${as_me:-configure}:16266: testing checking additions to CFLAGS ..." 1>&5
16267
16268 cf_check_cflags="$CFLAGS"
16269 cf_check_cppflags="$CPPFLAGS"
16270
16271 cf_fix_cppflags=no
16272 cf_new_cflags=
16273 cf_new_cppflags=
16274 cf_new_extra_cppflags=
16275
16276 for cf_add_cflags in $X_CFLAGS
16277 do
16278 case "$cf_fix_cppflags" in
16279 (no)
16280         case "$cf_add_cflags" in
16281         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16282                 case "$cf_add_cflags" in
16283                 (-D*)
16284                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16285
16286                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16287                                 && test -z "${cf_tst_cflags}" \
16288                                 && cf_fix_cppflags=yes
16289
16290                         if test "$cf_fix_cppflags" = yes ; then
16291
16292         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16293         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16294
16295                                 continue
16296                         elif test "${cf_tst_cflags}" = "\"'" ; then
16297
16298         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16299         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16300
16301                                 continue
16302                         fi
16303                         ;;
16304                 esac
16305                 case "$CPPFLAGS" in
16306                 (*$cf_add_cflags)
16307                         ;;
16308                 (*)
16309                         case "$cf_add_cflags" in
16310                         (-D*)
16311                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16312
16313 CPPFLAGS=`echo "$CPPFLAGS" | \
16314         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16315                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16316
16317                                 ;;
16318                         esac
16319
16320         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16321         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16322
16323                         ;;
16324                 esac
16325                 ;;
16326         (*)
16327
16328         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16329         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16330
16331                 ;;
16332         esac
16333         ;;
16334 (yes)
16335
16336         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16337         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16338
16339         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16340
16341         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16342                 && test -z "${cf_tst_cflags}" \
16343                 && cf_fix_cppflags=no
16344         ;;
16345 esac
16346 done
16347
16348 if test -n "$cf_new_cflags" ; then
16349         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
16350
16351 echo "${as_me:-configure}:16351: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
16352
16353         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16354         CFLAGS="${CFLAGS}$cf_new_cflags"
16355
16356 fi
16357
16358 if test -n "$cf_new_cppflags" ; then
16359         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
16360
16361 echo "${as_me:-configure}:16361: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
16362
16363         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16364         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16365
16366 fi
16367
16368 if test -n "$cf_new_extra_cppflags" ; then
16369         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
16370
16371 echo "${as_me:-configure}:16371: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
16372
16373         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16374         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16375
16376 fi
16377
16378 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
16379 cat >"conftest.$ac_ext" <<_ACEOF
16380 #line 16380 "configure"
16381 #include "confdefs.h"
16382 #include <stdio.h>
16383 int
16384 main (void)
16385 {
16386 printf("Hello world");
16387   ;
16388   return 0;
16389 }
16390 _ACEOF
16391 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16392 if { (eval echo "$as_me:16392: \"$ac_link\"") >&5
16393   (eval $ac_link) 2>&5
16394   ac_status=$?
16395   echo "$as_me:16395: \$? = $ac_status" >&5
16396   (exit "$ac_status"); } &&
16397          { ac_try='test -s "conftest$ac_exeext"'
16398   { (eval echo "$as_me:16398: \"$ac_try\"") >&5
16399   (eval $ac_try) 2>&5
16400   ac_status=$?
16401   echo "$as_me:16401: \$? = $ac_status" >&5
16402   (exit "$ac_status"); }; }; then
16403   :
16404 else
16405   echo "$as_me: failed program was:" >&5
16406 cat "conftest.$ac_ext" >&5
16407 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
16408
16409 echo "${as_me:-configure}:16409: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
16410
16411          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16412                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
16413
16414 echo "${as_me:-configure}:16414: testing but keeping change to \$CPPFLAGS ..." 1>&5
16415
16416          fi
16417          CFLAGS="$cf_check_cflags"
16418 fi
16419 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16420 fi
16421
16422 echo "$as_me:16422: checking for XOpenDisplay in -lX11" >&5
16423 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16424 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16425   echo $ECHO_N "(cached) $ECHO_C" >&6
16426 else
16427   ac_check_lib_save_LIBS=$LIBS
16428 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
16429 cat >"conftest.$ac_ext" <<_ACEOF
16430 #line 16430 "configure"
16431 #include "confdefs.h"
16432
16433 /* Override any gcc2 internal prototype to avoid an error.  */
16434 #ifdef __cplusplus
16435 extern "C"
16436 #endif
16437 /* We use char because int might match the return type of a gcc2
16438    builtin and then its argument prototype would still apply.  */
16439 char XOpenDisplay ();
16440 int
16441 main (void)
16442 {
16443 XOpenDisplay ();
16444   ;
16445   return 0;
16446 }
16447 _ACEOF
16448 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16449 if { (eval echo "$as_me:16449: \"$ac_link\"") >&5
16450   (eval $ac_link) 2>&5
16451   ac_status=$?
16452   echo "$as_me:16452: \$? = $ac_status" >&5
16453   (exit "$ac_status"); } &&
16454          { ac_try='test -s "conftest$ac_exeext"'
16455   { (eval echo "$as_me:16455: \"$ac_try\"") >&5
16456   (eval $ac_try) 2>&5
16457   ac_status=$?
16458   echo "$as_me:16458: \$? = $ac_status" >&5
16459   (exit "$ac_status"); }; }; then
16460   ac_cv_lib_X11_XOpenDisplay=yes
16461 else
16462   echo "$as_me: failed program was:" >&5
16463 cat "conftest.$ac_ext" >&5
16464 ac_cv_lib_X11_XOpenDisplay=no
16465 fi
16466 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16467 LIBS=$ac_check_lib_save_LIBS
16468 fi
16469 echo "$as_me:16469: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16470 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16471 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16472
16473 cf_add_libs="$LIBS"
16474 # reverse order
16475 cf_add_0lib=
16476 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16477 # filter duplicates
16478 for cf_add_1lib in $cf_add_0lib; do
16479         for cf_add_2lib in $cf_add_libs; do
16480                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16481                         cf_add_1lib=
16482                         break
16483                 fi
16484         done
16485         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16486 done
16487 LIBS="$cf_add_libs"
16488
16489 fi
16490
16491 echo "$as_me:16491: checking for XCurses library" >&5
16492 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16493 if test "${cf_cv_lib_XCurses+set}" = set; then
16494   echo $ECHO_N "(cached) $ECHO_C" >&6
16495 else
16496
16497 cf_add_libs="$LIBS"
16498 # reverse order
16499 cf_add_0lib=
16500 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16501 # filter duplicates
16502 for cf_add_1lib in $cf_add_0lib; do
16503         for cf_add_2lib in $cf_add_libs; do
16504                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16505                         cf_add_1lib=
16506                         break
16507                 fi
16508         done
16509         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16510 done
16511 LIBS="$cf_add_libs"
16512
16513 cat >"conftest.$ac_ext" <<_ACEOF
16514 #line 16514 "configure"
16515 #include "confdefs.h"
16516
16517 #include <xcurses.h>
16518 char *XCursesProgramName = "test";
16519
16520 int
16521 main (void)
16522 {
16523 XCursesExit();
16524   ;
16525   return 0;
16526 }
16527 _ACEOF
16528 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16529 if { (eval echo "$as_me:16529: \"$ac_link\"") >&5
16530   (eval $ac_link) 2>&5
16531   ac_status=$?
16532   echo "$as_me:16532: \$? = $ac_status" >&5
16533   (exit "$ac_status"); } &&
16534          { ac_try='test -s "conftest$ac_exeext"'
16535   { (eval echo "$as_me:16535: \"$ac_try\"") >&5
16536   (eval $ac_try) 2>&5
16537   ac_status=$?
16538   echo "$as_me:16538: \$? = $ac_status" >&5
16539   (exit "$ac_status"); }; }; then
16540   cf_cv_lib_XCurses=yes
16541 else
16542   echo "$as_me: failed program was:" >&5
16543 cat "conftest.$ac_ext" >&5
16544 cf_cv_lib_XCurses=no
16545 fi
16546 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16547
16548 fi
16549 echo "$as_me:16549: result: $cf_cv_lib_XCurses" >&5
16550 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16551
16552 fi
16553
16554 if test "$cf_cv_lib_XCurses" = yes ; then
16555
16556 cat >>confdefs.h <<\EOF
16557 #define UNIX 1
16558 EOF
16559
16560 cat >>confdefs.h <<\EOF
16561 #define XCURSES 1
16562 EOF
16563
16564         echo "$as_me:16564: checking for xcurses.h" >&5
16565 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16566 if test "${ac_cv_header_xcurses_h+set}" = set; then
16567   echo $ECHO_N "(cached) $ECHO_C" >&6
16568 else
16569   cat >"conftest.$ac_ext" <<_ACEOF
16570 #line 16570 "configure"
16571 #include "confdefs.h"
16572 #include <xcurses.h>
16573 _ACEOF
16574 if { (eval echo "$as_me:16574: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16575   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16576   ac_status=$?
16577   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16578   rm -f conftest.er1
16579   cat conftest.err >&5
16580   echo "$as_me:16580: \$? = $ac_status" >&5
16581   (exit "$ac_status"); } >/dev/null; then
16582   if test -s conftest.err; then
16583     ac_cpp_err=$ac_c_preproc_warn_flag
16584   else
16585     ac_cpp_err=
16586   fi
16587 else
16588   ac_cpp_err=yes
16589 fi
16590 if test -z "$ac_cpp_err"; then
16591   ac_cv_header_xcurses_h=yes
16592 else
16593   echo "$as_me: failed program was:" >&5
16594   cat "conftest.$ac_ext" >&5
16595   ac_cv_header_xcurses_h=no
16596 fi
16597 rm -f conftest.err "conftest.$ac_ext"
16598 fi
16599 echo "$as_me:16599: result: $ac_cv_header_xcurses_h" >&5
16600 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16601 if test "$ac_cv_header_xcurses_h" = yes; then
16602
16603 cat >>confdefs.h <<\EOF
16604 #define HAVE_XCURSES 1
16605 EOF
16606
16607 fi
16608
16609 else
16610         { { echo "$as_me:16610: error: Cannot link with XCurses" >&5
16611 echo "$as_me: error: Cannot link with XCurses" >&2;}
16612    { (exit 1); exit 1; }; }
16613 fi
16614
16615         ;;
16616 (*)
16617         { { echo "$as_me:16617: error: unexpected screen-value: $cf_cv_screen" >&5
16618 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16619    { (exit 1); exit 1; }; }
16620         ;;
16621 esac
16622
16623 : ${cf_nculib_root:=$cf_cv_screen}
16624 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16625 echo "$as_me:16625: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16626 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16627 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16628   echo $ECHO_N "(cached) $ECHO_C" >&6
16629 else
16630   ac_check_lib_save_LIBS=$LIBS
16631 LIBS="-l$cf_nculib_root  $LIBS"
16632 cat >"conftest.$ac_ext" <<_ACEOF
16633 #line 16633 "configure"
16634 #include "confdefs.h"
16635
16636 /* Override any gcc2 internal prototype to avoid an error.  */
16637 #ifdef __cplusplus
16638 extern "C"
16639 #endif
16640 /* We use char because int might match the return type of a gcc2
16641    builtin and then its argument prototype would still apply.  */
16642 char _nc_init_pthreads ();
16643 int
16644 main (void)
16645 {
16646 _nc_init_pthreads ();
16647   ;
16648   return 0;
16649 }
16650 _ACEOF
16651 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16652 if { (eval echo "$as_me:16652: \"$ac_link\"") >&5
16653   (eval $ac_link) 2>&5
16654   ac_status=$?
16655   echo "$as_me:16655: \$? = $ac_status" >&5
16656   (exit "$ac_status"); } &&
16657          { ac_try='test -s "conftest$ac_exeext"'
16658   { (eval echo "$as_me:16658: \"$ac_try\"") >&5
16659   (eval $ac_try) 2>&5
16660   ac_status=$?
16661   echo "$as_me:16661: \$? = $ac_status" >&5
16662   (exit "$ac_status"); }; }; then
16663   eval "$as_ac_Lib=yes"
16664 else
16665   echo "$as_me: failed program was:" >&5
16666 cat "conftest.$ac_ext" >&5
16667 eval "$as_ac_Lib=no"
16668 fi
16669 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16670 LIBS=$ac_check_lib_save_LIBS
16671 fi
16672 echo "$as_me:16672: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16673 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16674 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16675   cf_cv_ncurses_pthreads=yes
16676 else
16677   cf_cv_ncurses_pthreads=no
16678 fi
16679
16680 if test "$cf_cv_ncurses_pthreads" = yes
16681 then
16682
16683 cf_add_libs="$LIBS"
16684 # reverse order
16685 cf_add_0lib=
16686 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16687 # filter duplicates
16688 for cf_add_1lib in $cf_add_0lib; do
16689         for cf_add_2lib in $cf_add_libs; do
16690                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16691                         cf_add_1lib=
16692                         break
16693                 fi
16694         done
16695         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16696 done
16697 LIBS="$cf_add_libs"
16698
16699 fi
16700
16701 case $cf_cv_screen in
16702 (ncurses*)
16703         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16704         ;;
16705 esac
16706
16707 echo "$as_me:16707: checking for X11 rgb file" >&5
16708 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16709
16710 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16711 if test "${with_x11_rgb+set}" = set; then
16712   withval="$with_x11_rgb"
16713   RGB_PATH=$withval
16714 else
16715   RGB_PATH=auto
16716 fi;
16717
16718 if test "x$RGB_PATH" = xauto
16719 then
16720         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16721         for cf_path in \
16722                 /opt/local/share/X11/rgb.txt \
16723                 /opt/X11/share/X11/rgb.txt \
16724                 /usr/share/X11/rgb.txt \
16725                 /usr/X11/share/X11/rgb.txt \
16726                 /usr/X11/lib/X11/rgb.txt \
16727                 /usr/lib/X11/rgb.txt \
16728                 /etc/X11/rgb.txt \
16729                 /usr/pkg/lib/X11/rgb.txt \
16730                 /usr/X11R7/lib/X11/rgb.txt \
16731                 /usr/X11R6/lib/X11/rgb.txt \
16732                 /usr/X11R5/lib/X11/rgb.txt \
16733                 /usr/X11R4/lib/X11/rgb.txt \
16734                 /usr/local/lib/X11/rgb.txt \
16735                 /usr/local/share/X11/rgb.txt \
16736                 /usr/lib64/X11/rgb.txt
16737         do
16738                 if test -f "$cf_path" ; then
16739                         RGB_PATH="$cf_path"
16740                         break
16741                 fi
16742         done
16743 else
16744         cf_path=$RGB_PATH
16745
16746 if test "x$prefix" != xNONE; then
16747         cf_path_syntax="$prefix"
16748 else
16749         cf_path_syntax="$ac_default_prefix"
16750 fi
16751
16752 case ".$cf_path" in
16753 (.\$\(*\)*|.\'*\'*)
16754         ;;
16755 (..|./*|.\\*)
16756         ;;
16757 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16758         ;;
16759 (.\$\{*prefix\}*|.\$\{*dir\}*)
16760         eval cf_path="$cf_path"
16761         case ".$cf_path" in
16762         (.NONE/*)
16763                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16764                 ;;
16765         esac
16766         ;;
16767 (.no|.NONE/*)
16768         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16769         ;;
16770 (*)
16771         { { echo "$as_me:16771: error: expected a pathname, not \"$cf_path\"" >&5
16772 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16773    { (exit 1); exit 1; }; }
16774         ;;
16775 esac
16776
16777 fi
16778
16779 echo "$as_me:16779: result: $RGB_PATH" >&5
16780 echo "${ECHO_T}$RGB_PATH" >&6
16781
16782 cat >>confdefs.h <<EOF
16783 #define RGB_PATH "$cf_path"
16784 EOF
16785
16786 no_x11_rgb=
16787 if test "$RGB_PATH" = no
16788 then
16789         no_x11_rgb="#"
16790 fi
16791
16792 cf_curses_headers=
16793
16794 case $cf_cv_screen in
16795 (pdcurses)
16796         cf_default_panel=no
16797         cf_default_form=no
16798         cf_default_menu=no
16799         cf_default_tinfo=no
16800         ;;
16801 (xcurses|bsdcurses)
16802         cf_default_panel=no
16803         cf_default_form=no
16804         cf_default_menu=no
16805         cf_default_tinfo=yes
16806         ;;
16807 (*)
16808         cf_default_panel=yes
16809         cf_default_form=yes
16810         cf_default_menu=yes
16811         cf_default_tinfo=yes
16812         case $cf_cv_screen in
16813         (ncurses*)
16814                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16815                 ;;
16816         esac
16817         ;;
16818 esac
16819
16820 echo "$as_me:16820: checking for desired basename for form library" >&5
16821 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16822
16823 # Check whether --with-form-libname or --without-form-libname was given.
16824 if test "${with_form_libname+set}" = set; then
16825   withval="$with_form_libname"
16826   with_lib_basename=$withval
16827 else
16828   with_lib_basename=form
16829 fi;
16830 FORM_NAME="$with_lib_basename"
16831
16832 case "x$FORM_NAME" in
16833 (x|xno|xnone|xyes)
16834         FORM_NAME=form
16835         ;;
16836 (*)
16837         ;;
16838 esac
16839
16840 echo "$as_me:16840: result: $FORM_NAME" >&5
16841 echo "${ECHO_T}$FORM_NAME" >&6
16842
16843 echo "$as_me:16843: checking for desired basename for menu library" >&5
16844 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16845
16846 # Check whether --with-menu-libname or --without-menu-libname was given.
16847 if test "${with_menu_libname+set}" = set; then
16848   withval="$with_menu_libname"
16849   with_lib_basename=$withval
16850 else
16851   with_lib_basename=menu
16852 fi;
16853 MENU_NAME="$with_lib_basename"
16854
16855 case "x$MENU_NAME" in
16856 (x|xno|xnone|xyes)
16857         MENU_NAME=menu
16858         ;;
16859 (*)
16860         ;;
16861 esac
16862
16863 echo "$as_me:16863: result: $MENU_NAME" >&5
16864 echo "${ECHO_T}$MENU_NAME" >&6
16865
16866 echo "$as_me:16866: checking for desired basename for panel library" >&5
16867 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16868
16869 # Check whether --with-panel-libname or --without-panel-libname was given.
16870 if test "${with_panel_libname+set}" = set; then
16871   withval="$with_panel_libname"
16872   with_lib_basename=$withval
16873 else
16874   with_lib_basename=panel
16875 fi;
16876 PANEL_NAME="$with_lib_basename"
16877
16878 case "x$PANEL_NAME" in
16879 (x|xno|xnone|xyes)
16880         PANEL_NAME=panel
16881         ;;
16882 (*)
16883         ;;
16884 esac
16885
16886 echo "$as_me:16886: result: $PANEL_NAME" >&5
16887 echo "${ECHO_T}$PANEL_NAME" >&6
16888
16889 echo "$as_me:16889: checking if you want to check for panel functions" >&5
16890 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16891
16892 # Check whether --enable-panel or --disable-panel was given.
16893 if test "${enable_panel+set}" = set; then
16894   enableval="$enable_panel"
16895   test "$enableval" != no && enableval=yes
16896         if test "$enableval" != "yes" ; then
16897     cf_enable_panel=no
16898         else
16899                 cf_enable_panel=$cf_default_panel
16900         fi
16901 else
16902   enableval=yes
16903         cf_enable_panel=$cf_default_panel
16904
16905 fi;
16906 echo "$as_me:16906: result: $cf_enable_panel" >&5
16907 echo "${ECHO_T}$cf_enable_panel" >&6
16908 if test $cf_enable_panel = yes
16909 then
16910
16911 cf_have_curses_lib=no
16912
16913 : ${NCURSES_CONFIG_PKG:=none}
16914 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16915         :
16916 elif test "x${PKG_CONFIG:=none}" != xnone; then
16917         echo "$as_me:16917: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16918 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16919         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16920                 echo "$as_me:16920: result: yes" >&5
16921 echo "${ECHO_T}yes" >&6
16922
16923                 echo "$as_me:16923: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16924 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16925
16926                 cf_save_CFLAGS="$CFLAGS"
16927                 cf_save_CPPFLAGS="$CPPFLAGS"
16928                 cf_save_LIBS="$LIBS"
16929
16930 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16931 do
16932         case "x$cf_add_cflags" in
16933         (x-[DU]*)
16934
16935 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
16936 while true
16937 do
16938         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
16939         test "$CFLAGS" != "$cf_old_cflag" || break
16940
16941         CFLAGS="$cf_old_cflag"
16942 done
16943
16944 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
16945 while true
16946 do
16947         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
16948         test "$CPPFLAGS" != "$cf_old_cflag" || break
16949
16950         CPPFLAGS="$cf_old_cflag"
16951 done
16952
16953                 ;;
16954         esac
16955
16956 cf_fix_cppflags=no
16957 cf_new_cflags=
16958 cf_new_cppflags=
16959 cf_new_extra_cppflags=
16960
16961 for cf_add_cflags in $cf_add_cflags
16962 do
16963 case "$cf_fix_cppflags" in
16964 (no)
16965         case "$cf_add_cflags" in
16966         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16967                 case "$cf_add_cflags" in
16968                 (-D*)
16969                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16970
16971                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16972                                 && test -z "${cf_tst_cflags}" \
16973                                 && cf_fix_cppflags=yes
16974
16975                         if test "$cf_fix_cppflags" = yes ; then
16976
16977         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16978         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16979
16980                                 continue
16981                         elif test "${cf_tst_cflags}" = "\"'" ; then
16982
16983         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16984         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16985
16986                                 continue
16987                         fi
16988                         ;;
16989                 esac
16990                 case "$CPPFLAGS" in
16991                 (*$cf_add_cflags)
16992                         ;;
16993                 (*)
16994                         case "$cf_add_cflags" in
16995                         (-D*)
16996                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16997
16998 CPPFLAGS=`echo "$CPPFLAGS" | \
16999         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17000                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17001
17002                                 ;;
17003                         esac
17004
17005         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17006         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17007
17008                         ;;
17009                 esac
17010                 ;;
17011         (*)
17012
17013         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17014         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17015
17016                 ;;
17017         esac
17018         ;;
17019 (yes)
17020
17021         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17022         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17023
17024         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17025
17026         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17027                 && test -z "${cf_tst_cflags}" \
17028                 && cf_fix_cppflags=no
17029         ;;
17030 esac
17031 done
17032
17033 if test -n "$cf_new_cflags" ; then
17034
17035         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17036         CFLAGS="${CFLAGS}$cf_new_cflags"
17037
17038 fi
17039
17040 if test -n "$cf_new_cppflags" ; then
17041
17042         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17043         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17044
17045 fi
17046
17047 if test -n "$cf_new_extra_cppflags" ; then
17048
17049         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17050         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17051
17052 fi
17053
17054 done
17055
17056 cf_add_libs="$LIBS"
17057 # reverse order
17058 cf_add_0lib=
17059 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17060 # filter duplicates
17061 for cf_add_1lib in $cf_add_0lib; do
17062         for cf_add_2lib in $cf_add_libs; do
17063                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17064                         cf_add_1lib=
17065                         break
17066                 fi
17067         done
17068         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17069 done
17070 LIBS="$cf_add_libs"
17071
17072                 cat >"conftest.$ac_ext" <<_ACEOF
17073 #line 17073 "configure"
17074 #include "confdefs.h"
17075 #include <$PANEL_NAME.h>
17076 int
17077 main (void)
17078 {
17079 (void) new_panel ( 0 );
17080   ;
17081   return 0;
17082 }
17083 _ACEOF
17084 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17085 if { (eval echo "$as_me:17085: \"$ac_link\"") >&5
17086   (eval $ac_link) 2>&5
17087   ac_status=$?
17088   echo "$as_me:17088: \$? = $ac_status" >&5
17089   (exit "$ac_status"); } &&
17090          { ac_try='test -s "conftest$ac_exeext"'
17091   { (eval echo "$as_me:17091: \"$ac_try\"") >&5
17092   (eval $ac_try) 2>&5
17093   ac_status=$?
17094   echo "$as_me:17094: \$? = $ac_status" >&5
17095   (exit "$ac_status"); }; }; then
17096   if test "$cross_compiling" = yes; then
17097   cf_have_curses_lib=maybe
17098 else
17099   cat >"conftest.$ac_ext" <<_ACEOF
17100 #line 17100 "configure"
17101 #include "confdefs.h"
17102 #include <$PANEL_NAME.h>
17103                                 int main(void)
17104                                 { (void) new_panel ( 0 ); return 0; }
17105 _ACEOF
17106 rm -f "conftest$ac_exeext"
17107 if { (eval echo "$as_me:17107: \"$ac_link\"") >&5
17108   (eval $ac_link) 2>&5
17109   ac_status=$?
17110   echo "$as_me:17110: \$? = $ac_status" >&5
17111   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17112   { (eval echo "$as_me:17112: \"$ac_try\"") >&5
17113   (eval $ac_try) 2>&5
17114   ac_status=$?
17115   echo "$as_me:17115: \$? = $ac_status" >&5
17116   (exit "$ac_status"); }; }; then
17117   cf_have_curses_lib=yes
17118 else
17119   echo "$as_me: program exited with status $ac_status" >&5
17120 echo "$as_me: failed program was:" >&5
17121 cat "conftest.$ac_ext" >&5
17122 cf_have_curses_lib=no
17123 fi
17124 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17125 fi
17126 else
17127   echo "$as_me: failed program was:" >&5
17128 cat "conftest.$ac_ext" >&5
17129 cf_have_curses_lib=no
17130 fi
17131 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17132                 echo "$as_me:17132: result: $cf_have_curses_lib" >&5
17133 echo "${ECHO_T}$cf_have_curses_lib" >&6
17134                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17135                 if test "$cf_have_curses_lib" = "yes"
17136                 then
17137
17138 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17139
17140                         cat >>confdefs.h <<EOF
17141 #define $cf_upper 1
17142 EOF
17143
17144                 else
17145                         CFLAGS="$cf_save_CFLAGS"
17146                         CPPFLAGS="$cf_save_CPPFLAGS"
17147                         LIBS="$cf_save_LIBS"
17148                 fi
17149         fi
17150 fi
17151 if test "$cf_have_curses_lib" = no; then
17152         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
17153 echo "$as_me:17153: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
17154 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17155 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17156   echo $ECHO_N "(cached) $ECHO_C" >&6
17157 else
17158   ac_check_lib_save_LIBS=$LIBS
17159 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
17160 cat >"conftest.$ac_ext" <<_ACEOF
17161 #line 17161 "configure"
17162 #include "confdefs.h"
17163
17164 /* Override any gcc2 internal prototype to avoid an error.  */
17165 #ifdef __cplusplus
17166 extern "C"
17167 #endif
17168 /* We use char because int might match the return type of a gcc2
17169    builtin and then its argument prototype would still apply.  */
17170 char new_panel ();
17171 int
17172 main (void)
17173 {
17174 new_panel ();
17175   ;
17176   return 0;
17177 }
17178 _ACEOF
17179 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17180 if { (eval echo "$as_me:17180: \"$ac_link\"") >&5
17181   (eval $ac_link) 2>&5
17182   ac_status=$?
17183   echo "$as_me:17183: \$? = $ac_status" >&5
17184   (exit "$ac_status"); } &&
17185          { ac_try='test -s "conftest$ac_exeext"'
17186   { (eval echo "$as_me:17186: \"$ac_try\"") >&5
17187   (eval $ac_try) 2>&5
17188   ac_status=$?
17189   echo "$as_me:17189: \$? = $ac_status" >&5
17190   (exit "$ac_status"); }; }; then
17191   eval "$as_ac_Lib=yes"
17192 else
17193   echo "$as_me: failed program was:" >&5
17194 cat "conftest.$ac_ext" >&5
17195 eval "$as_ac_Lib=no"
17196 fi
17197 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17198 LIBS=$ac_check_lib_save_LIBS
17199 fi
17200 echo "$as_me:17200: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17201 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17202 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17203
17204 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17205
17206 cf_add_libs="$LIBS"
17207 # reverse order
17208 cf_add_0lib=
17209 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17210 # filter duplicates
17211 for cf_add_1lib in $cf_add_0lib; do
17212         for cf_add_2lib in $cf_add_libs; do
17213                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17214                         cf_add_1lib=
17215                         break
17216                 fi
17217         done
17218         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17219 done
17220 LIBS="$cf_add_libs"
17221
17222                 cat >>confdefs.h <<EOF
17223 #define $cf_upper 1
17224 EOF
17225
17226 fi
17227
17228 fi
17229
17230         cf_curses_headers="$cf_curses_headers panel.h"
17231 fi
17232
17233 echo "$as_me:17233: checking if you want to check for menu functions" >&5
17234 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
17235
17236 # Check whether --enable-menu or --disable-menu was given.
17237 if test "${enable_menu+set}" = set; then
17238   enableval="$enable_menu"
17239   test "$enableval" != no && enableval=yes
17240         if test "$enableval" != "yes" ; then
17241     cf_enable_menu=no
17242         else
17243                 cf_enable_menu=$cf_default_menu
17244         fi
17245 else
17246   enableval=yes
17247         cf_enable_menu=$cf_default_menu
17248
17249 fi;
17250 echo "$as_me:17250: result: $cf_enable_menu" >&5
17251 echo "${ECHO_T}$cf_enable_menu" >&6
17252 if test $cf_enable_menu = yes
17253 then
17254         case $cf_cv_screen in
17255         (ncurses*)
17256                 ;;
17257         (curses*)
17258
17259 echo "$as_me:17259: checking for NetBSD menu.h" >&5
17260 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
17261 if test "${cf_cv_netbsd_menu_h+set}" = set; then
17262   echo $ECHO_N "(cached) $ECHO_C" >&6
17263 else
17264
17265 cat >"conftest.$ac_ext" <<_ACEOF
17266 #line 17266 "configure"
17267 #include "confdefs.h"
17268
17269 #include <${cf_cv_ncurses_header:-curses.h}>
17270 #include <menu.h>
17271
17272 int
17273 main (void)
17274 {
17275
17276         MENU *menu;
17277         int y = menu->max_item_width;
17278
17279   ;
17280   return 0;
17281 }
17282 _ACEOF
17283 rm -f "conftest.$ac_objext"
17284 if { (eval echo "$as_me:17284: \"$ac_compile\"") >&5
17285   (eval $ac_compile) 2>&5
17286   ac_status=$?
17287   echo "$as_me:17287: \$? = $ac_status" >&5
17288   (exit "$ac_status"); } &&
17289          { ac_try='test -s "conftest.$ac_objext"'
17290   { (eval echo "$as_me:17290: \"$ac_try\"") >&5
17291   (eval $ac_try) 2>&5
17292   ac_status=$?
17293   echo "$as_me:17293: \$? = $ac_status" >&5
17294   (exit "$ac_status"); }; }; then
17295   cf_cv_netbsd_menu_h=yes
17296
17297 else
17298   echo "$as_me: failed program was:" >&5
17299 cat "conftest.$ac_ext" >&5
17300 cf_cv_netbsd_menu_h=no
17301 fi
17302 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17303
17304 fi
17305 echo "$as_me:17305: result: $cf_cv_netbsd_menu_h" >&5
17306 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
17307
17308 test "$cf_cv_netbsd_menu_h" = yes &&
17309 cat >>confdefs.h <<\EOF
17310 #define HAVE_NETBSD_MENU_H 1
17311 EOF
17312
17313                 ;;
17314         esac
17315
17316 cf_have_curses_lib=no
17317
17318 : ${NCURSES_CONFIG_PKG:=none}
17319 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17320         :
17321 elif test "x${PKG_CONFIG:=none}" != xnone; then
17322         echo "$as_me:17322: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
17323 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17324         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
17325                 echo "$as_me:17325: result: yes" >&5
17326 echo "${ECHO_T}yes" >&6
17327
17328                 echo "$as_me:17328: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
17329 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17330
17331                 cf_save_CFLAGS="$CFLAGS"
17332                 cf_save_CPPFLAGS="$CPPFLAGS"
17333                 cf_save_LIBS="$LIBS"
17334
17335 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
17336 do
17337         case "x$cf_add_cflags" in
17338         (x-[DU]*)
17339
17340 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17341 while true
17342 do
17343         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17344         test "$CFLAGS" != "$cf_old_cflag" || break
17345
17346         CFLAGS="$cf_old_cflag"
17347 done
17348
17349 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17350 while true
17351 do
17352         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17353         test "$CPPFLAGS" != "$cf_old_cflag" || break
17354
17355         CPPFLAGS="$cf_old_cflag"
17356 done
17357
17358                 ;;
17359         esac
17360
17361 cf_fix_cppflags=no
17362 cf_new_cflags=
17363 cf_new_cppflags=
17364 cf_new_extra_cppflags=
17365
17366 for cf_add_cflags in $cf_add_cflags
17367 do
17368 case "$cf_fix_cppflags" in
17369 (no)
17370         case "$cf_add_cflags" in
17371         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17372                 case "$cf_add_cflags" in
17373                 (-D*)
17374                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17375
17376                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17377                                 && test -z "${cf_tst_cflags}" \
17378                                 && cf_fix_cppflags=yes
17379
17380                         if test "$cf_fix_cppflags" = yes ; then
17381
17382         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17383         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17384
17385                                 continue
17386                         elif test "${cf_tst_cflags}" = "\"'" ; then
17387
17388         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17389         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17390
17391                                 continue
17392                         fi
17393                         ;;
17394                 esac
17395                 case "$CPPFLAGS" in
17396                 (*$cf_add_cflags)
17397                         ;;
17398                 (*)
17399                         case "$cf_add_cflags" in
17400                         (-D*)
17401                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17402
17403 CPPFLAGS=`echo "$CPPFLAGS" | \
17404         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17405                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17406
17407                                 ;;
17408                         esac
17409
17410         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17411         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17412
17413                         ;;
17414                 esac
17415                 ;;
17416         (*)
17417
17418         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17419         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17420
17421                 ;;
17422         esac
17423         ;;
17424 (yes)
17425
17426         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17427         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17428
17429         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17430
17431         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17432                 && test -z "${cf_tst_cflags}" \
17433                 && cf_fix_cppflags=no
17434         ;;
17435 esac
17436 done
17437
17438 if test -n "$cf_new_cflags" ; then
17439
17440         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17441         CFLAGS="${CFLAGS}$cf_new_cflags"
17442
17443 fi
17444
17445 if test -n "$cf_new_cppflags" ; then
17446
17447         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17448         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17449
17450 fi
17451
17452 if test -n "$cf_new_extra_cppflags" ; then
17453
17454         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17455         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17456
17457 fi
17458
17459 done
17460
17461 cf_add_libs="$LIBS"
17462 # reverse order
17463 cf_add_0lib=
17464 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17465 # filter duplicates
17466 for cf_add_1lib in $cf_add_0lib; do
17467         for cf_add_2lib in $cf_add_libs; do
17468                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17469                         cf_add_1lib=
17470                         break
17471                 fi
17472         done
17473         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17474 done
17475 LIBS="$cf_add_libs"
17476
17477                 cat >"conftest.$ac_ext" <<_ACEOF
17478 #line 17478 "configure"
17479 #include "confdefs.h"
17480 #include <$MENU_NAME.h>
17481 int
17482 main (void)
17483 {
17484 (void) menu_driver ( 0,0 );
17485   ;
17486   return 0;
17487 }
17488 _ACEOF
17489 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17490 if { (eval echo "$as_me:17490: \"$ac_link\"") >&5
17491   (eval $ac_link) 2>&5
17492   ac_status=$?
17493   echo "$as_me:17493: \$? = $ac_status" >&5
17494   (exit "$ac_status"); } &&
17495          { ac_try='test -s "conftest$ac_exeext"'
17496   { (eval echo "$as_me:17496: \"$ac_try\"") >&5
17497   (eval $ac_try) 2>&5
17498   ac_status=$?
17499   echo "$as_me:17499: \$? = $ac_status" >&5
17500   (exit "$ac_status"); }; }; then
17501   if test "$cross_compiling" = yes; then
17502   cf_have_curses_lib=maybe
17503 else
17504   cat >"conftest.$ac_ext" <<_ACEOF
17505 #line 17505 "configure"
17506 #include "confdefs.h"
17507 #include <$MENU_NAME.h>
17508                                 int main(void)
17509                                 { (void) menu_driver ( 0,0 ); return 0; }
17510 _ACEOF
17511 rm -f "conftest$ac_exeext"
17512 if { (eval echo "$as_me:17512: \"$ac_link\"") >&5
17513   (eval $ac_link) 2>&5
17514   ac_status=$?
17515   echo "$as_me:17515: \$? = $ac_status" >&5
17516   (exit "$ac_status"); } && { ac_try='"./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   cf_have_curses_lib=yes
17523 else
17524   echo "$as_me: program exited with status $ac_status" >&5
17525 echo "$as_me: failed program was:" >&5
17526 cat "conftest.$ac_ext" >&5
17527 cf_have_curses_lib=no
17528 fi
17529 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17530 fi
17531 else
17532   echo "$as_me: failed program was:" >&5
17533 cat "conftest.$ac_ext" >&5
17534 cf_have_curses_lib=no
17535 fi
17536 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17537                 echo "$as_me:17537: result: $cf_have_curses_lib" >&5
17538 echo "${ECHO_T}$cf_have_curses_lib" >&6
17539                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17540                 if test "$cf_have_curses_lib" = "yes"
17541                 then
17542
17543 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17544
17545                         cat >>confdefs.h <<EOF
17546 #define $cf_upper 1
17547 EOF
17548
17549                 else
17550                         CFLAGS="$cf_save_CFLAGS"
17551                         CPPFLAGS="$cf_save_CPPFLAGS"
17552                         LIBS="$cf_save_LIBS"
17553                 fi
17554         fi
17555 fi
17556 if test "$cf_have_curses_lib" = no; then
17557         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17558 echo "$as_me:17558: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17559 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17560 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17561   echo $ECHO_N "(cached) $ECHO_C" >&6
17562 else
17563   ac_check_lib_save_LIBS=$LIBS
17564 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17565 cat >"conftest.$ac_ext" <<_ACEOF
17566 #line 17566 "configure"
17567 #include "confdefs.h"
17568
17569 /* Override any gcc2 internal prototype to avoid an error.  */
17570 #ifdef __cplusplus
17571 extern "C"
17572 #endif
17573 /* We use char because int might match the return type of a gcc2
17574    builtin and then its argument prototype would still apply.  */
17575 char menu_driver ();
17576 int
17577 main (void)
17578 {
17579 menu_driver ();
17580   ;
17581   return 0;
17582 }
17583 _ACEOF
17584 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17585 if { (eval echo "$as_me:17585: \"$ac_link\"") >&5
17586   (eval $ac_link) 2>&5
17587   ac_status=$?
17588   echo "$as_me:17588: \$? = $ac_status" >&5
17589   (exit "$ac_status"); } &&
17590          { ac_try='test -s "conftest$ac_exeext"'
17591   { (eval echo "$as_me:17591: \"$ac_try\"") >&5
17592   (eval $ac_try) 2>&5
17593   ac_status=$?
17594   echo "$as_me:17594: \$? = $ac_status" >&5
17595   (exit "$ac_status"); }; }; then
17596   eval "$as_ac_Lib=yes"
17597 else
17598   echo "$as_me: failed program was:" >&5
17599 cat "conftest.$ac_ext" >&5
17600 eval "$as_ac_Lib=no"
17601 fi
17602 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17603 LIBS=$ac_check_lib_save_LIBS
17604 fi
17605 echo "$as_me:17605: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17606 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17607 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17608
17609 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17610
17611 cf_add_libs="$LIBS"
17612 # reverse order
17613 cf_add_0lib=
17614 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17615 # filter duplicates
17616 for cf_add_1lib in $cf_add_0lib; do
17617         for cf_add_2lib in $cf_add_libs; do
17618                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17619                         cf_add_1lib=
17620                         break
17621                 fi
17622         done
17623         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17624 done
17625 LIBS="$cf_add_libs"
17626
17627                 cat >>confdefs.h <<EOF
17628 #define $cf_upper 1
17629 EOF
17630
17631 fi
17632
17633 fi
17634
17635         cf_curses_headers="$cf_curses_headers menu.h"
17636 fi
17637
17638 echo "$as_me:17638: checking if you want to check for form functions" >&5
17639 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17640
17641 # Check whether --enable-form or --disable-form was given.
17642 if test "${enable_form+set}" = set; then
17643   enableval="$enable_form"
17644   test "$enableval" != no && enableval=yes
17645         if test "$enableval" != "yes" ; then
17646     cf_enable_form=no
17647         else
17648                 cf_enable_form=$cf_default_form
17649         fi
17650 else
17651   enableval=yes
17652         cf_enable_form=$cf_default_form
17653
17654 fi;
17655 echo "$as_me:17655: result: $cf_enable_form" >&5
17656 echo "${ECHO_T}$cf_enable_form" >&6
17657 if test $cf_enable_form = yes
17658 then
17659         case $cf_cv_screen in
17660         (ncurses*)
17661                 ;;
17662         (curses*)
17663
17664 echo "$as_me:17664: checking for NetBSD form.h" >&5
17665 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17666 if test "${cf_cv_netbsd_form_h+set}" = set; then
17667   echo $ECHO_N "(cached) $ECHO_C" >&6
17668 else
17669
17670 cat >"conftest.$ac_ext" <<_ACEOF
17671 #line 17671 "configure"
17672 #include "confdefs.h"
17673
17674 #include <${cf_cv_ncurses_header:-curses.h}>
17675 #include <form.h>
17676
17677 int
17678 main (void)
17679 {
17680
17681         FORM *form;
17682         int y = current_field(form)->cursor_ypos;
17683         int x = current_field(form)->cursor_xpos;
17684
17685   ;
17686   return 0;
17687 }
17688 _ACEOF
17689 rm -f "conftest.$ac_objext"
17690 if { (eval echo "$as_me:17690: \"$ac_compile\"") >&5
17691   (eval $ac_compile) 2>&5
17692   ac_status=$?
17693   echo "$as_me:17693: \$? = $ac_status" >&5
17694   (exit "$ac_status"); } &&
17695          { ac_try='test -s "conftest.$ac_objext"'
17696   { (eval echo "$as_me:17696: \"$ac_try\"") >&5
17697   (eval $ac_try) 2>&5
17698   ac_status=$?
17699   echo "$as_me:17699: \$? = $ac_status" >&5
17700   (exit "$ac_status"); }; }; then
17701   cf_cv_netbsd_form_h=yes
17702
17703 else
17704   echo "$as_me: failed program was:" >&5
17705 cat "conftest.$ac_ext" >&5
17706 cf_cv_netbsd_form_h=no
17707 fi
17708 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17709
17710 fi
17711 echo "$as_me:17711: result: $cf_cv_netbsd_form_h" >&5
17712 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17713
17714 test "$cf_cv_netbsd_form_h" = yes &&
17715 cat >>confdefs.h <<\EOF
17716 #define HAVE_NETBSD_FORM_H 1
17717 EOF
17718
17719                 ;;
17720         esac
17721
17722 cf_have_curses_lib=no
17723
17724 : ${NCURSES_CONFIG_PKG:=none}
17725 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17726         :
17727 elif test "x${PKG_CONFIG:=none}" != xnone; then
17728         echo "$as_me:17728: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17729 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17730         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17731                 echo "$as_me:17731: result: yes" >&5
17732 echo "${ECHO_T}yes" >&6
17733
17734                 echo "$as_me:17734: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17735 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17736
17737                 cf_save_CFLAGS="$CFLAGS"
17738                 cf_save_CPPFLAGS="$CPPFLAGS"
17739                 cf_save_LIBS="$LIBS"
17740
17741 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17742 do
17743         case "x$cf_add_cflags" in
17744         (x-[DU]*)
17745
17746 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17747 while true
17748 do
17749         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17750         test "$CFLAGS" != "$cf_old_cflag" || break
17751
17752         CFLAGS="$cf_old_cflag"
17753 done
17754
17755 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17756 while true
17757 do
17758         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17759         test "$CPPFLAGS" != "$cf_old_cflag" || break
17760
17761         CPPFLAGS="$cf_old_cflag"
17762 done
17763
17764                 ;;
17765         esac
17766
17767 cf_fix_cppflags=no
17768 cf_new_cflags=
17769 cf_new_cppflags=
17770 cf_new_extra_cppflags=
17771
17772 for cf_add_cflags in $cf_add_cflags
17773 do
17774 case "$cf_fix_cppflags" in
17775 (no)
17776         case "$cf_add_cflags" in
17777         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17778                 case "$cf_add_cflags" in
17779                 (-D*)
17780                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17781
17782                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17783                                 && test -z "${cf_tst_cflags}" \
17784                                 && cf_fix_cppflags=yes
17785
17786                         if test "$cf_fix_cppflags" = yes ; then
17787
17788         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17789         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17790
17791                                 continue
17792                         elif test "${cf_tst_cflags}" = "\"'" ; then
17793
17794         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17795         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17796
17797                                 continue
17798                         fi
17799                         ;;
17800                 esac
17801                 case "$CPPFLAGS" in
17802                 (*$cf_add_cflags)
17803                         ;;
17804                 (*)
17805                         case "$cf_add_cflags" in
17806                         (-D*)
17807                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17808
17809 CPPFLAGS=`echo "$CPPFLAGS" | \
17810         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17811                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17812
17813                                 ;;
17814                         esac
17815
17816         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17817         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17818
17819                         ;;
17820                 esac
17821                 ;;
17822         (*)
17823
17824         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17825         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17826
17827                 ;;
17828         esac
17829         ;;
17830 (yes)
17831
17832         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17833         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17834
17835         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17836
17837         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17838                 && test -z "${cf_tst_cflags}" \
17839                 && cf_fix_cppflags=no
17840         ;;
17841 esac
17842 done
17843
17844 if test -n "$cf_new_cflags" ; then
17845
17846         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17847         CFLAGS="${CFLAGS}$cf_new_cflags"
17848
17849 fi
17850
17851 if test -n "$cf_new_cppflags" ; then
17852
17853         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17854         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17855
17856 fi
17857
17858 if test -n "$cf_new_extra_cppflags" ; then
17859
17860         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17861         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17862
17863 fi
17864
17865 done
17866
17867 cf_add_libs="$LIBS"
17868 # reverse order
17869 cf_add_0lib=
17870 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17871 # filter duplicates
17872 for cf_add_1lib in $cf_add_0lib; do
17873         for cf_add_2lib in $cf_add_libs; do
17874                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17875                         cf_add_1lib=
17876                         break
17877                 fi
17878         done
17879         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17880 done
17881 LIBS="$cf_add_libs"
17882
17883                 cat >"conftest.$ac_ext" <<_ACEOF
17884 #line 17884 "configure"
17885 #include "confdefs.h"
17886 #include <$FORM_NAME.h>
17887 int
17888 main (void)
17889 {
17890 (void) form_driver ( 0,0 );
17891   ;
17892   return 0;
17893 }
17894 _ACEOF
17895 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17896 if { (eval echo "$as_me:17896: \"$ac_link\"") >&5
17897   (eval $ac_link) 2>&5
17898   ac_status=$?
17899   echo "$as_me:17899: \$? = $ac_status" >&5
17900   (exit "$ac_status"); } &&
17901          { ac_try='test -s "conftest$ac_exeext"'
17902   { (eval echo "$as_me:17902: \"$ac_try\"") >&5
17903   (eval $ac_try) 2>&5
17904   ac_status=$?
17905   echo "$as_me:17905: \$? = $ac_status" >&5
17906   (exit "$ac_status"); }; }; then
17907   if test "$cross_compiling" = yes; then
17908   cf_have_curses_lib=maybe
17909 else
17910   cat >"conftest.$ac_ext" <<_ACEOF
17911 #line 17911 "configure"
17912 #include "confdefs.h"
17913 #include <$FORM_NAME.h>
17914                                 int main(void)
17915                                 { (void) form_driver ( 0,0 ); return 0; }
17916 _ACEOF
17917 rm -f "conftest$ac_exeext"
17918 if { (eval echo "$as_me:17918: \"$ac_link\"") >&5
17919   (eval $ac_link) 2>&5
17920   ac_status=$?
17921   echo "$as_me:17921: \$? = $ac_status" >&5
17922   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17923   { (eval echo "$as_me:17923: \"$ac_try\"") >&5
17924   (eval $ac_try) 2>&5
17925   ac_status=$?
17926   echo "$as_me:17926: \$? = $ac_status" >&5
17927   (exit "$ac_status"); }; }; then
17928   cf_have_curses_lib=yes
17929 else
17930   echo "$as_me: program exited with status $ac_status" >&5
17931 echo "$as_me: failed program was:" >&5
17932 cat "conftest.$ac_ext" >&5
17933 cf_have_curses_lib=no
17934 fi
17935 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17936 fi
17937 else
17938   echo "$as_me: failed program was:" >&5
17939 cat "conftest.$ac_ext" >&5
17940 cf_have_curses_lib=no
17941 fi
17942 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17943                 echo "$as_me:17943: result: $cf_have_curses_lib" >&5
17944 echo "${ECHO_T}$cf_have_curses_lib" >&6
17945                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17946                 if test "$cf_have_curses_lib" = "yes"
17947                 then
17948
17949 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17950
17951                         cat >>confdefs.h <<EOF
17952 #define $cf_upper 1
17953 EOF
17954
17955                 else
17956                         CFLAGS="$cf_save_CFLAGS"
17957                         CPPFLAGS="$cf_save_CPPFLAGS"
17958                         LIBS="$cf_save_LIBS"
17959                 fi
17960         fi
17961 fi
17962 if test "$cf_have_curses_lib" = no; then
17963         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17964 echo "$as_me:17964: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17965 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17966 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17967   echo $ECHO_N "(cached) $ECHO_C" >&6
17968 else
17969   ac_check_lib_save_LIBS=$LIBS
17970 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17971 cat >"conftest.$ac_ext" <<_ACEOF
17972 #line 17972 "configure"
17973 #include "confdefs.h"
17974
17975 /* Override any gcc2 internal prototype to avoid an error.  */
17976 #ifdef __cplusplus
17977 extern "C"
17978 #endif
17979 /* We use char because int might match the return type of a gcc2
17980    builtin and then its argument prototype would still apply.  */
17981 char form_driver ();
17982 int
17983 main (void)
17984 {
17985 form_driver ();
17986   ;
17987   return 0;
17988 }
17989 _ACEOF
17990 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17991 if { (eval echo "$as_me:17991: \"$ac_link\"") >&5
17992   (eval $ac_link) 2>&5
17993   ac_status=$?
17994   echo "$as_me:17994: \$? = $ac_status" >&5
17995   (exit "$ac_status"); } &&
17996          { ac_try='test -s "conftest$ac_exeext"'
17997   { (eval echo "$as_me:17997: \"$ac_try\"") >&5
17998   (eval $ac_try) 2>&5
17999   ac_status=$?
18000   echo "$as_me:18000: \$? = $ac_status" >&5
18001   (exit "$ac_status"); }; }; then
18002   eval "$as_ac_Lib=yes"
18003 else
18004   echo "$as_me: failed program was:" >&5
18005 cat "conftest.$ac_ext" >&5
18006 eval "$as_ac_Lib=no"
18007 fi
18008 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18009 LIBS=$ac_check_lib_save_LIBS
18010 fi
18011 echo "$as_me:18011: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
18012 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
18013 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
18014
18015 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18016
18017 cf_add_libs="$LIBS"
18018 # reverse order
18019 cf_add_0lib=
18020 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18021 # filter duplicates
18022 for cf_add_1lib in $cf_add_0lib; do
18023         for cf_add_2lib in $cf_add_libs; do
18024                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18025                         cf_add_1lib=
18026                         break
18027                 fi
18028         done
18029         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18030 done
18031 LIBS="$cf_add_libs"
18032
18033                 cat >>confdefs.h <<EOF
18034 #define $cf_upper 1
18035 EOF
18036
18037 fi
18038
18039 fi
18040
18041         cf_curses_headers="$cf_curses_headers form.h"
18042 fi
18043
18044 # look for curses-related headers
18045
18046 for ac_header in $cf_curses_headers
18047 do
18048 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18049 echo "$as_me:18049: checking for $ac_header" >&5
18050 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18051 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18052   echo $ECHO_N "(cached) $ECHO_C" >&6
18053 else
18054   cat >"conftest.$ac_ext" <<_ACEOF
18055 #line 18055 "configure"
18056 #include "confdefs.h"
18057 #include <$ac_header>
18058 _ACEOF
18059 if { (eval echo "$as_me:18059: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18060   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18061   ac_status=$?
18062   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18063   rm -f conftest.er1
18064   cat conftest.err >&5
18065   echo "$as_me:18065: \$? = $ac_status" >&5
18066   (exit "$ac_status"); } >/dev/null; then
18067   if test -s conftest.err; then
18068     ac_cpp_err=$ac_c_preproc_warn_flag
18069   else
18070     ac_cpp_err=
18071   fi
18072 else
18073   ac_cpp_err=yes
18074 fi
18075 if test -z "$ac_cpp_err"; then
18076   eval "$as_ac_Header=yes"
18077 else
18078   echo "$as_me: failed program was:" >&5
18079   cat "conftest.$ac_ext" >&5
18080   eval "$as_ac_Header=no"
18081 fi
18082 rm -f conftest.err "conftest.$ac_ext"
18083 fi
18084 echo "$as_me:18084: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18085 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18086 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18087   cat >>confdefs.h <<EOF
18088 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18089 EOF
18090
18091 fi
18092 done
18093
18094 echo "$as_me:18094: checking for ANSI C header files" >&5
18095 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
18096 if test "${ac_cv_header_stdc+set}" = set; then
18097   echo $ECHO_N "(cached) $ECHO_C" >&6
18098 else
18099   cat >"conftest.$ac_ext" <<_ACEOF
18100 #line 18100 "configure"
18101 #include "confdefs.h"
18102 #include <stdlib.h>
18103 #include <stdarg.h>
18104 #include <string.h>
18105 #include <float.h>
18106
18107 _ACEOF
18108 if { (eval echo "$as_me:18108: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18109   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18110   ac_status=$?
18111   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18112   rm -f conftest.er1
18113   cat conftest.err >&5
18114   echo "$as_me:18114: \$? = $ac_status" >&5
18115   (exit "$ac_status"); } >/dev/null; then
18116   if test -s conftest.err; then
18117     ac_cpp_err=$ac_c_preproc_warn_flag
18118   else
18119     ac_cpp_err=
18120   fi
18121 else
18122   ac_cpp_err=yes
18123 fi
18124 if test -z "$ac_cpp_err"; then
18125   ac_cv_header_stdc=yes
18126 else
18127   echo "$as_me: failed program was:" >&5
18128   cat "conftest.$ac_ext" >&5
18129   ac_cv_header_stdc=no
18130 fi
18131 rm -f conftest.err "conftest.$ac_ext"
18132
18133 if test $ac_cv_header_stdc = yes; then
18134   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
18135   cat >"conftest.$ac_ext" <<_ACEOF
18136 #line 18136 "configure"
18137 #include "confdefs.h"
18138 #include <string.h>
18139
18140 _ACEOF
18141 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18142   $EGREP "memchr" >/dev/null 2>&1; then
18143   :
18144 else
18145   ac_cv_header_stdc=no
18146 fi
18147 rm -rf conftest*
18148
18149 fi
18150
18151 if test $ac_cv_header_stdc = yes; then
18152   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
18153   cat >"conftest.$ac_ext" <<_ACEOF
18154 #line 18154 "configure"
18155 #include "confdefs.h"
18156 #include <stdlib.h>
18157
18158 _ACEOF
18159 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18160   $EGREP "free" >/dev/null 2>&1; then
18161   :
18162 else
18163   ac_cv_header_stdc=no
18164 fi
18165 rm -rf conftest*
18166
18167 fi
18168
18169 if test $ac_cv_header_stdc = yes; then
18170   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
18171   if test "$cross_compiling" = yes; then
18172   :
18173 else
18174   cat >"conftest.$ac_ext" <<_ACEOF
18175 #line 18175 "configure"
18176 #include "confdefs.h"
18177 #include <ctype.h>
18178 #if ((' ' & 0x0FF) == 0x020)
18179 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
18180 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
18181 #else
18182 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
18183                      || ('j' <= (c) && (c) <= 'r') \
18184                      || ('s' <= (c) && (c) <= 'z'))
18185 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
18186 #endif
18187
18188 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
18189 int
18190 main (void)
18191 {
18192   int i;
18193   for (i = 0; i < 256; i++)
18194     if (XOR (islower (i), ISLOWER (i))
18195         || toupper (i) != TOUPPER (i))
18196       $ac_main_return(2);
18197   $ac_main_return (0);
18198 }
18199 _ACEOF
18200 rm -f "conftest$ac_exeext"
18201 if { (eval echo "$as_me:18201: \"$ac_link\"") >&5
18202   (eval $ac_link) 2>&5
18203   ac_status=$?
18204   echo "$as_me:18204: \$? = $ac_status" >&5
18205   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
18206   { (eval echo "$as_me:18206: \"$ac_try\"") >&5
18207   (eval $ac_try) 2>&5
18208   ac_status=$?
18209   echo "$as_me:18209: \$? = $ac_status" >&5
18210   (exit "$ac_status"); }; }; then
18211   :
18212 else
18213   echo "$as_me: program exited with status $ac_status" >&5
18214 echo "$as_me: failed program was:" >&5
18215 cat "conftest.$ac_ext" >&5
18216 ac_cv_header_stdc=no
18217 fi
18218 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
18219 fi
18220 fi
18221 fi
18222 echo "$as_me:18222: result: $ac_cv_header_stdc" >&5
18223 echo "${ECHO_T}$ac_cv_header_stdc" >&6
18224 if test $ac_cv_header_stdc = yes; then
18225
18226 cat >>confdefs.h <<\EOF
18227 #define STDC_HEADERS 1
18228 EOF
18229
18230 fi
18231
18232 echo "$as_me:18232: checking whether time.h and sys/time.h may both be included" >&5
18233 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
18234 if test "${ac_cv_header_time+set}" = set; then
18235   echo $ECHO_N "(cached) $ECHO_C" >&6
18236 else
18237   cat >"conftest.$ac_ext" <<_ACEOF
18238 #line 18238 "configure"
18239 #include "confdefs.h"
18240 #include <sys/types.h>
18241 #include <sys/time.h>
18242 #include <time.h>
18243
18244 int
18245 main (void)
18246 {
18247 if ((struct tm *) 0)
18248 return 0;
18249   ;
18250   return 0;
18251 }
18252 _ACEOF
18253 rm -f "conftest.$ac_objext"
18254 if { (eval echo "$as_me:18254: \"$ac_compile\"") >&5
18255   (eval $ac_compile) 2>&5
18256   ac_status=$?
18257   echo "$as_me:18257: \$? = $ac_status" >&5
18258   (exit "$ac_status"); } &&
18259          { ac_try='test -s "conftest.$ac_objext"'
18260   { (eval echo "$as_me:18260: \"$ac_try\"") >&5
18261   (eval $ac_try) 2>&5
18262   ac_status=$?
18263   echo "$as_me:18263: \$? = $ac_status" >&5
18264   (exit "$ac_status"); }; }; then
18265   ac_cv_header_time=yes
18266 else
18267   echo "$as_me: failed program was:" >&5
18268 cat "conftest.$ac_ext" >&5
18269 ac_cv_header_time=no
18270 fi
18271 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18272 fi
18273 echo "$as_me:18273: result: $ac_cv_header_time" >&5
18274 echo "${ECHO_T}$ac_cv_header_time" >&6
18275 if test $ac_cv_header_time = yes; then
18276
18277 cat >>confdefs.h <<\EOF
18278 #define TIME_WITH_SYS_TIME 1
18279 EOF
18280
18281 fi
18282
18283 for ac_header in \
18284 getopt.h \
18285 locale.h \
18286 math.h \
18287 stdarg.h \
18288 stdint.h \
18289 sys/ioctl.h \
18290 sys/select.h \
18291 sys/time.h \
18292 termios.h \
18293 unistd.h \
18294
18295 do
18296 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18297 echo "$as_me:18297: checking for $ac_header" >&5
18298 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18299 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18300   echo $ECHO_N "(cached) $ECHO_C" >&6
18301 else
18302   cat >"conftest.$ac_ext" <<_ACEOF
18303 #line 18303 "configure"
18304 #include "confdefs.h"
18305 #include <$ac_header>
18306 _ACEOF
18307 if { (eval echo "$as_me:18307: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18308   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18309   ac_status=$?
18310   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18311   rm -f conftest.er1
18312   cat conftest.err >&5
18313   echo "$as_me:18313: \$? = $ac_status" >&5
18314   (exit "$ac_status"); } >/dev/null; then
18315   if test -s conftest.err; then
18316     ac_cpp_err=$ac_c_preproc_warn_flag
18317   else
18318     ac_cpp_err=
18319   fi
18320 else
18321   ac_cpp_err=yes
18322 fi
18323 if test -z "$ac_cpp_err"; then
18324   eval "$as_ac_Header=yes"
18325 else
18326   echo "$as_me: failed program was:" >&5
18327   cat "conftest.$ac_ext" >&5
18328   eval "$as_ac_Header=no"
18329 fi
18330 rm -f conftest.err "conftest.$ac_ext"
18331 fi
18332 echo "$as_me:18332: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18333 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18334 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18335   cat >>confdefs.h <<EOF
18336 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18337 EOF
18338
18339 fi
18340 done
18341
18342 for ac_header in unistd.h getopt.h
18343 do
18344 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18345 echo "$as_me:18345: checking for $ac_header" >&5
18346 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18347 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18348   echo $ECHO_N "(cached) $ECHO_C" >&6
18349 else
18350   cat >"conftest.$ac_ext" <<_ACEOF
18351 #line 18351 "configure"
18352 #include "confdefs.h"
18353 #include <$ac_header>
18354 _ACEOF
18355 if { (eval echo "$as_me:18355: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18356   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18357   ac_status=$?
18358   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18359   rm -f conftest.er1
18360   cat conftest.err >&5
18361   echo "$as_me:18361: \$? = $ac_status" >&5
18362   (exit "$ac_status"); } >/dev/null; then
18363   if test -s conftest.err; then
18364     ac_cpp_err=$ac_c_preproc_warn_flag
18365   else
18366     ac_cpp_err=
18367   fi
18368 else
18369   ac_cpp_err=yes
18370 fi
18371 if test -z "$ac_cpp_err"; then
18372   eval "$as_ac_Header=yes"
18373 else
18374   echo "$as_me: failed program was:" >&5
18375   cat "conftest.$ac_ext" >&5
18376   eval "$as_ac_Header=no"
18377 fi
18378 rm -f conftest.err "conftest.$ac_ext"
18379 fi
18380 echo "$as_me:18380: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18381 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18382 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18383   cat >>confdefs.h <<EOF
18384 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18385 EOF
18386
18387 fi
18388 done
18389
18390 echo "$as_me:18390: checking for header declaring getopt variables" >&5
18391 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
18392 if test "${cf_cv_getopt_header+set}" = set; then
18393   echo $ECHO_N "(cached) $ECHO_C" >&6
18394 else
18395
18396 cf_cv_getopt_header=none
18397 for cf_header in stdio.h stdlib.h unistd.h getopt.h
18398 do
18399 cat >"conftest.$ac_ext" <<_ACEOF
18400 #line 18400 "configure"
18401 #include "confdefs.h"
18402
18403 #include <$cf_header>
18404 int
18405 main (void)
18406 {
18407 int x = optind; char *y = optarg; (void)x; (void)y
18408   ;
18409   return 0;
18410 }
18411 _ACEOF
18412 rm -f "conftest.$ac_objext"
18413 if { (eval echo "$as_me:18413: \"$ac_compile\"") >&5
18414   (eval $ac_compile) 2>&5
18415   ac_status=$?
18416   echo "$as_me:18416: \$? = $ac_status" >&5
18417   (exit "$ac_status"); } &&
18418          { ac_try='test -s "conftest.$ac_objext"'
18419   { (eval echo "$as_me:18419: \"$ac_try\"") >&5
18420   (eval $ac_try) 2>&5
18421   ac_status=$?
18422   echo "$as_me:18422: \$? = $ac_status" >&5
18423   (exit "$ac_status"); }; }; then
18424   cf_cv_getopt_header=$cf_header
18425  break
18426 else
18427   echo "$as_me: failed program was:" >&5
18428 cat "conftest.$ac_ext" >&5
18429 fi
18430 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18431 done
18432
18433 fi
18434 echo "$as_me:18434: result: $cf_cv_getopt_header" >&5
18435 echo "${ECHO_T}$cf_cv_getopt_header" >&6
18436 if test "$cf_cv_getopt_header" != none ; then
18437
18438 cat >>confdefs.h <<\EOF
18439 #define HAVE_GETOPT_HEADER 1
18440 EOF
18441
18442 fi
18443 if test "$cf_cv_getopt_header" = getopt.h ; then
18444
18445 cat >>confdefs.h <<\EOF
18446 #define NEED_GETOPT_H 1
18447 EOF
18448
18449 fi
18450
18451 for ac_func in \
18452 cfmakeraw \
18453 getopt \
18454 gettimeofday \
18455 snprintf \
18456 strdup \
18457 strstr \
18458 tsearch \
18459
18460 do
18461 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18462 echo "$as_me:18462: checking for $ac_func" >&5
18463 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18464 if eval "test \"\${$as_ac_var+set}\" = set"; then
18465   echo $ECHO_N "(cached) $ECHO_C" >&6
18466 else
18467   cat >"conftest.$ac_ext" <<_ACEOF
18468 #line 18468 "configure"
18469 #include "confdefs.h"
18470 #define $ac_func autoconf_temporary
18471 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18472 #undef $ac_func
18473
18474 #ifdef __cplusplus
18475 extern "C"
18476 #endif
18477
18478 /* We use char because int might match the return type of a gcc2
18479    builtin and then its argument prototype would still apply.  */
18480 char $ac_func (void);
18481
18482 int
18483 main (void)
18484 {
18485
18486 /* The GNU C library defines stubs for functions which it implements
18487     to always fail with ENOSYS.  Some functions are actually named
18488     something starting with __ and the normal name is an alias.  */
18489 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18490 #error found stub for $ac_func
18491 #endif
18492
18493         return $ac_func ();
18494   ;
18495   return 0;
18496 }
18497 _ACEOF
18498 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18499 if { (eval echo "$as_me:18499: \"$ac_link\"") >&5
18500   (eval $ac_link) 2>&5
18501   ac_status=$?
18502   echo "$as_me:18502: \$? = $ac_status" >&5
18503   (exit "$ac_status"); } &&
18504          { ac_try='test -s "conftest$ac_exeext"'
18505   { (eval echo "$as_me:18505: \"$ac_try\"") >&5
18506   (eval $ac_try) 2>&5
18507   ac_status=$?
18508   echo "$as_me:18508: \$? = $ac_status" >&5
18509   (exit "$ac_status"); }; }; then
18510   eval "$as_ac_var=yes"
18511 else
18512   echo "$as_me: failed program was:" >&5
18513 cat "conftest.$ac_ext" >&5
18514 eval "$as_ac_var=no"
18515 fi
18516 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18517 fi
18518 echo "$as_me:18518: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18519 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18520 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18521   cat >>confdefs.h <<EOF
18522 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18523 EOF
18524
18525 fi
18526 done
18527
18528 # use a compile-check to work with ncurses*-config and subdirectory includes
18529 echo "$as_me:18529: checking if we can use termcap.h" >&5
18530 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18531 if test "${cf_cv_have_termcap_h+set}" = set; then
18532   echo $ECHO_N "(cached) $ECHO_C" >&6
18533 else
18534
18535         cat >"conftest.$ac_ext" <<_ACEOF
18536 #line 18536 "configure"
18537 #include "confdefs.h"
18538
18539 #include <curses.h>
18540 #ifdef NCURSES_VERSION
18541 #undef NCURSES_VERSION
18542 #endif
18543 #include <termcap.h>
18544 #ifndef NCURSES_VERSION
18545 #error wrong header
18546 #endif
18547
18548 int
18549 main (void)
18550 {
18551 return 0;
18552   ;
18553   return 0;
18554 }
18555 _ACEOF
18556 rm -f "conftest.$ac_objext"
18557 if { (eval echo "$as_me:18557: \"$ac_compile\"") >&5
18558   (eval $ac_compile) 2>&5
18559   ac_status=$?
18560   echo "$as_me:18560: \$? = $ac_status" >&5
18561   (exit "$ac_status"); } &&
18562          { ac_try='test -s "conftest.$ac_objext"'
18563   { (eval echo "$as_me:18563: \"$ac_try\"") >&5
18564   (eval $ac_try) 2>&5
18565   ac_status=$?
18566   echo "$as_me:18566: \$? = $ac_status" >&5
18567   (exit "$ac_status"); }; }; then
18568   cf_cv_have_termcap_h=yes
18569 else
18570   echo "$as_me: failed program was:" >&5
18571 cat "conftest.$ac_ext" >&5
18572 cf_cv_have_termcap_h=no
18573 fi
18574 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18575 fi
18576 echo "$as_me:18576: result: $cf_cv_have_termcap_h" >&5
18577 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18578 if test "x$cf_cv_have_termcap_h" = xyes
18579 then
18580
18581 cat >>confdefs.h <<\EOF
18582 #define HAVE_TERMCAP_H 1
18583 EOF
18584
18585 else
18586 echo "$as_me:18586: checking if we can use ncurses/termcap.h" >&5
18587 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18588 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18589   echo $ECHO_N "(cached) $ECHO_C" >&6
18590 else
18591
18592         cat >"conftest.$ac_ext" <<_ACEOF
18593 #line 18593 "configure"
18594 #include "confdefs.h"
18595
18596 #include <ncurses/curses.h>
18597 #ifdef NCURSES_VERSION
18598 #undef NCURSES_VERSION
18599 #endif
18600 #include <ncurses/termcap.h>
18601 #ifndef NCURSES_VERSION
18602 #error wrong header
18603 #endif
18604
18605 int
18606 main (void)
18607 {
18608 return 0;
18609   ;
18610   return 0;
18611 }
18612 _ACEOF
18613 rm -f "conftest.$ac_objext"
18614 if { (eval echo "$as_me:18614: \"$ac_compile\"") >&5
18615   (eval $ac_compile) 2>&5
18616   ac_status=$?
18617   echo "$as_me:18617: \$? = $ac_status" >&5
18618   (exit "$ac_status"); } &&
18619          { ac_try='test -s "conftest.$ac_objext"'
18620   { (eval echo "$as_me:18620: \"$ac_try\"") >&5
18621   (eval $ac_try) 2>&5
18622   ac_status=$?
18623   echo "$as_me:18623: \$? = $ac_status" >&5
18624   (exit "$ac_status"); }; }; then
18625   cf_cv_have_ncurses_termcap_h=yes
18626 else
18627   echo "$as_me: failed program was:" >&5
18628 cat "conftest.$ac_ext" >&5
18629 cf_cv_have_ncurses_termcap_h=no
18630 fi
18631 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18632 fi
18633 echo "$as_me:18633: result: $cf_cv_have_ncurses_termcap_h" >&5
18634 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18635 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18636 cat >>confdefs.h <<\EOF
18637 #define HAVE_NCURSES_TERMCAP_H 1
18638 EOF
18639
18640 fi
18641
18642 if test "x$ac_cv_func_getopt" = xno; then
18643         { { echo "$as_me:18643: error: getopt is required for building programs" >&5
18644 echo "$as_me: error: getopt is required for building programs" >&2;}
18645    { (exit 1); exit 1; }; }
18646 fi
18647
18648 if test "$cf_enable_widec" = yes; then
18649
18650 for ac_func in \
18651 mblen \
18652 mbrlen \
18653 mbrtowc \
18654 mbsrtowcs \
18655 mbstowcs \
18656 mbtowc \
18657 wcsrtombs \
18658 wcstombs \
18659
18660 do
18661 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18662 echo "$as_me:18662: checking for $ac_func" >&5
18663 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18664 if eval "test \"\${$as_ac_var+set}\" = set"; then
18665   echo $ECHO_N "(cached) $ECHO_C" >&6
18666 else
18667   cat >"conftest.$ac_ext" <<_ACEOF
18668 #line 18668 "configure"
18669 #include "confdefs.h"
18670 #define $ac_func autoconf_temporary
18671 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18672 #undef $ac_func
18673
18674 #ifdef __cplusplus
18675 extern "C"
18676 #endif
18677
18678 /* We use char because int might match the return type of a gcc2
18679    builtin and then its argument prototype would still apply.  */
18680 char $ac_func (void);
18681
18682 int
18683 main (void)
18684 {
18685
18686 /* The GNU C library defines stubs for functions which it implements
18687     to always fail with ENOSYS.  Some functions are actually named
18688     something starting with __ and the normal name is an alias.  */
18689 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18690 #error found stub for $ac_func
18691 #endif
18692
18693         return $ac_func ();
18694   ;
18695   return 0;
18696 }
18697 _ACEOF
18698 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18699 if { (eval echo "$as_me:18699: \"$ac_link\"") >&5
18700   (eval $ac_link) 2>&5
18701   ac_status=$?
18702   echo "$as_me:18702: \$? = $ac_status" >&5
18703   (exit "$ac_status"); } &&
18704          { ac_try='test -s "conftest$ac_exeext"'
18705   { (eval echo "$as_me:18705: \"$ac_try\"") >&5
18706   (eval $ac_try) 2>&5
18707   ac_status=$?
18708   echo "$as_me:18708: \$? = $ac_status" >&5
18709   (exit "$ac_status"); }; }; then
18710   eval "$as_ac_var=yes"
18711 else
18712   echo "$as_me: failed program was:" >&5
18713 cat "conftest.$ac_ext" >&5
18714 eval "$as_ac_var=no"
18715 fi
18716 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18717 fi
18718 echo "$as_me:18718: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18719 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18720 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18721   cat >>confdefs.h <<EOF
18722 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18723 EOF
18724
18725 fi
18726 done
18727
18728 fi
18729
18730 echo "$as_me:18730: checking definition to turn on extended curses functions" >&5
18731 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18732 if test "${cf_cv_need_xopen_extension+set}" = set; then
18733   echo $ECHO_N "(cached) $ECHO_C" >&6
18734 else
18735
18736 cf_cv_need_xopen_extension=unknown
18737 cat >"conftest.$ac_ext" <<_ACEOF
18738 #line 18738 "configure"
18739 #include "confdefs.h"
18740
18741 #include <stdlib.h>
18742 #include <${cf_cv_ncurses_header:-curses.h}>
18743 int
18744 main (void)
18745 {
18746
18747 #if defined(NCURSES_VERSION_PATCH)
18748 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18749         make an error
18750 #endif
18751 #endif
18752 #ifdef NCURSES_WIDECHAR
18753 make an error   /* prefer to fall-through on the second checks */
18754 #endif
18755         cchar_t check;
18756         int check2 = curs_set((int)sizeof(check));
18757         long x = winnstr(stdscr, "", 0);
18758         int x1, y1;
18759         (void)check2;
18760         getbegyx(stdscr, y1, x1);
18761         (void)x;
18762         (void)y1;
18763         (void)x1;
18764
18765   ;
18766   return 0;
18767 }
18768 _ACEOF
18769 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18770 if { (eval echo "$as_me:18770: \"$ac_link\"") >&5
18771   (eval $ac_link) 2>&5
18772   ac_status=$?
18773   echo "$as_me:18773: \$? = $ac_status" >&5
18774   (exit "$ac_status"); } &&
18775          { ac_try='test -s "conftest$ac_exeext"'
18776   { (eval echo "$as_me:18776: \"$ac_try\"") >&5
18777   (eval $ac_try) 2>&5
18778   ac_status=$?
18779   echo "$as_me:18779: \$? = $ac_status" >&5
18780   (exit "$ac_status"); }; }; then
18781   cf_cv_need_xopen_extension=none
18782 else
18783   echo "$as_me: failed program was:" >&5
18784 cat "conftest.$ac_ext" >&5
18785
18786         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18787         do
18788                 cat >"conftest.$ac_ext" <<_ACEOF
18789 #line 18789 "configure"
18790 #include "confdefs.h"
18791
18792 #define $cf_try_xopen_extension 1
18793 #include <stdlib.h>
18794 #include <${cf_cv_ncurses_header:-curses.h}>
18795 int
18796 main (void)
18797 {
18798
18799                 cchar_t check;
18800                 int check2 = curs_set((int)sizeof(check));
18801                 long x = winnstr(stdscr, "", 0);
18802                 int x1, y1;
18803                 getbegyx(stdscr, y1, x1);
18804                 (void)check2;
18805                 (void)x;
18806                 (void)y1;
18807                 (void)x1;
18808
18809   ;
18810   return 0;
18811 }
18812 _ACEOF
18813 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18814 if { (eval echo "$as_me:18814: \"$ac_link\"") >&5
18815   (eval $ac_link) 2>&5
18816   ac_status=$?
18817   echo "$as_me:18817: \$? = $ac_status" >&5
18818   (exit "$ac_status"); } &&
18819          { ac_try='test -s "conftest$ac_exeext"'
18820   { (eval echo "$as_me:18820: \"$ac_try\"") >&5
18821   (eval $ac_try) 2>&5
18822   ac_status=$?
18823   echo "$as_me:18823: \$? = $ac_status" >&5
18824   (exit "$ac_status"); }; }; then
18825   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18826 else
18827   echo "$as_me: failed program was:" >&5
18828 cat "conftest.$ac_ext" >&5
18829 fi
18830 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18831         done
18832
18833 fi
18834 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18835
18836 fi
18837 echo "$as_me:18837: result: $cf_cv_need_xopen_extension" >&5
18838 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18839
18840 case "$cf_cv_need_xopen_extension" in
18841 (*_*)
18842
18843         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18844         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18845
18846         ;;
18847 esac
18848
18849 echo "$as_me:18849: checking for term.h" >&5
18850 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18851 if test "${cf_cv_term_header+set}" = set; then
18852   echo $ECHO_N "(cached) $ECHO_C" >&6
18853 else
18854
18855 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18856 # for <term.h> if we do not find the variant.
18857
18858 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18859
18860 case "${cf_cv_ncurses_header:-curses.h}" in
18861 (*/*)
18862         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18863         cf_header_list="$cf_header_item $cf_header_list"
18864         ;;
18865 esac
18866
18867 for cf_header in $cf_header_list
18868 do
18869         cat >"conftest.$ac_ext" <<_ACEOF
18870 #line 18870 "configure"
18871 #include "confdefs.h"
18872
18873 #include <${cf_cv_ncurses_header:-curses.h}>
18874 #include <${cf_header}>
18875 int
18876 main (void)
18877 {
18878 WINDOW *x; (void)x
18879   ;
18880   return 0;
18881 }
18882 _ACEOF
18883 rm -f "conftest.$ac_objext"
18884 if { (eval echo "$as_me:18884: \"$ac_compile\"") >&5
18885   (eval $ac_compile) 2>&5
18886   ac_status=$?
18887   echo "$as_me:18887: \$? = $ac_status" >&5
18888   (exit "$ac_status"); } &&
18889          { ac_try='test -s "conftest.$ac_objext"'
18890   { (eval echo "$as_me:18890: \"$ac_try\"") >&5
18891   (eval $ac_try) 2>&5
18892   ac_status=$?
18893   echo "$as_me:18893: \$? = $ac_status" >&5
18894   (exit "$ac_status"); }; }; then
18895   cf_cv_term_header=$cf_header
18896          break
18897 else
18898   echo "$as_me: failed program was:" >&5
18899 cat "conftest.$ac_ext" >&5
18900 cf_cv_term_header=no
18901 fi
18902 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18903 done
18904
18905 case "$cf_cv_term_header" in
18906 (no)
18907         # If curses is ncurses, some packagers still mess it up by trying to make
18908         # us use GNU termcap.  This handles the most common case.
18909         for cf_header in ncurses/term.h ncursesw/term.h
18910         do
18911                 cat >"conftest.$ac_ext" <<_ACEOF
18912 #line 18912 "configure"
18913 #include "confdefs.h"
18914
18915 #include <${cf_cv_ncurses_header:-curses.h}>
18916 #ifdef NCURSES_VERSION
18917 #include <${cf_header}>
18918 #else
18919 make an error
18920 #endif
18921 int
18922 main (void)
18923 {
18924 WINDOW *x; (void)x
18925   ;
18926   return 0;
18927 }
18928 _ACEOF
18929 rm -f "conftest.$ac_objext"
18930 if { (eval echo "$as_me:18930: \"$ac_compile\"") >&5
18931   (eval $ac_compile) 2>&5
18932   ac_status=$?
18933   echo "$as_me:18933: \$? = $ac_status" >&5
18934   (exit "$ac_status"); } &&
18935          { ac_try='test -s "conftest.$ac_objext"'
18936   { (eval echo "$as_me:18936: \"$ac_try\"") >&5
18937   (eval $ac_try) 2>&5
18938   ac_status=$?
18939   echo "$as_me:18939: \$? = $ac_status" >&5
18940   (exit "$ac_status"); }; }; then
18941   cf_cv_term_header=$cf_header
18942                          break
18943 else
18944   echo "$as_me: failed program was:" >&5
18945 cat "conftest.$ac_ext" >&5
18946 cf_cv_term_header=no
18947 fi
18948 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18949         done
18950         ;;
18951 esac
18952
18953 fi
18954 echo "$as_me:18954: result: $cf_cv_term_header" >&5
18955 echo "${ECHO_T}$cf_cv_term_header" >&6
18956
18957 case "$cf_cv_term_header" in
18958 (term.h)
18959
18960 cat >>confdefs.h <<\EOF
18961 #define HAVE_TERM_H 1
18962 EOF
18963
18964         ;;
18965 (ncurses/term.h)
18966
18967 cat >>confdefs.h <<\EOF
18968 #define HAVE_NCURSES_TERM_H 1
18969 EOF
18970
18971         ;;
18972 (ncursesw/term.h)
18973
18974 cat >>confdefs.h <<\EOF
18975 #define HAVE_NCURSESW_TERM_H 1
18976 EOF
18977
18978         ;;
18979 esac
18980
18981 echo "$as_me:18981: checking for unctrl.h" >&5
18982 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18983 if test "${cf_cv_unctrl_header+set}" = set; then
18984   echo $ECHO_N "(cached) $ECHO_C" >&6
18985 else
18986
18987 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18988 # for <unctrl.h> if we do not find the variant.
18989
18990 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18991
18992 case "${cf_cv_ncurses_header:-curses.h}" in
18993 (*/*)
18994         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18995         cf_header_list="$cf_header_item $cf_header_list"
18996         ;;
18997 esac
18998
18999 for cf_header in $cf_header_list
19000 do
19001         cat >"conftest.$ac_ext" <<_ACEOF
19002 #line 19002 "configure"
19003 #include "confdefs.h"
19004
19005 #include <${cf_cv_ncurses_header:-curses.h}>
19006 #include <${cf_header}>
19007 int
19008 main (void)
19009 {
19010 WINDOW *x; (void)x
19011   ;
19012   return 0;
19013 }
19014 _ACEOF
19015 rm -f "conftest.$ac_objext"
19016 if { (eval echo "$as_me:19016: \"$ac_compile\"") >&5
19017   (eval $ac_compile) 2>&5
19018   ac_status=$?
19019   echo "$as_me:19019: \$? = $ac_status" >&5
19020   (exit "$ac_status"); } &&
19021          { ac_try='test -s "conftest.$ac_objext"'
19022   { (eval echo "$as_me:19022: \"$ac_try\"") >&5
19023   (eval $ac_try) 2>&5
19024   ac_status=$?
19025   echo "$as_me:19025: \$? = $ac_status" >&5
19026   (exit "$ac_status"); }; }; then
19027   cf_cv_unctrl_header=$cf_header
19028          break
19029 else
19030   echo "$as_me: failed program was:" >&5
19031 cat "conftest.$ac_ext" >&5
19032 cf_cv_unctrl_header=no
19033 fi
19034 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19035 done
19036
19037 fi
19038 echo "$as_me:19038: result: $cf_cv_unctrl_header" >&5
19039 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
19040
19041 case "$cf_cv_unctrl_header" in
19042 (no)
19043         { echo "$as_me:19043: WARNING: unctrl.h header not found" >&5
19044 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
19045         ;;
19046 esac
19047
19048 case "$cf_cv_unctrl_header" in
19049 (unctrl.h)
19050
19051 cat >>confdefs.h <<\EOF
19052 #define HAVE_UNCTRL_H 1
19053 EOF
19054
19055         ;;
19056 (ncurses/unctrl.h)
19057
19058 cat >>confdefs.h <<\EOF
19059 #define HAVE_NCURSES_UNCTRL_H 1
19060 EOF
19061
19062         ;;
19063 (ncursesw/unctrl.h)
19064
19065 cat >>confdefs.h <<\EOF
19066 #define HAVE_NCURSESW_UNCTRL_H 1
19067 EOF
19068
19069         ;;
19070 esac
19071
19072 for cf_func in \
19073 alloc_pair \
19074 assume_default_colors \
19075 chgat \
19076 color_content \
19077 color_set \
19078 copywin \
19079 curses_trace \
19080 delscreen \
19081 dupwin \
19082 exit_curses \
19083 exit_terminfo \
19084 filter \
19085 getbegx \
19086 getcurx \
19087 getmaxx \
19088 getnstr \
19089 getparx \
19090 getwin \
19091 halfdelay \
19092 init_extended_color \
19093 mvderwin \
19094 mvvline \
19095 mvwin \
19096 mvwvline \
19097 napms \
19098 newpad \
19099 putwin \
19100 reset_color_pairs \
19101 resize_term \
19102 resizeterm \
19103 restartterm \
19104 ripoffline \
19105 scr_dump \
19106 setupterm \
19107 slk_color \
19108 slk_init \
19109 termattrs \
19110 termname \
19111 tgetent \
19112 tigetnum \
19113 tigetstr \
19114 tputs_sp \
19115 typeahead \
19116 unget_wch \
19117 use_default_colors \
19118 use_env \
19119 use_extended_names \
19120 use_screen \
19121 use_window \
19122 vid_puts \
19123 vidputs \
19124 vsscanf \
19125 vw_printw \
19126 wchgat \
19127 winsdelln \
19128 winsstr \
19129 wresize \
19130 wsyncdown \
19131 _tracef \
19132
19133 do
19134
19135 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19136
19137         echo "$as_me:19137: checking for ${cf_func}" >&5
19138 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19139
19140 echo "${as_me:-configure}:19140: testing ${cf_func} ..." 1>&5
19141
19142         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19143   echo $ECHO_N "(cached) $ECHO_C" >&6
19144 else
19145
19146                 eval cf_result='$ac_cv_func_'$cf_func
19147                 if test ".$cf_result" != ".no"; then
19148                         cat >"conftest.$ac_ext" <<_ACEOF
19149 #line 19149 "configure"
19150 #include "confdefs.h"
19151
19152 #ifdef HAVE_XCURSES
19153 #include <xcurses.h>
19154 char * XCursesProgramName = "test";
19155 #else
19156 #include <${cf_cv_ncurses_header:-curses.h}>
19157 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19158 #include <ncursesw/term.h>
19159 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19160 #include <ncurses/term.h>
19161 #elif defined(HAVE_TERM_H)
19162 #include <term.h>
19163 #endif
19164 #endif
19165
19166 int
19167 main (void)
19168 {
19169
19170 #ifndef ${cf_func}
19171 long foo = (long)(&${cf_func});
19172 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19173 if (foo + 1234L > 5678L)
19174         ${cf_cv_main_return:-return}(foo != 0);
19175 #endif
19176
19177   ;
19178   return 0;
19179 }
19180 _ACEOF
19181 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19182 if { (eval echo "$as_me:19182: \"$ac_link\"") >&5
19183   (eval $ac_link) 2>&5
19184   ac_status=$?
19185   echo "$as_me:19185: \$? = $ac_status" >&5
19186   (exit "$ac_status"); } &&
19187          { ac_try='test -s "conftest$ac_exeext"'
19188   { (eval echo "$as_me:19188: \"$ac_try\"") >&5
19189   (eval $ac_try) 2>&5
19190   ac_status=$?
19191   echo "$as_me:19191: \$? = $ac_status" >&5
19192   (exit "$ac_status"); }; }; then
19193   cf_result=yes
19194 else
19195   echo "$as_me: failed program was:" >&5
19196 cat "conftest.$ac_ext" >&5
19197 cf_result=no
19198 fi
19199 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19200                 fi
19201                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19202
19203 fi
19204
19205         # use the computed/retrieved cache-value:
19206         eval 'cf_result=$cf_cv_func_'$cf_func
19207         echo "$as_me:19207: result: $cf_result" >&5
19208 echo "${ECHO_T}$cf_result" >&6
19209         if test "$cf_result" != no; then
19210                 cat >>confdefs.h <<EOF
19211 #define HAVE_${cf_tr_func} 1
19212 EOF
19213
19214         fi
19215 done
19216
19217 for cf_func in tputs
19218 do
19219
19220 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19221
19222         echo "$as_me:19222: checking for ${cf_func}" >&5
19223 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19224
19225 echo "${as_me:-configure}:19225: testing ${cf_func} ..." 1>&5
19226
19227         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19228   echo $ECHO_N "(cached) $ECHO_C" >&6
19229 else
19230
19231                 eval cf_result='$ac_cv_func_'$cf_func
19232                 if test ".$cf_result" != ".no"; then
19233                         cat >"conftest.$ac_ext" <<_ACEOF
19234 #line 19234 "configure"
19235 #include "confdefs.h"
19236
19237 #ifdef HAVE_XCURSES
19238 #include <xcurses.h>
19239 char * XCursesProgramName = "test";
19240 #else
19241 #include <${cf_cv_ncurses_header:-curses.h}>
19242 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19243 #include <ncursesw/term.h>
19244 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19245 #include <ncurses/term.h>
19246 #elif defined(HAVE_TERM_H)
19247 #include <term.h>
19248 #endif
19249 #endif
19250
19251 int
19252 main (void)
19253 {
19254
19255 #ifndef ${cf_func}
19256 long foo = (long)(&${cf_func});
19257 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19258 if (foo + 1234L > 5678L)
19259         ${cf_cv_main_return:-return}(foo != 0);
19260 #endif
19261
19262   ;
19263   return 0;
19264 }
19265 _ACEOF
19266 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19267 if { (eval echo "$as_me:19267: \"$ac_link\"") >&5
19268   (eval $ac_link) 2>&5
19269   ac_status=$?
19270   echo "$as_me:19270: \$? = $ac_status" >&5
19271   (exit "$ac_status"); } &&
19272          { ac_try='test -s "conftest$ac_exeext"'
19273   { (eval echo "$as_me:19273: \"$ac_try\"") >&5
19274   (eval $ac_try) 2>&5
19275   ac_status=$?
19276   echo "$as_me:19276: \$? = $ac_status" >&5
19277   (exit "$ac_status"); }; }; then
19278   cf_result=yes
19279 else
19280   echo "$as_me: failed program was:" >&5
19281 cat "conftest.$ac_ext" >&5
19282 cf_result=no
19283 fi
19284 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19285                 fi
19286                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19287
19288 fi
19289
19290         # use the computed/retrieved cache-value:
19291         eval 'cf_result=$cf_cv_func_'$cf_func
19292         echo "$as_me:19292: result: $cf_result" >&5
19293 echo "${ECHO_T}$cf_result" >&6
19294         if test "$cf_result" != no; then
19295                 cat >>confdefs.h <<EOF
19296 #define HAVE_${cf_tr_func} 1
19297 EOF
19298
19299         fi
19300 done
19301
19302 if test "x$cf_cv_func_tputs" = xyes
19303 then
19304         cf_done=no
19305         for cf_arg in int char
19306         do
19307                 for cf_ret in int void
19308                 do
19309                         if test "$cf_ret" = void
19310                         then
19311                                 cf_return="/* nothing */"
19312                         else
19313                                 cf_return="return value"
19314                         fi
19315                         cat >"conftest.$ac_ext" <<_ACEOF
19316 #line 19316 "configure"
19317 #include "confdefs.h"
19318
19319 #include <${cf_cv_ncurses_header:-curses.h}>
19320 #include <$cf_cv_term_header>
19321
19322 static $cf_ret outc($cf_arg value) { $cf_return; }
19323
19324 int
19325 main (void)
19326 {
19327
19328         tputs("hello", 0, outc);
19329         ${cf_cv_main_return:-return}(0);
19330
19331   ;
19332   return 0;
19333 }
19334 _ACEOF
19335 rm -f "conftest.$ac_objext"
19336 if { (eval echo "$as_me:19336: \"$ac_compile\"") >&5
19337   (eval $ac_compile) 2>&5
19338   ac_status=$?
19339   echo "$as_me:19339: \$? = $ac_status" >&5
19340   (exit "$ac_status"); } &&
19341          { ac_try='test -s "conftest.$ac_objext"'
19342   { (eval echo "$as_me:19342: \"$ac_try\"") >&5
19343   (eval $ac_try) 2>&5
19344   ac_status=$?
19345   echo "$as_me:19345: \$? = $ac_status" >&5
19346   (exit "$ac_status"); }; }; then
19347
19348                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
19349
19350 echo "${as_me:-configure}:19350: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
19351
19352                 cat >>confdefs.h <<EOF
19353 #define TPUTS_ARG               $cf_arg
19354 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
19355 #define TPUTS_RETURN(value)     $cf_return
19356 EOF
19357                 cf_done=yes
19358                 break
19359
19360 else
19361   echo "$as_me: failed program was:" >&5
19362 cat "conftest.$ac_ext" >&5
19363 fi
19364 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19365                 done
19366                 test "$cf_done" = yes && break
19367         done
19368 fi
19369
19370 echo "$as_me:19370: checking for ncurses extended functions" >&5
19371 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
19372 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
19373   echo $ECHO_N "(cached) $ECHO_C" >&6
19374 else
19375
19376 cat >"conftest.$ac_ext" <<_ACEOF
19377 #line 19377 "configure"
19378 #include "confdefs.h"
19379
19380 #include <${cf_cv_ncurses_header:-curses.h}>
19381 int
19382 main (void)
19383 {
19384
19385 int x = NCURSES_EXT_FUNCS
19386
19387   ;
19388   return 0;
19389 }
19390 _ACEOF
19391 rm -f "conftest.$ac_objext"
19392 if { (eval echo "$as_me:19392: \"$ac_compile\"") >&5
19393   (eval $ac_compile) 2>&5
19394   ac_status=$?
19395   echo "$as_me:19395: \$? = $ac_status" >&5
19396   (exit "$ac_status"); } &&
19397          { ac_try='test -s "conftest.$ac_objext"'
19398   { (eval echo "$as_me:19398: \"$ac_try\"") >&5
19399   (eval $ac_try) 2>&5
19400   ac_status=$?
19401   echo "$as_me:19401: \$? = $ac_status" >&5
19402   (exit "$ac_status"); }; }; then
19403   cf_cv_ncurses_ext_funcs=defined
19404 else
19405   echo "$as_me: failed program was:" >&5
19406 cat "conftest.$ac_ext" >&5
19407
19408 cat >"conftest.$ac_ext" <<_ACEOF
19409 #line 19409 "configure"
19410 #include "confdefs.h"
19411
19412 #include <${cf_cv_ncurses_header:-curses.h}>
19413 int
19414 main (void)
19415 {
19416
19417         (void) assume_default_colors (0, 0);
19418         (void) curses_version ();
19419         (void) define_key (0, 0);
19420         (void) is_term_resized (0, 0);
19421         (void) key_defined (0);
19422         (void) keybound (0, 0);
19423         (void) keyok (0, 0);
19424         (void) resize_term (0, 0);
19425         (void) resizeterm (0, 0);
19426         (void) use_default_colors ();
19427         (void) use_extended_names (0);
19428         (void) wresize (0, 0, 0);
19429   ;
19430   return 0;
19431 }
19432 _ACEOF
19433 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19434 if { (eval echo "$as_me:19434: \"$ac_link\"") >&5
19435   (eval $ac_link) 2>&5
19436   ac_status=$?
19437   echo "$as_me:19437: \$? = $ac_status" >&5
19438   (exit "$ac_status"); } &&
19439          { ac_try='test -s "conftest$ac_exeext"'
19440   { (eval echo "$as_me:19440: \"$ac_try\"") >&5
19441   (eval $ac_try) 2>&5
19442   ac_status=$?
19443   echo "$as_me:19443: \$? = $ac_status" >&5
19444   (exit "$ac_status"); }; }; then
19445   cf_cv_ncurses_ext_funcs=yes
19446 else
19447   echo "$as_me: failed program was:" >&5
19448 cat "conftest.$ac_ext" >&5
19449 cf_cv_ncurses_ext_funcs=no
19450 fi
19451 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19452
19453 fi
19454 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19455
19456 fi
19457 echo "$as_me:19457: result: $cf_cv_ncurses_ext_funcs" >&5
19458 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19459 test "$cf_cv_ncurses_ext_funcs" = yes &&
19460 cat >>confdefs.h <<\EOF
19461 #define NCURSES_EXT_FUNCS 1
19462 EOF
19463
19464 if test "$cf_enable_widec" = yes
19465 then
19466         # workaround for systems with ncurses before 20111029, due to change of
19467         # feature test macro from _XPG5 to _XOPEN_SOURCE
19468         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19469         then
19470                 cf_define_xpg5=no
19471                 echo "$as_me:19471: checking if _XPG5 should be defined to enable wide-characters" >&5
19472 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19473
19474                 cat >"conftest.$ac_ext" <<_ACEOF
19475 #line 19475 "configure"
19476 #include "confdefs.h"
19477
19478 #include <${cf_cv_ncurses_header:-curses.h}>
19479 int
19480 main (void)
19481 {
19482 int x = _XPG5
19483   ;
19484   return 0;
19485 }
19486 _ACEOF
19487 rm -f "conftest.$ac_objext"
19488 if { (eval echo "$as_me:19488: \"$ac_compile\"") >&5
19489   (eval $ac_compile) 2>&5
19490   ac_status=$?
19491   echo "$as_me:19491: \$? = $ac_status" >&5
19492   (exit "$ac_status"); } &&
19493          { ac_try='test -s "conftest.$ac_objext"'
19494   { (eval echo "$as_me:19494: \"$ac_try\"") >&5
19495   (eval $ac_try) 2>&5
19496   ac_status=$?
19497   echo "$as_me:19497: \$? = $ac_status" >&5
19498   (exit "$ac_status"); }; }; then
19499   :
19500 else
19501   echo "$as_me: failed program was:" >&5
19502 cat "conftest.$ac_ext" >&5
19503 cf_save_cppflags="$CPPFLAGS"
19504                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19505                          cat >"conftest.$ac_ext" <<_ACEOF
19506 #line 19506 "configure"
19507 #include "confdefs.h"
19508
19509 #include <${cf_cv_ncurses_header:-curses.h}>
19510 int
19511 main (void)
19512 {
19513 int x = _XPG5
19514   ;
19515   return 0;
19516 }
19517 _ACEOF
19518 rm -f "conftest.$ac_objext"
19519 if { (eval echo "$as_me:19519: \"$ac_compile\"") >&5
19520   (eval $ac_compile) 2>&5
19521   ac_status=$?
19522   echo "$as_me:19522: \$? = $ac_status" >&5
19523   (exit "$ac_status"); } &&
19524          { ac_try='test -s "conftest.$ac_objext"'
19525   { (eval echo "$as_me:19525: \"$ac_try\"") >&5
19526   (eval $ac_try) 2>&5
19527   ac_status=$?
19528   echo "$as_me:19528: \$? = $ac_status" >&5
19529   (exit "$ac_status"); }; }; then
19530   cf_define_xpg5=yes
19531 else
19532   echo "$as_me: failed program was:" >&5
19533 cat "conftest.$ac_ext" >&5
19534 fi
19535 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19536                          CPPFLAGS="$cf_save_cppflags"
19537 fi
19538 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19539                 echo "$as_me:19539: result: $cf_define_xpg5" >&5
19540 echo "${ECHO_T}$cf_define_xpg5" >&6
19541
19542                 if test "$cf_define_xpg5" = yes
19543                 then
19544                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19545                 fi
19546         fi
19547
19548         echo "$as_me:19548: checking for wide-character functions" >&5
19549 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19550 if test "${cf_cv_widechar_funcs+set}" = set; then
19551   echo $ECHO_N "(cached) $ECHO_C" >&6
19552 else
19553
19554         cat >"conftest.$ac_ext" <<_ACEOF
19555 #line 19555 "configure"
19556 #include "confdefs.h"
19557
19558 #include <${cf_cv_ncurses_header:-curses.h}>
19559 int
19560 main (void)
19561 {
19562
19563                 static wchar_t src_wchar[2];
19564                 static cchar_t dst_cchar;
19565                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19566
19567   ;
19568   return 0;
19569 }
19570 _ACEOF
19571 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19572 if { (eval echo "$as_me:19572: \"$ac_link\"") >&5
19573   (eval $ac_link) 2>&5
19574   ac_status=$?
19575   echo "$as_me:19575: \$? = $ac_status" >&5
19576   (exit "$ac_status"); } &&
19577          { ac_try='test -s "conftest$ac_exeext"'
19578   { (eval echo "$as_me:19578: \"$ac_try\"") >&5
19579   (eval $ac_try) 2>&5
19580   ac_status=$?
19581   echo "$as_me:19581: \$? = $ac_status" >&5
19582   (exit "$ac_status"); }; }; then
19583   cf_cv_widechar_funcs=yes
19584 else
19585   echo "$as_me: failed program was:" >&5
19586 cat "conftest.$ac_ext" >&5
19587 cf_cv_widechar_funcs=no
19588 fi
19589 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19590
19591 fi
19592 echo "$as_me:19592: result: $cf_cv_widechar_funcs" >&5
19593 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19594         if test "$cf_cv_widechar_funcs" != no ; then
19595
19596 cat >>confdefs.h <<\EOF
19597 #define USE_WIDEC_SUPPORT 1
19598 EOF
19599
19600         else
19601                 cat >>confdefs.h <<\EOF
19602 #define USE_WIDEC_SUPPORT 0
19603 EOF
19604
19605         fi
19606 else
19607         cat >>confdefs.h <<\EOF
19608 #define USE_WIDEC_SUPPORT 0
19609 EOF
19610
19611 fi
19612
19613 echo "$as_me:19613: checking if $cf_cv_screen library uses pthreads" >&5
19614 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19615 if test "${cf_cv_use_pthreads+set}" = set; then
19616   echo $ECHO_N "(cached) $ECHO_C" >&6
19617 else
19618
19619 cat >"conftest.$ac_ext" <<_ACEOF
19620 #line 19620 "configure"
19621 #include "confdefs.h"
19622
19623 #include <${cf_cv_ncurses_header:-curses.h}>
19624 extern void _nc_init_pthreads(void);
19625
19626 int
19627 main (void)
19628 {
19629
19630         initscr();
19631         _nc_init_pthreads();
19632
19633   ;
19634   return 0;
19635 }
19636 _ACEOF
19637 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19638 if { (eval echo "$as_me:19638: \"$ac_link\"") >&5
19639   (eval $ac_link) 2>&5
19640   ac_status=$?
19641   echo "$as_me:19641: \$? = $ac_status" >&5
19642   (exit "$ac_status"); } &&
19643          { ac_try='test -s "conftest$ac_exeext"'
19644   { (eval echo "$as_me:19644: \"$ac_try\"") >&5
19645   (eval $ac_try) 2>&5
19646   ac_status=$?
19647   echo "$as_me:19647: \$? = $ac_status" >&5
19648   (exit "$ac_status"); }; }; then
19649   cf_cv_use_pthreads=yes
19650 else
19651   echo "$as_me: failed program was:" >&5
19652 cat "conftest.$ac_ext" >&5
19653 cf_cv_use_pthreads=no
19654 fi
19655 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19656
19657 fi
19658 echo "$as_me:19658: result: $cf_cv_use_pthreads" >&5
19659 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19660 test $cf_cv_use_pthreads = yes &&
19661 cat >>confdefs.h <<\EOF
19662 #define USE_PTHREADS 1
19663 EOF
19664
19665 echo "$as_me:19665: checking if sys/time.h works with sys/select.h" >&5
19666 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19667 if test "${cf_cv_sys_time_select+set}" = set; then
19668   echo $ECHO_N "(cached) $ECHO_C" >&6
19669 else
19670
19671 cat >"conftest.$ac_ext" <<_ACEOF
19672 #line 19672 "configure"
19673 #include "confdefs.h"
19674
19675 #include <sys/types.h>
19676 #ifdef HAVE_SYS_TIME_H
19677 #include <sys/time.h>
19678 #endif
19679 #ifdef HAVE_SYS_SELECT_H
19680 #include <sys/select.h>
19681 #endif
19682
19683 int
19684 main (void)
19685 {
19686
19687   ;
19688   return 0;
19689 }
19690 _ACEOF
19691 rm -f "conftest.$ac_objext"
19692 if { (eval echo "$as_me:19692: \"$ac_compile\"") >&5
19693   (eval $ac_compile) 2>&5
19694   ac_status=$?
19695   echo "$as_me:19695: \$? = $ac_status" >&5
19696   (exit "$ac_status"); } &&
19697          { ac_try='test -s "conftest.$ac_objext"'
19698   { (eval echo "$as_me:19698: \"$ac_try\"") >&5
19699   (eval $ac_try) 2>&5
19700   ac_status=$?
19701   echo "$as_me:19701: \$? = $ac_status" >&5
19702   (exit "$ac_status"); }; }; then
19703   cf_cv_sys_time_select=yes
19704 else
19705   echo "$as_me: failed program was:" >&5
19706 cat "conftest.$ac_ext" >&5
19707 cf_cv_sys_time_select=no
19708 fi
19709 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19710
19711 fi
19712
19713 echo "$as_me:19713: result: $cf_cv_sys_time_select" >&5
19714 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19715 test "$cf_cv_sys_time_select" = yes &&
19716 cat >>confdefs.h <<\EOF
19717 #define HAVE_SYS_TIME_SELECT 1
19718 EOF
19719
19720 # special check for test/ditto.c
19721
19722 echo "$as_me:19722: checking for openpty in -lutil" >&5
19723 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19724 if test "${ac_cv_lib_util_openpty+set}" = set; then
19725   echo $ECHO_N "(cached) $ECHO_C" >&6
19726 else
19727   ac_check_lib_save_LIBS=$LIBS
19728 LIBS="-lutil  $LIBS"
19729 cat >"conftest.$ac_ext" <<_ACEOF
19730 #line 19730 "configure"
19731 #include "confdefs.h"
19732
19733 /* Override any gcc2 internal prototype to avoid an error.  */
19734 #ifdef __cplusplus
19735 extern "C"
19736 #endif
19737 /* We use char because int might match the return type of a gcc2
19738    builtin and then its argument prototype would still apply.  */
19739 char openpty ();
19740 int
19741 main (void)
19742 {
19743 openpty ();
19744   ;
19745   return 0;
19746 }
19747 _ACEOF
19748 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19749 if { (eval echo "$as_me:19749: \"$ac_link\"") >&5
19750   (eval $ac_link) 2>&5
19751   ac_status=$?
19752   echo "$as_me:19752: \$? = $ac_status" >&5
19753   (exit "$ac_status"); } &&
19754          { ac_try='test -s "conftest$ac_exeext"'
19755   { (eval echo "$as_me:19755: \"$ac_try\"") >&5
19756   (eval $ac_try) 2>&5
19757   ac_status=$?
19758   echo "$as_me:19758: \$? = $ac_status" >&5
19759   (exit "$ac_status"); }; }; then
19760   ac_cv_lib_util_openpty=yes
19761 else
19762   echo "$as_me: failed program was:" >&5
19763 cat "conftest.$ac_ext" >&5
19764 ac_cv_lib_util_openpty=no
19765 fi
19766 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19767 LIBS=$ac_check_lib_save_LIBS
19768 fi
19769 echo "$as_me:19769: result: $ac_cv_lib_util_openpty" >&5
19770 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19771 if test "$ac_cv_lib_util_openpty" = yes; then
19772   cf_cv_lib_util=yes
19773 else
19774   cf_cv_lib_util=no
19775 fi
19776
19777 echo "$as_me:19777: checking for openpty header" >&5
19778 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19779 if test "${cf_cv_func_openpty+set}" = set; then
19780   echo $ECHO_N "(cached) $ECHO_C" >&6
19781 else
19782
19783         cf_save_LIBS="$LIBS"
19784         test "$cf_cv_lib_util" = yes && {
19785 cf_add_libs="$LIBS"
19786 # reverse order
19787 cf_add_0lib=
19788 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19789 # filter duplicates
19790 for cf_add_1lib in $cf_add_0lib; do
19791         for cf_add_2lib in $cf_add_libs; do
19792                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19793                         cf_add_1lib=
19794                         break
19795                 fi
19796         done
19797         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19798 done
19799 LIBS="$cf_add_libs"
19800  }
19801         for cf_header in pty.h libutil.h util.h
19802         do
19803         cat >"conftest.$ac_ext" <<_ACEOF
19804 #line 19804 "configure"
19805 #include "confdefs.h"
19806
19807 #include <$cf_header>
19808
19809 int
19810 main (void)
19811 {
19812
19813         int x = openpty((int *)0, (int *)0, (char *)0,
19814                                    (struct termios *)0, (struct winsize *)0);
19815
19816   ;
19817   return 0;
19818 }
19819 _ACEOF
19820 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19821 if { (eval echo "$as_me:19821: \"$ac_link\"") >&5
19822   (eval $ac_link) 2>&5
19823   ac_status=$?
19824   echo "$as_me:19824: \$? = $ac_status" >&5
19825   (exit "$ac_status"); } &&
19826          { ac_try='test -s "conftest$ac_exeext"'
19827   { (eval echo "$as_me:19827: \"$ac_try\"") >&5
19828   (eval $ac_try) 2>&5
19829   ac_status=$?
19830   echo "$as_me:19830: \$? = $ac_status" >&5
19831   (exit "$ac_status"); }; }; then
19832
19833                 cf_cv_func_openpty=$cf_header
19834                 break
19835
19836 else
19837   echo "$as_me: failed program was:" >&5
19838 cat "conftest.$ac_ext" >&5
19839
19840                 cf_cv_func_openpty=no
19841
19842 fi
19843 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19844         done
19845         LIBS="$cf_save_LIBS"
19846
19847 fi
19848 echo "$as_me:19848: result: $cf_cv_func_openpty" >&5
19849 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19850
19851 if test "$cf_cv_func_openpty" != no ; then
19852
19853 cat >>confdefs.h <<EOF
19854 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19855 EOF
19856
19857 cat >>confdefs.h <<\EOF
19858 #define USE_XTERM_PTY 1
19859 EOF
19860
19861         if test "x$cf_cv_lib_util" = xyes ; then
19862
19863 cf_add_libs="$TEST_LIBS"
19864 # reverse order
19865 cf_add_0lib=
19866 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19867 # filter duplicates
19868 for cf_add_1lib in $cf_add_0lib; do
19869         for cf_add_2lib in $cf_add_libs; do
19870                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19871                         cf_add_1lib=
19872                         break
19873                 fi
19874         done
19875         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19876 done
19877 TEST_LIBS="$cf_add_libs"
19878
19879         fi
19880 fi
19881
19882 echo "$as_me:19882: checking for function curses_version" >&5
19883 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19884 if test "${cf_cv_func_curses_version+set}" = set; then
19885   echo $ECHO_N "(cached) $ECHO_C" >&6
19886 else
19887
19888 if test "$cross_compiling" = yes; then
19889   cf_cv_func_curses_version=unknown
19890 else
19891   cat >"conftest.$ac_ext" <<_ACEOF
19892 #line 19892 "configure"
19893 #include "confdefs.h"
19894
19895 $ac_includes_default
19896
19897 #include <${cf_cv_ncurses_header:-curses.h}>
19898
19899 int main(void)
19900 {
19901         char temp[1024];
19902         sprintf(temp, "%.999s\\n", curses_version());
19903         ${cf_cv_main_return:-return}(0);
19904 }
19905
19906 _ACEOF
19907 rm -f "conftest$ac_exeext"
19908 if { (eval echo "$as_me:19908: \"$ac_link\"") >&5
19909   (eval $ac_link) 2>&5
19910   ac_status=$?
19911   echo "$as_me:19911: \$? = $ac_status" >&5
19912   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19913   { (eval echo "$as_me:19913: \"$ac_try\"") >&5
19914   (eval $ac_try) 2>&5
19915   ac_status=$?
19916   echo "$as_me:19916: \$? = $ac_status" >&5
19917   (exit "$ac_status"); }; }; then
19918   cf_cv_func_curses_version=yes
19919
19920 else
19921   echo "$as_me: program exited with status $ac_status" >&5
19922 echo "$as_me: failed program was:" >&5
19923 cat "conftest.$ac_ext" >&5
19924 cf_cv_func_curses_version=no
19925
19926 fi
19927 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19928 fi
19929 rm -f core
19930 fi
19931 echo "$as_me:19931: result: $cf_cv_func_curses_version" >&5
19932 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19933 test "$cf_cv_func_curses_version" = yes &&
19934 cat >>confdefs.h <<\EOF
19935 #define HAVE_CURSES_VERSION 1
19936 EOF
19937
19938 echo "$as_me:19938: checking for alternate character set array" >&5
19939 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19940 if test "${cf_cv_curses_acs_map+set}" = set; then
19941   echo $ECHO_N "(cached) $ECHO_C" >&6
19942 else
19943
19944 cf_cv_curses_acs_map=unknown
19945 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19946 do
19947 cat >"conftest.$ac_ext" <<_ACEOF
19948 #line 19948 "configure"
19949 #include "confdefs.h"
19950
19951 #include <${cf_cv_ncurses_header:-curses.h}>
19952
19953 int
19954 main (void)
19955 {
19956
19957 ${name}['k'] = ACS_PLUS
19958
19959   ;
19960   return 0;
19961 }
19962 _ACEOF
19963 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19964 if { (eval echo "$as_me:19964: \"$ac_link\"") >&5
19965   (eval $ac_link) 2>&5
19966   ac_status=$?
19967   echo "$as_me:19967: \$? = $ac_status" >&5
19968   (exit "$ac_status"); } &&
19969          { ac_try='test -s "conftest$ac_exeext"'
19970   { (eval echo "$as_me:19970: \"$ac_try\"") >&5
19971   (eval $ac_try) 2>&5
19972   ac_status=$?
19973   echo "$as_me:19973: \$? = $ac_status" >&5
19974   (exit "$ac_status"); }; }; then
19975   cf_cv_curses_acs_map=$name; break
19976 else
19977   echo "$as_me: failed program was:" >&5
19978 cat "conftest.$ac_ext" >&5
19979 fi
19980 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19981 done
19982
19983 fi
19984 echo "$as_me:19984: result: $cf_cv_curses_acs_map" >&5
19985 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19986
19987 test "$cf_cv_curses_acs_map" != unknown &&
19988 cat >>confdefs.h <<EOF
19989 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19990 EOF
19991
19992 if test "$cf_enable_widec" = yes; then
19993
19994 echo "$as_me:19994: checking for wide alternate character set array" >&5
19995 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19996 if test "${cf_cv_curses_wacs_map+set}" = set; then
19997   echo $ECHO_N "(cached) $ECHO_C" >&6
19998 else
19999
20000         cf_cv_curses_wacs_map=unknown
20001         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
20002         do
20003         cat >"conftest.$ac_ext" <<_ACEOF
20004 #line 20004 "configure"
20005 #include "confdefs.h"
20006
20007 #ifndef _XOPEN_SOURCE_EXTENDED
20008 #define _XOPEN_SOURCE_EXTENDED
20009 #endif
20010 #include <${cf_cv_ncurses_header:-curses.h}>
20011 int
20012 main (void)
20013 {
20014 void *foo = &(${name}['k']); (void)foo
20015   ;
20016   return 0;
20017 }
20018 _ACEOF
20019 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20020 if { (eval echo "$as_me:20020: \"$ac_link\"") >&5
20021   (eval $ac_link) 2>&5
20022   ac_status=$?
20023   echo "$as_me:20023: \$? = $ac_status" >&5
20024   (exit "$ac_status"); } &&
20025          { ac_try='test -s "conftest$ac_exeext"'
20026   { (eval echo "$as_me:20026: \"$ac_try\"") >&5
20027   (eval $ac_try) 2>&5
20028   ac_status=$?
20029   echo "$as_me:20029: \$? = $ac_status" >&5
20030   (exit "$ac_status"); }; }; then
20031   cf_cv_curses_wacs_map=$name
20032          break
20033 else
20034   echo "$as_me: failed program was:" >&5
20035 cat "conftest.$ac_ext" >&5
20036 fi
20037 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20038         done
20039 fi
20040 echo "$as_me:20040: result: $cf_cv_curses_wacs_map" >&5
20041 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
20042
20043 test "$cf_cv_curses_wacs_map" != unknown &&
20044 cat >>confdefs.h <<EOF
20045 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
20046 EOF
20047
20048 echo "$as_me:20048: checking for wide alternate character constants" >&5
20049 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
20050 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
20051   echo $ECHO_N "(cached) $ECHO_C" >&6
20052 else
20053
20054 cf_cv_curses_wacs_symbols=no
20055 if test "$cf_cv_curses_wacs_map" != unknown
20056 then
20057         cat >"conftest.$ac_ext" <<_ACEOF
20058 #line 20058 "configure"
20059 #include "confdefs.h"
20060
20061 #ifndef _XOPEN_SOURCE_EXTENDED
20062 #define _XOPEN_SOURCE_EXTENDED
20063 #endif
20064 #include <${cf_cv_ncurses_header:-curses.h}>
20065 int
20066 main (void)
20067 {
20068 cchar_t *foo = WACS_PLUS;
20069          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
20070   ;
20071   return 0;
20072 }
20073 _ACEOF
20074 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20075 if { (eval echo "$as_me:20075: \"$ac_link\"") >&5
20076   (eval $ac_link) 2>&5
20077   ac_status=$?
20078   echo "$as_me:20078: \$? = $ac_status" >&5
20079   (exit "$ac_status"); } &&
20080          { ac_try='test -s "conftest$ac_exeext"'
20081   { (eval echo "$as_me:20081: \"$ac_try\"") >&5
20082   (eval $ac_try) 2>&5
20083   ac_status=$?
20084   echo "$as_me:20084: \$? = $ac_status" >&5
20085   (exit "$ac_status"); }; }; then
20086   cf_cv_curses_wacs_symbols=yes
20087 else
20088   echo "$as_me: failed program was:" >&5
20089 cat "conftest.$ac_ext" >&5
20090 fi
20091 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20092 else
20093         cat >"conftest.$ac_ext" <<_ACEOF
20094 #line 20094 "configure"
20095 #include "confdefs.h"
20096
20097 #ifndef _XOPEN_SOURCE_EXTENDED
20098 #define _XOPEN_SOURCE_EXTENDED
20099 #endif
20100 #include <${cf_cv_ncurses_header:-curses.h}>
20101 int
20102 main (void)
20103 {
20104 cchar_t *foo = WACS_PLUS; (void)foo
20105   ;
20106   return 0;
20107 }
20108 _ACEOF
20109 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20110 if { (eval echo "$as_me:20110: \"$ac_link\"") >&5
20111   (eval $ac_link) 2>&5
20112   ac_status=$?
20113   echo "$as_me:20113: \$? = $ac_status" >&5
20114   (exit "$ac_status"); } &&
20115          { ac_try='test -s "conftest$ac_exeext"'
20116   { (eval echo "$as_me:20116: \"$ac_try\"") >&5
20117   (eval $ac_try) 2>&5
20118   ac_status=$?
20119   echo "$as_me:20119: \$? = $ac_status" >&5
20120   (exit "$ac_status"); }; }; then
20121   cf_cv_curses_wacs_symbols=yes
20122 else
20123   echo "$as_me: failed program was:" >&5
20124 cat "conftest.$ac_ext" >&5
20125 fi
20126 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20127 fi
20128
20129 fi
20130 echo "$as_me:20130: result: $cf_cv_curses_wacs_symbols" >&5
20131 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
20132
20133 test "$cf_cv_curses_wacs_symbols" != no &&
20134 cat >>confdefs.h <<\EOF
20135 #define CURSES_WACS_SYMBOLS 1
20136 EOF
20137
20138 fi
20139
20140 echo "$as_me:20140: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20141 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20142 cat >"conftest.$ac_ext" <<_ACEOF
20143 #line 20143 "configure"
20144 #include "confdefs.h"
20145
20146 #ifndef _XOPEN_SOURCE_EXTENDED
20147 #define _XOPEN_SOURCE_EXTENDED
20148 #endif
20149 #include <${cf_cv_ncurses_header:-curses.h}>
20150 int
20151 main (void)
20152 {
20153
20154 attr_t foo
20155
20156   ;
20157   return 0;
20158 }
20159 _ACEOF
20160 rm -f "conftest.$ac_objext"
20161 if { (eval echo "$as_me:20161: \"$ac_compile\"") >&5
20162   (eval $ac_compile) 2>&5
20163   ac_status=$?
20164   echo "$as_me:20164: \$? = $ac_status" >&5
20165   (exit "$ac_status"); } &&
20166          { ac_try='test -s "conftest.$ac_objext"'
20167   { (eval echo "$as_me:20167: \"$ac_try\"") >&5
20168   (eval $ac_try) 2>&5
20169   ac_status=$?
20170   echo "$as_me:20170: \$? = $ac_status" >&5
20171   (exit "$ac_status"); }; }; then
20172   cf_result=yes
20173 else
20174   echo "$as_me: failed program was:" >&5
20175 cat "conftest.$ac_ext" >&5
20176 cf_result=no
20177 fi
20178 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20179 echo "$as_me:20179: result: $cf_result" >&5
20180 echo "${ECHO_T}$cf_result" >&6
20181 if test "$cf_result" = yes ; then
20182
20183 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20184
20185 cat >>confdefs.h <<EOF
20186 #define $cf_result 1
20187 EOF
20188
20189 else
20190
20191 cat >>confdefs.h <<EOF
20192 #define attr_t long
20193 EOF
20194
20195 fi
20196
20197 if test "$cf_enable_widec" = yes; then
20198
20199 # This is needed on Tru64 5.0 to declare mbstate_t
20200 echo "$as_me:20200: checking if we must include wchar.h to declare mbstate_t" >&5
20201 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
20202 if test "${cf_cv_mbstate_t+set}" = set; then
20203   echo $ECHO_N "(cached) $ECHO_C" >&6
20204 else
20205
20206 cat >"conftest.$ac_ext" <<_ACEOF
20207 #line 20207 "configure"
20208 #include "confdefs.h"
20209
20210 #include <stdlib.h>
20211 #include <stdarg.h>
20212 #include <stdio.h>
20213 #ifdef HAVE_LIBUTF8_H
20214 #include <libutf8.h>
20215 #endif
20216 int
20217 main (void)
20218 {
20219 mbstate_t state
20220   ;
20221   return 0;
20222 }
20223 _ACEOF
20224 rm -f "conftest.$ac_objext"
20225 if { (eval echo "$as_me:20225: \"$ac_compile\"") >&5
20226   (eval $ac_compile) 2>&5
20227   ac_status=$?
20228   echo "$as_me:20228: \$? = $ac_status" >&5
20229   (exit "$ac_status"); } &&
20230          { ac_try='test -s "conftest.$ac_objext"'
20231   { (eval echo "$as_me:20231: \"$ac_try\"") >&5
20232   (eval $ac_try) 2>&5
20233   ac_status=$?
20234   echo "$as_me:20234: \$? = $ac_status" >&5
20235   (exit "$ac_status"); }; }; then
20236   cf_cv_mbstate_t=no
20237 else
20238   echo "$as_me: failed program was:" >&5
20239 cat "conftest.$ac_ext" >&5
20240 cat >"conftest.$ac_ext" <<_ACEOF
20241 #line 20241 "configure"
20242 #include "confdefs.h"
20243
20244 #include <stdlib.h>
20245 #include <stdarg.h>
20246 #include <stdio.h>
20247 #include <wchar.h>
20248 #ifdef HAVE_LIBUTF8_H
20249 #include <libutf8.h>
20250 #endif
20251 int
20252 main (void)
20253 {
20254 mbstate_t value
20255   ;
20256   return 0;
20257 }
20258 _ACEOF
20259 rm -f "conftest.$ac_objext"
20260 if { (eval echo "$as_me:20260: \"$ac_compile\"") >&5
20261   (eval $ac_compile) 2>&5
20262   ac_status=$?
20263   echo "$as_me:20263: \$? = $ac_status" >&5
20264   (exit "$ac_status"); } &&
20265          { ac_try='test -s "conftest.$ac_objext"'
20266   { (eval echo "$as_me:20266: \"$ac_try\"") >&5
20267   (eval $ac_try) 2>&5
20268   ac_status=$?
20269   echo "$as_me:20269: \$? = $ac_status" >&5
20270   (exit "$ac_status"); }; }; then
20271   cf_cv_mbstate_t=yes
20272 else
20273   echo "$as_me: failed program was:" >&5
20274 cat "conftest.$ac_ext" >&5
20275 cf_cv_mbstate_t=unknown
20276 fi
20277 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20278 fi
20279 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20280 fi
20281 echo "$as_me:20281: result: $cf_cv_mbstate_t" >&5
20282 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
20283
20284 if test "$cf_cv_mbstate_t" = yes ; then
20285
20286 cat >>confdefs.h <<\EOF
20287 #define NEED_WCHAR_H 1
20288 EOF
20289
20290         NEED_WCHAR_H=1
20291 fi
20292
20293 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
20294 if test "$cf_cv_mbstate_t" = unknown ; then
20295         NCURSES_MBSTATE_T=1
20296 fi
20297
20298 # if we find mbstate_t in either place, use substitution to provide a fallback.
20299 if test "$cf_cv_mbstate_t" != unknown ; then
20300         NCURSES_OK_MBSTATE_T=1
20301 fi
20302
20303 # This is needed on Tru64 5.0 to declare wchar_t
20304 echo "$as_me:20304: checking if we must include wchar.h to declare wchar_t" >&5
20305 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
20306 if test "${cf_cv_wchar_t+set}" = set; then
20307   echo $ECHO_N "(cached) $ECHO_C" >&6
20308 else
20309
20310 cat >"conftest.$ac_ext" <<_ACEOF
20311 #line 20311 "configure"
20312 #include "confdefs.h"
20313
20314 #include <stdlib.h>
20315 #include <stdarg.h>
20316 #include <stdio.h>
20317 #ifdef HAVE_LIBUTF8_H
20318 #include <libutf8.h>
20319 #endif
20320 int
20321 main (void)
20322 {
20323 wchar_t state
20324   ;
20325   return 0;
20326 }
20327 _ACEOF
20328 rm -f "conftest.$ac_objext"
20329 if { (eval echo "$as_me:20329: \"$ac_compile\"") >&5
20330   (eval $ac_compile) 2>&5
20331   ac_status=$?
20332   echo "$as_me:20332: \$? = $ac_status" >&5
20333   (exit "$ac_status"); } &&
20334          { ac_try='test -s "conftest.$ac_objext"'
20335   { (eval echo "$as_me:20335: \"$ac_try\"") >&5
20336   (eval $ac_try) 2>&5
20337   ac_status=$?
20338   echo "$as_me:20338: \$? = $ac_status" >&5
20339   (exit "$ac_status"); }; }; then
20340   cf_cv_wchar_t=no
20341 else
20342   echo "$as_me: failed program was:" >&5
20343 cat "conftest.$ac_ext" >&5
20344 cat >"conftest.$ac_ext" <<_ACEOF
20345 #line 20345 "configure"
20346 #include "confdefs.h"
20347
20348 #include <stdlib.h>
20349 #include <stdarg.h>
20350 #include <stdio.h>
20351 #include <wchar.h>
20352 #ifdef HAVE_LIBUTF8_H
20353 #include <libutf8.h>
20354 #endif
20355 int
20356 main (void)
20357 {
20358 wchar_t value
20359   ;
20360   return 0;
20361 }
20362 _ACEOF
20363 rm -f "conftest.$ac_objext"
20364 if { (eval echo "$as_me:20364: \"$ac_compile\"") >&5
20365   (eval $ac_compile) 2>&5
20366   ac_status=$?
20367   echo "$as_me:20367: \$? = $ac_status" >&5
20368   (exit "$ac_status"); } &&
20369          { ac_try='test -s "conftest.$ac_objext"'
20370   { (eval echo "$as_me:20370: \"$ac_try\"") >&5
20371   (eval $ac_try) 2>&5
20372   ac_status=$?
20373   echo "$as_me:20373: \$? = $ac_status" >&5
20374   (exit "$ac_status"); }; }; then
20375   cf_cv_wchar_t=yes
20376 else
20377   echo "$as_me: failed program was:" >&5
20378 cat "conftest.$ac_ext" >&5
20379 cf_cv_wchar_t=unknown
20380 fi
20381 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20382 fi
20383 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20384 fi
20385 echo "$as_me:20385: result: $cf_cv_wchar_t" >&5
20386 echo "${ECHO_T}$cf_cv_wchar_t" >&6
20387
20388 if test "$cf_cv_wchar_t" = yes ; then
20389
20390 cat >>confdefs.h <<\EOF
20391 #define NEED_WCHAR_H 1
20392 EOF
20393
20394         NEED_WCHAR_H=1
20395 fi
20396
20397 # if we do not find wchar_t in either place, use substitution to provide a fallback.
20398 if test "$cf_cv_wchar_t" = unknown ; then
20399         NCURSES_WCHAR_T=1
20400 fi
20401
20402 # if we find wchar_t in either place, use substitution to provide a fallback.
20403 if test "$cf_cv_wchar_t" != unknown ; then
20404         NCURSES_OK_WCHAR_T=1
20405 fi
20406
20407 # This is needed on Tru64 5.0 to declare wint_t
20408 echo "$as_me:20408: checking if we must include wchar.h to declare wint_t" >&5
20409 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
20410 if test "${cf_cv_wint_t+set}" = set; then
20411   echo $ECHO_N "(cached) $ECHO_C" >&6
20412 else
20413
20414 cat >"conftest.$ac_ext" <<_ACEOF
20415 #line 20415 "configure"
20416 #include "confdefs.h"
20417
20418 #include <stdlib.h>
20419 #include <stdarg.h>
20420 #include <stdio.h>
20421 #ifdef HAVE_LIBUTF8_H
20422 #include <libutf8.h>
20423 #endif
20424 int
20425 main (void)
20426 {
20427 wint_t state
20428   ;
20429   return 0;
20430 }
20431 _ACEOF
20432 rm -f "conftest.$ac_objext"
20433 if { (eval echo "$as_me:20433: \"$ac_compile\"") >&5
20434   (eval $ac_compile) 2>&5
20435   ac_status=$?
20436   echo "$as_me:20436: \$? = $ac_status" >&5
20437   (exit "$ac_status"); } &&
20438          { ac_try='test -s "conftest.$ac_objext"'
20439   { (eval echo "$as_me:20439: \"$ac_try\"") >&5
20440   (eval $ac_try) 2>&5
20441   ac_status=$?
20442   echo "$as_me:20442: \$? = $ac_status" >&5
20443   (exit "$ac_status"); }; }; then
20444   cf_cv_wint_t=no
20445 else
20446   echo "$as_me: failed program was:" >&5
20447 cat "conftest.$ac_ext" >&5
20448 cat >"conftest.$ac_ext" <<_ACEOF
20449 #line 20449 "configure"
20450 #include "confdefs.h"
20451
20452 #include <stdlib.h>
20453 #include <stdarg.h>
20454 #include <stdio.h>
20455 #include <wchar.h>
20456 #ifdef HAVE_LIBUTF8_H
20457 #include <libutf8.h>
20458 #endif
20459 int
20460 main (void)
20461 {
20462 wint_t value
20463   ;
20464   return 0;
20465 }
20466 _ACEOF
20467 rm -f "conftest.$ac_objext"
20468 if { (eval echo "$as_me:20468: \"$ac_compile\"") >&5
20469   (eval $ac_compile) 2>&5
20470   ac_status=$?
20471   echo "$as_me:20471: \$? = $ac_status" >&5
20472   (exit "$ac_status"); } &&
20473          { ac_try='test -s "conftest.$ac_objext"'
20474   { (eval echo "$as_me:20474: \"$ac_try\"") >&5
20475   (eval $ac_try) 2>&5
20476   ac_status=$?
20477   echo "$as_me:20477: \$? = $ac_status" >&5
20478   (exit "$ac_status"); }; }; then
20479   cf_cv_wint_t=yes
20480 else
20481   echo "$as_me: failed program was:" >&5
20482 cat "conftest.$ac_ext" >&5
20483 cf_cv_wint_t=unknown
20484 fi
20485 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20486 fi
20487 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20488 fi
20489 echo "$as_me:20489: result: $cf_cv_wint_t" >&5
20490 echo "${ECHO_T}$cf_cv_wint_t" >&6
20491
20492 if test "$cf_cv_wint_t" = yes ; then
20493
20494 cat >>confdefs.h <<\EOF
20495 #define NEED_WCHAR_H 1
20496 EOF
20497
20498         NEED_WCHAR_H=1
20499 fi
20500
20501 # if we do not find wint_t in either place, use substitution to provide a fallback.
20502 if test "$cf_cv_wint_t" = unknown ; then
20503         NCURSES_WINT_T=1
20504 fi
20505
20506 # if we find wint_t in either place, use substitution to provide a fallback.
20507 if test "$cf_cv_wint_t" != unknown ; then
20508         NCURSES_OK_WINT_T=1
20509 fi
20510
20511         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20512
20513 echo "$as_me:20513: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20514 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20515 cat >"conftest.$ac_ext" <<_ACEOF
20516 #line 20516 "configure"
20517 #include "confdefs.h"
20518
20519 #ifndef _XOPEN_SOURCE_EXTENDED
20520 #define _XOPEN_SOURCE_EXTENDED
20521 #endif
20522 #include <${cf_cv_ncurses_header:-curses.h}>
20523 int
20524 main (void)
20525 {
20526
20527 mbstate_t foo
20528
20529   ;
20530   return 0;
20531 }
20532 _ACEOF
20533 rm -f "conftest.$ac_objext"
20534 if { (eval echo "$as_me:20534: \"$ac_compile\"") >&5
20535   (eval $ac_compile) 2>&5
20536   ac_status=$?
20537   echo "$as_me:20537: \$? = $ac_status" >&5
20538   (exit "$ac_status"); } &&
20539          { ac_try='test -s "conftest.$ac_objext"'
20540   { (eval echo "$as_me:20540: \"$ac_try\"") >&5
20541   (eval $ac_try) 2>&5
20542   ac_status=$?
20543   echo "$as_me:20543: \$? = $ac_status" >&5
20544   (exit "$ac_status"); }; }; then
20545   cf_result=yes
20546 else
20547   echo "$as_me: failed program was:" >&5
20548 cat "conftest.$ac_ext" >&5
20549 cf_result=no
20550 fi
20551 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20552 echo "$as_me:20552: result: $cf_result" >&5
20553 echo "${ECHO_T}$cf_result" >&6
20554 if test "$cf_result" = yes ; then
20555
20556 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20557
20558 cat >>confdefs.h <<EOF
20559 #define $cf_result 1
20560 EOF
20561
20562 else
20563
20564 cat >>confdefs.h <<EOF
20565 #define mbstate_t long
20566 EOF
20567
20568 fi
20569
20570         fi
20571
20572         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20573
20574 echo "$as_me:20574: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20575 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20576 cat >"conftest.$ac_ext" <<_ACEOF
20577 #line 20577 "configure"
20578 #include "confdefs.h"
20579
20580 #ifndef _XOPEN_SOURCE_EXTENDED
20581 #define _XOPEN_SOURCE_EXTENDED
20582 #endif
20583 #include <${cf_cv_ncurses_header:-curses.h}>
20584 int
20585 main (void)
20586 {
20587
20588 wchar_t foo
20589
20590   ;
20591   return 0;
20592 }
20593 _ACEOF
20594 rm -f "conftest.$ac_objext"
20595 if { (eval echo "$as_me:20595: \"$ac_compile\"") >&5
20596   (eval $ac_compile) 2>&5
20597   ac_status=$?
20598   echo "$as_me:20598: \$? = $ac_status" >&5
20599   (exit "$ac_status"); } &&
20600          { ac_try='test -s "conftest.$ac_objext"'
20601   { (eval echo "$as_me:20601: \"$ac_try\"") >&5
20602   (eval $ac_try) 2>&5
20603   ac_status=$?
20604   echo "$as_me:20604: \$? = $ac_status" >&5
20605   (exit "$ac_status"); }; }; then
20606   cf_result=yes
20607 else
20608   echo "$as_me: failed program was:" >&5
20609 cat "conftest.$ac_ext" >&5
20610 cf_result=no
20611 fi
20612 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20613 echo "$as_me:20613: result: $cf_result" >&5
20614 echo "${ECHO_T}$cf_result" >&6
20615 if test "$cf_result" = yes ; then
20616
20617 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20618
20619 cat >>confdefs.h <<EOF
20620 #define $cf_result 1
20621 EOF
20622
20623 else
20624
20625 cat >>confdefs.h <<EOF
20626 #define wchar_t long
20627 EOF
20628
20629 fi
20630
20631         fi
20632
20633         if test "$NCURSES_OK_WINT_T" = 0 ; then
20634
20635 echo "$as_me:20635: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20636 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20637 cat >"conftest.$ac_ext" <<_ACEOF
20638 #line 20638 "configure"
20639 #include "confdefs.h"
20640
20641 #ifndef _XOPEN_SOURCE_EXTENDED
20642 #define _XOPEN_SOURCE_EXTENDED
20643 #endif
20644 #include <${cf_cv_ncurses_header:-curses.h}>
20645 int
20646 main (void)
20647 {
20648
20649 wint_t foo
20650
20651   ;
20652   return 0;
20653 }
20654 _ACEOF
20655 rm -f "conftest.$ac_objext"
20656 if { (eval echo "$as_me:20656: \"$ac_compile\"") >&5
20657   (eval $ac_compile) 2>&5
20658   ac_status=$?
20659   echo "$as_me:20659: \$? = $ac_status" >&5
20660   (exit "$ac_status"); } &&
20661          { ac_try='test -s "conftest.$ac_objext"'
20662   { (eval echo "$as_me:20662: \"$ac_try\"") >&5
20663   (eval $ac_try) 2>&5
20664   ac_status=$?
20665   echo "$as_me:20665: \$? = $ac_status" >&5
20666   (exit "$ac_status"); }; }; then
20667   cf_result=yes
20668 else
20669   echo "$as_me: failed program was:" >&5
20670 cat "conftest.$ac_ext" >&5
20671 cf_result=no
20672 fi
20673 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20674 echo "$as_me:20674: result: $cf_result" >&5
20675 echo "${ECHO_T}$cf_result" >&6
20676 if test "$cf_result" = yes ; then
20677
20678 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20679
20680 cat >>confdefs.h <<EOF
20681 #define $cf_result 1
20682 EOF
20683
20684 else
20685
20686 cat >>confdefs.h <<EOF
20687 #define wint_t long
20688 EOF
20689
20690 fi
20691
20692         fi
20693 fi
20694
20695 for cf_data in \
20696 TABSIZE \
20697 curscr \
20698 ospeed \
20699 boolnames \
20700 boolfnames \
20701 ttytype
20702 do
20703 echo "$as_me:20703: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20704 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20705
20706 cat >"conftest.$ac_ext" <<_ACEOF
20707 #line 20707 "configure"
20708 #include "confdefs.h"
20709
20710 #ifdef HAVE_XCURSES
20711 #include <xcurses.h>
20712 char * XCursesProgramName = "test";
20713 #else
20714 #include <${cf_cv_ncurses_header:-curses.h}>
20715 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20716 #include <ncursesw/term.h>
20717 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20718 #include <ncurses/term.h>
20719 #elif defined(HAVE_TERM_H)
20720 #include <term.h>
20721 #endif
20722 #endif
20723
20724 int
20725 main (void)
20726 {
20727
20728 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20729         const void *foo = (const void *)($cf_data);
20730 #else
20731         const void *foo = &($cf_data);
20732 #endif
20733         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20734
20735   ;
20736   return 0;
20737 }
20738 _ACEOF
20739 rm -f "conftest.$ac_objext"
20740 if { (eval echo "$as_me:20740: \"$ac_compile\"") >&5
20741   (eval $ac_compile) 2>&5
20742   ac_status=$?
20743   echo "$as_me:20743: \$? = $ac_status" >&5
20744   (exit "$ac_status"); } &&
20745          { ac_try='test -s "conftest.$ac_objext"'
20746   { (eval echo "$as_me:20746: \"$ac_try\"") >&5
20747   (eval $ac_try) 2>&5
20748   ac_status=$?
20749   echo "$as_me:20749: \$? = $ac_status" >&5
20750   (exit "$ac_status"); }; }; then
20751   cf_result=yes
20752
20753 else
20754   echo "$as_me: failed program was:" >&5
20755 cat "conftest.$ac_ext" >&5
20756 cf_result=no
20757 fi
20758 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20759 echo "$as_me:20759: result: $cf_result" >&5
20760 echo "${ECHO_T}$cf_result" >&6
20761
20762 if test "$cf_result" = yes ; then
20763
20764 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20765
20766         cat >>confdefs.h <<EOF
20767 #define $cf_result 1
20768 EOF
20769
20770 else
20771         echo "$as_me:20771: checking for data $cf_data in library" >&5
20772 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20773         # BSD linkers insist on making weak linkage, but resolve at runtime.
20774         if test "$cross_compiling" = yes; then
20775
20776         # cross-compiling
20777         cat >"conftest.$ac_ext" <<_ACEOF
20778 #line 20778 "configure"
20779 #include "confdefs.h"
20780
20781 #ifdef HAVE_XCURSES
20782 #include <xcurses.h>
20783 char * XCursesProgramName = "test";
20784 #else
20785 #include <${cf_cv_ncurses_header:-curses.h}>
20786 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20787 #include <ncursesw/term.h>
20788 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20789 #include <ncurses/term.h>
20790 #elif defined(HAVE_TERM_H)
20791 #include <term.h>
20792 #endif
20793 #endif
20794
20795 extern char $cf_data;
20796 int
20797 main (void)
20798 {
20799
20800         do {
20801
20802 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20803         const void *foo = (const void *)($cf_data);
20804 #else
20805         const void *foo = &($cf_data);
20806 #endif
20807         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20808
20809                 ${cf_cv_main_return:-return}(foo == 0);
20810         } while (0)
20811
20812   ;
20813   return 0;
20814 }
20815 _ACEOF
20816 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20817 if { (eval echo "$as_me:20817: \"$ac_link\"") >&5
20818   (eval $ac_link) 2>&5
20819   ac_status=$?
20820   echo "$as_me:20820: \$? = $ac_status" >&5
20821   (exit "$ac_status"); } &&
20822          { ac_try='test -s "conftest$ac_exeext"'
20823   { (eval echo "$as_me:20823: \"$ac_try\"") >&5
20824   (eval $ac_try) 2>&5
20825   ac_status=$?
20826   echo "$as_me:20826: \$? = $ac_status" >&5
20827   (exit "$ac_status"); }; }; then
20828   cf_result=yes
20829 else
20830   echo "$as_me: failed program was:" >&5
20831 cat "conftest.$ac_ext" >&5
20832 cf_result=no
20833 fi
20834 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20835
20836 else
20837   cat >"conftest.$ac_ext" <<_ACEOF
20838 #line 20838 "configure"
20839 #include "confdefs.h"
20840
20841 #ifdef HAVE_XCURSES
20842 #include <xcurses.h>
20843 char * XCursesProgramName = "test";
20844 #else
20845 #include <${cf_cv_ncurses_header:-curses.h}>
20846 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20847 #include <ncursesw/term.h>
20848 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20849 #include <ncurses/term.h>
20850 #elif defined(HAVE_TERM_H)
20851 #include <term.h>
20852 #endif
20853 #endif
20854
20855 extern char $cf_data;
20856 int main(void)
20857 {
20858
20859 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20860         const void *foo = (const void *)($cf_data);
20861 #else
20862         const void *foo = &($cf_data);
20863 #endif
20864         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20865
20866         ${cf_cv_main_return:-return}(foo == 0);
20867 }
20868 _ACEOF
20869 rm -f "conftest$ac_exeext"
20870 if { (eval echo "$as_me:20870: \"$ac_link\"") >&5
20871   (eval $ac_link) 2>&5
20872   ac_status=$?
20873   echo "$as_me:20873: \$? = $ac_status" >&5
20874   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20875   { (eval echo "$as_me:20875: \"$ac_try\"") >&5
20876   (eval $ac_try) 2>&5
20877   ac_status=$?
20878   echo "$as_me:20878: \$? = $ac_status" >&5
20879   (exit "$ac_status"); }; }; then
20880   cf_result=yes
20881
20882 else
20883   echo "$as_me: program exited with status $ac_status" >&5
20884 echo "$as_me: failed program was:" >&5
20885 cat "conftest.$ac_ext" >&5
20886 cf_result=no
20887 fi
20888 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20889 fi
20890         echo "$as_me:20890: result: $cf_result" >&5
20891 echo "${ECHO_T}$cf_result" >&6
20892         if test "$cf_result" = yes ; then
20893
20894 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20895
20896                 cat >>confdefs.h <<EOF
20897 #define $cf_result 1
20898 EOF
20899
20900                 # do not exit loop here, since we prefer system's declarations
20901         fi
20902 fi
20903 done
20904
20905 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20906 then
20907         echo "$as_me:20907: checking for X" >&5
20908 echo $ECHO_N "checking for X... $ECHO_C" >&6
20909
20910 # Check whether --with-x or --without-x was given.
20911 if test "${with_x+set}" = set; then
20912   withval="$with_x"
20913
20914 fi;
20915 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20916 if test "x$with_x" = xno; then
20917   # The user explicitly disabled X.
20918   have_x=disabled
20919 else
20920   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20921     # Both variables are already set.
20922     have_x=yes
20923   else
20924     if test "${ac_cv_have_x+set}" = set; then
20925   echo $ECHO_N "(cached) $ECHO_C" >&6
20926 else
20927   # One or both of the vars are not set, and there is no cached value.
20928 ac_x_includes=no ac_x_libraries=no
20929 rm -fr conftest.dir
20930 if mkdir conftest.dir; then
20931   cd conftest.dir
20932   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20933   cat >Imakefile <<'EOF'
20934 acfindx:
20935         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20936 EOF
20937   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20938     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20939     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20940     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20941     for ac_extension in a so sl dylib dll; do
20942       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20943          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20944         ac_im_usrlibdir=$ac_im_libdir; break
20945       fi
20946     done
20947     # Screen out bogus values from the imake configuration.  They are
20948     # bogus both because they are the default anyway, and because
20949     # using them would break gcc on systems where it needs fixed includes.
20950     case $ac_im_incroot in
20951         /usr/include) ;;
20952         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20953     esac
20954     case $ac_im_usrlibdir in
20955         /usr/lib | /lib) ;;
20956         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20957     esac
20958   fi
20959   cd ..
20960   rm -fr conftest.dir
20961 fi
20962
20963 # Standard set of common directories for X headers.
20964 # Check X11 before X11Rn because it is often a symlink to the current release.
20965 ac_x_header_dirs='
20966 /usr/X11/include
20967 /usr/X11R7/include
20968 /usr/X11R6/include
20969 /usr/X11R5/include
20970 /usr/X11R4/include
20971
20972 /opt/local/include
20973 /opt/X11/include
20974
20975 /usr/include/X11
20976 /usr/include/X11R7
20977 /usr/include/X11R6
20978 /usr/include/X11R5
20979 /usr/include/X11R4
20980
20981 /usr/local/X11/include
20982 /usr/local/X11R7/include
20983 /usr/local/X11R6/include
20984 /usr/local/X11R5/include
20985 /usr/local/X11R4/include
20986
20987 /usr/local/include/X11
20988 /usr/local/include/X11R7
20989 /usr/local/include/X11R6
20990 /usr/local/include/X11R5
20991 /usr/local/include/X11R4
20992
20993 /usr/X386/include
20994 /usr/x386/include
20995 /usr/XFree86/include/X11
20996
20997 /usr/include
20998 /usr/local/include
20999 /usr/unsupported/include
21000 /usr/athena/include
21001 /usr/local/x11r5/include
21002 /usr/lpp/Xamples/include
21003
21004 /usr/openwin/include
21005 /usr/openwin/share/include'
21006
21007 if test "$ac_x_includes" = no; then
21008   # Guess where to find include files, by looking for Intrinsic.h.
21009   # First, try using that file with no special directory specified.
21010   cat >"conftest.$ac_ext" <<_ACEOF
21011 #line 21011 "configure"
21012 #include "confdefs.h"
21013 #include <X11/Intrinsic.h>
21014 _ACEOF
21015 if { (eval echo "$as_me:21015: \"$ac_cpp "conftest.$ac_ext"\"") >&5
21016   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
21017   ac_status=$?
21018   $EGREP -v '^ *\+' conftest.er1 >conftest.err
21019   rm -f conftest.er1
21020   cat conftest.err >&5
21021   echo "$as_me:21021: \$? = $ac_status" >&5
21022   (exit "$ac_status"); } >/dev/null; then
21023   if test -s conftest.err; then
21024     ac_cpp_err=$ac_c_preproc_warn_flag
21025   else
21026     ac_cpp_err=
21027   fi
21028 else
21029   ac_cpp_err=yes
21030 fi
21031 if test -z "$ac_cpp_err"; then
21032   # We can compile using X headers with no special include directory.
21033 ac_x_includes=
21034 else
21035   echo "$as_me: failed program was:" >&5
21036   cat "conftest.$ac_ext" >&5
21037   for ac_dir in $ac_x_header_dirs; do
21038   if test -r "$ac_dir/X11/Intrinsic.h"; then
21039     ac_x_includes=$ac_dir
21040     break
21041   fi
21042 done
21043 fi
21044 rm -f conftest.err "conftest.$ac_ext"
21045 fi # $ac_x_includes = no
21046
21047 if test "$ac_x_libraries" = no; then
21048   # Check for the libraries.
21049   # See if we find them without any special options.
21050   # Don't add to $LIBS permanently.
21051   ac_save_LIBS=$LIBS
21052   LIBS="-lXt $LIBS"
21053   cat >"conftest.$ac_ext" <<_ACEOF
21054 #line 21054 "configure"
21055 #include "confdefs.h"
21056 #include <X11/Intrinsic.h>
21057 int
21058 main (void)
21059 {
21060 XtMalloc (0)
21061   ;
21062   return 0;
21063 }
21064 _ACEOF
21065 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21066 if { (eval echo "$as_me:21066: \"$ac_link\"") >&5
21067   (eval $ac_link) 2>&5
21068   ac_status=$?
21069   echo "$as_me:21069: \$? = $ac_status" >&5
21070   (exit "$ac_status"); } &&
21071          { ac_try='test -s "conftest$ac_exeext"'
21072   { (eval echo "$as_me:21072: \"$ac_try\"") >&5
21073   (eval $ac_try) 2>&5
21074   ac_status=$?
21075   echo "$as_me:21075: \$? = $ac_status" >&5
21076   (exit "$ac_status"); }; }; then
21077   LIBS=$ac_save_LIBS
21078 # We can link X programs with no special library path.
21079 ac_x_libraries=
21080 else
21081   echo "$as_me: failed program was:" >&5
21082 cat "conftest.$ac_ext" >&5
21083 LIBS=$ac_save_LIBS
21084 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
21085 do
21086   # Don't even attempt the hair of trying to link an X program!
21087   for ac_extension in a so sl dylib dll; do
21088     if test -r "$ac_dir/libXt.$ac_extension"; then
21089       ac_x_libraries=$ac_dir
21090       break 2
21091     fi
21092   done
21093 done
21094 fi
21095 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21096 fi # $ac_x_libraries = no
21097
21098 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
21099   # Didn't find X anywhere.  Cache the known absence of X.
21100   ac_cv_have_x="have_x=no"
21101 else
21102   # Record where we found X for the cache.
21103   ac_cv_have_x="have_x=yes \
21104                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
21105 fi
21106 fi
21107
21108   fi
21109   eval "$ac_cv_have_x"
21110 fi # $with_x != no
21111
21112 if test "$have_x" != yes; then
21113   echo "$as_me:21113: result: $have_x" >&5
21114 echo "${ECHO_T}$have_x" >&6
21115   no_x=yes
21116 else
21117   # If each of the values was on the command line, it overrides each guess.
21118   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
21119   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
21120   # Update the cache value to reflect the command line values.
21121   ac_cv_have_x="have_x=yes \
21122                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
21123   echo "$as_me:21123: result: libraries $x_libraries, headers $x_includes" >&5
21124 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
21125 fi
21126
21127         if test "$no_x" = yes; then
21128   # Not all programs may use this symbol, but it does not hurt to define it.
21129
21130 cat >>confdefs.h <<\EOF
21131 #define X_DISPLAY_MISSING 1
21132 EOF
21133
21134   X_CFLAGS=
21135   X_PRE_LIBS=
21136   X_LIBS=
21137   X_EXTRA_LIBS=
21138 else
21139   if test -n "$x_includes"; then
21140     X_CFLAGS="$X_CFLAGS -I$x_includes"
21141   fi
21142
21143   # It would also be nice to do this for all -L options, not just this one.
21144   if test -n "$x_libraries"; then
21145     X_LIBS="$X_LIBS -L$x_libraries"
21146     # For Solaris; some versions of Sun CC require a space after -R and
21147     # others require no space.  Words are not sufficient . . . .
21148     case `(uname -sr) 2>/dev/null` in
21149     "SunOS 5"*)
21150       echo "$as_me:21150: checking whether -R must be followed by a space" >&5
21151 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
21152       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
21153       cat >"conftest.$ac_ext" <<_ACEOF
21154 #line 21154 "configure"
21155 #include "confdefs.h"
21156
21157 int
21158 main (void)
21159 {
21160
21161   ;
21162   return 0;
21163 }
21164 _ACEOF
21165 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21166 if { (eval echo "$as_me:21166: \"$ac_link\"") >&5
21167   (eval $ac_link) 2>&5
21168   ac_status=$?
21169   echo "$as_me:21169: \$? = $ac_status" >&5
21170   (exit "$ac_status"); } &&
21171          { ac_try='test -s "conftest$ac_exeext"'
21172   { (eval echo "$as_me:21172: \"$ac_try\"") >&5
21173   (eval $ac_try) 2>&5
21174   ac_status=$?
21175   echo "$as_me:21175: \$? = $ac_status" >&5
21176   (exit "$ac_status"); }; }; then
21177   ac_R_nospace=yes
21178 else
21179   echo "$as_me: failed program was:" >&5
21180 cat "conftest.$ac_ext" >&5
21181 ac_R_nospace=no
21182 fi
21183 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21184       if test $ac_R_nospace = yes; then
21185         echo "$as_me:21185: result: no" >&5
21186 echo "${ECHO_T}no" >&6
21187         X_LIBS="$X_LIBS -R$x_libraries"
21188       else
21189         LIBS="$ac_xsave_LIBS -R $x_libraries"
21190         cat >"conftest.$ac_ext" <<_ACEOF
21191 #line 21191 "configure"
21192 #include "confdefs.h"
21193
21194 int
21195 main (void)
21196 {
21197
21198   ;
21199   return 0;
21200 }
21201 _ACEOF
21202 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21203 if { (eval echo "$as_me:21203: \"$ac_link\"") >&5
21204   (eval $ac_link) 2>&5
21205   ac_status=$?
21206   echo "$as_me:21206: \$? = $ac_status" >&5
21207   (exit "$ac_status"); } &&
21208          { ac_try='test -s "conftest$ac_exeext"'
21209   { (eval echo "$as_me:21209: \"$ac_try\"") >&5
21210   (eval $ac_try) 2>&5
21211   ac_status=$?
21212   echo "$as_me:21212: \$? = $ac_status" >&5
21213   (exit "$ac_status"); }; }; then
21214   ac_R_space=yes
21215 else
21216   echo "$as_me: failed program was:" >&5
21217 cat "conftest.$ac_ext" >&5
21218 ac_R_space=no
21219 fi
21220 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21221         if test $ac_R_space = yes; then
21222           echo "$as_me:21222: result: yes" >&5
21223 echo "${ECHO_T}yes" >&6
21224           X_LIBS="$X_LIBS -R $x_libraries"
21225         else
21226           echo "$as_me:21226: result: neither works" >&5
21227 echo "${ECHO_T}neither works" >&6
21228         fi
21229       fi
21230       LIBS=$ac_xsave_LIBS
21231     esac
21232   fi
21233
21234   # Check for system-dependent libraries X programs must link with.
21235   # Do this before checking for the system-independent R6 libraries
21236   # (-lICE), since we may need -lsocket or whatever for X linking.
21237
21238   if test "$ISC" = yes; then
21239     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
21240   else
21241     # Martyn Johnson says this is needed for Ultrix, if the X
21242     # libraries were built with DECnet support.  And Karl Berry says
21243     # the Alpha needs dnet_stub (dnet does not exist).
21244     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
21245     cat >"conftest.$ac_ext" <<_ACEOF
21246 #line 21246 "configure"
21247 #include "confdefs.h"
21248
21249 /* Override any gcc2 internal prototype to avoid an error.  */
21250 #ifdef __cplusplus
21251 extern "C"
21252 #endif
21253 /* We use char because int might match the return type of a gcc2
21254    builtin and then its argument prototype would still apply.  */
21255 char XOpenDisplay ();
21256 int
21257 main (void)
21258 {
21259 XOpenDisplay ();
21260   ;
21261   return 0;
21262 }
21263 _ACEOF
21264 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21265 if { (eval echo "$as_me:21265: \"$ac_link\"") >&5
21266   (eval $ac_link) 2>&5
21267   ac_status=$?
21268   echo "$as_me:21268: \$? = $ac_status" >&5
21269   (exit "$ac_status"); } &&
21270          { ac_try='test -s "conftest$ac_exeext"'
21271   { (eval echo "$as_me:21271: \"$ac_try\"") >&5
21272   (eval $ac_try) 2>&5
21273   ac_status=$?
21274   echo "$as_me:21274: \$? = $ac_status" >&5
21275   (exit "$ac_status"); }; }; then
21276   :
21277 else
21278   echo "$as_me: failed program was:" >&5
21279 cat "conftest.$ac_ext" >&5
21280 echo "$as_me:21280: checking for dnet_ntoa in -ldnet" >&5
21281 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
21282 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
21283   echo $ECHO_N "(cached) $ECHO_C" >&6
21284 else
21285   ac_check_lib_save_LIBS=$LIBS
21286 LIBS="-ldnet  $LIBS"
21287 cat >"conftest.$ac_ext" <<_ACEOF
21288 #line 21288 "configure"
21289 #include "confdefs.h"
21290
21291 /* Override any gcc2 internal prototype to avoid an error.  */
21292 #ifdef __cplusplus
21293 extern "C"
21294 #endif
21295 /* We use char because int might match the return type of a gcc2
21296    builtin and then its argument prototype would still apply.  */
21297 char dnet_ntoa ();
21298 int
21299 main (void)
21300 {
21301 dnet_ntoa ();
21302   ;
21303   return 0;
21304 }
21305 _ACEOF
21306 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21307 if { (eval echo "$as_me:21307: \"$ac_link\"") >&5
21308   (eval $ac_link) 2>&5
21309   ac_status=$?
21310   echo "$as_me:21310: \$? = $ac_status" >&5
21311   (exit "$ac_status"); } &&
21312          { ac_try='test -s "conftest$ac_exeext"'
21313   { (eval echo "$as_me:21313: \"$ac_try\"") >&5
21314   (eval $ac_try) 2>&5
21315   ac_status=$?
21316   echo "$as_me:21316: \$? = $ac_status" >&5
21317   (exit "$ac_status"); }; }; then
21318   ac_cv_lib_dnet_dnet_ntoa=yes
21319 else
21320   echo "$as_me: failed program was:" >&5
21321 cat "conftest.$ac_ext" >&5
21322 ac_cv_lib_dnet_dnet_ntoa=no
21323 fi
21324 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21325 LIBS=$ac_check_lib_save_LIBS
21326 fi
21327 echo "$as_me:21327: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
21328 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
21329 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
21330   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
21331 fi
21332
21333     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
21334       echo "$as_me:21334: checking for dnet_ntoa in -ldnet_stub" >&5
21335 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
21336 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
21337   echo $ECHO_N "(cached) $ECHO_C" >&6
21338 else
21339   ac_check_lib_save_LIBS=$LIBS
21340 LIBS="-ldnet_stub  $LIBS"
21341 cat >"conftest.$ac_ext" <<_ACEOF
21342 #line 21342 "configure"
21343 #include "confdefs.h"
21344
21345 /* Override any gcc2 internal prototype to avoid an error.  */
21346 #ifdef __cplusplus
21347 extern "C"
21348 #endif
21349 /* We use char because int might match the return type of a gcc2
21350    builtin and then its argument prototype would still apply.  */
21351 char dnet_ntoa ();
21352 int
21353 main (void)
21354 {
21355 dnet_ntoa ();
21356   ;
21357   return 0;
21358 }
21359 _ACEOF
21360 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21361 if { (eval echo "$as_me:21361: \"$ac_link\"") >&5
21362   (eval $ac_link) 2>&5
21363   ac_status=$?
21364   echo "$as_me:21364: \$? = $ac_status" >&5
21365   (exit "$ac_status"); } &&
21366          { ac_try='test -s "conftest$ac_exeext"'
21367   { (eval echo "$as_me:21367: \"$ac_try\"") >&5
21368   (eval $ac_try) 2>&5
21369   ac_status=$?
21370   echo "$as_me:21370: \$? = $ac_status" >&5
21371   (exit "$ac_status"); }; }; then
21372   ac_cv_lib_dnet_stub_dnet_ntoa=yes
21373 else
21374   echo "$as_me: failed program was:" >&5
21375 cat "conftest.$ac_ext" >&5
21376 ac_cv_lib_dnet_stub_dnet_ntoa=no
21377 fi
21378 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21379 LIBS=$ac_check_lib_save_LIBS
21380 fi
21381 echo "$as_me:21381: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
21382 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
21383 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
21384   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
21385 fi
21386
21387     fi
21388 fi
21389 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21390     LIBS="$ac_xsave_LIBS"
21391
21392     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
21393     # to get the SysV transport functions.
21394     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
21395     # needs -lnsl.
21396     # The nsl library prevents programs from opening the X display
21397     # on Irix 5.2, according to T.E. Dickey.
21398     # The functions gethostbyname, getservbyname, and inet_addr are
21399     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
21400     echo "$as_me:21400: checking for gethostbyname" >&5
21401 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
21402 if test "${ac_cv_func_gethostbyname+set}" = set; then
21403   echo $ECHO_N "(cached) $ECHO_C" >&6
21404 else
21405   cat >"conftest.$ac_ext" <<_ACEOF
21406 #line 21406 "configure"
21407 #include "confdefs.h"
21408 #define gethostbyname autoconf_temporary
21409 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21410 #undef gethostbyname
21411
21412 #ifdef __cplusplus
21413 extern "C"
21414 #endif
21415
21416 /* We use char because int might match the return type of a gcc2
21417    builtin and then its argument prototype would still apply.  */
21418 char gethostbyname (void);
21419
21420 int
21421 main (void)
21422 {
21423
21424 /* The GNU C library defines stubs for functions which it implements
21425     to always fail with ENOSYS.  Some functions are actually named
21426     something starting with __ and the normal name is an alias.  */
21427 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21428 #error found stub for gethostbyname
21429 #endif
21430
21431         return gethostbyname ();
21432   ;
21433   return 0;
21434 }
21435 _ACEOF
21436 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21437 if { (eval echo "$as_me:21437: \"$ac_link\"") >&5
21438   (eval $ac_link) 2>&5
21439   ac_status=$?
21440   echo "$as_me:21440: \$? = $ac_status" >&5
21441   (exit "$ac_status"); } &&
21442          { ac_try='test -s "conftest$ac_exeext"'
21443   { (eval echo "$as_me:21443: \"$ac_try\"") >&5
21444   (eval $ac_try) 2>&5
21445   ac_status=$?
21446   echo "$as_me:21446: \$? = $ac_status" >&5
21447   (exit "$ac_status"); }; }; then
21448   ac_cv_func_gethostbyname=yes
21449 else
21450   echo "$as_me: failed program was:" >&5
21451 cat "conftest.$ac_ext" >&5
21452 ac_cv_func_gethostbyname=no
21453 fi
21454 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21455 fi
21456 echo "$as_me:21456: result: $ac_cv_func_gethostbyname" >&5
21457 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21458
21459     if test $ac_cv_func_gethostbyname = no; then
21460       echo "$as_me:21460: checking for gethostbyname in -lnsl" >&5
21461 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21462 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21463   echo $ECHO_N "(cached) $ECHO_C" >&6
21464 else
21465   ac_check_lib_save_LIBS=$LIBS
21466 LIBS="-lnsl  $LIBS"
21467 cat >"conftest.$ac_ext" <<_ACEOF
21468 #line 21468 "configure"
21469 #include "confdefs.h"
21470
21471 /* Override any gcc2 internal prototype to avoid an error.  */
21472 #ifdef __cplusplus
21473 extern "C"
21474 #endif
21475 /* We use char because int might match the return type of a gcc2
21476    builtin and then its argument prototype would still apply.  */
21477 char gethostbyname ();
21478 int
21479 main (void)
21480 {
21481 gethostbyname ();
21482   ;
21483   return 0;
21484 }
21485 _ACEOF
21486 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21487 if { (eval echo "$as_me:21487: \"$ac_link\"") >&5
21488   (eval $ac_link) 2>&5
21489   ac_status=$?
21490   echo "$as_me:21490: \$? = $ac_status" >&5
21491   (exit "$ac_status"); } &&
21492          { ac_try='test -s "conftest$ac_exeext"'
21493   { (eval echo "$as_me:21493: \"$ac_try\"") >&5
21494   (eval $ac_try) 2>&5
21495   ac_status=$?
21496   echo "$as_me:21496: \$? = $ac_status" >&5
21497   (exit "$ac_status"); }; }; then
21498   ac_cv_lib_nsl_gethostbyname=yes
21499 else
21500   echo "$as_me: failed program was:" >&5
21501 cat "conftest.$ac_ext" >&5
21502 ac_cv_lib_nsl_gethostbyname=no
21503 fi
21504 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21505 LIBS=$ac_check_lib_save_LIBS
21506 fi
21507 echo "$as_me:21507: result: $ac_cv_lib_nsl_gethostbyname" >&5
21508 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21509 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21510   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21511 fi
21512
21513       if test $ac_cv_lib_nsl_gethostbyname = no; then
21514         echo "$as_me:21514: checking for gethostbyname in -lbsd" >&5
21515 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21516 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21517   echo $ECHO_N "(cached) $ECHO_C" >&6
21518 else
21519   ac_check_lib_save_LIBS=$LIBS
21520 LIBS="-lbsd  $LIBS"
21521 cat >"conftest.$ac_ext" <<_ACEOF
21522 #line 21522 "configure"
21523 #include "confdefs.h"
21524
21525 /* Override any gcc2 internal prototype to avoid an error.  */
21526 #ifdef __cplusplus
21527 extern "C"
21528 #endif
21529 /* We use char because int might match the return type of a gcc2
21530    builtin and then its argument prototype would still apply.  */
21531 char gethostbyname ();
21532 int
21533 main (void)
21534 {
21535 gethostbyname ();
21536   ;
21537   return 0;
21538 }
21539 _ACEOF
21540 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21541 if { (eval echo "$as_me:21541: \"$ac_link\"") >&5
21542   (eval $ac_link) 2>&5
21543   ac_status=$?
21544   echo "$as_me:21544: \$? = $ac_status" >&5
21545   (exit "$ac_status"); } &&
21546          { ac_try='test -s "conftest$ac_exeext"'
21547   { (eval echo "$as_me:21547: \"$ac_try\"") >&5
21548   (eval $ac_try) 2>&5
21549   ac_status=$?
21550   echo "$as_me:21550: \$? = $ac_status" >&5
21551   (exit "$ac_status"); }; }; then
21552   ac_cv_lib_bsd_gethostbyname=yes
21553 else
21554   echo "$as_me: failed program was:" >&5
21555 cat "conftest.$ac_ext" >&5
21556 ac_cv_lib_bsd_gethostbyname=no
21557 fi
21558 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21559 LIBS=$ac_check_lib_save_LIBS
21560 fi
21561 echo "$as_me:21561: result: $ac_cv_lib_bsd_gethostbyname" >&5
21562 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21563 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21564   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21565 fi
21566
21567       fi
21568     fi
21569
21570     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21571     # socket/setsockopt and other routines are undefined under SCO ODT
21572     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21573     # on later versions), says Simon Leinen: it contains gethostby*
21574     # variants that don't use the nameserver (or something).  -lsocket
21575     # must be given before -lnsl if both are needed.  We assume that
21576     # if connect needs -lnsl, so does gethostbyname.
21577     echo "$as_me:21577: checking for connect" >&5
21578 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21579 if test "${ac_cv_func_connect+set}" = set; then
21580   echo $ECHO_N "(cached) $ECHO_C" >&6
21581 else
21582   cat >"conftest.$ac_ext" <<_ACEOF
21583 #line 21583 "configure"
21584 #include "confdefs.h"
21585 #define connect autoconf_temporary
21586 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21587 #undef connect
21588
21589 #ifdef __cplusplus
21590 extern "C"
21591 #endif
21592
21593 /* We use char because int might match the return type of a gcc2
21594    builtin and then its argument prototype would still apply.  */
21595 char connect (void);
21596
21597 int
21598 main (void)
21599 {
21600
21601 /* The GNU C library defines stubs for functions which it implements
21602     to always fail with ENOSYS.  Some functions are actually named
21603     something starting with __ and the normal name is an alias.  */
21604 #if defined (__stub_connect) || defined (__stub___connect)
21605 #error found stub for connect
21606 #endif
21607
21608         return connect ();
21609   ;
21610   return 0;
21611 }
21612 _ACEOF
21613 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21614 if { (eval echo "$as_me:21614: \"$ac_link\"") >&5
21615   (eval $ac_link) 2>&5
21616   ac_status=$?
21617   echo "$as_me:21617: \$? = $ac_status" >&5
21618   (exit "$ac_status"); } &&
21619          { ac_try='test -s "conftest$ac_exeext"'
21620   { (eval echo "$as_me:21620: \"$ac_try\"") >&5
21621   (eval $ac_try) 2>&5
21622   ac_status=$?
21623   echo "$as_me:21623: \$? = $ac_status" >&5
21624   (exit "$ac_status"); }; }; then
21625   ac_cv_func_connect=yes
21626 else
21627   echo "$as_me: failed program was:" >&5
21628 cat "conftest.$ac_ext" >&5
21629 ac_cv_func_connect=no
21630 fi
21631 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21632 fi
21633 echo "$as_me:21633: result: $ac_cv_func_connect" >&5
21634 echo "${ECHO_T}$ac_cv_func_connect" >&6
21635
21636     if test $ac_cv_func_connect = no; then
21637       echo "$as_me:21637: checking for connect in -lsocket" >&5
21638 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21639 if test "${ac_cv_lib_socket_connect+set}" = set; then
21640   echo $ECHO_N "(cached) $ECHO_C" >&6
21641 else
21642   ac_check_lib_save_LIBS=$LIBS
21643 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21644 cat >"conftest.$ac_ext" <<_ACEOF
21645 #line 21645 "configure"
21646 #include "confdefs.h"
21647
21648 /* Override any gcc2 internal prototype to avoid an error.  */
21649 #ifdef __cplusplus
21650 extern "C"
21651 #endif
21652 /* We use char because int might match the return type of a gcc2
21653    builtin and then its argument prototype would still apply.  */
21654 char connect ();
21655 int
21656 main (void)
21657 {
21658 connect ();
21659   ;
21660   return 0;
21661 }
21662 _ACEOF
21663 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21664 if { (eval echo "$as_me:21664: \"$ac_link\"") >&5
21665   (eval $ac_link) 2>&5
21666   ac_status=$?
21667   echo "$as_me:21667: \$? = $ac_status" >&5
21668   (exit "$ac_status"); } &&
21669          { ac_try='test -s "conftest$ac_exeext"'
21670   { (eval echo "$as_me:21670: \"$ac_try\"") >&5
21671   (eval $ac_try) 2>&5
21672   ac_status=$?
21673   echo "$as_me:21673: \$? = $ac_status" >&5
21674   (exit "$ac_status"); }; }; then
21675   ac_cv_lib_socket_connect=yes
21676 else
21677   echo "$as_me: failed program was:" >&5
21678 cat "conftest.$ac_ext" >&5
21679 ac_cv_lib_socket_connect=no
21680 fi
21681 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21682 LIBS=$ac_check_lib_save_LIBS
21683 fi
21684 echo "$as_me:21684: result: $ac_cv_lib_socket_connect" >&5
21685 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21686 if test "$ac_cv_lib_socket_connect" = yes; then
21687   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21688 fi
21689
21690     fi
21691
21692     # Guillermo Gomez says -lposix is necessary on A/UX.
21693     echo "$as_me:21693: checking for remove" >&5
21694 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21695 if test "${ac_cv_func_remove+set}" = set; then
21696   echo $ECHO_N "(cached) $ECHO_C" >&6
21697 else
21698   cat >"conftest.$ac_ext" <<_ACEOF
21699 #line 21699 "configure"
21700 #include "confdefs.h"
21701 #define remove autoconf_temporary
21702 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21703 #undef remove
21704
21705 #ifdef __cplusplus
21706 extern "C"
21707 #endif
21708
21709 /* We use char because int might match the return type of a gcc2
21710    builtin and then its argument prototype would still apply.  */
21711 char remove (void);
21712
21713 int
21714 main (void)
21715 {
21716
21717 /* The GNU C library defines stubs for functions which it implements
21718     to always fail with ENOSYS.  Some functions are actually named
21719     something starting with __ and the normal name is an alias.  */
21720 #if defined (__stub_remove) || defined (__stub___remove)
21721 #error found stub for remove
21722 #endif
21723
21724         return remove ();
21725   ;
21726   return 0;
21727 }
21728 _ACEOF
21729 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21730 if { (eval echo "$as_me:21730: \"$ac_link\"") >&5
21731   (eval $ac_link) 2>&5
21732   ac_status=$?
21733   echo "$as_me:21733: \$? = $ac_status" >&5
21734   (exit "$ac_status"); } &&
21735          { ac_try='test -s "conftest$ac_exeext"'
21736   { (eval echo "$as_me:21736: \"$ac_try\"") >&5
21737   (eval $ac_try) 2>&5
21738   ac_status=$?
21739   echo "$as_me:21739: \$? = $ac_status" >&5
21740   (exit "$ac_status"); }; }; then
21741   ac_cv_func_remove=yes
21742 else
21743   echo "$as_me: failed program was:" >&5
21744 cat "conftest.$ac_ext" >&5
21745 ac_cv_func_remove=no
21746 fi
21747 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21748 fi
21749 echo "$as_me:21749: result: $ac_cv_func_remove" >&5
21750 echo "${ECHO_T}$ac_cv_func_remove" >&6
21751
21752     if test $ac_cv_func_remove = no; then
21753       echo "$as_me:21753: checking for remove in -lposix" >&5
21754 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21755 if test "${ac_cv_lib_posix_remove+set}" = set; then
21756   echo $ECHO_N "(cached) $ECHO_C" >&6
21757 else
21758   ac_check_lib_save_LIBS=$LIBS
21759 LIBS="-lposix  $LIBS"
21760 cat >"conftest.$ac_ext" <<_ACEOF
21761 #line 21761 "configure"
21762 #include "confdefs.h"
21763
21764 /* Override any gcc2 internal prototype to avoid an error.  */
21765 #ifdef __cplusplus
21766 extern "C"
21767 #endif
21768 /* We use char because int might match the return type of a gcc2
21769    builtin and then its argument prototype would still apply.  */
21770 char remove ();
21771 int
21772 main (void)
21773 {
21774 remove ();
21775   ;
21776   return 0;
21777 }
21778 _ACEOF
21779 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21780 if { (eval echo "$as_me:21780: \"$ac_link\"") >&5
21781   (eval $ac_link) 2>&5
21782   ac_status=$?
21783   echo "$as_me:21783: \$? = $ac_status" >&5
21784   (exit "$ac_status"); } &&
21785          { ac_try='test -s "conftest$ac_exeext"'
21786   { (eval echo "$as_me:21786: \"$ac_try\"") >&5
21787   (eval $ac_try) 2>&5
21788   ac_status=$?
21789   echo "$as_me:21789: \$? = $ac_status" >&5
21790   (exit "$ac_status"); }; }; then
21791   ac_cv_lib_posix_remove=yes
21792 else
21793   echo "$as_me: failed program was:" >&5
21794 cat "conftest.$ac_ext" >&5
21795 ac_cv_lib_posix_remove=no
21796 fi
21797 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21798 LIBS=$ac_check_lib_save_LIBS
21799 fi
21800 echo "$as_me:21800: result: $ac_cv_lib_posix_remove" >&5
21801 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21802 if test "$ac_cv_lib_posix_remove" = yes; then
21803   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21804 fi
21805
21806     fi
21807
21808     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21809     echo "$as_me:21809: checking for shmat" >&5
21810 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21811 if test "${ac_cv_func_shmat+set}" = set; then
21812   echo $ECHO_N "(cached) $ECHO_C" >&6
21813 else
21814   cat >"conftest.$ac_ext" <<_ACEOF
21815 #line 21815 "configure"
21816 #include "confdefs.h"
21817 #define shmat autoconf_temporary
21818 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21819 #undef shmat
21820
21821 #ifdef __cplusplus
21822 extern "C"
21823 #endif
21824
21825 /* We use char because int might match the return type of a gcc2
21826    builtin and then its argument prototype would still apply.  */
21827 char shmat (void);
21828
21829 int
21830 main (void)
21831 {
21832
21833 /* The GNU C library defines stubs for functions which it implements
21834     to always fail with ENOSYS.  Some functions are actually named
21835     something starting with __ and the normal name is an alias.  */
21836 #if defined (__stub_shmat) || defined (__stub___shmat)
21837 #error found stub for shmat
21838 #endif
21839
21840         return shmat ();
21841   ;
21842   return 0;
21843 }
21844 _ACEOF
21845 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21846 if { (eval echo "$as_me:21846: \"$ac_link\"") >&5
21847   (eval $ac_link) 2>&5
21848   ac_status=$?
21849   echo "$as_me:21849: \$? = $ac_status" >&5
21850   (exit "$ac_status"); } &&
21851          { ac_try='test -s "conftest$ac_exeext"'
21852   { (eval echo "$as_me:21852: \"$ac_try\"") >&5
21853   (eval $ac_try) 2>&5
21854   ac_status=$?
21855   echo "$as_me:21855: \$? = $ac_status" >&5
21856   (exit "$ac_status"); }; }; then
21857   ac_cv_func_shmat=yes
21858 else
21859   echo "$as_me: failed program was:" >&5
21860 cat "conftest.$ac_ext" >&5
21861 ac_cv_func_shmat=no
21862 fi
21863 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21864 fi
21865 echo "$as_me:21865: result: $ac_cv_func_shmat" >&5
21866 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21867
21868     if test $ac_cv_func_shmat = no; then
21869       echo "$as_me:21869: checking for shmat in -lipc" >&5
21870 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21871 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21872   echo $ECHO_N "(cached) $ECHO_C" >&6
21873 else
21874   ac_check_lib_save_LIBS=$LIBS
21875 LIBS="-lipc  $LIBS"
21876 cat >"conftest.$ac_ext" <<_ACEOF
21877 #line 21877 "configure"
21878 #include "confdefs.h"
21879
21880 /* Override any gcc2 internal prototype to avoid an error.  */
21881 #ifdef __cplusplus
21882 extern "C"
21883 #endif
21884 /* We use char because int might match the return type of a gcc2
21885    builtin and then its argument prototype would still apply.  */
21886 char shmat ();
21887 int
21888 main (void)
21889 {
21890 shmat ();
21891   ;
21892   return 0;
21893 }
21894 _ACEOF
21895 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21896 if { (eval echo "$as_me:21896: \"$ac_link\"") >&5
21897   (eval $ac_link) 2>&5
21898   ac_status=$?
21899   echo "$as_me:21899: \$? = $ac_status" >&5
21900   (exit "$ac_status"); } &&
21901          { ac_try='test -s "conftest$ac_exeext"'
21902   { (eval echo "$as_me:21902: \"$ac_try\"") >&5
21903   (eval $ac_try) 2>&5
21904   ac_status=$?
21905   echo "$as_me:21905: \$? = $ac_status" >&5
21906   (exit "$ac_status"); }; }; then
21907   ac_cv_lib_ipc_shmat=yes
21908 else
21909   echo "$as_me: failed program was:" >&5
21910 cat "conftest.$ac_ext" >&5
21911 ac_cv_lib_ipc_shmat=no
21912 fi
21913 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21914 LIBS=$ac_check_lib_save_LIBS
21915 fi
21916 echo "$as_me:21916: result: $ac_cv_lib_ipc_shmat" >&5
21917 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21918 if test "$ac_cv_lib_ipc_shmat" = yes; then
21919   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21920 fi
21921
21922     fi
21923   fi
21924
21925   # Check for libraries that X11R6 Xt/Xaw programs need.
21926   ac_save_LDFLAGS=$LDFLAGS
21927   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21928   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21929   # check for ICE first), but we must link in the order -lSM -lICE or
21930   # we get undefined symbols.  So assume we have SM if we have ICE.
21931   # These have to be linked with before -lX11, unlike the other
21932   # libraries we check for below, so use a different variable.
21933   # John Interrante, Karl Berry
21934   echo "$as_me:21934: checking for IceConnectionNumber in -lICE" >&5
21935 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21936 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21937   echo $ECHO_N "(cached) $ECHO_C" >&6
21938 else
21939   ac_check_lib_save_LIBS=$LIBS
21940 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21941 cat >"conftest.$ac_ext" <<_ACEOF
21942 #line 21942 "configure"
21943 #include "confdefs.h"
21944
21945 /* Override any gcc2 internal prototype to avoid an error.  */
21946 #ifdef __cplusplus
21947 extern "C"
21948 #endif
21949 /* We use char because int might match the return type of a gcc2
21950    builtin and then its argument prototype would still apply.  */
21951 char IceConnectionNumber ();
21952 int
21953 main (void)
21954 {
21955 IceConnectionNumber ();
21956   ;
21957   return 0;
21958 }
21959 _ACEOF
21960 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21961 if { (eval echo "$as_me:21961: \"$ac_link\"") >&5
21962   (eval $ac_link) 2>&5
21963   ac_status=$?
21964   echo "$as_me:21964: \$? = $ac_status" >&5
21965   (exit "$ac_status"); } &&
21966          { ac_try='test -s "conftest$ac_exeext"'
21967   { (eval echo "$as_me:21967: \"$ac_try\"") >&5
21968   (eval $ac_try) 2>&5
21969   ac_status=$?
21970   echo "$as_me:21970: \$? = $ac_status" >&5
21971   (exit "$ac_status"); }; }; then
21972   ac_cv_lib_ICE_IceConnectionNumber=yes
21973 else
21974   echo "$as_me: failed program was:" >&5
21975 cat "conftest.$ac_ext" >&5
21976 ac_cv_lib_ICE_IceConnectionNumber=no
21977 fi
21978 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21979 LIBS=$ac_check_lib_save_LIBS
21980 fi
21981 echo "$as_me:21981: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21982 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21983 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21984   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21985 fi
21986
21987   LDFLAGS=$ac_save_LDFLAGS
21988
21989 fi
21990
21991 fi
21992
21993 if test "$GCC" = yes || test "$GXX" = yes
21994 then
21995
21996 if test "$GCC" = yes || test "$GXX" = yes
21997 then
21998         case $CFLAGS in
21999         (*-Werror=*)
22000                 cf_temp_flags=
22001                 for cf_temp_scan in $CFLAGS
22002                 do
22003                         case "x$cf_temp_scan" in
22004                         (x-Werror=format*)
22005
22006         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22007         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22008
22009                                 ;;
22010                         (x-Werror=*)
22011
22012         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22013         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22014
22015                                 ;;
22016                         (*)
22017
22018         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22019         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22020
22021                                 ;;
22022                         esac
22023                 done
22024                 if test "x$CFLAGS" != "x$cf_temp_flags"
22025                 then
22026                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
22027
22028 echo "${as_me:-configure}:22028: testing repairing CFLAGS: $CFLAGS ..." 1>&5
22029
22030                         CFLAGS="$cf_temp_flags"
22031                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
22032
22033 echo "${as_me:-configure}:22033: testing ... fixed $CFLAGS ..." 1>&5
22034
22035                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22036
22037 echo "${as_me:-configure}:22037: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22038
22039                 fi
22040                 ;;
22041         esac
22042 fi
22043
22044 if test "$GCC" = yes || test "$GXX" = yes
22045 then
22046         case $CPPFLAGS in
22047         (*-Werror=*)
22048                 cf_temp_flags=
22049                 for cf_temp_scan in $CPPFLAGS
22050                 do
22051                         case "x$cf_temp_scan" in
22052                         (x-Werror=format*)
22053
22054         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22055         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22056
22057                                 ;;
22058                         (x-Werror=*)
22059
22060         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22061         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22062
22063                                 ;;
22064                         (*)
22065
22066         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22067         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22068
22069                                 ;;
22070                         esac
22071                 done
22072                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
22073                 then
22074                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
22075
22076 echo "${as_me:-configure}:22076: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
22077
22078                         CPPFLAGS="$cf_temp_flags"
22079                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
22080
22081 echo "${as_me:-configure}:22081: testing ... fixed $CPPFLAGS ..." 1>&5
22082
22083                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22084
22085 echo "${as_me:-configure}:22085: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22086
22087                 fi
22088                 ;;
22089         esac
22090 fi
22091
22092 if test "$GCC" = yes || test "$GXX" = yes
22093 then
22094         case $LDFLAGS in
22095         (*-Werror=*)
22096                 cf_temp_flags=
22097                 for cf_temp_scan in $LDFLAGS
22098                 do
22099                         case "x$cf_temp_scan" in
22100                         (x-Werror=format*)
22101
22102         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22103         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22104
22105                                 ;;
22106                         (x-Werror=*)
22107
22108         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22109         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22110
22111                                 ;;
22112                         (*)
22113
22114         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22115         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22116
22117                                 ;;
22118                         esac
22119                 done
22120                 if test "x$LDFLAGS" != "x$cf_temp_flags"
22121                 then
22122                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
22123
22124 echo "${as_me:-configure}:22124: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
22125
22126                         LDFLAGS="$cf_temp_flags"
22127                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
22128
22129 echo "${as_me:-configure}:22129: testing ... fixed $LDFLAGS ..." 1>&5
22130
22131                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22132
22133 echo "${as_me:-configure}:22133: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22134
22135                 fi
22136                 ;;
22137         esac
22138 fi
22139
22140 echo "$as_me:22140: checking if you want to turn on gcc warnings" >&5
22141 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
22142
22143 # Check whether --enable-warnings or --disable-warnings was given.
22144 if test "${enable_warnings+set}" = set; then
22145   enableval="$enable_warnings"
22146   test "$enableval" != yes && enableval=no
22147         if test "$enableval" != "no" ; then
22148     enable_warnings=yes
22149         else
22150                 enable_warnings=no
22151         fi
22152 else
22153   enableval=no
22154         enable_warnings=no
22155
22156 fi;
22157 echo "$as_me:22157: result: $enable_warnings" >&5
22158 echo "${ECHO_T}$enable_warnings" >&6
22159 if test "$enable_warnings" = "yes"
22160 then
22161
22162 if test "$GCC" = yes || test "$GXX" = yes
22163 then
22164 cat > conftest.i <<EOF
22165 #ifndef GCC_PRINTF
22166 #define GCC_PRINTF 0
22167 #endif
22168 #ifndef GCC_SCANF
22169 #define GCC_SCANF 0
22170 #endif
22171 #ifndef GCC_NORETURN
22172 #define GCC_NORETURN /* nothing */
22173 #endif
22174 #ifndef GCC_UNUSED
22175 #define GCC_UNUSED /* nothing */
22176 #endif
22177 EOF
22178 if test "$GCC" = yes
22179 then
22180         { echo "$as_me:22180: checking for $CC __attribute__ directives..." >&5
22181 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
22182 cat > "conftest.$ac_ext" <<EOF
22183 #line 22183 "${as_me:-configure}"
22184 #include <stdio.h>
22185 #include "confdefs.h"
22186 #include "conftest.h"
22187 #include "conftest.i"
22188 #if     GCC_PRINTF
22189 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
22190 #else
22191 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
22192 #endif
22193 #if     GCC_SCANF
22194 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
22195 #else
22196 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
22197 #endif
22198 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
22199 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
22200 extern GCC_NORETURN void foo(void);
22201 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
22202 EOF
22203         cf_printf_attribute=no
22204         cf_scanf_attribute=no
22205         for cf_attribute in scanf printf unused noreturn
22206         do
22207
22208 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
22209
22210                 cf_directive="__attribute__(($cf_attribute))"
22211                 echo "checking for $CC $cf_directive" 1>&5
22212
22213                 case "$cf_attribute" in
22214                 (printf)
22215                         cf_printf_attribute=yes
22216                         cat >conftest.h <<EOF
22217 #define GCC_$cf_ATTRIBUTE 1
22218 EOF
22219                         ;;
22220                 (scanf)
22221                         cf_scanf_attribute=yes
22222                         cat >conftest.h <<EOF
22223 #define GCC_$cf_ATTRIBUTE 1
22224 EOF
22225                         ;;
22226                 (*)
22227                         cat >conftest.h <<EOF
22228 #define GCC_$cf_ATTRIBUTE $cf_directive
22229 EOF
22230                         ;;
22231                 esac
22232
22233                 if { (eval echo "$as_me:22233: \"$ac_compile\"") >&5
22234   (eval $ac_compile) 2>&5
22235   ac_status=$?
22236   echo "$as_me:22236: \$? = $ac_status" >&5
22237   (exit "$ac_status"); }; then
22238                         test -n "$verbose" && echo "$as_me:22238: result: ... $cf_attribute" >&5
22239 echo "${ECHO_T}... $cf_attribute" >&6
22240                         cat conftest.h >>confdefs.h
22241                         case "$cf_attribute" in
22242                         (noreturn)
22243
22244 cat >>confdefs.h <<EOF
22245 #define GCC_NORETURN $cf_directive
22246 EOF
22247
22248                                 ;;
22249                         (printf)
22250                                 cf_value='/* nothing */'
22251                                 if test "$cf_printf_attribute" != no ; then
22252                                         cf_value='__attribute__((format(printf,fmt,var)))'
22253
22254 cat >>confdefs.h <<\EOF
22255 #define GCC_PRINTF 1
22256 EOF
22257
22258                                 fi
22259
22260 cat >>confdefs.h <<EOF
22261 #define GCC_PRINTFLIKE(fmt,var) $cf_value
22262 EOF
22263
22264                                 ;;
22265                         (scanf)
22266                                 cf_value='/* nothing */'
22267                                 if test "$cf_scanf_attribute" != no ; then
22268                                         cf_value='__attribute__((format(scanf,fmt,var)))'
22269
22270 cat >>confdefs.h <<\EOF
22271 #define GCC_SCANF 1
22272 EOF
22273
22274                                 fi
22275
22276 cat >>confdefs.h <<EOF
22277 #define GCC_SCANFLIKE(fmt,var) $cf_value
22278 EOF
22279
22280                                 ;;
22281                         (unused)
22282
22283 cat >>confdefs.h <<EOF
22284 #define GCC_UNUSED $cf_directive
22285 EOF
22286
22287                                 ;;
22288                         esac
22289                 fi
22290         done
22291 else
22292         ${FGREP-fgrep} define conftest.i >>confdefs.h
22293 fi
22294 rm -rf ./conftest*
22295 fi
22296
22297 if test "x$have_x" = xyes; then
22298
22299 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
22300 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
22301 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
22302 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
22303 for cf_X_CFLAGS in $X_CFLAGS
22304 do
22305         case "x$cf_X_CFLAGS" in
22306         x-[IUD]*)
22307                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
22308                 ;;
22309         *)
22310                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
22311                 ;;
22312         esac
22313 done
22314
22315 cat >"conftest.$ac_ext" <<_ACEOF
22316 #line 22316 "configure"
22317 #include "confdefs.h"
22318
22319 #include <stdlib.h>
22320 #include <X11/Intrinsic.h>
22321
22322 int
22323 main (void)
22324 {
22325 String foo = malloc(1); free((void*)foo)
22326   ;
22327   return 0;
22328 }
22329 _ACEOF
22330 rm -f "conftest.$ac_objext"
22331 if { (eval echo "$as_me:22331: \"$ac_compile\"") >&5
22332   (eval $ac_compile) 2>&5
22333   ac_status=$?
22334   echo "$as_me:22334: \$? = $ac_status" >&5
22335   (exit "$ac_status"); } &&
22336          { ac_try='test -s "conftest.$ac_objext"'
22337   { (eval echo "$as_me:22337: \"$ac_try\"") >&5
22338   (eval $ac_try) 2>&5
22339   ac_status=$?
22340   echo "$as_me:22340: \$? = $ac_status" >&5
22341   (exit "$ac_status"); }; }; then
22342
22343 echo "$as_me:22343: checking for X11/Xt const-feature" >&5
22344 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
22345 if test "${cf_cv_const_x_string+set}" = set; then
22346   echo $ECHO_N "(cached) $ECHO_C" >&6
22347 else
22348
22349         cat >"conftest.$ac_ext" <<_ACEOF
22350 #line 22350 "configure"
22351 #include "confdefs.h"
22352
22353 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
22354 #undef  XTSTRINGDEFINES /* X11R5 and later */
22355 #include <stdlib.h>
22356 #include <X11/Intrinsic.h>
22357
22358 int
22359 main (void)
22360 {
22361 String foo = malloc(1); *foo = 0
22362   ;
22363   return 0;
22364 }
22365 _ACEOF
22366 rm -f "conftest.$ac_objext"
22367 if { (eval echo "$as_me:22367: \"$ac_compile\"") >&5
22368   (eval $ac_compile) 2>&5
22369   ac_status=$?
22370   echo "$as_me:22370: \$? = $ac_status" >&5
22371   (exit "$ac_status"); } &&
22372          { ac_try='test -s "conftest.$ac_objext"'
22373   { (eval echo "$as_me:22373: \"$ac_try\"") >&5
22374   (eval $ac_try) 2>&5
22375   ac_status=$?
22376   echo "$as_me:22376: \$? = $ac_status" >&5
22377   (exit "$ac_status"); }; }; then
22378
22379                         cf_cv_const_x_string=no
22380
22381 else
22382   echo "$as_me: failed program was:" >&5
22383 cat "conftest.$ac_ext" >&5
22384
22385                         cf_cv_const_x_string=yes
22386
22387 fi
22388 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22389
22390 fi
22391 echo "$as_me:22391: result: $cf_cv_const_x_string" >&5
22392 echo "${ECHO_T}$cf_cv_const_x_string" >&6
22393
22394 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
22395 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
22396 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
22397
22398 case "$cf_cv_const_x_string" in
22399 (no)
22400
22401         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22402         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
22403
22404         ;;
22405 (*)
22406
22407         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22408         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
22409
22410         ;;
22411 esac
22412
22413 else
22414   echo "$as_me: failed program was:" >&5
22415 cat "conftest.$ac_ext" >&5
22416 fi
22417 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22418  fi
22419 cat > "conftest.$ac_ext" <<EOF
22420 #line 22420 "${as_me:-configure}"
22421 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
22422 EOF
22423 if test "$INTEL_COMPILER" = yes
22424 then
22425 # The "-wdXXX" options suppress warnings:
22426 # remark #1419: external declaration in primary source file
22427 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
22428 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
22429 # remark #193: zero used for undefined preprocessing identifier
22430 # remark #593: variable "curs_sb_left_arrow" was set but never used
22431 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
22432 # remark #869: parameter "tw" was never referenced
22433 # remark #981: operands are evaluated in unspecified order
22434 # warning #279: controlling expression is constant
22435
22436         { echo "$as_me:22436: checking for $CC warning options..." >&5
22437 echo "$as_me: checking for $CC warning options..." >&6;}
22438         cf_save_CFLAGS="$CFLAGS"
22439         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
22440         for cf_opt in \
22441                 wd1419 \
22442                 wd1683 \
22443                 wd1684 \
22444                 wd193 \
22445                 wd593 \
22446                 wd279 \
22447                 wd810 \
22448                 wd869 \
22449                 wd981
22450         do
22451                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22452                 if { (eval echo "$as_me:22452: \"$ac_compile\"") >&5
22453   (eval $ac_compile) 2>&5
22454   ac_status=$?
22455   echo "$as_me:22455: \$? = $ac_status" >&5
22456   (exit "$ac_status"); }; then
22457                         test -n "$verbose" && echo "$as_me:22457: result: ... -$cf_opt" >&5
22458 echo "${ECHO_T}... -$cf_opt" >&6
22459                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22460                 fi
22461         done
22462         CFLAGS="$cf_save_CFLAGS"
22463 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
22464 then
22465         { echo "$as_me:22465: checking for $CC warning options..." >&5
22466 echo "$as_me: checking for $CC warning options..." >&6;}
22467         cf_save_CFLAGS="$CFLAGS"
22468         cf_warn_CONST=""
22469         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22470         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22471         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22472         for cf_opt in W Wall \
22473                 Wbad-function-cast \
22474                 Wcast-align \
22475                 Wcast-qual \
22476                 Wdeclaration-after-statement \
22477                 Wextra \
22478                 Winline \
22479                 Wmissing-declarations \
22480                 Wmissing-prototypes \
22481                 Wnested-externs \
22482                 Wpointer-arith \
22483                 Wshadow \
22484                 Wstrict-prototypes \
22485                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
22486         do
22487                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22488                 if { (eval echo "$as_me:22488: \"$ac_compile\"") >&5
22489   (eval $ac_compile) 2>&5
22490   ac_status=$?
22491   echo "$as_me:22491: \$? = $ac_status" >&5
22492   (exit "$ac_status"); }; then
22493                         test -n "$verbose" && echo "$as_me:22493: result: ... -$cf_opt" >&5
22494 echo "${ECHO_T}... -$cf_opt" >&6
22495                         case "$cf_opt" in
22496                         (Winline)
22497                                 case "$GCC_VERSION" in
22498                                 ([34].*)
22499                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22500
22501 echo "${as_me:-configure}:22501: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22502
22503                                         continue;;
22504                                 esac
22505                                 ;;
22506                         (Wpointer-arith)
22507                                 case "$GCC_VERSION" in
22508                                 ([12].*)
22509                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22510
22511 echo "${as_me:-configure}:22511: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22512
22513                                         continue;;
22514                                 esac
22515                                 ;;
22516                         esac
22517                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22518                 fi
22519         done
22520         CFLAGS="$cf_save_CFLAGS"
22521 fi
22522 rm -rf ./conftest*
22523
22524 fi
22525
22526 fi
22527
22528 echo "$as_me:22528: checking if you want to use dmalloc for testing" >&5
22529 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22530
22531 # Check whether --with-dmalloc or --without-dmalloc was given.
22532 if test "${with_dmalloc+set}" = set; then
22533   withval="$with_dmalloc"
22534   case "x$withval" in
22535         (x|xno) ;;
22536         (*)
22537                 : "${with_cflags:=-g}"
22538                 : "${enable_leaks:=no}"
22539                 with_dmalloc=yes
22540
22541 cat >>confdefs.h <<EOF
22542 #define USE_DMALLOC 1
22543 EOF
22544
22545                 ;;
22546         esac
22547 else
22548   with_dmalloc=
22549 fi;
22550 echo "$as_me:22550: result: ${with_dmalloc:-no}" >&5
22551 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22552
22553 case ".$with_cflags" in
22554 (.*-g*)
22555         case .$CFLAGS in
22556         (.*-g*)
22557                 ;;
22558         (*)
22559
22560 cf_fix_cppflags=no
22561 cf_new_cflags=
22562 cf_new_cppflags=
22563 cf_new_extra_cppflags=
22564
22565 for cf_add_cflags in -g
22566 do
22567 case "$cf_fix_cppflags" in
22568 (no)
22569         case "$cf_add_cflags" in
22570         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22571                 case "$cf_add_cflags" in
22572                 (-D*)
22573                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22574
22575                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22576                                 && test -z "${cf_tst_cflags}" \
22577                                 && cf_fix_cppflags=yes
22578
22579                         if test "$cf_fix_cppflags" = yes ; then
22580
22581         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22582         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22583
22584                                 continue
22585                         elif test "${cf_tst_cflags}" = "\"'" ; then
22586
22587         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22588         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22589
22590                                 continue
22591                         fi
22592                         ;;
22593                 esac
22594                 case "$CPPFLAGS" in
22595                 (*$cf_add_cflags)
22596                         ;;
22597                 (*)
22598                         case "$cf_add_cflags" in
22599                         (-D*)
22600                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22601
22602 CPPFLAGS=`echo "$CPPFLAGS" | \
22603         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22604                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22605
22606                                 ;;
22607                         esac
22608
22609         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22610         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22611
22612                         ;;
22613                 esac
22614                 ;;
22615         (*)
22616
22617         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22618         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22619
22620                 ;;
22621         esac
22622         ;;
22623 (yes)
22624
22625         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22626         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22627
22628         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22629
22630         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22631                 && test -z "${cf_tst_cflags}" \
22632                 && cf_fix_cppflags=no
22633         ;;
22634 esac
22635 done
22636
22637 if test -n "$cf_new_cflags" ; then
22638
22639         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22640         CFLAGS="${CFLAGS}$cf_new_cflags"
22641
22642 fi
22643
22644 if test -n "$cf_new_cppflags" ; then
22645
22646         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22647         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22648
22649 fi
22650
22651 if test -n "$cf_new_extra_cppflags" ; then
22652
22653         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22654         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22655
22656 fi
22657
22658                 ;;
22659         esac
22660         ;;
22661 esac
22662
22663 if test "$with_dmalloc" = yes ; then
22664         echo "$as_me:22664: checking for dmalloc.h" >&5
22665 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22666 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22667   echo $ECHO_N "(cached) $ECHO_C" >&6
22668 else
22669   cat >"conftest.$ac_ext" <<_ACEOF
22670 #line 22670 "configure"
22671 #include "confdefs.h"
22672 #include <dmalloc.h>
22673 _ACEOF
22674 if { (eval echo "$as_me:22674: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22675   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22676   ac_status=$?
22677   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22678   rm -f conftest.er1
22679   cat conftest.err >&5
22680   echo "$as_me:22680: \$? = $ac_status" >&5
22681   (exit "$ac_status"); } >/dev/null; then
22682   if test -s conftest.err; then
22683     ac_cpp_err=$ac_c_preproc_warn_flag
22684   else
22685     ac_cpp_err=
22686   fi
22687 else
22688   ac_cpp_err=yes
22689 fi
22690 if test -z "$ac_cpp_err"; then
22691   ac_cv_header_dmalloc_h=yes
22692 else
22693   echo "$as_me: failed program was:" >&5
22694   cat "conftest.$ac_ext" >&5
22695   ac_cv_header_dmalloc_h=no
22696 fi
22697 rm -f conftest.err "conftest.$ac_ext"
22698 fi
22699 echo "$as_me:22699: result: $ac_cv_header_dmalloc_h" >&5
22700 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22701 if test "$ac_cv_header_dmalloc_h" = yes; then
22702
22703 echo "$as_me:22703: checking for dmalloc_debug in -ldmalloc" >&5
22704 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22705 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22706   echo $ECHO_N "(cached) $ECHO_C" >&6
22707 else
22708   ac_check_lib_save_LIBS=$LIBS
22709 LIBS="-ldmalloc  $LIBS"
22710 cat >"conftest.$ac_ext" <<_ACEOF
22711 #line 22711 "configure"
22712 #include "confdefs.h"
22713
22714 /* Override any gcc2 internal prototype to avoid an error.  */
22715 #ifdef __cplusplus
22716 extern "C"
22717 #endif
22718 /* We use char because int might match the return type of a gcc2
22719    builtin and then its argument prototype would still apply.  */
22720 char dmalloc_debug ();
22721 int
22722 main (void)
22723 {
22724 dmalloc_debug ();
22725   ;
22726   return 0;
22727 }
22728 _ACEOF
22729 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22730 if { (eval echo "$as_me:22730: \"$ac_link\"") >&5
22731   (eval $ac_link) 2>&5
22732   ac_status=$?
22733   echo "$as_me:22733: \$? = $ac_status" >&5
22734   (exit "$ac_status"); } &&
22735          { ac_try='test -s "conftest$ac_exeext"'
22736   { (eval echo "$as_me:22736: \"$ac_try\"") >&5
22737   (eval $ac_try) 2>&5
22738   ac_status=$?
22739   echo "$as_me:22739: \$? = $ac_status" >&5
22740   (exit "$ac_status"); }; }; then
22741   ac_cv_lib_dmalloc_dmalloc_debug=yes
22742 else
22743   echo "$as_me: failed program was:" >&5
22744 cat "conftest.$ac_ext" >&5
22745 ac_cv_lib_dmalloc_dmalloc_debug=no
22746 fi
22747 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22748 LIBS=$ac_check_lib_save_LIBS
22749 fi
22750 echo "$as_me:22750: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22751 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22752 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22753   cat >>confdefs.h <<EOF
22754 #define HAVE_LIBDMALLOC 1
22755 EOF
22756
22757   LIBS="-ldmalloc $LIBS"
22758
22759 fi
22760
22761 fi
22762
22763 fi
22764
22765 echo "$as_me:22765: checking if you want to use dbmalloc for testing" >&5
22766 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22767
22768 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22769 if test "${with_dbmalloc+set}" = set; then
22770   withval="$with_dbmalloc"
22771   case "x$withval" in
22772         (x|xno) ;;
22773         (*)
22774                 : "${with_cflags:=-g}"
22775                 : "${enable_leaks:=no}"
22776                 with_dbmalloc=yes
22777
22778 cat >>confdefs.h <<EOF
22779 #define USE_DBMALLOC 1
22780 EOF
22781
22782                 ;;
22783         esac
22784 else
22785   with_dbmalloc=
22786 fi;
22787 echo "$as_me:22787: result: ${with_dbmalloc:-no}" >&5
22788 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22789
22790 case ".$with_cflags" in
22791 (.*-g*)
22792         case .$CFLAGS in
22793         (.*-g*)
22794                 ;;
22795         (*)
22796
22797 cf_fix_cppflags=no
22798 cf_new_cflags=
22799 cf_new_cppflags=
22800 cf_new_extra_cppflags=
22801
22802 for cf_add_cflags in -g
22803 do
22804 case "$cf_fix_cppflags" in
22805 (no)
22806         case "$cf_add_cflags" in
22807         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22808                 case "$cf_add_cflags" in
22809                 (-D*)
22810                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22811
22812                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22813                                 && test -z "${cf_tst_cflags}" \
22814                                 && cf_fix_cppflags=yes
22815
22816                         if test "$cf_fix_cppflags" = yes ; then
22817
22818         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22819         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22820
22821                                 continue
22822                         elif test "${cf_tst_cflags}" = "\"'" ; then
22823
22824         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22825         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22826
22827                                 continue
22828                         fi
22829                         ;;
22830                 esac
22831                 case "$CPPFLAGS" in
22832                 (*$cf_add_cflags)
22833                         ;;
22834                 (*)
22835                         case "$cf_add_cflags" in
22836                         (-D*)
22837                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22838
22839 CPPFLAGS=`echo "$CPPFLAGS" | \
22840         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22841                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22842
22843                                 ;;
22844                         esac
22845
22846         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22847         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22848
22849                         ;;
22850                 esac
22851                 ;;
22852         (*)
22853
22854         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22855         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22856
22857                 ;;
22858         esac
22859         ;;
22860 (yes)
22861
22862         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22863         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22864
22865         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22866
22867         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22868                 && test -z "${cf_tst_cflags}" \
22869                 && cf_fix_cppflags=no
22870         ;;
22871 esac
22872 done
22873
22874 if test -n "$cf_new_cflags" ; then
22875
22876         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22877         CFLAGS="${CFLAGS}$cf_new_cflags"
22878
22879 fi
22880
22881 if test -n "$cf_new_cppflags" ; then
22882
22883         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22884         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22885
22886 fi
22887
22888 if test -n "$cf_new_extra_cppflags" ; then
22889
22890         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22891         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22892
22893 fi
22894
22895                 ;;
22896         esac
22897         ;;
22898 esac
22899
22900 if test "$with_dbmalloc" = yes ; then
22901         echo "$as_me:22901: checking for dbmalloc.h" >&5
22902 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22903 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22904   echo $ECHO_N "(cached) $ECHO_C" >&6
22905 else
22906   cat >"conftest.$ac_ext" <<_ACEOF
22907 #line 22907 "configure"
22908 #include "confdefs.h"
22909 #include <dbmalloc.h>
22910 _ACEOF
22911 if { (eval echo "$as_me:22911: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22912   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22913   ac_status=$?
22914   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22915   rm -f conftest.er1
22916   cat conftest.err >&5
22917   echo "$as_me:22917: \$? = $ac_status" >&5
22918   (exit "$ac_status"); } >/dev/null; then
22919   if test -s conftest.err; then
22920     ac_cpp_err=$ac_c_preproc_warn_flag
22921   else
22922     ac_cpp_err=
22923   fi
22924 else
22925   ac_cpp_err=yes
22926 fi
22927 if test -z "$ac_cpp_err"; then
22928   ac_cv_header_dbmalloc_h=yes
22929 else
22930   echo "$as_me: failed program was:" >&5
22931   cat "conftest.$ac_ext" >&5
22932   ac_cv_header_dbmalloc_h=no
22933 fi
22934 rm -f conftest.err "conftest.$ac_ext"
22935 fi
22936 echo "$as_me:22936: result: $ac_cv_header_dbmalloc_h" >&5
22937 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22938 if test "$ac_cv_header_dbmalloc_h" = yes; then
22939
22940 echo "$as_me:22940: checking for debug_malloc in -ldbmalloc" >&5
22941 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22942 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22943   echo $ECHO_N "(cached) $ECHO_C" >&6
22944 else
22945   ac_check_lib_save_LIBS=$LIBS
22946 LIBS="-ldbmalloc  $LIBS"
22947 cat >"conftest.$ac_ext" <<_ACEOF
22948 #line 22948 "configure"
22949 #include "confdefs.h"
22950
22951 /* Override any gcc2 internal prototype to avoid an error.  */
22952 #ifdef __cplusplus
22953 extern "C"
22954 #endif
22955 /* We use char because int might match the return type of a gcc2
22956    builtin and then its argument prototype would still apply.  */
22957 char debug_malloc ();
22958 int
22959 main (void)
22960 {
22961 debug_malloc ();
22962   ;
22963   return 0;
22964 }
22965 _ACEOF
22966 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22967 if { (eval echo "$as_me:22967: \"$ac_link\"") >&5
22968   (eval $ac_link) 2>&5
22969   ac_status=$?
22970   echo "$as_me:22970: \$? = $ac_status" >&5
22971   (exit "$ac_status"); } &&
22972          { ac_try='test -s "conftest$ac_exeext"'
22973   { (eval echo "$as_me:22973: \"$ac_try\"") >&5
22974   (eval $ac_try) 2>&5
22975   ac_status=$?
22976   echo "$as_me:22976: \$? = $ac_status" >&5
22977   (exit "$ac_status"); }; }; then
22978   ac_cv_lib_dbmalloc_debug_malloc=yes
22979 else
22980   echo "$as_me: failed program was:" >&5
22981 cat "conftest.$ac_ext" >&5
22982 ac_cv_lib_dbmalloc_debug_malloc=no
22983 fi
22984 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22985 LIBS=$ac_check_lib_save_LIBS
22986 fi
22987 echo "$as_me:22987: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22988 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22989 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22990   cat >>confdefs.h <<EOF
22991 #define HAVE_LIBDBMALLOC 1
22992 EOF
22993
22994   LIBS="-ldbmalloc $LIBS"
22995
22996 fi
22997
22998 fi
22999
23000 fi
23001
23002 echo "$as_me:23002: checking if you want to use valgrind for testing" >&5
23003 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
23004
23005 # Check whether --with-valgrind or --without-valgrind was given.
23006 if test "${with_valgrind+set}" = set; then
23007   withval="$with_valgrind"
23008   case "x$withval" in
23009         (x|xno) ;;
23010         (*)
23011                 : "${with_cflags:=-g}"
23012                 : "${enable_leaks:=no}"
23013                 with_valgrind=yes
23014
23015 cat >>confdefs.h <<EOF
23016 #define USE_VALGRIND 1
23017 EOF
23018
23019                 ;;
23020         esac
23021 else
23022   with_valgrind=
23023 fi;
23024 echo "$as_me:23024: result: ${with_valgrind:-no}" >&5
23025 echo "${ECHO_T}${with_valgrind:-no}" >&6
23026
23027 case ".$with_cflags" in
23028 (.*-g*)
23029         case .$CFLAGS in
23030         (.*-g*)
23031                 ;;
23032         (*)
23033
23034 cf_fix_cppflags=no
23035 cf_new_cflags=
23036 cf_new_cppflags=
23037 cf_new_extra_cppflags=
23038
23039 for cf_add_cflags in -g
23040 do
23041 case "$cf_fix_cppflags" in
23042 (no)
23043         case "$cf_add_cflags" in
23044         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
23045                 case "$cf_add_cflags" in
23046                 (-D*)
23047                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
23048
23049                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23050                                 && test -z "${cf_tst_cflags}" \
23051                                 && cf_fix_cppflags=yes
23052
23053                         if test "$cf_fix_cppflags" = yes ; then
23054
23055         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23056         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23057
23058                                 continue
23059                         elif test "${cf_tst_cflags}" = "\"'" ; then
23060
23061         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23062         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23063
23064                                 continue
23065                         fi
23066                         ;;
23067                 esac
23068                 case "$CPPFLAGS" in
23069                 (*$cf_add_cflags)
23070                         ;;
23071                 (*)
23072                         case "$cf_add_cflags" in
23073                         (-D*)
23074                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
23075
23076 CPPFLAGS=`echo "$CPPFLAGS" | \
23077         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
23078                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
23079
23080                                 ;;
23081                         esac
23082
23083         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
23084         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
23085
23086                         ;;
23087                 esac
23088                 ;;
23089         (*)
23090
23091         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
23092         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
23093
23094                 ;;
23095         esac
23096         ;;
23097 (yes)
23098
23099         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23100         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23101
23102         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
23103
23104         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23105                 && test -z "${cf_tst_cflags}" \
23106                 && cf_fix_cppflags=no
23107         ;;
23108 esac
23109 done
23110
23111 if test -n "$cf_new_cflags" ; then
23112
23113         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
23114         CFLAGS="${CFLAGS}$cf_new_cflags"
23115
23116 fi
23117
23118 if test -n "$cf_new_cppflags" ; then
23119
23120         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23121         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23122
23123 fi
23124
23125 if test -n "$cf_new_extra_cppflags" ; then
23126
23127         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23128         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23129
23130 fi
23131
23132                 ;;
23133         esac
23134         ;;
23135 esac
23136
23137 echo "$as_me:23137: checking if you want to perform memory-leak testing" >&5
23138 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
23139
23140 # Check whether --enable-leaks or --disable-leaks was given.
23141 if test "${enable_leaks+set}" = set; then
23142   enableval="$enable_leaks"
23143   enable_leaks=$enableval
23144 else
23145   enable_leaks=yes
23146 fi;
23147 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
23148 echo "$as_me:23148: result: $with_no_leaks" >&5
23149 echo "${ECHO_T}$with_no_leaks" >&6
23150
23151 if test "$enable_leaks" = no ; then
23152
23153 cat >>confdefs.h <<\EOF
23154 #define NO_LEAKS 1
23155 EOF
23156
23157 cat >>confdefs.h <<\EOF
23158 #define YY_NO_LEAKS 1
23159 EOF
23160
23161 fi
23162
23163 LD_RPATH_OPT=
23164 if test "x$cf_cv_enable_rpath" != xno
23165 then
23166         echo "$as_me:23166: checking for an rpath option" >&5
23167 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
23168         case "$cf_cv_system_name" in
23169         (irix*)
23170                 if test "$GCC" = yes; then
23171                         LD_RPATH_OPT="-Wl,-rpath,"
23172                 else
23173                         LD_RPATH_OPT="-rpath "
23174                 fi
23175                 ;;
23176         (linux*|gnu*|k*bsd*-gnu|freebsd*)
23177                 LD_RPATH_OPT="-Wl,-rpath,"
23178                 ;;
23179         (openbsd[2-9].*|mirbsd*)
23180                 LD_RPATH_OPT="-Wl,-rpath,"
23181                 ;;
23182         (dragonfly*)
23183                 LD_RPATH_OPT="-rpath "
23184                 ;;
23185         (netbsd*)
23186                 LD_RPATH_OPT="-Wl,-rpath,"
23187                 ;;
23188         (osf*|mls+*)
23189                 LD_RPATH_OPT="-rpath "
23190                 ;;
23191         (solaris2*)
23192                 LD_RPATH_OPT="-R"
23193                 ;;
23194         (*)
23195                 ;;
23196         esac
23197         echo "$as_me:23197: result: $LD_RPATH_OPT" >&5
23198 echo "${ECHO_T}$LD_RPATH_OPT" >&6
23199
23200         case "x$LD_RPATH_OPT" in
23201         (x-R*)
23202                 echo "$as_me:23202: checking if we need a space after rpath option" >&5
23203 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
23204                 cf_save_LIBS="$LIBS"
23205
23206 cf_add_libs="$LIBS"
23207 # reverse order
23208 cf_add_0lib=
23209 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
23210 # filter duplicates
23211 for cf_add_1lib in $cf_add_0lib; do
23212         for cf_add_2lib in $cf_add_libs; do
23213                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
23214                         cf_add_1lib=
23215                         break
23216                 fi
23217         done
23218         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
23219 done
23220 LIBS="$cf_add_libs"
23221
23222                 cat >"conftest.$ac_ext" <<_ACEOF
23223 #line 23223 "configure"
23224 #include "confdefs.h"
23225
23226 int
23227 main (void)
23228 {
23229
23230   ;
23231   return 0;
23232 }
23233 _ACEOF
23234 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23235 if { (eval echo "$as_me:23235: \"$ac_link\"") >&5
23236   (eval $ac_link) 2>&5
23237   ac_status=$?
23238   echo "$as_me:23238: \$? = $ac_status" >&5
23239   (exit "$ac_status"); } &&
23240          { ac_try='test -s "conftest$ac_exeext"'
23241   { (eval echo "$as_me:23241: \"$ac_try\"") >&5
23242   (eval $ac_try) 2>&5
23243   ac_status=$?
23244   echo "$as_me:23244: \$? = $ac_status" >&5
23245   (exit "$ac_status"); }; }; then
23246   cf_rpath_space=no
23247 else
23248   echo "$as_me: failed program was:" >&5
23249 cat "conftest.$ac_ext" >&5
23250 cf_rpath_space=yes
23251 fi
23252 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23253                 LIBS="$cf_save_LIBS"
23254                 echo "$as_me:23254: result: $cf_rpath_space" >&5
23255 echo "${ECHO_T}$cf_rpath_space" >&6
23256                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
23257                 ;;
23258         esac
23259 fi
23260
23261 echo "$as_me:23261: checking if rpath-hack should be disabled" >&5
23262 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
23263
23264 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
23265 if test "${enable_rpath_hack+set}" = set; then
23266   enableval="$enable_rpath_hack"
23267   test "$enableval" != no && enableval=yes
23268         if test "$enableval" != "yes" ; then
23269     enable_rpath_hack=no
23270         else
23271                 enable_rpath_hack=yes
23272         fi
23273 else
23274   enableval=yes
23275         enable_rpath_hack=yes
23276
23277 fi;
23278 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
23279 echo "$as_me:23279: result: $cf_disable_rpath_hack" >&5
23280 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
23281
23282 if test "$enable_rpath_hack" = yes ; then
23283
23284 echo "$as_me:23284: checking for updated LDFLAGS" >&5
23285 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
23286 if test -n "$LD_RPATH_OPT" ; then
23287         echo "$as_me:23287: result: maybe" >&5
23288 echo "${ECHO_T}maybe" >&6
23289
23290         for ac_prog in ldd
23291 do
23292   # Extract the first word of "$ac_prog", so it can be a program name with args.
23293 set dummy $ac_prog; ac_word=$2
23294 echo "$as_me:23294: checking for $ac_word" >&5
23295 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
23296 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
23297   echo $ECHO_N "(cached) $ECHO_C" >&6
23298 else
23299   if test -n "$cf_ldd_prog"; then
23300   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
23301 else
23302   ac_save_IFS=$IFS; IFS=$ac_path_separator
23303 ac_dummy="$PATH"
23304 for ac_dir in $ac_dummy; do
23305   IFS=$ac_save_IFS
23306   test -z "$ac_dir" && ac_dir=.
23307   $as_executable_p "$ac_dir/$ac_word" || continue
23308 ac_cv_prog_cf_ldd_prog="$ac_prog"
23309 echo "$as_me:23309: found $ac_dir/$ac_word" >&5
23310 break
23311 done
23312
23313 fi
23314 fi
23315 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
23316 if test -n "$cf_ldd_prog"; then
23317   echo "$as_me:23317: result: $cf_ldd_prog" >&5
23318 echo "${ECHO_T}$cf_ldd_prog" >&6
23319 else
23320   echo "$as_me:23320: result: no" >&5
23321 echo "${ECHO_T}no" >&6
23322 fi
23323
23324   test -n "$cf_ldd_prog" && break
23325 done
23326 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
23327
23328         cf_rpath_list="/usr/lib /lib"
23329         if test "$cf_ldd_prog" != no
23330         then
23331                 cf_rpath_oops=
23332
23333 cat >"conftest.$ac_ext" <<_ACEOF
23334 #line 23334 "configure"
23335 #include "confdefs.h"
23336 #include <stdio.h>
23337 int
23338 main (void)
23339 {
23340 printf("Hello");
23341   ;
23342   return 0;
23343 }
23344 _ACEOF
23345 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23346 if { (eval echo "$as_me:23346: \"$ac_link\"") >&5
23347   (eval $ac_link) 2>&5
23348   ac_status=$?
23349   echo "$as_me:23349: \$? = $ac_status" >&5
23350   (exit "$ac_status"); } &&
23351          { ac_try='test -s "conftest$ac_exeext"'
23352   { (eval echo "$as_me:23352: \"$ac_try\"") >&5
23353   (eval $ac_try) 2>&5
23354   ac_status=$?
23355   echo "$as_me:23355: \$? = $ac_status" >&5
23356   (exit "$ac_status"); }; }; then
23357   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
23358                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
23359 else
23360   echo "$as_me: failed program was:" >&5
23361 cat "conftest.$ac_ext" >&5
23362 fi
23363 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23364
23365                 # If we passed the link-test, but get a "not found" on a given library,
23366                 # this could be due to inept reconfiguration of gcc to make it only
23367                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
23368                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
23369                 # /usr/local libraries.
23370                 if test -n "$cf_rpath_oops"
23371                 then
23372                         for cf_rpath_src in $cf_rpath_oops
23373                         do
23374                                 for cf_rpath_dir in \
23375                                         /usr/local \
23376                                         /usr/pkg \
23377                                         /opt/sfw
23378                                 do
23379                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
23380                                         then
23381                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
23382
23383 echo "${as_me:-configure}:23383: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
23384
23385                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
23386                                                 break
23387                                         fi
23388                                 done
23389                         done
23390                 fi
23391         fi
23392
23393         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23394
23395 echo "${as_me:-configure}:23395: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23396
23397 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
23398
23399 echo "${as_me:-configure}:23399: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
23400
23401 cf_rpath_dst=
23402 for cf_rpath_src in $LDFLAGS
23403 do
23404         case "$cf_rpath_src" in
23405         (-L*)
23406
23407                 # check if this refers to a directory which we will ignore
23408                 cf_rpath_skip=no
23409                 if test -n "$cf_rpath_list"
23410                 then
23411                         for cf_rpath_item in $cf_rpath_list
23412                         do
23413                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23414                                 then
23415                                         cf_rpath_skip=yes
23416                                         break
23417                                 fi
23418                         done
23419                 fi
23420
23421                 if test "$cf_rpath_skip" = no
23422                 then
23423                         # transform the option
23424                         if test "$LD_RPATH_OPT" = "-R " ; then
23425                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23426                         else
23427                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23428                         fi
23429
23430                         # if we have not already added this, add it now
23431                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23432                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23433                         then
23434                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23435
23436 echo "${as_me:-configure}:23436: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23437
23438                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23439                         fi
23440                 fi
23441                 ;;
23442         esac
23443         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23444 done
23445 LDFLAGS=$cf_rpath_dst
23446
23447 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
23448
23449 echo "${as_me:-configure}:23449: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
23450
23451 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
23452
23453 echo "${as_me:-configure}:23453: testing ...checking LIBS $LIBS ..." 1>&5
23454
23455 cf_rpath_dst=
23456 for cf_rpath_src in $LIBS
23457 do
23458         case "$cf_rpath_src" in
23459         (-L*)
23460
23461                 # check if this refers to a directory which we will ignore
23462                 cf_rpath_skip=no
23463                 if test -n "$cf_rpath_list"
23464                 then
23465                         for cf_rpath_item in $cf_rpath_list
23466                         do
23467                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23468                                 then
23469                                         cf_rpath_skip=yes
23470                                         break
23471                                 fi
23472                         done
23473                 fi
23474
23475                 if test "$cf_rpath_skip" = no
23476                 then
23477                         # transform the option
23478                         if test "$LD_RPATH_OPT" = "-R " ; then
23479                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23480                         else
23481                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23482                         fi
23483
23484                         # if we have not already added this, add it now
23485                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23486                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23487                         then
23488                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23489
23490 echo "${as_me:-configure}:23490: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23491
23492                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23493                         fi
23494                 fi
23495                 ;;
23496         esac
23497         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23498 done
23499 LIBS=$cf_rpath_dst
23500
23501 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
23502
23503 echo "${as_me:-configure}:23503: testing ...checked LIBS $LIBS ..." 1>&5
23504
23505         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23506
23507 echo "${as_me:-configure}:23507: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23508
23509 else
23510         echo "$as_me:23510: result: no" >&5
23511 echo "${ECHO_T}no" >&6
23512 fi
23513
23514 fi
23515
23516 TEST_ARGS="$LIBS"
23517 LIBS=
23518
23519 ac_config_files="$ac_config_files Makefile"
23520 ac_config_commands="$ac_config_commands default"
23521 cat >confcache <<\_ACEOF
23522 # This file is a shell script that caches the results of configure
23523 # tests run on this system so they can be shared between configure
23524 # scripts and configure runs, see configure's option --config-cache.
23525 # It is not useful on other systems.  If it contains results you don't
23526 # want to keep, you may remove or edit it.
23527 #
23528 # config.status only pays attention to the cache file if you give it
23529 # the --recheck option to rerun configure.
23530 #
23531 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23532 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23533 # following values.
23534
23535 _ACEOF
23536
23537 # The following way of writing the cache mishandles newlines in values,
23538 # but we know of no workaround that is simple, portable, and efficient.
23539 # So, don't put newlines in cache variables' values.
23540 # Ultrix sh set writes to stderr and can't be redirected directly,
23541 # and sets the high bit in the cache file unless we assign to the vars.
23542 {
23543   (set) 2>&1 |
23544     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23545     *ac_space=\ *)
23546       # `set' does not quote correctly, so add quotes (double-quote
23547       # substitution turns \\\\ into \\, and sed turns \\ into \).
23548       sed -n \
23549         "s/'/'\\\\''/g;
23550           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23551       ;;
23552     *)
23553       # `set' quotes correctly as required by POSIX, so do not add quotes.
23554       sed -n \
23555         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23556       ;;
23557     esac;
23558 } |
23559   sed '
23560      t clear
23561      : clear
23562      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23563      t end
23564      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23565      : end' >>confcache
23566 if cmp -s $cache_file confcache; then :; else
23567   if test -w $cache_file; then
23568     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23569     cat confcache >$cache_file
23570   else
23571     echo "not updating unwritable cache $cache_file"
23572   fi
23573 fi
23574 rm -f confcache
23575
23576 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23577 # Let make expand exec_prefix.
23578 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23579
23580 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23581 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23582 # trailing colons and then remove the whole line if VPATH becomes empty
23583 # (actually we leave an empty line to preserve line numbers).
23584 if test "x$srcdir" = x.; then
23585   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23586 s/:*\$(srcdir):*/:/;
23587 s/:*\${srcdir}:*/:/;
23588 s/:*@srcdir@:*/:/;
23589 s/^\([^=]*=[    ]*\):*/\1/;
23590 s/:*$//;
23591 s/^[^=]*=[      ]*$//;
23592 }'
23593 fi
23594
23595 DEFS=-DHAVE_CONFIG_H
23596
23597 : "${CONFIG_STATUS=./config.status}"
23598 ac_clean_files_save=$ac_clean_files
23599 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23600 { echo "$as_me:23600: creating $CONFIG_STATUS" >&5
23601 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23602 cat >"$CONFIG_STATUS" <<_ACEOF
23603 #! $SHELL
23604 # Generated automatically by configure.
23605 # Run this file to recreate the current configuration.
23606 # Compiler output produced by configure, useful for debugging
23607 # configure, is in config.log if it exists.
23608
23609 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
23610
23611 debug=false
23612 SHELL=\${CONFIG_SHELL-$SHELL}
23613 ac_cs_invocation="\$0 \$@"
23614
23615 CLICOLOR_FORCE= GREP_OPTIONS=
23616 unset CLICOLOR_FORCE GREP_OPTIONS
23617 _ACEOF
23618
23619 cat >>"$CONFIG_STATUS" <<\_ACEOF
23620 # Be Bourne compatible
23621 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23622   emulate sh
23623   NULLCMD=:
23624 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23625   set -o posix
23626 fi
23627
23628 # Name of the executable.
23629 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23630
23631 if expr a : '\(a\)' >/dev/null 2>&1; then
23632   as_expr="expr"
23633 else
23634   as_expr="false"
23635 fi
23636
23637 rm -f conf$$ conf$$.exe conf$$.file
23638 echo >conf$$.file
23639 if ln -s conf$$.file conf$$ 2>/dev/null; then
23640   # We could just check for DJGPP; but this test a) works b) is more generic
23641   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23642   if test -f conf$$.exe; then
23643     # Don't use ln at all; we don't have any links
23644     as_ln_s='cp -p'
23645   else
23646     as_ln_s='ln -s'
23647   fi
23648 elif ln conf$$.file conf$$ 2>/dev/null; then
23649   as_ln_s='ln'
23650 else
23651   as_ln_s='cp -p'
23652 fi
23653 rm -f conf$$ conf$$.exe conf$$.file
23654
23655 as_executable_p="test -f"
23656
23657 # Support unset when possible.
23658 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23659   as_unset="unset"
23660 else
23661   as_unset="false"
23662 fi
23663
23664 # NLS nuisances.
23665 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23666 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23667 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23668 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23669 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23670 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23671 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23672 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23673
23674 # IFS
23675 # We need space, tab and new line, in precisely that order.
23676 as_nl='
23677 '
23678 IFS="   $as_nl"
23679
23680 # CDPATH.
23681 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23682
23683 exec 6>&1
23684
23685 _ACEOF
23686
23687 # Files that config.status was made for.
23688 if test -n "$ac_config_files"; then
23689   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23690 fi
23691
23692 if test -n "$ac_config_headers"; then
23693   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23694 fi
23695
23696 if test -n "$ac_config_links"; then
23697   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23698 fi
23699
23700 if test -n "$ac_config_commands"; then
23701   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23702 fi
23703
23704 cat >>"$CONFIG_STATUS" <<\EOF
23705
23706 ac_cs_usage="\
23707 \`$as_me' instantiates files from templates according to the
23708 current configuration.
23709
23710 Usage: $0 [OPTIONS] [FILE]...
23711
23712   -h, --help       print this help, then exit
23713   -V, --version    print version number, then exit
23714   -d, --debug      don't remove temporary files
23715       --recheck    update $as_me by reconfiguring in the same conditions
23716   --file=FILE[:TEMPLATE]
23717                    instantiate the configuration file FILE
23718   --header=FILE[:TEMPLATE]
23719                    instantiate the configuration header FILE
23720
23721 Configuration files:
23722 $config_files
23723
23724 Configuration headers:
23725 $config_headers
23726
23727 Configuration commands:
23728 $config_commands
23729
23730 Report bugs to <dickey@invisible-island.net>."
23731 EOF
23732
23733 cat >>"$CONFIG_STATUS" <<EOF
23734 ac_cs_version="\\
23735 config.status
23736 configured by $0, generated by GNU Autoconf 2.52.20221202,
23737   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23738
23739 Copyright 2003-2021,2022        Thomas E. Dickey
23740 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23741 Free Software Foundation, Inc.
23742 This config.status script is free software; the Free Software Foundation
23743 gives unlimited permission to copy, distribute and modify it."
23744 srcdir="$srcdir"
23745 INSTALL="$INSTALL"
23746 EOF
23747
23748 cat >>"$CONFIG_STATUS" <<\EOF
23749 # If no file are specified by the user, then we need to provide default
23750 # value.  By we need to know if files were specified by the user.
23751 ac_need_defaults=:
23752 while test $# != 0
23753 do
23754   case $1 in
23755   --*=*)
23756     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23757     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23758     shift
23759     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23760     shift
23761     ;;
23762   -*);;
23763   *) # This is not an option, so the user has probably given explicit
23764      # arguments.
23765      ac_need_defaults=false;;
23766   esac
23767
23768   case $1 in
23769   # Handling of the options.
23770 EOF
23771 cat >>"$CONFIG_STATUS" <<EOF
23772   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23773     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23774     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23775 EOF
23776 cat >>"$CONFIG_STATUS" <<\EOF
23777   --version | --vers* | -V )
23778     echo "$ac_cs_version"; exit 0 ;;
23779   --he | --h)
23780     # Conflict between --help and --header
23781     { { echo "$as_me:23781: error: ambiguous option: $1
23782 Try \`$0 --help' for more information." >&5
23783 echo "$as_me: error: ambiguous option: $1
23784 Try \`$0 --help' for more information." >&2;}
23785    { (exit 1); exit 1; }; };;
23786   --help | --hel | -h )
23787     echo "$ac_cs_usage"; exit 0 ;;
23788   --debug | --d* | -d )
23789     debug=: ;;
23790   --file | --fil | --fi | --f )
23791     shift
23792     CONFIG_FILES="$CONFIG_FILES $1"
23793     ac_need_defaults=false;;
23794   --header | --heade | --head | --hea )
23795     shift
23796     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23797     ac_need_defaults=false;;
23798
23799   # This is an error.
23800   -*) { { echo "$as_me:23800: error: unrecognized option: $1
23801 Try \`$0 --help' for more information." >&5
23802 echo "$as_me: error: unrecognized option: $1
23803 Try \`$0 --help' for more information." >&2;}
23804    { (exit 1); exit 1; }; } ;;
23805
23806   *) ac_config_targets="$ac_config_targets $1" ;;
23807
23808   esac
23809   shift
23810 done
23811
23812 exec 5>>config.log
23813 cat >&5 << _ACEOF
23814
23815 ## ----------------------- ##
23816 ## Running config.status.  ##
23817 ## ----------------------- ##
23818
23819 This file was extended by $as_me 2.52.20221202, executed with
23820   CONFIG_FILES    = $CONFIG_FILES
23821   CONFIG_HEADERS  = $CONFIG_HEADERS
23822   CONFIG_LINKS    = $CONFIG_LINKS
23823   CONFIG_COMMANDS = $CONFIG_COMMANDS
23824   > "$ac_cs_invocation"
23825 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23826
23827 _ACEOF
23828 EOF
23829
23830 cat >>"$CONFIG_STATUS" <<EOF
23831 #
23832 # INIT-COMMANDS section.
23833 #
23834
23835 AWK="$AWK"
23836 ECHO_CC="$ECHO_CC"
23837 ECHO_LD="$ECHO_LD"
23838 SHOW_CC="$SHOW_LD"
23839
23840 EOF
23841
23842 cat >>"$CONFIG_STATUS" <<\EOF
23843 for ac_config_target in $ac_config_targets
23844 do
23845   case "$ac_config_target" in
23846   # Handling of arguments.
23847   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23848   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23849   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23850   *) { { echo "$as_me:23850: error: invalid argument: $ac_config_target" >&5
23851 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23852    { (exit 1); exit 1; }; };;
23853   esac
23854 done
23855
23856 # If the user did not use the arguments to specify the items to instantiate,
23857 # then the envvar interface is used.  Set only those that are not.
23858 # We use the long form for the default assignment because of an extremely
23859 # bizarre bug on SunOS 4.1.3.
23860 if "$ac_need_defaults"; then
23861   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23862   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23863   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23864 fi
23865
23866 # Create a temporary directory, and hook for its removal unless debugging.
23867 $debug ||
23868 {
23869   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23870   trap '{ (exit 1); exit 1; }' 1 2 13 15
23871 }
23872
23873 # Create a (secure) tmp directory for tmp files.
23874 : "${TMPDIR=/tmp}"
23875 {
23876   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23877   test -n "$tmp" && test -d "$tmp"
23878 }  ||
23879 {
23880   tmp=$TMPDIR/cs$$-$RANDOM
23881   (umask 077 && mkdir "$tmp")
23882 } ||
23883 {
23884    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23885    { (exit 1); exit 1; }
23886 }
23887
23888 EOF
23889
23890 cat >>"$CONFIG_STATUS" <<EOF
23891
23892 #
23893 # CONFIG_FILES section.
23894 #
23895
23896 # No need to generate the scripts if there are no CONFIG_FILES.
23897 # This happens for instance when ./config.status config.h
23898 if test -n "\$CONFIG_FILES"; then
23899   # Protect against being on the right side of a sed subst in config.status.
23900   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23901    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
23902 s,@SHELL@,$SHELL,;t t
23903 s,@exec_prefix@,$exec_prefix,;t t
23904 s,@prefix@,$prefix,;t t
23905 s,@program_transform_name@,$program_transform_name,;t t
23906 s,@bindir@,$bindir,;t t
23907 s,@sbindir@,$sbindir,;t t
23908 s,@libexecdir@,$libexecdir,;t t
23909 s,@datarootdir@,$datarootdir,;t t
23910 s,@datadir@,$datadir,;t t
23911 s,@sysconfdir@,$sysconfdir,;t t
23912 s,@sharedstatedir@,$sharedstatedir,;t t
23913 s,@localstatedir@,$localstatedir,;t t
23914 s,@runstatedir@,$runstatedir,;t t
23915 s,@libdir@,$libdir,;t t
23916 s,@includedir@,$includedir,;t t
23917 s,@oldincludedir@,$oldincludedir,;t t
23918 s,@infodir@,$infodir,;t t
23919 s,@mandir@,$mandir,;t t
23920 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23921 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23922 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23923 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23924 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23925 s,@build_alias@,$build_alias,;t t
23926 s,@host_alias@,$host_alias,;t t
23927 s,@target_alias@,$target_alias,;t t
23928 s,@ECHO_C@,$ECHO_C,;t t
23929 s,@ECHO_N@,$ECHO_N,;t t
23930 s,@ECHO_T@,$ECHO_T,;t t
23931 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23932 s,@DEFS@,$DEFS,;t t
23933 s,@LIBS@,$LIBS,;t t
23934 s,@build@,$build,;t t
23935 s,@build_cpu@,$build_cpu,;t t
23936 s,@build_vendor@,$build_vendor,;t t
23937 s,@build_os@,$build_os,;t t
23938 s,@host@,$host,;t t
23939 s,@host_cpu@,$host_cpu,;t t
23940 s,@host_vendor@,$host_vendor,;t t
23941 s,@host_os@,$host_os,;t t
23942 s,@SET_MAKE@,$SET_MAKE,;t t
23943 s,@CC@,$CC,;t t
23944 s,@CFLAGS@,$CFLAGS,;t t
23945 s,@LDFLAGS@,$LDFLAGS,;t t
23946 s,@CPPFLAGS@,$CPPFLAGS,;t t
23947 s,@ac_ct_CC@,$ac_ct_CC,;t t
23948 s,@EXEEXT@,$EXEEXT,;t t
23949 s,@OBJEXT@,$OBJEXT,;t t
23950 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23951 s,@CPP@,$CPP,;t t
23952 s,@GREP@,$GREP,;t t
23953 s,@EGREP@,$EGREP,;t t
23954 s,@AWK@,$AWK,;t t
23955 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23956 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23957 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23958 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23959 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23960 s,@LINT@,$LINT,;t t
23961 s,@LINT_OPTS@,$LINT_OPTS,;t t
23962 s,@LINT_LIBS@,$LINT_LIBS,;t t
23963 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
23964 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
23965 s,@CTAGS@,$CTAGS,;t t
23966 s,@ETAGS@,$ETAGS,;t t
23967 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23968 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23969 s,@MATH_LIB@,$MATH_LIB,;t t
23970 s,@top_builddir@,$top_builddir,;t t
23971 s,@CC_G_OPT@,$CC_G_OPT,;t t
23972 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23973 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23974 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23975 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23976 s,@LD@,$LD,;t t
23977 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23978 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23979 s,@LD_MODEL@,$LD_MODEL,;t t
23980 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23981 s,@LIBTOOL@,$LIBTOOL,;t t
23982 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23983 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23984 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23985 s,@LIB_LINK@,$LIB_LINK,;t t
23986 s,@LINK_TESTS@,$LINK_TESTS,;t t
23987 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23988 s,@PACKAGE@,$PACKAGE,;t t
23989 s,@PTHREAD@,$PTHREAD,;t t
23990 s,@TEST_ARGS@,$TEST_ARGS,;t t
23991 s,@TEST_DEPS@,$TEST_DEPS,;t t
23992 s,@TEST_LIBS@,$TEST_LIBS,;t t
23993 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23994 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23995 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23996 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23997 s,@includesubdir@,$includesubdir,;t t
23998 s,@FGREP@,$FGREP,;t t
23999 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
24000 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
24001 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
24002 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
24003 s,@ECHO_LT@,$ECHO_LT,;t t
24004 s,@ECHO_LD@,$ECHO_LD,;t t
24005 s,@RULE_CC@,$RULE_CC,;t t
24006 s,@SHOW_CC@,$SHOW_CC,;t t
24007 s,@ECHO_CC@,$ECHO_CC,;t t
24008 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
24009 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
24010 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
24011 s,@X_CFLAGS@,$X_CFLAGS,;t t
24012 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
24013 s,@X_LIBS@,$X_LIBS,;t t
24014 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
24015 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
24016 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
24017 s,@RGB_PATH@,$RGB_PATH,;t t
24018 s,@no_x11_rgb@,$no_x11_rgb,;t t
24019 s,@FORM_NAME@,$FORM_NAME,;t t
24020 s,@MENU_NAME@,$MENU_NAME,;t t
24021 s,@PANEL_NAME@,$PANEL_NAME,;t t
24022 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
24023 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
24024 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
24025 CEOF
24026
24027 EOF
24028
24029   cat >>"$CONFIG_STATUS" <<\EOF
24030   # Split the substitutions into bite-sized pieces for seds with
24031   # small command number limits, like on Digital OSF/1 and HP-UX.
24032   ac_max_sed_lines=48
24033   ac_sed_frag=1 # Number of current file.
24034   ac_beg=1 # First line for current file.
24035   ac_end=$ac_max_sed_lines # Line after last line for current file.
24036   ac_more_lines=:
24037   ac_sed_cmds=
24038   while "$ac_more_lines"; do
24039     if test "$ac_beg" -gt 1; then
24040       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
24041     else
24042       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
24043     fi
24044     if test ! -s "$tmp"/subs.frag; then
24045       ac_more_lines=false
24046     else
24047       # The purpose of the label and of the branching condition is to
24048       # speed up the sed processing (if there are no `@' at all, there
24049       # is no need to browse any of the substitutions).
24050       # These are the two extra sed commands mentioned above.
24051       (echo ':t
24052   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
24053       # It is possible to make a multiline substitution using escaped newlines.
24054       # Ensure that we do not split the substitution between script fragments.
24055       ac_BEG=$ac_end
24056       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
24057       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
24058       if test -s "$tmp"/subs.next; then
24059         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
24060         if test ! -s "$tmp"/subs.edit; then
24061           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
24062           if test ! -s "$tmp"/subs.edit; then
24063             if test "$ac_beg" -gt 1; then
24064               ac_end=`expr "$ac_end" - 1`
24065               continue
24066             fi
24067           fi
24068         fi
24069       fi
24070
24071       if test -z "$ac_sed_cmds"; then
24072         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
24073       else
24074         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
24075       fi
24076       ac_sed_frag=`expr "$ac_sed_frag" + 1`
24077       ac_beg=$ac_end
24078       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
24079     fi
24080   done
24081   if test -z "$ac_sed_cmds"; then
24082     ac_sed_cmds="cat"
24083   fi
24084 fi # test -n "$CONFIG_FILES"
24085
24086 EOF
24087 cat >>"$CONFIG_STATUS" <<\EOF
24088 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
24089   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24090   case "$ac_file" in
24091   - | *:- | *:-:* ) # input from stdin
24092         cat >"$tmp"/stdin
24093         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24094         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24095   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24096         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24097   * )   ac_file_in=$ac_file.in ;;
24098   esac
24099
24100   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
24101   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24102          X"$ac_file" : 'X\(//\)[^/]' \| \
24103          X"$ac_file" : 'X\(//\)$' \| \
24104          X"$ac_file" : 'X\(/\)' \| \
24105          .     : '\(.\)' 2>/dev/null ||
24106 echo X"$ac_file" |
24107     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24108           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24109           /^X\(\/\/\)$/{ s//\1/; q; }
24110           /^X\(\/\).*/{ s//\1/; q; }
24111           s/.*/./; q'`
24112   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24113     { case "$ac_dir" in
24114   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24115   *)                      as_incr_dir=.;;
24116 esac
24117 as_dummy="$ac_dir"
24118 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24119   case $as_mkdir_dir in
24120     # Skip DOS drivespec
24121     ?:) as_incr_dir=$as_mkdir_dir ;;
24122     *)
24123       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24124       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24125     ;;
24126   esac
24127 done; }
24128
24129     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
24130     # A "../" for each directory in $ac_dir_suffix.
24131     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
24132   else
24133     ac_dir_suffix= ac_dots=
24134   fi
24135
24136   case "$srcdir" in
24137   .)  ac_srcdir=.
24138       if test -z "$ac_dots"; then
24139          ac_top_srcdir=.
24140       else
24141          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
24142       fi ;;
24143   [\\/]* | ?:[\\/]* )
24144       ac_srcdir="$srcdir$ac_dir_suffix";
24145       ac_top_srcdir="$srcdir" ;;
24146   *) # Relative path.
24147     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
24148     ac_top_srcdir="$ac_dots$srcdir" ;;
24149   esac
24150
24151   case $INSTALL in
24152   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
24153   *) ac_INSTALL=$ac_dots$INSTALL ;;
24154   esac
24155
24156   if test x"$ac_file" != x-; then
24157     { echo "$as_me:24157: creating $ac_file" >&5
24158 echo "$as_me: creating $ac_file" >&6;}
24159     rm -f "$ac_file"
24160   fi
24161   # Let's still pretend it is `configure' which instantiates (i.e., don't
24162   # use $as_me), people would be surprised to read:
24163   #    /* config.h.  Generated automatically by config.status.  */
24164   configure_input="Generated automatically from `echo $ac_file_in |
24165                                                  sed 's,.*/,,'` by configure."
24166
24167   # First look for the input files in the build tree, otherwise in the
24168   # src tree.
24169   ac_file_inputs=`IFS=:
24170     for f in $ac_file_in; do
24171       case $f in
24172       -) echo "$tmp"/stdin ;;
24173       [\\/$]*)
24174          # Absolute (can't be DOS-style, as IFS=:)
24175          test -f "$f" || { { echo "$as_me:24175: error: cannot find input file: $f" >&5
24176 echo "$as_me: error: cannot find input file: $f" >&2;}
24177    { (exit 1); exit 1; }; }
24178          echo "$f";;
24179       *) # Relative
24180          if test -f "$f"; then
24181            # Build tree
24182            echo "$f"
24183          elif test -f "$srcdir/$f"; then
24184            # Source tree
24185            echo "$srcdir/$f"
24186          else
24187            # /dev/null tree
24188            { { echo "$as_me:24188: error: cannot find input file: $f" >&5
24189 echo "$as_me: error: cannot find input file: $f" >&2;}
24190    { (exit 1); exit 1; }; }
24191          fi;;
24192       esac
24193     done` || { (exit 1); exit 1; }
24194 EOF
24195 cat >>"$CONFIG_STATUS" <<\EOF
24196   ac_warn_datarootdir=no
24197   if test x"$ac_file" != x-; then
24198     for ac_item in $ac_file_inputs
24199     do
24200       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
24201       if test -n "$ac_seen"; then
24202         ac_used=`grep '@datarootdir@' "$ac_item"`
24203         if test -z "$ac_used"; then
24204           { echo "$as_me:24204: WARNING: datarootdir was used implicitly but not set:
24205 $ac_seen" >&5
24206 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
24207 $ac_seen" >&2;}
24208           ac_warn_datarootdir=yes
24209         fi
24210       fi
24211       ac_seen=`grep '${datarootdir}' "$ac_item"`
24212       if test -n "$ac_seen"; then
24213         { echo "$as_me:24213: WARNING: datarootdir was used explicitly but not set:
24214 $ac_seen" >&5
24215 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
24216 $ac_seen" >&2;}
24217         ac_warn_datarootdir=yes
24218       fi
24219     done
24220   fi
24221
24222 if test "x$ac_warn_datarootdir" = xyes; then
24223   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
24224 fi
24225
24226 EOF
24227 cat >>"$CONFIG_STATUS" <<EOF
24228   sed "$ac_vpsub
24229 $extrasub
24230 EOF
24231 cat >>"$CONFIG_STATUS" <<\EOF
24232 :t
24233 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
24234 s,@configure_input@,$configure_input,;t t
24235 s,@srcdir@,$ac_srcdir,;t t
24236 s,@top_srcdir@,$ac_top_srcdir,;t t
24237 s,@INSTALL@,$ac_INSTALL,;t t
24238 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
24239   rm -f "$tmp"/stdin
24240 EOF
24241 : "${FGREP:=grep -F}"
24242 : "${EGREP:=grep -E}"
24243 cat >>"$CONFIG_STATUS" <<EOF
24244   : "\${FGREP:=$FGREP}"
24245   : "\${EGREP:=$EGREP}"
24246 EOF
24247 cat >>"$CONFIG_STATUS" <<\EOF
24248   if test x"$ac_file" != x-; then
24249     cp "$tmp/out" "$ac_file"
24250
24251     for ac_name in prefix exec_prefix datarootdir
24252     do
24253         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
24254         if test -n "$ac_seen"; then
24255             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
24256             if test -z "$ac_init"; then
24257               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
24258               { echo "$as_me:24258: WARNING: Variable $ac_name is used but was not set:
24259 $ac_seen" >&5
24260 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
24261 $ac_seen" >&2;}
24262             fi
24263         fi
24264     done
24265     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
24266     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
24267     if test -s "$tmp"/out; then
24268       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
24269       { echo "$as_me:24269: WARNING: Some variables may not be substituted:
24270 $ac_seen" >&5
24271 echo "$as_me: WARNING: Some variables may not be substituted:
24272 $ac_seen" >&2;}
24273     fi
24274   else
24275     cat "$tmp"/out
24276   fi
24277   rm -f "$tmp"/out
24278
24279 done
24280 EOF
24281 cat >>"$CONFIG_STATUS" <<\EOF
24282
24283 #
24284 # CONFIG_HEADER section.
24285 #
24286
24287 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24288 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24289 #
24290 # ac_d sets the value in "#define NAME VALUE" lines.
24291 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24292 ac_dB='[        ].*$,\1#\2'
24293 ac_dC=' '
24294 ac_dD=',;t'
24295 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24296 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24297 ac_iB='\([      ]\),\1#\2define\3'
24298 ac_iC=' '
24299 ac_iD='\4,;t'
24300 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24301 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24302 ac_uB='$,\1#\2define\3'
24303 ac_uC=' '
24304 ac_uD=',;t'
24305
24306 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
24307   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24308   case "$ac_file" in
24309   - | *:- | *:-:* ) # input from stdin
24310         cat >"$tmp"/stdin
24311         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24312         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24313   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24314         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24315   * )   ac_file_in=$ac_file.in ;;
24316   esac
24317
24318   test x"$ac_file" != x- && { echo "$as_me:24318: creating $ac_file" >&5
24319 echo "$as_me: creating $ac_file" >&6;}
24320
24321   # First look for the input files in the build tree, otherwise in the
24322   # src tree.
24323   ac_file_inputs=`IFS=:
24324     for f in $ac_file_in; do
24325       case $f in
24326       -) echo "$tmp"/stdin ;;
24327       [\\/$]*)
24328          # Absolute (can't be DOS-style, as IFS=:)
24329          test -f "$f" || { { echo "$as_me:24329: error: cannot find input file: $f" >&5
24330 echo "$as_me: error: cannot find input file: $f" >&2;}
24331    { (exit 1); exit 1; }; }
24332          echo $f;;
24333       *) # Relative
24334          if test -f "$f"; then
24335            # Build tree
24336            echo $f
24337          elif test -f "$srcdir/$f"; then
24338            # Source tree
24339            echo "$srcdir/$f"
24340          else
24341            # /dev/null tree
24342            { { echo "$as_me:24342: error: cannot find input file: $f" >&5
24343 echo "$as_me: error: cannot find input file: $f" >&2;}
24344    { (exit 1); exit 1; }; }
24345          fi;;
24346       esac
24347     done` || { (exit 1); exit 1; }
24348   # Remove the trailing spaces.
24349   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
24350
24351 EOF
24352
24353 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
24354 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
24355 # be either 'cat' or 'sort'.
24356 cat confdefs.h | uniq >conftest.vals
24357
24358 # Break up conftest.vals because some shells have a limit on
24359 # the size of here documents, and old seds have small limits too.
24360
24361 rm -f conftest.tail
24362 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
24363 while grep . conftest.vals >/dev/null
24364 do
24365   # Write chunks of a limited-size here document to conftest.frag.
24366   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
24367   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
24368   echo 'CEOF' >> "$CONFIG_STATUS"
24369   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
24370   rm -f conftest.vals
24371   mv conftest.tail conftest.vals
24372 done
24373 rm -f conftest.vals
24374
24375 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
24376 # marker @DEFS@.
24377 echo '  cat >> conftest.edit <<CEOF
24378 /@DEFS@/r conftest.frag
24379 /@DEFS@/d
24380 CEOF
24381 sed -f conftest.edit "$tmp"/in > "$tmp"/out
24382 rm -f "$tmp"/in
24383 mv "$tmp"/out "$tmp"/in
24384 rm -f conftest.edit conftest.frag
24385 ' >> "$CONFIG_STATUS"
24386
24387 cat >>"$CONFIG_STATUS" <<\EOF
24388   # Let's still pretend it is `configure' which instantiates (i.e., don't
24389   # use $as_me), people would be surprised to read:
24390   #    /* config.h.  Generated automatically by config.status.  */
24391   if test x"$ac_file" = x-; then
24392     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
24393   else
24394     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
24395   fi
24396   cat "$tmp"/in >>"$tmp"/config.h
24397   rm -f "$tmp"/in
24398   if test x"$ac_file" != x-; then
24399     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
24400       { echo "$as_me:24400: $ac_file is unchanged" >&5
24401 echo "$as_me: $ac_file is unchanged" >&6;}
24402     else
24403       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24404          X"$ac_file" : 'X\(//\)[^/]' \| \
24405          X"$ac_file" : 'X\(//\)$' \| \
24406          X"$ac_file" : 'X\(/\)' \| \
24407          .     : '\(.\)' 2>/dev/null ||
24408 echo X"$ac_file" |
24409     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24410           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24411           /^X\(\/\/\)$/{ s//\1/; q; }
24412           /^X\(\/\).*/{ s//\1/; q; }
24413           s/.*/./; q'`
24414       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24415         { case "$ac_dir" in
24416   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24417   *)                      as_incr_dir=.;;
24418 esac
24419 as_dummy="$ac_dir"
24420 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24421   case $as_mkdir_dir in
24422     # Skip DOS drivespec
24423     ?:) as_incr_dir=$as_mkdir_dir ;;
24424     *)
24425       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24426       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24427     ;;
24428   esac
24429 done; }
24430
24431       fi
24432       rm -f "$ac_file"
24433       mv "$tmp/config.h" "$ac_file"
24434     fi
24435   else
24436     cat "$tmp"/config.h
24437     rm -f "$tmp"/config.h
24438   fi
24439 done
24440 EOF
24441 cat >>"$CONFIG_STATUS" <<\EOF
24442 #
24443 # CONFIG_COMMANDS section.
24444 #
24445 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
24446   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
24447   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
24448
24449   case "$ac_dest" in
24450     default )
24451
24452 for cf_dir in .
24453 do
24454         if test ! -d "$srcdir/$cf_dir" ; then
24455                 continue
24456         elif test -f "$srcdir/$cf_dir/programs" ; then
24457                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
24458         fi
24459 done
24460
24461         cat >>Makefile <<TEST_EOF
24462
24463 # These rules are generated so we do not rely on suffix rules, which do not
24464 # work consistently for different make-programs (the '\$(MODEL)/' confuses
24465 # some, and the '\$x' confuses others).
24466 TEST_EOF
24467
24468 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
24469 for N in $LIST
24470 do
24471         cat >>Makefile <<TEST_EOF
24472
24473 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24474         \$(srcdir)/test.priv.h \\
24475         ncurses_cfg.h
24476         $SHOW_CC
24477         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
24478 TEST_EOF
24479 done
24480
24481 if test -f ../config.guess && test -f ../config.sub
24482 then
24483         cat >>Makefile <<TEST_EOF
24484
24485 # if we used CF_INHERIT for getting these files, we can remove them
24486 distclean::
24487         rm -f config.guess config.sub
24488 TEST_EOF
24489 fi
24490  ;;
24491   esac
24492 done
24493 EOF
24494
24495 cat >>"$CONFIG_STATUS" <<\EOF
24496
24497 { (exit 0); exit 0; }
24498 EOF
24499 chmod +x "$CONFIG_STATUS"
24500 ac_clean_files=$ac_clean_files_save
24501
24502 # configure is writing to config.log, and then calls config.status.
24503 # config.status does its own redirection, appending to config.log.
24504 # Unfortunately, on DOS this fails, as config.log is still kept open
24505 # by configure, so config.status won't be able to write to it; its
24506 # output is simply discarded.  So we exec the FD to /dev/null,
24507 # effectively closing config.log, so it can be properly (re)opened and
24508 # appended to by config.status.  When coming back to configure, we
24509 # need to make the FD available again.
24510 if test "$no_create" != yes; then
24511   ac_cs_success=:
24512   exec 5>/dev/null
24513   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
24514   exec 5>>config.log
24515   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24516   # would make configure fail if this is the last instruction.
24517   "$ac_cs_success" || { (exit 1); exit 1; }
24518 fi
24519