]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.3 - patch 20220910
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20210509.
4 #
5 # Copyright 2003-2020,2021      Thomas E. Dickey
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset="unset"
64 else
65   as_unset="false"
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS=
101 MAKEFLAGS=
102 SHELL=${CONFIG_SHELL-/bin/sh}
103
104 # Maximum number of lines to put in a shell here document.
105 # This variable seems obsolete.  It should probably be removed, and
106 # only ac_max_sed_lines should be used.
107 : "${ac_max_here_lines=38}"
108
109 ac_unique_file="ncurses.c"
110
111 # Initialize some variables set by options.
112 ac_init_help=
113 ac_init_version=false
114 # The variables have the same names as the options, with
115 # dashes changed to underlines.
116 cache_file=/dev/null
117 exec_prefix=NONE
118 no_create=
119 no_recursion=
120 prefix=NONE
121 program_prefix=NONE
122 program_suffix=NONE
123 program_transform_name=s,x,x,
124 silent=
125 site=
126 srcdir=
127 verbose=
128 x_includes=NONE
129 x_libraries=NONE
130
131 # Installation directory options.
132 # These are left unexpanded so users can "make install exec_prefix=/foo"
133 # and all the variables that are supposed to be based on exec_prefix
134 # by default will actually change.
135 # Use braces instead of parens because sh, perl, etc. also accept them.
136 bindir='${exec_prefix}/bin'
137 sbindir='${exec_prefix}/sbin'
138 libexecdir='${exec_prefix}/libexec'
139 datarootdir='${prefix}/share'
140 datadir='${datarootdir}'
141 sysconfdir='${prefix}/etc'
142 sharedstatedir='${prefix}/com'
143 localstatedir='${prefix}/var'
144 runstatedir='${localstatedir}/run'
145 libdir='${exec_prefix}/lib'
146 includedir='${prefix}/include'
147 oldincludedir='/usr/include'
148 infodir='${datarootdir}/info'
149 mandir='${datarootdir}/man'
150
151 # Identity of this package.
152 PACKAGE_NAME=
153 PACKAGE_TARNAME=
154 PACKAGE_VERSION=
155 PACKAGE_STRING=
156 PACKAGE_BUGREPORT=
157
158 ac_prev=
159 for ac_option
160 do
161   # If the previous option needs an argument, assign it.
162   if test -n "$ac_prev"; then
163     eval "$ac_prev=\$ac_option"
164     ac_prev=
165     continue
166   fi
167
168   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
169
170   # Accept the important Cygnus configure options, so we can diagnose typos.
171
172   case "$ac_option" in
173
174   -bindir | --bindir | --bindi | --bind | --bin | --bi)
175     ac_prev=bindir ;;
176   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
177     bindir=$ac_optarg ;;
178
179   -build | --build | --buil | --bui | --bu)
180     ac_prev=build_alias ;;
181   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
182     build_alias=$ac_optarg ;;
183
184   -cache-file | --cache-file | --cache-fil | --cache-fi \
185   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
186     ac_prev=cache_file ;;
187   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
188   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
189     cache_file=$ac_optarg ;;
190
191   --config-cache | -C)
192     cache_file=config.cache ;;
193
194   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
195     ac_prev=datadir ;;
196   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
197   | --da=*)
198     datadir=$ac_optarg ;;
199
200   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
201   | --dataroo | --dataro | --datar)
202     ac_prev=datarootdir ;;
203   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
204   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
205     datarootdir=$ac_optarg ;;
206
207   -disable-* | --disable-*)
208     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
209     # Reject names that are not valid shell variable names.
210     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
211       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
212    { (exit 1); exit 1; }; }
213     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
214     eval "enable_$ac_feature=no" ;;
215
216   -enable-* | --enable-*)
217     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
218     # Reject names that are not valid shell variable names.
219     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
220       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
221    { (exit 1); exit 1; }; }
222     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
223     case "$ac_option" in
224       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
225       *) ac_optarg=yes ;;
226     esac
227     eval "enable_$ac_feature='$ac_optarg'" ;;
228
229   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
230   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
231   | --exec | --exe | --ex)
232     ac_prev=exec_prefix ;;
233   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
234   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
235   | --exec=* | --exe=* | --ex=*)
236     exec_prefix=$ac_optarg ;;
237
238   -gas | --gas | --ga | --g)
239     # Obsolete; use --with-gas.
240     with_gas=yes ;;
241
242   -help | --help | --hel | --he | -h)
243     ac_init_help=long ;;
244   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
245     ac_init_help=recursive ;;
246   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
247     ac_init_help=short ;;
248
249   -host | --host | --hos | --ho)
250     ac_prev=host_alias ;;
251   -host=* | --host=* | --hos=* | --ho=*)
252     host_alias=$ac_optarg ;;
253
254   -includedir | --includedir | --includedi | --included | --include \
255   | --includ | --inclu | --incl | --inc)
256     ac_prev=includedir ;;
257   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
258   | --includ=* | --inclu=* | --incl=* | --inc=*)
259     includedir=$ac_optarg ;;
260
261   -infodir | --infodir | --infodi | --infod | --info | --inf)
262     ac_prev=infodir ;;
263   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
264     infodir=$ac_optarg ;;
265
266   -libdir | --libdir | --libdi | --libd)
267     ac_prev=libdir ;;
268   -libdir=* | --libdir=* | --libdi=* | --libd=*)
269     libdir=$ac_optarg ;;
270
271   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
272   | --libexe | --libex | --libe)
273     ac_prev=libexecdir ;;
274   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
275   | --libexe=* | --libex=* | --libe=*)
276     libexecdir=$ac_optarg ;;
277
278   -localstatedir | --localstatedir | --localstatedi | --localstated \
279   | --localstate | --localstat | --localsta | --localst \
280   | --locals | --local | --loca | --loc | --lo)
281     ac_prev=localstatedir ;;
282   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
283   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
284   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
285     localstatedir=$ac_optarg ;;
286
287   -runstatedir | --runstatedir | --runstatedi | --runstated \
288   | --runstate | --runstat | --runsta | --runst \
289   | --runs | --run | --ru)
290     ac_prev=runstatedir ;;
291   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
292   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
293   | --runs=* | --run=* | --ru=*)
294     runstatedir=$ac_optarg ;;
295
296   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
297     ac_prev=mandir ;;
298   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
299     mandir=$ac_optarg ;;
300
301   -nfp | --nfp | --nf)
302     # Obsolete; use --without-fp.
303     with_fp=no ;;
304
305   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
306   | --no-cr | --no-c)
307     no_create=yes ;;
308
309   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
310   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
311     no_recursion=yes ;;
312
313   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
314   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
315   | --oldin | --oldi | --old | --ol | --o)
316     ac_prev=oldincludedir ;;
317   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
318   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
319   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
320     oldincludedir=$ac_optarg ;;
321
322   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
323     ac_prev=prefix ;;
324   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
325     prefix=$ac_optarg ;;
326
327   -program-prefix | --program-prefix | --program-prefi | --program-pref \
328   | --program-pre | --program-pr | --program-p)
329     ac_prev=program_prefix ;;
330   -program-prefix=* | --program-prefix=* | --program-prefi=* \
331   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
332     program_prefix=$ac_optarg ;;
333
334   -program-suffix | --program-suffix | --program-suffi | --program-suff \
335   | --program-suf | --program-su | --program-s)
336     ac_prev=program_suffix ;;
337   -program-suffix=* | --program-suffix=* | --program-suffi=* \
338   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
339     program_suffix=$ac_optarg ;;
340
341   -program-transform-name | --program-transform-name \
342   | --program-transform-nam | --program-transform-na \
343   | --program-transform-n | --program-transform- \
344   | --program-transform | --program-transfor \
345   | --program-transfo | --program-transf \
346   | --program-trans | --program-tran \
347   | --progr-tra | --program-tr | --program-t)
348     ac_prev=program_transform_name ;;
349   -program-transform-name=* | --program-transform-name=* \
350   | --program-transform-nam=* | --program-transform-na=* \
351   | --program-transform-n=* | --program-transform-=* \
352   | --program-transform=* | --program-transfor=* \
353   | --program-transfo=* | --program-transf=* \
354   | --program-trans=* | --program-tran=* \
355   | --progr-tra=* | --program-tr=* | --program-t=*)
356     program_transform_name=$ac_optarg ;;
357
358   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
359   | -silent | --silent | --silen | --sile | --sil)
360     silent=yes ;;
361
362   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
363     ac_prev=sbindir ;;
364   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
365   | --sbi=* | --sb=*)
366     sbindir=$ac_optarg ;;
367
368   -sharedstatedir | --sharedstatedir | --sharedstatedi \
369   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
370   | --sharedst | --shareds | --shared | --share | --shar \
371   | --sha | --sh)
372     ac_prev=sharedstatedir ;;
373   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
374   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
375   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
376   | --sha=* | --sh=*)
377     sharedstatedir=$ac_optarg ;;
378
379   -site | --site | --sit)
380     ac_prev=site ;;
381   -site=* | --site=* | --sit=*)
382     site=$ac_optarg ;;
383
384   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
385     ac_prev=srcdir ;;
386   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
387     srcdir=$ac_optarg ;;
388
389   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
390   | --syscon | --sysco | --sysc | --sys | --sy)
391     ac_prev=sysconfdir ;;
392   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
393   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
394     sysconfdir=$ac_optarg ;;
395
396   -target | --target | --targe | --targ | --tar | --ta | --t)
397     ac_prev=target_alias ;;
398   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
399     target_alias=$ac_optarg ;;
400
401   -v | -verbose | --verbose | --verbos | --verbo | --verb)
402     verbose=yes ;;
403
404   -version | --version | --versio | --versi | --vers | -V)
405     ac_init_version=: ;;
406
407   -with-* | --with-*)
408     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
409     # Reject names that are not valid shell variable names.
410     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
411       { echo "$as_me: error: invalid package name: $ac_package" >&2
412    { (exit 1); exit 1; }; }
413     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
414     case "$ac_option" in
415       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
416       *) ac_optarg=yes ;;
417     esac
418     eval "with_$ac_package='$ac_optarg'" ;;
419
420   -without-* | --without-*)
421     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
422     # Reject names that are not valid shell variable names.
423     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
424       { echo "$as_me: error: invalid package name: $ac_package" >&2
425    { (exit 1); exit 1; }; }
426     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
427     eval "with_$ac_package=no" ;;
428
429   --x)
430     # Obsolete; use --with-x.
431     with_x=yes ;;
432
433   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
434   | --x-incl | --x-inc | --x-in | --x-i)
435     ac_prev=x_includes ;;
436   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
437   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
438     x_includes=$ac_optarg ;;
439
440   -x-libraries | --x-libraries | --x-librarie | --x-librari \
441   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
442     ac_prev=x_libraries ;;
443   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
444   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
445     x_libraries=$ac_optarg ;;
446
447   -*) { echo "$as_me: error: unrecognized option: $ac_option
448 Try \`$0 --help' for more information." >&2
449    { (exit 1); exit 1; }; }
450     ;;
451
452   *=*)
453     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
454     # Reject names that are not valid shell variable names.
455     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
456       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
457    { (exit 1); exit 1; }; }
458     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
459     eval "$ac_envvar='$ac_optarg'"
460     export "$ac_envvar" ;;
461
462   *)
463     # FIXME: should be removed in autoconf 3.0.
464     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
465     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
466       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
467     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
468     ;;
469
470   esac
471 done
472
473 if test -n "$ac_prev"; then
474   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
475   { echo "$as_me: error: missing argument to $ac_option" >&2
476    { (exit 1); exit 1; }; }
477 fi
478
479 # Be sure to have absolute paths.
480 for ac_var in exec_prefix prefix
481 do
482   eval ac_val=$`echo "$ac_var"`
483   case "$ac_val" in
484     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # Be sure to have absolute paths.
491 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
492               localstatedir libdir includedir oldincludedir infodir mandir
493 do
494   eval ac_val=$`echo "$ac_var"`
495   case "$ac_val" in
496     [\\/$]* | ?:[\\/]* ) ;;
497     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
498    { (exit 1); exit 1; }; };;
499   esac
500 done
501
502 # There might be people who depend on the old broken behavior: `$host'
503 # used to hold the argument of --host etc.
504 build=$build_alias
505 host=$host_alias
506 target=$target_alias
507
508 # FIXME: should be removed in autoconf 3.0.
509 if test "x$host_alias" != x; then
510   if test "x$build_alias" = x; then
511     cross_compiling=maybe
512     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
513     If a cross compiler is detected then cross compile mode will be used." >&2
514   elif test "x$build_alias" != "x$host_alias"; then
515     cross_compiling=yes
516   fi
517 fi
518
519 ac_tool_prefix=
520 test -n "$host_alias" && ac_tool_prefix=$host_alias-
521
522 test "$silent" = yes && exec 6>/dev/null
523
524 # Find the source files, if location was not specified.
525 if test -z "$srcdir"; then
526   ac_srcdir_defaulted=yes
527   # Try the directory containing this script, then its parent.
528   ac_prog=$0
529   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
530   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
531   srcdir=$ac_confdir
532   if test ! -r "$srcdir/$ac_unique_file"; then
533     srcdir=..
534   fi
535 else
536   ac_srcdir_defaulted=no
537 fi
538 if test ! -r "$srcdir/$ac_unique_file"; then
539   if test "$ac_srcdir_defaulted" = yes; then
540     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
541    { (exit 1); exit 1; }; }
542   else
543     { echo "$as_me: error: cannot find sources in $srcdir" >&2
544    { (exit 1); exit 1; }; }
545   fi
546 fi
547 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
548 ac_env_build_alias_set=${build_alias+set}
549 ac_env_build_alias_value=$build_alias
550 ac_cv_env_build_alias_set=${build_alias+set}
551 ac_cv_env_build_alias_value=$build_alias
552 ac_env_host_alias_set=${host_alias+set}
553 ac_env_host_alias_value=$host_alias
554 ac_cv_env_host_alias_set=${host_alias+set}
555 ac_cv_env_host_alias_value=$host_alias
556 ac_env_target_alias_set=${target_alias+set}
557 ac_env_target_alias_value=$target_alias
558 ac_cv_env_target_alias_set=${target_alias+set}
559 ac_cv_env_target_alias_value=$target_alias
560 ac_env_CC_set=${CC+set}
561 ac_env_CC_value=$CC
562 ac_cv_env_CC_set=${CC+set}
563 ac_cv_env_CC_value=$CC
564 ac_env_CFLAGS_set=${CFLAGS+set}
565 ac_env_CFLAGS_value=$CFLAGS
566 ac_cv_env_CFLAGS_set=${CFLAGS+set}
567 ac_cv_env_CFLAGS_value=$CFLAGS
568 ac_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_env_LDFLAGS_value=$LDFLAGS
570 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
571 ac_cv_env_LDFLAGS_value=$LDFLAGS
572 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_env_CPPFLAGS_value=$CPPFLAGS
574 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
575 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
576 ac_env_CPP_set=${CPP+set}
577 ac_env_CPP_value=$CPP
578 ac_cv_env_CPP_set=${CPP+set}
579 ac_cv_env_CPP_value=$CPP
580
581 #
582 # Report the --help message.
583 #
584 if test "$ac_init_help" = "long"; then
585   # Omit some internal or obsolete options to make the list less imposing.
586   # This message is too long to be a string in the A/UX 3.1 sh.
587   cat <<EOF
588 \`configure' configures this package to adapt to many kinds of systems.
589
590 Usage: $0 [OPTION]... [VAR=VALUE]...
591
592 To assign environment variables (e.g., CC, CFLAGS...), specify them as
593 VAR=VALUE.  See below for descriptions of some of the useful variables.
594
595 Defaults for the options are specified in brackets.
596
597 Configuration:
598   -h, --help              display this help and exit
599       --help=short        display options specific to this package
600       --help=recursive    display the short help of all the included packages
601   -V, --version           display version information and exit
602   -q, --quiet, --silent   do not print \`checking...' messages
603       --cache-file=FILE   cache test results in FILE [disabled]
604   -C, --config-cache      alias for \`--cache-file=config.cache'
605   -n, --no-create         do not create output files
606       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
607
608 EOF
609
610   cat <<EOF
611 Installation directories:
612   --prefix=PREFIX         install architecture-independent files in PREFIX
613                           [$ac_default_prefix]
614   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
615                           [PREFIX]
616
617 By default, \`make install' will install all the files in
618 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
619 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
620 for instance \`--prefix=\$HOME'.
621
622 For better control, use the options below.
623
624 Fine tuning of the installation directories:
625   --bindir=DIR            user executables [EPREFIX/bin]
626   --sbindir=DIR           system admin executables [EPREFIX/sbin]
627   --libexecdir=DIR        program executables [EPREFIX/libexec]
628   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
629   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
630   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
631   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
632   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
633   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
634   --libdir=DIR            object code libraries [EPREFIX/lib]
635   --includedir=DIR        C header files [PREFIX/include]
636   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
637   --infodir=DIR           info documentation [DATAROOTDIR/info]
638   --mandir=DIR            man documentation [DATAROOTDIR/man]
639 EOF
640
641   cat <<\EOF
642
643 Program names:
644   --program-prefix=PREFIX            prepend PREFIX to installed program names
645   --program-suffix=SUFFIX            append SUFFIX to installed program names
646   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
647
648 X features:
649   --x-includes=DIR    X include files are in DIR
650   --x-libraries=DIR   X library files are in DIR
651
652 System types:
653   --build=BUILD           configure for building on BUILD [guessed]
654   --host=HOST       build programs to run on HOST [BUILD]
655 EOF
656 fi
657
658 if test -n "$ac_init_help"; then
659
660   cat <<\EOF
661
662 Optional Features:
663   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
664   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
665
666 Optional Packages:
667   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
668   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
669
670 General Options:
671   --disable-stripping     do not strip (debug info) installed executables
672   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
673   --enable-string-hacks   work around bogus compiler/loader warnings
674   --with-pkg-config{=path} enable/disable use of pkg-config
675   --disable-echo          do not display "compiling" commands
676 Curses Version-dependent Options:
677   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
678   --disable-widec         disable checks for wide-character functions
679   --with-curses-dir=DIR   directory in which (n)curses is installed
680   --with-screen=XXX       use specified curses-libraries
681   --with-ncursesw         use wide ncurses-libraries
682   --with-ncurses          use ncurses-libraries
683   --with-pdcurses         compile/link with pdcurses X11 library
684   --with-curses-colr      compile/link with HPUX 10.x color-curses
685   --with-curses-5lib      compile/link with SunOS 5lib curses
686   --with-Xaw3d            link with Xaw 3d library
687   --with-Xaw3dxft         link with Xaw 3d xft library
688   --with-neXtaw           link with neXT Athena library
689   --with-XawPlus          link with Athena-Plus library
690   --with-x                use the X Window System
691   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
692   --with-form-libname=XXX override form basename of library
693   --with-menu-libname=XXX override menu basename of library
694   --with-panel-libname=XXX override panel basename of library
695   --disable-panel         disable checks for panel functions
696   --disable-menu          disable checks for menu functions
697   --disable-form          disable checks for form functions
698 Testing/development Options:
699   --enable-warnings       test: turn on gcc compiler warnings
700   --with-dmalloc          test: use Gray Watson's dmalloc library
701   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
702   --with-valgrind         test: use valgrind
703   --disable-leaks         test: free permanent memory, analyze leaks
704   --disable-rpath-hack    don't add rpath options for additional libraries
705
706 Some influential environment variables:
707   CC          C compiler command
708   CFLAGS      C compiler flags
709   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
710               nonstandard directory <lib dir>
711   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
712               headers in a nonstandard directory <include dir>
713   CPP         C preprocessor
714
715 Use these variables to override the choices made by `configure' or to help
716 it to find libraries and programs with nonstandard names/locations.
717
718 EOF
719 fi
720
721 if test "$ac_init_help" = "recursive"; then
722   # If there are subdirs, report their specific --help.
723   ac_popdir=`pwd`
724   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
725     cd "$ac_subdir"
726     # A "../" for each directory in /$ac_subdir.
727     ac_dots=`echo "$ac_subdir" |
728              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
729
730     case "$srcdir" in
731     .) # No --srcdir option.  We are building in place.
732       ac_sub_srcdir="$srcdir" ;;
733     [\\/]* | ?:[\\/]* ) # Absolute path.
734       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
735     *) # Relative path.
736       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
737     esac
738
739     # Check for guested configure; otherwise get Cygnus style configure.
740     if test -f "$ac_sub_srcdir/configure.gnu"; then
741       echo
742       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
743     elif test -f "$ac_sub_srcdir/configure"; then
744       echo
745       $SHELL "$ac_sub_srcdir/configure" --help=recursive
746     elif test -f "$ac_sub_srcdir/configure.ac" ||
747            test -f "$ac_sub_srcdir/configure.in"; then
748       echo
749       "$ac_configure" --help
750     else
751       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
752     fi
753     cd "$ac_popdir"
754   done
755 fi
756
757 test -n "$ac_init_help" && exit 0
758 if "$ac_init_version"; then
759   cat <<\EOF
760
761 Copyright 2003-2020,2021        Thomas E. Dickey
762 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
763 Free Software Foundation, Inc.
764 This configure script is free software; the Free Software Foundation
765 gives unlimited permission to copy, distribute and modify it.
766 EOF
767   exit 0
768 fi
769 exec 5>config.log
770 cat >&5 <<EOF
771 This file contains any messages produced by compilers while
772 running configure, to aid debugging if configure makes a mistake.
773
774 It was created by $as_me, which was
775 generated by GNU Autoconf 2.52.20210509.  Invocation command line was
776
777   $ $0 $@
778
779 EOF
780 {
781 cat <<_ASUNAME
782 ## ---------- ##
783 ## Platform.  ##
784 ## ---------- ##
785
786 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
787 uname -m = `(uname -m) 2>/dev/null || echo unknown`
788 uname -r = `(uname -r) 2>/dev/null || echo unknown`
789 uname -s = `(uname -s) 2>/dev/null || echo unknown`
790 uname -v = `(uname -v) 2>/dev/null || echo unknown`
791
792 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
793 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
794
795 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
796 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
797 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
798 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
799 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
800 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
801 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
802
803 PATH = $PATH
804
805 _ASUNAME
806 } >&5
807
808 cat >&5 <<EOF
809 ## ------------ ##
810 ## Core tests.  ##
811 ## ------------ ##
812
813 EOF
814
815 # Keep a trace of the command line.
816 # Strip out --no-create and --no-recursion so they do not pile up.
817 # Also quote any args containing shell meta-characters.
818 ac_configure_args=
819 ac_sep=
820 for ac_arg
821 do
822   case "$ac_arg" in
823   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
824   | --no-cr | --no-c) ;;
825   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
826   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
827   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
828     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
829     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
830     ac_sep=" " ;;
831   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
832      ac_sep=" " ;;
833   esac
834   # Get rid of the leading space.
835 done
836
837 # When interrupted or exit'd, cleanup temporary files, and complete
838 # config.log.  We remove comments because anyway the quotes in there
839 # would cause problems or look ugly.
840 trap 'exit_status=$?
841   # Save into config.log some information that might help in debugging.
842   echo >&5
843   echo "## ----------------- ##" >&5
844   echo "## Cache variables.  ##" >&5
845   echo "## ----------------- ##" >&5
846   echo >&5
847   # The following way of writing the cache mishandles newlines in values,
848 {
849   (set) 2>&1 |
850     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
851     *ac_space=\ *)
852       sed -n \
853         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
854           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
855       ;;
856     *)
857       sed -n \
858         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
859       ;;
860     esac;
861 } >&5
862   sed "/^$/d" confdefs.h >conftest.log
863   if test -s conftest.log; then
864     echo >&5
865     echo "## ------------ ##" >&5
866     echo "## confdefs.h.  ##" >&5
867     echo "## ------------ ##" >&5
868     echo >&5
869     cat conftest.log >&5
870   fi
871   (echo; echo) >&5
872   test "$ac_signal" != 0 &&
873     echo "$as_me: caught signal $ac_signal" >&5
874   echo "$as_me: exit $exit_status" >&5
875   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
876     exit $exit_status
877      ' 0
878 for ac_signal in 1 2 13 15; do
879   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
880 done
881 ac_signal=0
882
883 # confdefs.h avoids OS command line length limits that DEFS can exceed.
884 rm -rf conftest* confdefs.h
885 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
886 echo >confdefs.h
887
888 # Let the site file select an alternate cache file if it wants to.
889 # Prefer explicitly selected file to automatically selected ones.
890 if test -z "$CONFIG_SITE"; then
891   if test "x$prefix" != xNONE; then
892     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
893   else
894     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
895   fi
896 fi
897 for ac_site_file in $CONFIG_SITE; do
898   if test -r "$ac_site_file"; then
899     { echo "$as_me:899: loading site script $ac_site_file" >&5
900 echo "$as_me: loading site script $ac_site_file" >&6;}
901     cat "$ac_site_file" >&5
902     . "$ac_site_file"
903   fi
904 done
905
906 if test -r "$cache_file"; then
907   # Some versions of bash will fail to source /dev/null (special
908   # files actually), so we avoid doing that.
909   if test -f "$cache_file"; then
910     { echo "$as_me:910: loading cache $cache_file" >&5
911 echo "$as_me: loading cache $cache_file" >&6;}
912     case $cache_file in
913       [\\/]* | ?:[\\/]* ) . $cache_file;;
914       *)                      . ./$cache_file;;
915     esac
916   fi
917 else
918   { echo "$as_me:918: creating cache $cache_file" >&5
919 echo "$as_me: creating cache $cache_file" >&6;}
920   >$cache_file
921 fi
922
923 # Check that the precious variables saved in the cache have kept the same
924 # value.
925 ac_cache_corrupted=false
926 for ac_var in `(set) 2>&1 |
927                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
928   eval ac_old_set=\$ac_cv_env_${ac_var}_set
929   eval ac_new_set=\$ac_env_${ac_var}_set
930   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
931   eval ac_new_val="\$ac_env_${ac_var}_value"
932   case "$ac_old_set,$ac_new_set" in
933     set,)
934       { echo "$as_me:934: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,set)
938       { echo "$as_me:938: error: \`$ac_var' was not set in the previous run" >&5
939 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
940       ac_cache_corrupted=: ;;
941     ,);;
942     *)
943       if test "x$ac_old_val" != "x$ac_new_val"; then
944         { echo "$as_me:944: error: \`$ac_var' has changed since the previous run:" >&5
945 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
946         { echo "$as_me:946:   former value:  $ac_old_val" >&5
947 echo "$as_me:   former value:  $ac_old_val" >&2;}
948         { echo "$as_me:948:   current value: $ac_new_val" >&5
949 echo "$as_me:   current value: $ac_new_val" >&2;}
950         ac_cache_corrupted=:
951       fi;;
952   esac
953   # Pass precious variables to config.status.  It doesn't matter if
954   # we pass some twice (in addition to the command line arguments).
955   if test "$ac_new_set" = set; then
956     case "$ac_new_val" in
957     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
958       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
959       ac_configure_args="$ac_configure_args '$ac_arg'"
960       ;;
961     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
962        ;;
963     esac
964   fi
965 done
966 if "$ac_cache_corrupted"; then
967   { echo "$as_me:967: error: changes in the environment can compromise the build" >&5
968 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
969   { { echo "$as_me:969: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
970 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
971    { (exit 1); exit 1; }; }
972 fi
973
974 ac_ext=c
975 ac_cpp='$CPP $CPPFLAGS'
976 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
977 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
978 ac_compiler_gnu=$ac_cv_c_compiler_gnu
979 ac_main_return="return"
980
981 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
982   *c*,-n*) ECHO_N=
983            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
984            ECHO_T='     '
985            ;;
986   *c*,*  ) ECHO_N=-n
987            ECHO_C=
988            ECHO_T=
989            ;;
990   *)       ECHO_N=
991            ECHO_C='\c'
992            ECHO_T=
993            ;;
994 esac
995 echo "#! $SHELL" >conftest.sh
996 echo  "exit 0"   >>conftest.sh
997 chmod +x conftest.sh
998 if { (echo "$as_me:998: PATH=\".;.\"; conftest.sh") >&5
999   (PATH=".;."; conftest.sh) 2>&5
1000   ac_status=$?
1001   echo "$as_me:1001: \$? = $ac_status" >&5
1002   (exit "$ac_status"); }; then
1003   ac_path_separator=';'
1004 else
1005   ac_path_separator=:
1006 fi
1007 PATH_SEPARATOR="$ac_path_separator"
1008 rm -f conftest.sh
1009
1010 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
1011
1012 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1013
1014 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1015
1016 ac_aux_dir=
1017 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1018   if test -f "$ac_dir/install-sh"; then
1019     ac_aux_dir=$ac_dir
1020     ac_install_sh="$ac_aux_dir/install-sh -c"
1021     break
1022   elif test -f "$ac_dir/install.sh"; then
1023     ac_aux_dir=$ac_dir
1024     ac_install_sh="$ac_aux_dir/install.sh -c"
1025     break
1026   elif test -f "$ac_dir/shtool"; then
1027     ac_aux_dir=$ac_dir
1028     ac_install_sh="$ac_aux_dir/shtool install -c"
1029     break
1030   fi
1031 done
1032 if test -z "$ac_aux_dir"; then
1033   { { echo "$as_me:1033: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1034 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1035    { (exit 1); exit 1; }; }
1036 fi
1037 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1038 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1039 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1040
1041 # Make sure we can run config.sub.
1042 $ac_config_sub sun4 >/dev/null 2>&1 ||
1043   { { echo "$as_me:1043: error: cannot run $ac_config_sub" >&5
1044 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1045    { (exit 1); exit 1; }; }
1046
1047 echo "$as_me:1047: checking build system type" >&5
1048 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1049 if test "${ac_cv_build+set}" = set; then
1050   echo $ECHO_N "(cached) $ECHO_C" >&6
1051 else
1052   ac_cv_build_alias=$build_alias
1053 test -z "$ac_cv_build_alias" &&
1054   ac_cv_build_alias=`$ac_config_guess`
1055 test -z "$ac_cv_build_alias" &&
1056   { { echo "$as_me:1056: error: cannot guess build type; you must specify one" >&5
1057 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1058    { (exit 1); exit 1; }; }
1059 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1060   { { echo "$as_me:1060: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1061 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1062    { (exit 1); exit 1; }; }
1063
1064 fi
1065 echo "$as_me:1065: result: $ac_cv_build" >&5
1066 echo "${ECHO_T}$ac_cv_build" >&6
1067 build=$ac_cv_build
1068 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1069 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1070 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1071
1072 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1073         echo "$as_me:1073: checking host system type" >&5
1074 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1075 if test "${ac_cv_host+set}" = set; then
1076   echo $ECHO_N "(cached) $ECHO_C" >&6
1077 else
1078   ac_cv_host_alias=$host_alias
1079 test -z "$ac_cv_host_alias" &&
1080   ac_cv_host_alias=$ac_cv_build_alias
1081 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1082   { { echo "$as_me:1082: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1083 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1084    { (exit 1); exit 1; }; }
1085
1086 fi
1087 echo "$as_me:1087: result: $ac_cv_host" >&5
1088 echo "${ECHO_T}$ac_cv_host" >&6
1089 host=$ac_cv_host
1090 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1091 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1092 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1093
1094         system_name="$host_os"
1095 else
1096         system_name="`(uname -s -r) 2>/dev/null`"
1097         if test -z "$system_name" ; then
1098                 system_name="`(hostname) 2>/dev/null`"
1099         fi
1100 fi
1101 test -n "$system_name" &&
1102 cat >>confdefs.h <<EOF
1103 #define SYSTEM_NAME "$system_name"
1104 EOF
1105
1106 if test "${cf_cv_system_name+set}" = set; then
1107   echo $ECHO_N "(cached) $ECHO_C" >&6
1108 else
1109   cf_cv_system_name="$system_name"
1110 fi
1111
1112 test -z "$system_name" && system_name="$cf_cv_system_name"
1113 test -n "$cf_cv_system_name" && echo "$as_me:1113: result: Configuring for $cf_cv_system_name" >&5
1114 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1115
1116 if test ".$system_name" != ".$cf_cv_system_name" ; then
1117         echo "$as_me:1117: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1118 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1119         { { echo "$as_me:1119: error: \"Please remove config.cache and try again.\"" >&5
1120 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1121    { (exit 1); exit 1; }; }
1122 fi
1123
1124 test "$program_prefix" != NONE &&
1125   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1126 # Use a double $ so make ignores it.
1127 test "$program_suffix" != NONE &&
1128   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1129 # Double any \ or $.  echo might interpret backslashes.
1130 # By default was `s,x,x', remove it if useless.
1131 cat <<\_ACEOF >conftest.sed
1132 s/[\\$]/&&/g;s/;s,x,x,$//
1133 _ACEOF
1134 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1135 rm conftest.sed
1136
1137 echo "$as_me:1137: checking whether ${MAKE-make} sets \${MAKE}" >&5
1138 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1139 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1140 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1141   echo $ECHO_N "(cached) $ECHO_C" >&6
1142 else
1143   cat >conftest.make <<\EOF
1144 all:
1145         @echo 'ac_maketemp="${MAKE}"'
1146 EOF
1147 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1148 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1149 if test -n "$ac_maketemp"; then
1150   eval ac_cv_prog_make_${ac_make}_set=yes
1151 else
1152   eval ac_cv_prog_make_${ac_make}_set=no
1153 fi
1154 rm -f conftest.make
1155 fi
1156 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1157   echo "$as_me:1157: result: yes" >&5
1158 echo "${ECHO_T}yes" >&6
1159   SET_MAKE=
1160 else
1161   echo "$as_me:1161: result: no" >&5
1162 echo "${ECHO_T}no" >&6
1163   SET_MAKE="MAKE=${MAKE-make}"
1164 fi
1165
1166 ac_ext=c
1167 ac_cpp='$CPP $CPPFLAGS'
1168 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1169 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1170 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1171 ac_main_return="return"
1172 if test -n "$ac_tool_prefix"; then
1173   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1174 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1175 echo "$as_me:1175: checking for $ac_word" >&5
1176 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1177 if test "${ac_cv_prog_CC+set}" = set; then
1178   echo $ECHO_N "(cached) $ECHO_C" >&6
1179 else
1180   if test -n "$CC"; then
1181   ac_cv_prog_CC="$CC" # Let the user override the test.
1182 else
1183   ac_save_IFS=$IFS; IFS=$ac_path_separator
1184 ac_dummy="$PATH"
1185 for ac_dir in $ac_dummy; do
1186   IFS=$ac_save_IFS
1187   test -z "$ac_dir" && ac_dir=.
1188   $as_executable_p "$ac_dir/$ac_word" || continue
1189 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1190 echo "$as_me:1190: found $ac_dir/$ac_word" >&5
1191 break
1192 done
1193
1194 fi
1195 fi
1196 CC=$ac_cv_prog_CC
1197 if test -n "$CC"; then
1198   echo "$as_me:1198: result: $CC" >&5
1199 echo "${ECHO_T}$CC" >&6
1200 else
1201   echo "$as_me:1201: result: no" >&5
1202 echo "${ECHO_T}no" >&6
1203 fi
1204
1205 fi
1206 if test -z "$ac_cv_prog_CC"; then
1207   ac_ct_CC=$CC
1208   # Extract the first word of "gcc", so it can be a program name with args.
1209 set dummy gcc; ac_word=$2
1210 echo "$as_me:1210: checking for $ac_word" >&5
1211 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1212 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1213   echo $ECHO_N "(cached) $ECHO_C" >&6
1214 else
1215   if test -n "$ac_ct_CC"; then
1216   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1217 else
1218   ac_save_IFS=$IFS; IFS=$ac_path_separator
1219 ac_dummy="$PATH"
1220 for ac_dir in $ac_dummy; do
1221   IFS=$ac_save_IFS
1222   test -z "$ac_dir" && ac_dir=.
1223   $as_executable_p "$ac_dir/$ac_word" || continue
1224 ac_cv_prog_ac_ct_CC="gcc"
1225 echo "$as_me:1225: found $ac_dir/$ac_word" >&5
1226 break
1227 done
1228
1229 fi
1230 fi
1231 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1232 if test -n "$ac_ct_CC"; then
1233   echo "$as_me:1233: result: $ac_ct_CC" >&5
1234 echo "${ECHO_T}$ac_ct_CC" >&6
1235 else
1236   echo "$as_me:1236: result: no" >&5
1237 echo "${ECHO_T}no" >&6
1238 fi
1239
1240   CC=$ac_ct_CC
1241 else
1242   CC="$ac_cv_prog_CC"
1243 fi
1244
1245 if test -z "$CC"; then
1246   if test -n "$ac_tool_prefix"; then
1247   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1248 set dummy ${ac_tool_prefix}cc; ac_word=$2
1249 echo "$as_me:1249: checking for $ac_word" >&5
1250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1251 if test "${ac_cv_prog_CC+set}" = set; then
1252   echo $ECHO_N "(cached) $ECHO_C" >&6
1253 else
1254   if test -n "$CC"; then
1255   ac_cv_prog_CC="$CC" # Let the user override the test.
1256 else
1257   ac_save_IFS=$IFS; IFS=$ac_path_separator
1258 ac_dummy="$PATH"
1259 for ac_dir in $ac_dummy; do
1260   IFS=$ac_save_IFS
1261   test -z "$ac_dir" && ac_dir=.
1262   $as_executable_p "$ac_dir/$ac_word" || continue
1263 ac_cv_prog_CC="${ac_tool_prefix}cc"
1264 echo "$as_me:1264: found $ac_dir/$ac_word" >&5
1265 break
1266 done
1267
1268 fi
1269 fi
1270 CC=$ac_cv_prog_CC
1271 if test -n "$CC"; then
1272   echo "$as_me:1272: result: $CC" >&5
1273 echo "${ECHO_T}$CC" >&6
1274 else
1275   echo "$as_me:1275: result: no" >&5
1276 echo "${ECHO_T}no" >&6
1277 fi
1278
1279 fi
1280 if test -z "$ac_cv_prog_CC"; then
1281   ac_ct_CC=$CC
1282   # Extract the first word of "cc", so it can be a program name with args.
1283 set dummy cc; ac_word=$2
1284 echo "$as_me:1284: checking for $ac_word" >&5
1285 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1286 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1287   echo $ECHO_N "(cached) $ECHO_C" >&6
1288 else
1289   if test -n "$ac_ct_CC"; then
1290   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1291 else
1292   ac_save_IFS=$IFS; IFS=$ac_path_separator
1293 ac_dummy="$PATH"
1294 for ac_dir in $ac_dummy; do
1295   IFS=$ac_save_IFS
1296   test -z "$ac_dir" && ac_dir=.
1297   $as_executable_p "$ac_dir/$ac_word" || continue
1298 ac_cv_prog_ac_ct_CC="cc"
1299 echo "$as_me:1299: found $ac_dir/$ac_word" >&5
1300 break
1301 done
1302
1303 fi
1304 fi
1305 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1306 if test -n "$ac_ct_CC"; then
1307   echo "$as_me:1307: result: $ac_ct_CC" >&5
1308 echo "${ECHO_T}$ac_ct_CC" >&6
1309 else
1310   echo "$as_me:1310: result: no" >&5
1311 echo "${ECHO_T}no" >&6
1312 fi
1313
1314   CC=$ac_ct_CC
1315 else
1316   CC="$ac_cv_prog_CC"
1317 fi
1318
1319 fi
1320 if test -z "$CC"; then
1321   # Extract the first word of "cc", so it can be a program name with args.
1322 set dummy cc; ac_word=$2
1323 echo "$as_me:1323: checking for $ac_word" >&5
1324 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1325 if test "${ac_cv_prog_CC+set}" = set; then
1326   echo $ECHO_N "(cached) $ECHO_C" >&6
1327 else
1328   if test -n "$CC"; then
1329   ac_cv_prog_CC="$CC" # Let the user override the test.
1330 else
1331   ac_prog_rejected=no
1332   ac_save_IFS=$IFS; IFS=$ac_path_separator
1333 ac_dummy="$PATH"
1334 for ac_dir in $ac_dummy; do
1335   IFS=$ac_save_IFS
1336   test -z "$ac_dir" && ac_dir=.
1337   $as_executable_p "$ac_dir/$ac_word" || continue
1338 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1339   ac_prog_rejected=yes
1340   continue
1341 fi
1342 ac_cv_prog_CC="cc"
1343 echo "$as_me:1343: found $ac_dir/$ac_word" >&5
1344 break
1345 done
1346
1347 if test "$ac_prog_rejected" = yes; then
1348   # We found a bogon in the path, so make sure we never use it.
1349   set dummy $ac_cv_prog_CC
1350   shift
1351   if test $# != 0; then
1352     # We chose a different compiler from the bogus one.
1353     # However, it has the same basename, so the bogon will be chosen
1354     # first if we set CC to just the basename; use the full file name.
1355     shift
1356     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1357     shift
1358     ac_cv_prog_CC="$@"
1359   fi
1360 fi
1361 fi
1362 fi
1363 CC=$ac_cv_prog_CC
1364 if test -n "$CC"; then
1365   echo "$as_me:1365: result: $CC" >&5
1366 echo "${ECHO_T}$CC" >&6
1367 else
1368   echo "$as_me:1368: result: no" >&5
1369 echo "${ECHO_T}no" >&6
1370 fi
1371
1372 fi
1373 if test -z "$CC"; then
1374   if test -n "$ac_tool_prefix"; then
1375   for ac_prog in cl
1376   do
1377     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1378 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1379 echo "$as_me:1379: checking for $ac_word" >&5
1380 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1381 if test "${ac_cv_prog_CC+set}" = set; then
1382   echo $ECHO_N "(cached) $ECHO_C" >&6
1383 else
1384   if test -n "$CC"; then
1385   ac_cv_prog_CC="$CC" # Let the user override the test.
1386 else
1387   ac_save_IFS=$IFS; IFS=$ac_path_separator
1388 ac_dummy="$PATH"
1389 for ac_dir in $ac_dummy; do
1390   IFS=$ac_save_IFS
1391   test -z "$ac_dir" && ac_dir=.
1392   $as_executable_p "$ac_dir/$ac_word" || continue
1393 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1394 echo "$as_me:1394: found $ac_dir/$ac_word" >&5
1395 break
1396 done
1397
1398 fi
1399 fi
1400 CC=$ac_cv_prog_CC
1401 if test -n "$CC"; then
1402   echo "$as_me:1402: result: $CC" >&5
1403 echo "${ECHO_T}$CC" >&6
1404 else
1405   echo "$as_me:1405: result: no" >&5
1406 echo "${ECHO_T}no" >&6
1407 fi
1408
1409     test -n "$CC" && break
1410   done
1411 fi
1412 if test -z "$CC"; then
1413   ac_ct_CC=$CC
1414   for ac_prog in cl
1415 do
1416   # Extract the first word of "$ac_prog", so it can be a program name with args.
1417 set dummy $ac_prog; ac_word=$2
1418 echo "$as_me:1418: checking for $ac_word" >&5
1419 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1420 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1421   echo $ECHO_N "(cached) $ECHO_C" >&6
1422 else
1423   if test -n "$ac_ct_CC"; then
1424   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1425 else
1426   ac_save_IFS=$IFS; IFS=$ac_path_separator
1427 ac_dummy="$PATH"
1428 for ac_dir in $ac_dummy; do
1429   IFS=$ac_save_IFS
1430   test -z "$ac_dir" && ac_dir=.
1431   $as_executable_p "$ac_dir/$ac_word" || continue
1432 ac_cv_prog_ac_ct_CC="$ac_prog"
1433 echo "$as_me:1433: found $ac_dir/$ac_word" >&5
1434 break
1435 done
1436
1437 fi
1438 fi
1439 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1440 if test -n "$ac_ct_CC"; then
1441   echo "$as_me:1441: result: $ac_ct_CC" >&5
1442 echo "${ECHO_T}$ac_ct_CC" >&6
1443 else
1444   echo "$as_me:1444: result: no" >&5
1445 echo "${ECHO_T}no" >&6
1446 fi
1447
1448   test -n "$ac_ct_CC" && break
1449 done
1450
1451   CC=$ac_ct_CC
1452 fi
1453
1454 fi
1455
1456 test -z "$CC" && { { echo "$as_me:1456: error: no acceptable cc found in \$PATH" >&5
1457 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1458    { (exit 1); exit 1; }; }
1459
1460 # Provide some information about the compiler.
1461 echo "$as_me:1461:" \
1462      "checking for C compiler version" >&5
1463 ac_compiler=`set X $ac_compile; echo "$2"`
1464 { (eval echo "$as_me:1464: \"$ac_compiler --version </dev/null >&5\"") >&5
1465   (eval $ac_compiler --version </dev/null >&5) 2>&5
1466   ac_status=$?
1467   echo "$as_me:1467: \$? = $ac_status" >&5
1468   (exit "$ac_status"); }
1469 { (eval echo "$as_me:1469: \"$ac_compiler -v </dev/null >&5\"") >&5
1470   (eval $ac_compiler -v </dev/null >&5) 2>&5
1471   ac_status=$?
1472   echo "$as_me:1472: \$? = $ac_status" >&5
1473   (exit "$ac_status"); }
1474 { (eval echo "$as_me:1474: \"$ac_compiler -V </dev/null >&5\"") >&5
1475   (eval $ac_compiler -V </dev/null >&5) 2>&5
1476   ac_status=$?
1477   echo "$as_me:1477: \$? = $ac_status" >&5
1478   (exit "$ac_status"); }
1479
1480 cat >"conftest.$ac_ext" <<_ACEOF
1481 #line 1481 "configure"
1482 #include "confdefs.h"
1483
1484 int
1485 main (void)
1486 {
1487
1488   ;
1489   return 0;
1490 }
1491 _ACEOF
1492 ac_clean_files_save=$ac_clean_files
1493 ac_clean_files="$ac_clean_files a.out a.exe"
1494 # Try to create an executable without -o first, disregard a.out.
1495 # It will help us diagnose broken compilers, and finding out an intuition
1496 # of exeext.
1497 echo "$as_me:1497: checking for C compiler default output" >&5
1498 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1499 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1500 if { (eval echo "$as_me:1500: \"$ac_link_default\"") >&5
1501   (eval $ac_link_default) 2>&5
1502   ac_status=$?
1503   echo "$as_me:1503: \$? = $ac_status" >&5
1504   (exit "$ac_status"); }; then
1505   # Find the output, starting from the most likely.  This scheme is
1506 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1507 # resort.
1508 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1509                 ls a.out conftest 2>/dev/null;
1510                 ls a.* conftest.* 2>/dev/null`; do
1511   case $ac_file in
1512     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1513     a.out ) # We found the default executable, but exeext='' is most
1514             # certainly right.
1515             break;;
1516     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1517           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1518           export ac_cv_exeext
1519           break;;
1520     * ) break;;
1521   esac
1522 done
1523 else
1524   echo "$as_me: failed program was:" >&5
1525 cat "conftest.$ac_ext" >&5
1526 { { echo "$as_me:1526: error: C compiler cannot create executables" >&5
1527 echo "$as_me: error: C compiler cannot create executables" >&2;}
1528    { (exit 77); exit 77; }; }
1529 fi
1530
1531 ac_exeext=$ac_cv_exeext
1532 echo "$as_me:1532: result: $ac_file" >&5
1533 echo "${ECHO_T}$ac_file" >&6
1534
1535 # Check the compiler produces executables we can run.  If not, either
1536 # the compiler is broken, or we cross compile.
1537 echo "$as_me:1537: checking whether the C compiler works" >&5
1538 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1539 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1540 # If not cross compiling, check that we can run a simple program.
1541 if test "$cross_compiling" != yes; then
1542   if { ac_try='./$ac_file'
1543   { (eval echo "$as_me:1543: \"$ac_try\"") >&5
1544   (eval $ac_try) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit "$ac_status"); }; }; then
1548     cross_compiling=no
1549   else
1550     if test "$cross_compiling" = maybe; then
1551         cross_compiling=yes
1552     else
1553         { { echo "$as_me:1553: error: cannot run C compiled programs.
1554 If you meant to cross compile, use \`--host'." >&5
1555 echo "$as_me: error: cannot run C compiled programs.
1556 If you meant to cross compile, use \`--host'." >&2;}
1557    { (exit 1); exit 1; }; }
1558     fi
1559   fi
1560 fi
1561 echo "$as_me:1561: result: yes" >&5
1562 echo "${ECHO_T}yes" >&6
1563
1564 rm -f a.out a.exe "conftest$ac_cv_exeext"
1565 ac_clean_files=$ac_clean_files_save
1566 # Check the compiler produces executables we can run.  If not, either
1567 # the compiler is broken, or we cross compile.
1568 echo "$as_me:1568: checking whether we are cross compiling" >&5
1569 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1570 echo "$as_me:1570: result: $cross_compiling" >&5
1571 echo "${ECHO_T}$cross_compiling" >&6
1572
1573 echo "$as_me:1573: checking for executable suffix" >&5
1574 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1575 if { (eval echo "$as_me:1575: \"$ac_link\"") >&5
1576   (eval $ac_link) 2>&5
1577   ac_status=$?
1578   echo "$as_me:1578: \$? = $ac_status" >&5
1579   (exit "$ac_status"); }; then
1580   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1581 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1582 # work properly (i.e., refer to `conftest.exe'), while it won't with
1583 # `rm'.
1584 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1585   case $ac_file in
1586     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1587     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1588           export ac_cv_exeext
1589           break;;
1590     * ) break;;
1591   esac
1592 done
1593 else
1594   { { echo "$as_me:1594: error: cannot compute EXEEXT: cannot compile and link" >&5
1595 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1596    { (exit 1); exit 1; }; }
1597 fi
1598
1599 rm -f "conftest$ac_cv_exeext"
1600 echo "$as_me:1600: result: $ac_cv_exeext" >&5
1601 echo "${ECHO_T}$ac_cv_exeext" >&6
1602
1603 rm -f "conftest.$ac_ext"
1604 EXEEXT=$ac_cv_exeext
1605 ac_exeext=$EXEEXT
1606 echo "$as_me:1606: checking for object suffix" >&5
1607 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1608 if test "${ac_cv_objext+set}" = set; then
1609   echo $ECHO_N "(cached) $ECHO_C" >&6
1610 else
1611   cat >"conftest.$ac_ext" <<_ACEOF
1612 #line 1612 "configure"
1613 #include "confdefs.h"
1614
1615 int
1616 main (void)
1617 {
1618
1619   ;
1620   return 0;
1621 }
1622 _ACEOF
1623 rm -f conftest.o conftest.obj
1624 if { (eval echo "$as_me:1624: \"$ac_compile\"") >&5
1625   (eval $ac_compile) 2>&5
1626   ac_status=$?
1627   echo "$as_me:1627: \$? = $ac_status" >&5
1628   (exit "$ac_status"); }; then
1629   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1630   case $ac_file in
1631     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1632     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1633        break;;
1634   esac
1635 done
1636 else
1637   echo "$as_me: failed program was:" >&5
1638 cat "conftest.$ac_ext" >&5
1639 { { echo "$as_me:1639: error: cannot compute OBJEXT: cannot compile" >&5
1640 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1641    { (exit 1); exit 1; }; }
1642 fi
1643
1644 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1645 fi
1646 echo "$as_me:1646: result: $ac_cv_objext" >&5
1647 echo "${ECHO_T}$ac_cv_objext" >&6
1648 OBJEXT=$ac_cv_objext
1649 ac_objext=$OBJEXT
1650 echo "$as_me:1650: checking whether we are using the GNU C compiler" >&5
1651 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1652 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1653   echo $ECHO_N "(cached) $ECHO_C" >&6
1654 else
1655   cat >"conftest.$ac_ext" <<_ACEOF
1656 #line 1656 "configure"
1657 #include "confdefs.h"
1658
1659 int
1660 main (void)
1661 {
1662 #ifndef __GNUC__
1663        choke me
1664 #endif
1665
1666   ;
1667   return 0;
1668 }
1669 _ACEOF
1670 rm -f "conftest.$ac_objext"
1671 if { (eval echo "$as_me:1671: \"$ac_compile\"") >&5
1672   (eval $ac_compile) 2>&5
1673   ac_status=$?
1674   echo "$as_me:1674: \$? = $ac_status" >&5
1675   (exit "$ac_status"); } &&
1676          { ac_try='test -s "conftest.$ac_objext"'
1677   { (eval echo "$as_me:1677: \"$ac_try\"") >&5
1678   (eval $ac_try) 2>&5
1679   ac_status=$?
1680   echo "$as_me:1680: \$? = $ac_status" >&5
1681   (exit "$ac_status"); }; }; then
1682   ac_compiler_gnu=yes
1683 else
1684   echo "$as_me: failed program was:" >&5
1685 cat "conftest.$ac_ext" >&5
1686 ac_compiler_gnu=no
1687 fi
1688 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1689 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1690
1691 fi
1692 echo "$as_me:1692: result: $ac_cv_c_compiler_gnu" >&5
1693 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1694 GCC=`test $ac_compiler_gnu = yes && echo yes`
1695 ac_test_CFLAGS=${CFLAGS+set}
1696 ac_save_CFLAGS=$CFLAGS
1697 CFLAGS="-g"
1698 echo "$as_me:1698: checking whether $CC accepts -g" >&5
1699 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1700 if test "${ac_cv_prog_cc_g+set}" = set; then
1701   echo $ECHO_N "(cached) $ECHO_C" >&6
1702 else
1703   cat >"conftest.$ac_ext" <<_ACEOF
1704 #line 1704 "configure"
1705 #include "confdefs.h"
1706
1707 int
1708 main (void)
1709 {
1710
1711   ;
1712   return 0;
1713 }
1714 _ACEOF
1715 rm -f "conftest.$ac_objext"
1716 if { (eval echo "$as_me:1716: \"$ac_compile\"") >&5
1717   (eval $ac_compile) 2>&5
1718   ac_status=$?
1719   echo "$as_me:1719: \$? = $ac_status" >&5
1720   (exit "$ac_status"); } &&
1721          { ac_try='test -s "conftest.$ac_objext"'
1722   { (eval echo "$as_me:1722: \"$ac_try\"") >&5
1723   (eval $ac_try) 2>&5
1724   ac_status=$?
1725   echo "$as_me:1725: \$? = $ac_status" >&5
1726   (exit "$ac_status"); }; }; then
1727   ac_cv_prog_cc_g=yes
1728 else
1729   echo "$as_me: failed program was:" >&5
1730 cat "conftest.$ac_ext" >&5
1731 ac_cv_prog_cc_g=no
1732 fi
1733 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1734 fi
1735 echo "$as_me:1735: result: $ac_cv_prog_cc_g" >&5
1736 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1737 if test "$ac_test_CFLAGS" = set; then
1738   CFLAGS=$ac_save_CFLAGS
1739 elif test $ac_cv_prog_cc_g = yes; then
1740   if test "$GCC" = yes; then
1741     CFLAGS="-g -O2"
1742   else
1743     CFLAGS="-g"
1744   fi
1745 else
1746   if test "$GCC" = yes; then
1747     CFLAGS="-O2"
1748   else
1749     CFLAGS=
1750   fi
1751 fi
1752 # Some people use a C++ compiler to compile C.  Since we use `exit',
1753 # in C++ we need to declare it.  In case someone uses the same compiler
1754 # for both compiling C and C++ we need to have the C++ compiler decide
1755 # the declaration of exit, since it's the most demanding environment.
1756 cat >"conftest.$ac_ext" <<_ACEOF
1757 #ifndef __cplusplus
1758   choke me
1759 #endif
1760 _ACEOF
1761 rm -f "conftest.$ac_objext"
1762 if { (eval echo "$as_me:1762: \"$ac_compile\"") >&5
1763   (eval $ac_compile) 2>&5
1764   ac_status=$?
1765   echo "$as_me:1765: \$? = $ac_status" >&5
1766   (exit "$ac_status"); } &&
1767          { ac_try='test -s "conftest.$ac_objext"'
1768   { (eval echo "$as_me:1768: \"$ac_try\"") >&5
1769   (eval $ac_try) 2>&5
1770   ac_status=$?
1771   echo "$as_me:1771: \$? = $ac_status" >&5
1772   (exit "$ac_status"); }; }; then
1773   for ac_declaration in \
1774    ''\
1775    '#include <stdlib.h>' \
1776    'extern "C" void std::exit (int) throw (); using std::exit;' \
1777    'extern "C" void std::exit (int); using std::exit;' \
1778    'extern "C" void exit (int) throw ();' \
1779    'extern "C" void exit (int);' \
1780    'void exit (int);'
1781 do
1782   cat >"conftest.$ac_ext" <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 #include <stdlib.h>
1786 $ac_declaration
1787 int
1788 main (void)
1789 {
1790 exit (42);
1791   ;
1792   return 0;
1793 }
1794 _ACEOF
1795 rm -f "conftest.$ac_objext"
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit "$ac_status"); } &&
1801          { ac_try='test -s "conftest.$ac_objext"'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit "$ac_status"); }; }; then
1807   :
1808 else
1809   echo "$as_me: failed program was:" >&5
1810 cat "conftest.$ac_ext" >&5
1811 continue
1812 fi
1813 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1814   cat >"conftest.$ac_ext" <<_ACEOF
1815 #line 1815 "configure"
1816 #include "confdefs.h"
1817 $ac_declaration
1818 int
1819 main (void)
1820 {
1821 exit (42);
1822   ;
1823   return 0;
1824 }
1825 _ACEOF
1826 rm -f "conftest.$ac_objext"
1827 if { (eval echo "$as_me:1827: \"$ac_compile\"") >&5
1828   (eval $ac_compile) 2>&5
1829   ac_status=$?
1830   echo "$as_me:1830: \$? = $ac_status" >&5
1831   (exit "$ac_status"); } &&
1832          { ac_try='test -s "conftest.$ac_objext"'
1833   { (eval echo "$as_me:1833: \"$ac_try\"") >&5
1834   (eval $ac_try) 2>&5
1835   ac_status=$?
1836   echo "$as_me:1836: \$? = $ac_status" >&5
1837   (exit "$ac_status"); }; }; then
1838   break
1839 else
1840   echo "$as_me: failed program was:" >&5
1841 cat "conftest.$ac_ext" >&5
1842 fi
1843 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1844 done
1845 rm -rf conftest*
1846 if test -n "$ac_declaration"; then
1847   echo '#ifdef __cplusplus' >>confdefs.h
1848   echo "$ac_declaration"    >>confdefs.h
1849   echo '#endif'             >>confdefs.h
1850 fi
1851
1852 else
1853   echo "$as_me: failed program was:" >&5
1854 cat "conftest.$ac_ext" >&5
1855 fi
1856 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1857 ac_ext=c
1858 ac_cpp='$CPP $CPPFLAGS'
1859 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1860 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1861 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1862 ac_main_return="return"
1863
1864 GCC_VERSION=none
1865 if test "$GCC" = yes ; then
1866         echo "$as_me:1866: checking version of $CC" >&5
1867 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1868         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1869         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1870         echo "$as_me:1870: result: $GCC_VERSION" >&5
1871 echo "${ECHO_T}$GCC_VERSION" >&6
1872 fi
1873
1874 INTEL_COMPILER=no
1875
1876 if test "$GCC" = yes ; then
1877         case "$host_os" in
1878         (linux*|gnu*)
1879                 echo "$as_me:1879: checking if this is really Intel C compiler" >&5
1880 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1881                 cf_save_CFLAGS="$CFLAGS"
1882                 CFLAGS="$CFLAGS -no-gcc"
1883                 cat >"conftest.$ac_ext" <<_ACEOF
1884 #line 1884 "configure"
1885 #include "confdefs.h"
1886
1887 int
1888 main (void)
1889 {
1890
1891 #ifdef __INTEL_COMPILER
1892 #else
1893 make an error
1894 #endif
1895
1896   ;
1897   return 0;
1898 }
1899 _ACEOF
1900 rm -f "conftest.$ac_objext"
1901 if { (eval echo "$as_me:1901: \"$ac_compile\"") >&5
1902   (eval $ac_compile) 2>&5
1903   ac_status=$?
1904   echo "$as_me:1904: \$? = $ac_status" >&5
1905   (exit "$ac_status"); } &&
1906          { ac_try='test -s "conftest.$ac_objext"'
1907   { (eval echo "$as_me:1907: \"$ac_try\"") >&5
1908   (eval $ac_try) 2>&5
1909   ac_status=$?
1910   echo "$as_me:1910: \$? = $ac_status" >&5
1911   (exit "$ac_status"); }; }; then
1912   INTEL_COMPILER=yes
1913 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1914
1915 else
1916   echo "$as_me: failed program was:" >&5
1917 cat "conftest.$ac_ext" >&5
1918 fi
1919 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1920                 CFLAGS="$cf_save_CFLAGS"
1921                 echo "$as_me:1921: result: $INTEL_COMPILER" >&5
1922 echo "${ECHO_T}$INTEL_COMPILER" >&6
1923                 ;;
1924         esac
1925 fi
1926
1927 CLANG_COMPILER=no
1928
1929 if test "$GCC" = yes ; then
1930         echo "$as_me:1930: checking if this is really Clang C compiler" >&5
1931 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1932         cf_save_CFLAGS="$CFLAGS"
1933         cat >"conftest.$ac_ext" <<_ACEOF
1934 #line 1934 "configure"
1935 #include "confdefs.h"
1936
1937 int
1938 main (void)
1939 {
1940
1941 #ifdef __clang__
1942 #else
1943 make an error
1944 #endif
1945
1946   ;
1947   return 0;
1948 }
1949 _ACEOF
1950 rm -f "conftest.$ac_objext"
1951 if { (eval echo "$as_me:1951: \"$ac_compile\"") >&5
1952   (eval $ac_compile) 2>&5
1953   ac_status=$?
1954   echo "$as_me:1954: \$? = $ac_status" >&5
1955   (exit "$ac_status"); } &&
1956          { ac_try='test -s "conftest.$ac_objext"'
1957   { (eval echo "$as_me:1957: \"$ac_try\"") >&5
1958   (eval $ac_try) 2>&5
1959   ac_status=$?
1960   echo "$as_me:1960: \$? = $ac_status" >&5
1961   (exit "$ac_status"); }; }; then
1962   CLANG_COMPILER=yes
1963
1964 else
1965   echo "$as_me: failed program was:" >&5
1966 cat "conftest.$ac_ext" >&5
1967 fi
1968 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1969         CFLAGS="$cf_save_CFLAGS"
1970         echo "$as_me:1970: result: $CLANG_COMPILER" >&5
1971 echo "${ECHO_T}$CLANG_COMPILER" >&6
1972 fi
1973
1974 CLANG_VERSION=none
1975
1976 if test "x$CLANG_COMPILER" = "xyes" ; then
1977         case "$CC" in
1978         (c[1-9][0-9]|*/c[1-9][0-9])
1979                 { echo "$as_me:1979: WARNING: replacing broken compiler alias $CC" >&5
1980 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1981                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1982                 CC=clang
1983                 ;;
1984         esac
1985
1986         echo "$as_me:1986: checking version of $CC" >&5
1987 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1988         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1989         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1990         echo "$as_me:1990: result: $CLANG_VERSION" >&5
1991 echo "${ECHO_T}$CLANG_VERSION" >&6
1992
1993         for cf_clang_opt in \
1994                 -Qunused-arguments \
1995                 -Wno-error=implicit-function-declaration
1996         do
1997                 echo "$as_me:1997: checking if option $cf_clang_opt works" >&5
1998 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1999                 cf_save_CFLAGS="$CFLAGS"
2000                 CFLAGS="$CFLAGS $cf_clang_opt"
2001                 cat >"conftest.$ac_ext" <<_ACEOF
2002 #line 2002 "configure"
2003 #include "confdefs.h"
2004
2005                         #include <stdio.h>
2006 int
2007 main (void)
2008 {
2009
2010                         printf("hello!\\n");
2011   ;
2012   return 0;
2013 }
2014 _ACEOF
2015 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2016 if { (eval echo "$as_me:2016: \"$ac_link\"") >&5
2017   (eval $ac_link) 2>&5
2018   ac_status=$?
2019   echo "$as_me:2019: \$? = $ac_status" >&5
2020   (exit "$ac_status"); } &&
2021          { ac_try='test -s "conftest$ac_exeext"'
2022   { (eval echo "$as_me:2022: \"$ac_try\"") >&5
2023   (eval $ac_try) 2>&5
2024   ac_status=$?
2025   echo "$as_me:2025: \$? = $ac_status" >&5
2026   (exit "$ac_status"); }; }; then
2027
2028                         cf_clang_optok=yes
2029 else
2030   echo "$as_me: failed program was:" >&5
2031 cat "conftest.$ac_ext" >&5
2032
2033                         cf_clang_optok=no
2034 fi
2035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2036                 echo "$as_me:2036: result: $cf_clang_optok" >&5
2037 echo "${ECHO_T}$cf_clang_optok" >&6
2038                 CFLAGS="$cf_save_CFLAGS"
2039                 if test "$cf_clang_optok" = yes; then
2040                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2041
2042 echo "${as_me:-configure}:2042: testing adding option $cf_clang_opt ..." 1>&5
2043
2044         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2045         CFLAGS="${CFLAGS}$cf_clang_opt"
2046
2047                 fi
2048         done
2049 fi
2050
2051 echo "$as_me:2051: checking for $CC option to accept ANSI C" >&5
2052 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2053 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2054   echo $ECHO_N "(cached) $ECHO_C" >&6
2055 else
2056   ac_cv_prog_cc_stdc=no
2057 ac_save_CC=$CC
2058 cat >"conftest.$ac_ext" <<_ACEOF
2059 #line 2059 "configure"
2060 #include "confdefs.h"
2061 #include <stdarg.h>
2062 #include <stdio.h>
2063 #include <sys/types.h>
2064 #include <sys/stat.h>
2065 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2066 struct buf { int x; };
2067 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2068 static char *e (p, i)
2069      char **p;
2070      int i;
2071 {
2072   return p[i];
2073 }
2074 static char *f (char * (*g) (char **, int), char **p, ...)
2075 {
2076   char *s;
2077   va_list v;
2078   va_start (v,p);
2079   s = g (p, va_arg (v,int));
2080   va_end (v);
2081   return s;
2082 }
2083 int test (int i, double x);
2084 struct s1 {int (*f) (int a);};
2085 struct s2 {int (*f) (double a);};
2086 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2087 int argc;
2088 char **argv;
2089 int
2090 main (void)
2091 {
2092 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2093   ;
2094   return 0;
2095 }
2096 _ACEOF
2097 # Don't try gcc -ansi; that turns off useful extensions and
2098 # breaks some systems' header files.
2099 # AIX                   -qlanglvl=ansi
2100 # Ultrix and OSF/1      -std1
2101 # HP-UX 10.20 and later -Ae
2102 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2103 # SVR4                  -Xc -D__EXTENSIONS__
2104 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2105 do
2106   CC="$ac_save_CC $ac_arg"
2107   rm -f "conftest.$ac_objext"
2108 if { (eval echo "$as_me:2108: \"$ac_compile\"") >&5
2109   (eval $ac_compile) 2>&5
2110   ac_status=$?
2111   echo "$as_me:2111: \$? = $ac_status" >&5
2112   (exit "$ac_status"); } &&
2113          { ac_try='test -s "conftest.$ac_objext"'
2114   { (eval echo "$as_me:2114: \"$ac_try\"") >&5
2115   (eval $ac_try) 2>&5
2116   ac_status=$?
2117   echo "$as_me:2117: \$? = $ac_status" >&5
2118   (exit "$ac_status"); }; }; then
2119   ac_cv_prog_cc_stdc=$ac_arg
2120 break
2121 else
2122   echo "$as_me: failed program was:" >&5
2123 cat "conftest.$ac_ext" >&5
2124 fi
2125 rm -f "conftest.$ac_objext"
2126 done
2127 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2128 CC=$ac_save_CC
2129
2130 fi
2131
2132 case "x$ac_cv_prog_cc_stdc" in
2133   x|xno)
2134     echo "$as_me:2134: result: none needed" >&5
2135 echo "${ECHO_T}none needed" >&6 ;;
2136   *)
2137     echo "$as_me:2137: result: $ac_cv_prog_cc_stdc" >&5
2138 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2139     CC="$CC $ac_cv_prog_cc_stdc" ;;
2140 esac
2141
2142 # This should have been defined by AC_PROG_CC
2143 : "${CC:=cc}"
2144
2145 echo "$as_me:2145: checking \$CFLAGS variable" >&5
2146 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2147 case "x$CFLAGS" in
2148 (*-[IUD]*)
2149         echo "$as_me:2149: result: broken" >&5
2150 echo "${ECHO_T}broken" >&6
2151         { echo "$as_me:2151: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2152 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2153         cf_flags="$CFLAGS"
2154         CFLAGS=
2155         for cf_arg in $cf_flags
2156         do
2157
2158 cf_fix_cppflags=no
2159 cf_new_cflags=
2160 cf_new_cppflags=
2161 cf_new_extra_cppflags=
2162
2163 for cf_add_cflags in $cf_arg
2164 do
2165 case "$cf_fix_cppflags" in
2166 (no)
2167         case "$cf_add_cflags" in
2168         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2169                 case "$cf_add_cflags" in
2170                 (-D*)
2171                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2172
2173                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2174                                 && test -z "${cf_tst_cflags}" \
2175                                 && cf_fix_cppflags=yes
2176
2177                         if test "$cf_fix_cppflags" = yes ; then
2178
2179         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2180         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2181
2182                                 continue
2183                         elif test "${cf_tst_cflags}" = "\"'" ; then
2184
2185         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2186         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2187
2188                                 continue
2189                         fi
2190                         ;;
2191                 esac
2192                 case "$CPPFLAGS" in
2193                 (*$cf_add_cflags)
2194                         ;;
2195                 (*)
2196                         case "$cf_add_cflags" in
2197                         (-D*)
2198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2199
2200 CPPFLAGS=`echo "$CPPFLAGS" | \
2201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2203
2204                                 ;;
2205                         esac
2206
2207         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2208         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2209
2210                         ;;
2211                 esac
2212                 ;;
2213         (*)
2214
2215         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2216         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2217
2218                 ;;
2219         esac
2220         ;;
2221 (yes)
2222
2223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2225
2226         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2227
2228         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2229                 && test -z "${cf_tst_cflags}" \
2230                 && cf_fix_cppflags=no
2231         ;;
2232 esac
2233 done
2234
2235 if test -n "$cf_new_cflags" ; then
2236
2237         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2238         CFLAGS="${CFLAGS}$cf_new_cflags"
2239
2240 fi
2241
2242 if test -n "$cf_new_cppflags" ; then
2243
2244         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2245         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2246
2247 fi
2248
2249 if test -n "$cf_new_extra_cppflags" ; then
2250
2251         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2252         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2253
2254 fi
2255
2256         done
2257         ;;
2258 (*)
2259         echo "$as_me:2259: result: ok" >&5
2260 echo "${ECHO_T}ok" >&6
2261         ;;
2262 esac
2263
2264 echo "$as_me:2264: checking \$CC variable" >&5
2265 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2266 case "$CC" in
2267 (*[\ \  ]-*)
2268         echo "$as_me:2268: result: broken" >&5
2269 echo "${ECHO_T}broken" >&6
2270         { echo "$as_me:2270: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2271 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2272         # humor him...
2273         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2274         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2275         CC="$cf_prog"
2276         for cf_arg in $cf_flags
2277         do
2278                 case "x$cf_arg" in
2279                 (x-[IUDfgOW]*)
2280
2281 cf_fix_cppflags=no
2282 cf_new_cflags=
2283 cf_new_cppflags=
2284 cf_new_extra_cppflags=
2285
2286 for cf_add_cflags in $cf_arg
2287 do
2288 case "$cf_fix_cppflags" in
2289 (no)
2290         case "$cf_add_cflags" in
2291         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2292                 case "$cf_add_cflags" in
2293                 (-D*)
2294                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2295
2296                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2297                                 && test -z "${cf_tst_cflags}" \
2298                                 && cf_fix_cppflags=yes
2299
2300                         if test "$cf_fix_cppflags" = yes ; then
2301
2302         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2303         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2304
2305                                 continue
2306                         elif test "${cf_tst_cflags}" = "\"'" ; then
2307
2308         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2309         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2310
2311                                 continue
2312                         fi
2313                         ;;
2314                 esac
2315                 case "$CPPFLAGS" in
2316                 (*$cf_add_cflags)
2317                         ;;
2318                 (*)
2319                         case "$cf_add_cflags" in
2320                         (-D*)
2321                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2322
2323 CPPFLAGS=`echo "$CPPFLAGS" | \
2324         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2325                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2326
2327                                 ;;
2328                         esac
2329
2330         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2331         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2332
2333                         ;;
2334                 esac
2335                 ;;
2336         (*)
2337
2338         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2339         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2340
2341                 ;;
2342         esac
2343         ;;
2344 (yes)
2345
2346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2348
2349         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2350
2351         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2352                 && test -z "${cf_tst_cflags}" \
2353                 && cf_fix_cppflags=no
2354         ;;
2355 esac
2356 done
2357
2358 if test -n "$cf_new_cflags" ; then
2359
2360         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2361         CFLAGS="${CFLAGS}$cf_new_cflags"
2362
2363 fi
2364
2365 if test -n "$cf_new_cppflags" ; then
2366
2367         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2368         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2369
2370 fi
2371
2372 if test -n "$cf_new_extra_cppflags" ; then
2373
2374         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2375         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2376
2377 fi
2378
2379                         ;;
2380                 (*)
2381                         CC="$CC $cf_arg"
2382                         ;;
2383                 esac
2384         done
2385         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2386
2387 echo "${as_me:-configure}:2387: testing resulting CC: '$CC' ..." 1>&5
2388
2389         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2390
2391 echo "${as_me:-configure}:2391: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2392
2393         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2394
2395 echo "${as_me:-configure}:2395: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2396
2397         ;;
2398 (*)
2399         echo "$as_me:2399: result: ok" >&5
2400 echo "${ECHO_T}ok" >&6
2401         ;;
2402 esac
2403
2404 echo "$as_me:2404: checking for inline" >&5
2405 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2406 if test "${ac_cv_c_inline+set}" = set; then
2407   echo $ECHO_N "(cached) $ECHO_C" >&6
2408 else
2409   ac_cv_c_inline=no
2410 for ac_kw in inline __inline__ __inline; do
2411   cat >"conftest.$ac_ext" <<_ACEOF
2412 #line 2412 "configure"
2413 #include "confdefs.h"
2414 #ifndef __cplusplus
2415 static $ac_kw int static_foo () {return 0; }
2416 $ac_kw int foo () {return 0; }
2417 #endif
2418
2419 _ACEOF
2420 rm -f "conftest.$ac_objext"
2421 if { (eval echo "$as_me:2421: \"$ac_compile\"") >&5
2422   (eval $ac_compile) 2>&5
2423   ac_status=$?
2424   echo "$as_me:2424: \$? = $ac_status" >&5
2425   (exit "$ac_status"); } &&
2426          { ac_try='test -s "conftest.$ac_objext"'
2427   { (eval echo "$as_me:2427: \"$ac_try\"") >&5
2428   (eval $ac_try) 2>&5
2429   ac_status=$?
2430   echo "$as_me:2430: \$? = $ac_status" >&5
2431   (exit "$ac_status"); }; }; then
2432   ac_cv_c_inline=$ac_kw; break
2433 else
2434   echo "$as_me: failed program was:" >&5
2435 cat "conftest.$ac_ext" >&5
2436 fi
2437 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2438 done
2439
2440 fi
2441 echo "$as_me:2441: result: $ac_cv_c_inline" >&5
2442 echo "${ECHO_T}$ac_cv_c_inline" >&6
2443 case $ac_cv_c_inline in
2444   inline | yes) ;;
2445   no)
2446 cat >>confdefs.h <<\EOF
2447 #define inline
2448 EOF
2449  ;;
2450   *)  cat >>confdefs.h <<EOF
2451 #define inline $ac_cv_c_inline
2452 EOF
2453  ;;
2454 esac
2455
2456 for ac_prog in ggrep grep
2457 do
2458   # Extract the first word of "$ac_prog", so it can be a program name with args.
2459 set dummy $ac_prog; ac_word=$2
2460 echo "$as_me:2460: checking for $ac_word" >&5
2461 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2462 if test "${ac_cv_prog_GREP+set}" = set; then
2463   echo $ECHO_N "(cached) $ECHO_C" >&6
2464 else
2465   if test -n "$GREP"; then
2466   ac_cv_prog_GREP="$GREP" # Let the user override the test.
2467 else
2468   ac_save_IFS=$IFS; IFS=$ac_path_separator
2469 ac_dummy="$PATH"
2470 for ac_dir in $ac_dummy; do
2471   IFS=$ac_save_IFS
2472   test -z "$ac_dir" && ac_dir=.
2473   $as_executable_p "$ac_dir/$ac_word" || continue
2474 ac_cv_prog_GREP="$ac_prog"
2475 echo "$as_me:2475: found $ac_dir/$ac_word" >&5
2476 break
2477 done
2478
2479 fi
2480 fi
2481 GREP=$ac_cv_prog_GREP
2482 if test -n "$GREP"; then
2483   echo "$as_me:2483: result: $GREP" >&5
2484 echo "${ECHO_T}$GREP" >&6
2485 else
2486   echo "$as_me:2486: result: no" >&5
2487 echo "${ECHO_T}no" >&6
2488 fi
2489
2490   test -n "$GREP" && break
2491 done
2492 test -n "$GREP" || GREP=": "
2493
2494 echo "$as_me:2494: checking for egrep" >&5
2495 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2496 if test "${ac_cv_path_EGREP+set}" = set; then
2497   echo $ECHO_N "(cached) $ECHO_C" >&6
2498 else
2499   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2500    then ac_cv_path_EGREP="$GREP -E"
2501    else
2502      for ac_prog in gegrep egrep
2503 do
2504   # Extract the first word of "$ac_prog", so it can be a program name with args.
2505 set dummy $ac_prog; ac_word=$2
2506 echo "$as_me:2506: checking for $ac_word" >&5
2507 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2508 if test "${ac_cv_path_EGREP+set}" = set; then
2509   echo $ECHO_N "(cached) $ECHO_C" >&6
2510 else
2511   case $EGREP in
2512   [\\/]* | ?:[\\/]*)
2513   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2514   ;;
2515   *)
2516   ac_save_IFS=$IFS; IFS=$ac_path_separator
2517 ac_dummy="$PATH"
2518 for ac_dir in $ac_dummy; do
2519   IFS=$ac_save_IFS
2520   test -z "$ac_dir" && ac_dir=.
2521   if $as_executable_p "$ac_dir/$ac_word"; then
2522    ac_cv_path_EGREP="$ac_dir/$ac_word"
2523    echo "$as_me:2523: found $ac_dir/$ac_word" >&5
2524    break
2525 fi
2526 done
2527
2528   ;;
2529 esac
2530 fi
2531 EGREP=$ac_cv_path_EGREP
2532
2533 if test -n "$EGREP"; then
2534   echo "$as_me:2534: result: $EGREP" >&5
2535 echo "${ECHO_T}$EGREP" >&6
2536 else
2537   echo "$as_me:2537: result: no" >&5
2538 echo "${ECHO_T}no" >&6
2539 fi
2540
2541   test -n "$EGREP" && break
2542 done
2543 test -n "$EGREP" || EGREP=": "
2544
2545      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2545: error: cannot find workable egrep" >&5
2546 echo "$as_me: error: cannot find workable egrep" >&2;}
2547    { (exit 1); exit 1; }; }
2548    fi
2549 fi
2550 echo "$as_me:2550: result: $ac_cv_path_EGREP" >&5
2551 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2552  EGREP="$ac_cv_path_EGREP"
2553
2554 ac_ext=c
2555 ac_cpp='$CPP $CPPFLAGS'
2556 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2557 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2558 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2559 ac_main_return="return"
2560 echo "$as_me:2560: checking how to run the C preprocessor" >&5
2561 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2562 # On Suns, sometimes $CPP names a directory.
2563 if test -n "$CPP" && test -d "$CPP"; then
2564   CPP=
2565 fi
2566 if test -z "$CPP"; then
2567   if test "${ac_cv_prog_CPP+set}" = set; then
2568   echo $ECHO_N "(cached) $ECHO_C" >&6
2569 else
2570       # Double quotes because CPP needs to be expanded
2571     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2572     do
2573       ac_preproc_ok=false
2574 for ac_c_preproc_warn_flag in '' yes
2575 do
2576   # Use a header file that comes with gcc, so configuring glibc
2577   # with a fresh cross-compiler works.
2578   # On the NeXT, cc -E runs the code through the compiler's parser,
2579   # not just through cpp. "Syntax error" is here to catch this case.
2580   cat >"conftest.$ac_ext" <<_ACEOF
2581 #line 2581 "configure"
2582 #include "confdefs.h"
2583 #include <assert.h>
2584                      Syntax error
2585 _ACEOF
2586 if { (eval echo "$as_me:2586: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2587   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2588   ac_status=$?
2589   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2590   rm -f conftest.er1
2591   cat conftest.err >&5
2592   echo "$as_me:2592: \$? = $ac_status" >&5
2593   (exit "$ac_status"); } >/dev/null; then
2594   if test -s conftest.err; then
2595     ac_cpp_err=$ac_c_preproc_warn_flag
2596   else
2597     ac_cpp_err=
2598   fi
2599 else
2600   ac_cpp_err=yes
2601 fi
2602 if test -z "$ac_cpp_err"; then
2603   :
2604 else
2605   echo "$as_me: failed program was:" >&5
2606   cat "conftest.$ac_ext" >&5
2607   # Broken: fails on valid input.
2608 continue
2609 fi
2610 rm -f conftest.err "conftest.$ac_ext"
2611
2612   # OK, works on sane cases.  Now check whether non-existent headers
2613   # can be detected and how.
2614   cat >"conftest.$ac_ext" <<_ACEOF
2615 #line 2615 "configure"
2616 #include "confdefs.h"
2617 #include <ac_nonexistent.h>
2618 _ACEOF
2619 if { (eval echo "$as_me:2619: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2620   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2621   ac_status=$?
2622   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2623   rm -f conftest.er1
2624   cat conftest.err >&5
2625   echo "$as_me:2625: \$? = $ac_status" >&5
2626   (exit "$ac_status"); } >/dev/null; then
2627   if test -s conftest.err; then
2628     ac_cpp_err=$ac_c_preproc_warn_flag
2629   else
2630     ac_cpp_err=
2631   fi
2632 else
2633   ac_cpp_err=yes
2634 fi
2635 if test -z "$ac_cpp_err"; then
2636   # Broken: success on invalid input.
2637 continue
2638 else
2639   echo "$as_me: failed program was:" >&5
2640   cat "conftest.$ac_ext" >&5
2641   # Passes both tests.
2642 ac_preproc_ok=:
2643 break
2644 fi
2645 rm -f conftest.err "conftest.$ac_ext"
2646
2647 done
2648 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2649 rm -f conftest.err "conftest.$ac_ext"
2650 if $ac_preproc_ok; then
2651   break
2652 fi
2653
2654     done
2655     ac_cv_prog_CPP=$CPP
2656
2657 fi
2658   CPP=$ac_cv_prog_CPP
2659 else
2660   ac_cv_prog_CPP=$CPP
2661 fi
2662 echo "$as_me:2662: result: $CPP" >&5
2663 echo "${ECHO_T}$CPP" >&6
2664 ac_preproc_ok=false
2665 for ac_c_preproc_warn_flag in '' yes
2666 do
2667   # Use a header file that comes with gcc, so configuring glibc
2668   # with a fresh cross-compiler works.
2669   # On the NeXT, cc -E runs the code through the compiler's parser,
2670   # not just through cpp. "Syntax error" is here to catch this case.
2671   cat >"conftest.$ac_ext" <<_ACEOF
2672 #line 2672 "configure"
2673 #include "confdefs.h"
2674 #include <assert.h>
2675                      Syntax error
2676 _ACEOF
2677 if { (eval echo "$as_me:2677: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2678   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2679   ac_status=$?
2680   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2681   rm -f conftest.er1
2682   cat conftest.err >&5
2683   echo "$as_me:2683: \$? = $ac_status" >&5
2684   (exit "$ac_status"); } >/dev/null; then
2685   if test -s conftest.err; then
2686     ac_cpp_err=$ac_c_preproc_warn_flag
2687   else
2688     ac_cpp_err=
2689   fi
2690 else
2691   ac_cpp_err=yes
2692 fi
2693 if test -z "$ac_cpp_err"; then
2694   :
2695 else
2696   echo "$as_me: failed program was:" >&5
2697   cat "conftest.$ac_ext" >&5
2698   # Broken: fails on valid input.
2699 continue
2700 fi
2701 rm -f conftest.err "conftest.$ac_ext"
2702
2703   # OK, works on sane cases.  Now check whether non-existent headers
2704   # can be detected and how.
2705   cat >"conftest.$ac_ext" <<_ACEOF
2706 #line 2706 "configure"
2707 #include "confdefs.h"
2708 #include <ac_nonexistent.h>
2709 _ACEOF
2710 if { (eval echo "$as_me:2710: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2711   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2712   ac_status=$?
2713   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2714   rm -f conftest.er1
2715   cat conftest.err >&5
2716   echo "$as_me:2716: \$? = $ac_status" >&5
2717   (exit "$ac_status"); } >/dev/null; then
2718   if test -s conftest.err; then
2719     ac_cpp_err=$ac_c_preproc_warn_flag
2720   else
2721     ac_cpp_err=
2722   fi
2723 else
2724   ac_cpp_err=yes
2725 fi
2726 if test -z "$ac_cpp_err"; then
2727   # Broken: success on invalid input.
2728 continue
2729 else
2730   echo "$as_me: failed program was:" >&5
2731   cat "conftest.$ac_ext" >&5
2732   # Passes both tests.
2733 ac_preproc_ok=:
2734 break
2735 fi
2736 rm -f conftest.err "conftest.$ac_ext"
2737
2738 done
2739 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2740 rm -f conftest.err "conftest.$ac_ext"
2741 if $ac_preproc_ok; then
2742   :
2743 else
2744   { { echo "$as_me:2744: error: C preprocessor \"$CPP\" fails sanity check" >&5
2745 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2746    { (exit 1); exit 1; }; }
2747 fi
2748
2749 ac_ext=c
2750 ac_cpp='$CPP $CPPFLAGS'
2751 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2752 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2753 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2754 ac_main_return="return"
2755
2756 for ac_prog in mawk gawk nawk awk
2757 do
2758   # Extract the first word of "$ac_prog", so it can be a program name with args.
2759 set dummy $ac_prog; ac_word=$2
2760 echo "$as_me:2760: checking for $ac_word" >&5
2761 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2762 if test "${ac_cv_prog_AWK+set}" = set; then
2763   echo $ECHO_N "(cached) $ECHO_C" >&6
2764 else
2765   if test -n "$AWK"; then
2766   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2767 else
2768   ac_save_IFS=$IFS; IFS=$ac_path_separator
2769 ac_dummy="$PATH"
2770 for ac_dir in $ac_dummy; do
2771   IFS=$ac_save_IFS
2772   test -z "$ac_dir" && ac_dir=.
2773   $as_executable_p "$ac_dir/$ac_word" || continue
2774 ac_cv_prog_AWK="$ac_prog"
2775 echo "$as_me:2775: found $ac_dir/$ac_word" >&5
2776 break
2777 done
2778
2779 fi
2780 fi
2781 AWK=$ac_cv_prog_AWK
2782 if test -n "$AWK"; then
2783   echo "$as_me:2783: result: $AWK" >&5
2784 echo "${ECHO_T}$AWK" >&6
2785 else
2786   echo "$as_me:2786: result: no" >&5
2787 echo "${ECHO_T}no" >&6
2788 fi
2789
2790   test -n "$AWK" && break
2791 done
2792
2793 # Find a good install program.  We prefer a C program (faster),
2794 # so one script is as good as another.  But avoid the broken or
2795 # incompatible versions:
2796 # SysV /etc/install, /usr/sbin/install
2797 # SunOS /usr/etc/install
2798 # IRIX /sbin/install
2799 # AIX /bin/install
2800 # AmigaOS /C/install, which installs bootblocks on floppy discs
2801 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2802 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2803 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2804 # ./install, which can be erroneously created by make from ./install.sh.
2805 echo "$as_me:2805: checking for a BSD compatible install" >&5
2806 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2807 if test -z "$INSTALL"; then
2808 if test "${ac_cv_path_install+set}" = set; then
2809   echo $ECHO_N "(cached) $ECHO_C" >&6
2810 else
2811     ac_save_IFS=$IFS; IFS=$ac_path_separator
2812   for ac_dir in $PATH; do
2813     IFS=$ac_save_IFS
2814     # Account for people who put trailing slashes in PATH elements.
2815     case $ac_dir/ in
2816     / | ./ | .// | /cC/* \
2817     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2818     | /usr/ucb/* ) ;;
2819     *)
2820       # OSF1 and SCO ODT 3.0 have their own names for install.
2821       # Don't use installbsd from OSF since it installs stuff as root
2822       # by default.
2823       for ac_prog in ginstall scoinst install; do
2824         if $as_executable_p "$ac_dir/$ac_prog"; then
2825           if test $ac_prog = install &&
2826             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2827             # AIX install.  It has an incompatible calling convention.
2828             :
2829           elif test $ac_prog = install &&
2830             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2831             # program-specific install script used by HP pwplus--don't use.
2832             :
2833           else
2834             ac_cv_path_install="$ac_dir/$ac_prog -c"
2835             break 2
2836           fi
2837         fi
2838       done
2839       ;;
2840     esac
2841   done
2842
2843 fi
2844   if test "${ac_cv_path_install+set}" = set; then
2845     INSTALL=$ac_cv_path_install
2846   else
2847     # As a last resort, use the slow shell script.  We don't cache a
2848     # path for INSTALL within a source directory, because that will
2849     # break other packages using the cache if that directory is
2850     # removed, or if the path is relative.
2851     INSTALL=$ac_install_sh
2852   fi
2853 fi
2854 echo "$as_me:2854: result: $INSTALL" >&5
2855 echo "${ECHO_T}$INSTALL" >&6
2856
2857 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2858 # It thinks the first close brace ends the variable substitution.
2859 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2860
2861 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2862
2863 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2864
2865 case $INSTALL in
2866 (/*)
2867         ;;
2868 (*)
2869         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2870         test -z "$cf_dir" && cf_dir=.
2871         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2872         ;;
2873 esac
2874
2875 echo "$as_me:2875: checking if you want to install stripped executables" >&5
2876 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2877
2878 # Check whether --enable-stripping or --disable-stripping was given.
2879 if test "${enable_stripping+set}" = set; then
2880   enableval="$enable_stripping"
2881   test "$enableval" != no && enableval=yes
2882         if test "$enableval" != "yes" ; then
2883     enable_stripping=no
2884         else
2885                 enable_stripping=yes
2886         fi
2887 else
2888   enableval=yes
2889         enable_stripping=yes
2890
2891 fi;
2892 echo "$as_me:2892: result: $enable_stripping" >&5
2893 echo "${ECHO_T}$enable_stripping" >&6
2894
2895 if test "$enable_stripping" = yes
2896 then
2897         INSTALL_OPT_S="-s"
2898 else
2899         INSTALL_OPT_S=
2900 fi
2901
2902 : "${INSTALL:=install}"
2903 echo "$as_me:2903: checking if install accepts -p option" >&5
2904 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2905 if test "${cf_cv_install_p+set}" = set; then
2906   echo $ECHO_N "(cached) $ECHO_C" >&6
2907 else
2908
2909         rm -rf ./conftest*
2910         date >conftest.in
2911         mkdir conftest.out
2912         sleep 3
2913         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2914         then
2915                 if test -f conftest.out/conftest.in
2916                 then
2917                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2918                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2919                         if test -s conftest.err
2920                         then
2921                                 cf_cv_install_p=no
2922                         else
2923                                 cf_cv_install_p=yes
2924                         fi
2925                 else
2926                         cf_cv_install_p=no
2927                 fi
2928         else
2929                 cf_cv_install_p=no
2930         fi
2931         rm -rf ./conftest*
2932
2933 fi
2934 echo "$as_me:2934: result: $cf_cv_install_p" >&5
2935 echo "${ECHO_T}$cf_cv_install_p" >&6
2936
2937 echo "$as_me:2937: checking if install needs to be told about ownership" >&5
2938 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2939 case `$ac_config_guess` in
2940 (*minix)
2941         with_install_o=yes
2942         ;;
2943 (*)
2944         with_install_o=no
2945         ;;
2946 esac
2947
2948 echo "$as_me:2948: result: $with_install_o" >&5
2949 echo "${ECHO_T}$with_install_o" >&6
2950 if test "x$with_install_o" = xyes
2951 then
2952         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
2953 else
2954         INSTALL_OPT_O=
2955 fi
2956
2957 for ac_prog in lint cppcheck splint
2958 do
2959   # Extract the first word of "$ac_prog", so it can be a program name with args.
2960 set dummy $ac_prog; ac_word=$2
2961 echo "$as_me:2961: checking for $ac_word" >&5
2962 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2963 if test "${ac_cv_prog_LINT+set}" = set; then
2964   echo $ECHO_N "(cached) $ECHO_C" >&6
2965 else
2966   if test -n "$LINT"; then
2967   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2968 else
2969   ac_save_IFS=$IFS; IFS=$ac_path_separator
2970 ac_dummy="$PATH"
2971 for ac_dir in $ac_dummy; do
2972   IFS=$ac_save_IFS
2973   test -z "$ac_dir" && ac_dir=.
2974   $as_executable_p "$ac_dir/$ac_word" || continue
2975 ac_cv_prog_LINT="$ac_prog"
2976 echo "$as_me:2976: found $ac_dir/$ac_word" >&5
2977 break
2978 done
2979
2980 fi
2981 fi
2982 LINT=$ac_cv_prog_LINT
2983 if test -n "$LINT"; then
2984   echo "$as_me:2984: result: $LINT" >&5
2985 echo "${ECHO_T}$LINT" >&6
2986 else
2987   echo "$as_me:2987: result: no" >&5
2988 echo "${ECHO_T}no" >&6
2989 fi
2990
2991   test -n "$LINT" && break
2992 done
2993
2994 case "x$LINT" in
2995 (xcppcheck|x*/cppcheck)
2996         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2997         ;;
2998 esac
2999
3000 echo "$as_me:3000: checking 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 "confdefs.h"
3568 #include "conftest.h"
3569 #include "conftest.i"
3570 #if     GCC_PRINTF
3571 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3572 #else
3573 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3574 #endif
3575 #if     GCC_SCANF
3576 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3577 #else
3578 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3579 #endif
3580 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3581 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3582 extern GCC_NORETURN void foo(void);
3583 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3584 EOF
3585         cf_printf_attribute=no
3586         cf_scanf_attribute=no
3587         for cf_attribute in scanf printf unused noreturn
3588         do
3589
3590 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3591
3592                 cf_directive="__attribute__(($cf_attribute))"
3593                 echo "checking for $CC $cf_directive" 1>&5
3594
3595                 case "$cf_attribute" in
3596                 (printf)
3597                         cf_printf_attribute=yes
3598                         cat >conftest.h <<EOF
3599 #define GCC_$cf_ATTRIBUTE 1
3600 EOF
3601                         ;;
3602                 (scanf)
3603                         cf_scanf_attribute=yes
3604                         cat >conftest.h <<EOF
3605 #define GCC_$cf_ATTRIBUTE 1
3606 EOF
3607                         ;;
3608                 (*)
3609                         cat >conftest.h <<EOF
3610 #define GCC_$cf_ATTRIBUTE $cf_directive
3611 EOF
3612                         ;;
3613                 esac
3614
3615                 if { (eval echo "$as_me:3615: \"$ac_compile\"") >&5
3616   (eval $ac_compile) 2>&5
3617   ac_status=$?
3618   echo "$as_me:3618: \$? = $ac_status" >&5
3619   (exit "$ac_status"); }; then
3620                         test -n "$verbose" && echo "$as_me:3620: result: ... $cf_attribute" >&5
3621 echo "${ECHO_T}... $cf_attribute" >&6
3622                         cat conftest.h >>confdefs.h
3623                         case "$cf_attribute" in
3624                         (noreturn)
3625
3626 cat >>confdefs.h <<EOF
3627 #define GCC_NORETURN $cf_directive
3628 EOF
3629
3630                                 ;;
3631                         (printf)
3632                                 cf_value='/* nothing */'
3633                                 if test "$cf_printf_attribute" != no ; then
3634                                         cf_value='__attribute__((format(printf,fmt,var)))'
3635
3636 cat >>confdefs.h <<\EOF
3637 #define GCC_PRINTF 1
3638 EOF
3639
3640                                 fi
3641
3642 cat >>confdefs.h <<EOF
3643 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3644 EOF
3645
3646                                 ;;
3647                         (scanf)
3648                                 cf_value='/* nothing */'
3649                                 if test "$cf_scanf_attribute" != no ; then
3650                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3651
3652 cat >>confdefs.h <<\EOF
3653 #define GCC_SCANF 1
3654 EOF
3655
3656                                 fi
3657
3658 cat >>confdefs.h <<EOF
3659 #define GCC_SCANFLIKE(fmt,var) $cf_value
3660 EOF
3661
3662                                 ;;
3663                         (unused)
3664
3665 cat >>confdefs.h <<EOF
3666 #define GCC_UNUSED $cf_directive
3667 EOF
3668
3669                                 ;;
3670                         esac
3671                 fi
3672         done
3673 else
3674         ${FGREP-fgrep} define conftest.i >>confdefs.h
3675 fi
3676 rm -rf ./conftest*
3677 fi
3678
3679 echo "$as_me:3679: checking if you want to work around bogus compiler/loader warnings" >&5
3680 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3681
3682 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3683 if test "${enable_string_hacks+set}" = set; then
3684   enableval="$enable_string_hacks"
3685   enable_string_hacks=$enableval
3686 else
3687   enable_string_hacks=no
3688 fi;
3689 echo "$as_me:3689: result: $enable_string_hacks" >&5
3690 echo "${ECHO_T}$enable_string_hacks" >&6
3691
3692 if test "x$enable_string_hacks" = "xyes"; then
3693
3694 cat >>confdefs.h <<\EOF
3695 #define USE_STRING_HACKS 1
3696 EOF
3697
3698         { echo "$as_me:3698: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3699 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3700         echo "$as_me:3700: checking for strlcat" >&5
3701 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3702 if test "${ac_cv_func_strlcat+set}" = set; then
3703   echo $ECHO_N "(cached) $ECHO_C" >&6
3704 else
3705   cat >"conftest.$ac_ext" <<_ACEOF
3706 #line 3706 "configure"
3707 #include "confdefs.h"
3708 #define strlcat autoconf_temporary
3709 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3710 #undef strlcat
3711
3712 #ifdef __cplusplus
3713 extern "C"
3714 #endif
3715
3716 /* We use char because int might match the return type of a gcc2
3717    builtin and then its argument prototype would still apply.  */
3718 char strlcat (void);
3719
3720 int
3721 main (void)
3722 {
3723
3724 /* The GNU C library defines stubs for functions which it implements
3725     to always fail with ENOSYS.  Some functions are actually named
3726     something starting with __ and the normal name is an alias.  */
3727 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3728 #error found stub for strlcat
3729 #endif
3730
3731         return strlcat ();
3732   ;
3733   return 0;
3734 }
3735 _ACEOF
3736 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3737 if { (eval echo "$as_me:3737: \"$ac_link\"") >&5
3738   (eval $ac_link) 2>&5
3739   ac_status=$?
3740   echo "$as_me:3740: \$? = $ac_status" >&5
3741   (exit "$ac_status"); } &&
3742          { ac_try='test -s "conftest$ac_exeext"'
3743   { (eval echo "$as_me:3743: \"$ac_try\"") >&5
3744   (eval $ac_try) 2>&5
3745   ac_status=$?
3746   echo "$as_me:3746: \$? = $ac_status" >&5
3747   (exit "$ac_status"); }; }; then
3748   ac_cv_func_strlcat=yes
3749 else
3750   echo "$as_me: failed program was:" >&5
3751 cat "conftest.$ac_ext" >&5
3752 ac_cv_func_strlcat=no
3753 fi
3754 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3755 fi
3756 echo "$as_me:3756: result: $ac_cv_func_strlcat" >&5
3757 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3758 if test "$ac_cv_func_strlcat" = yes; then
3759
3760 cat >>confdefs.h <<\EOF
3761 #define HAVE_STRLCAT 1
3762 EOF
3763
3764 else
3765
3766                 echo "$as_me:3766: checking for strlcat in -lbsd" >&5
3767 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3768 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3769   echo $ECHO_N "(cached) $ECHO_C" >&6
3770 else
3771   ac_check_lib_save_LIBS=$LIBS
3772 LIBS="-lbsd  $LIBS"
3773 cat >"conftest.$ac_ext" <<_ACEOF
3774 #line 3774 "configure"
3775 #include "confdefs.h"
3776
3777 /* Override any gcc2 internal prototype to avoid an error.  */
3778 #ifdef __cplusplus
3779 extern "C"
3780 #endif
3781 /* We use char because int might match the return type of a gcc2
3782    builtin and then its argument prototype would still apply.  */
3783 char strlcat ();
3784 int
3785 main (void)
3786 {
3787 strlcat ();
3788   ;
3789   return 0;
3790 }
3791 _ACEOF
3792 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3793 if { (eval echo "$as_me:3793: \"$ac_link\"") >&5
3794   (eval $ac_link) 2>&5
3795   ac_status=$?
3796   echo "$as_me:3796: \$? = $ac_status" >&5
3797   (exit "$ac_status"); } &&
3798          { ac_try='test -s "conftest$ac_exeext"'
3799   { (eval echo "$as_me:3799: \"$ac_try\"") >&5
3800   (eval $ac_try) 2>&5
3801   ac_status=$?
3802   echo "$as_me:3802: \$? = $ac_status" >&5
3803   (exit "$ac_status"); }; }; then
3804   ac_cv_lib_bsd_strlcat=yes
3805 else
3806   echo "$as_me: failed program was:" >&5
3807 cat "conftest.$ac_ext" >&5
3808 ac_cv_lib_bsd_strlcat=no
3809 fi
3810 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3811 LIBS=$ac_check_lib_save_LIBS
3812 fi
3813 echo "$as_me:3813: result: $ac_cv_lib_bsd_strlcat" >&5
3814 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3815 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3816
3817 cf_add_libs="$LIBS"
3818 # reverse order
3819 cf_add_0lib=
3820 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3821 # filter duplicates
3822 for cf_add_1lib in $cf_add_0lib; do
3823         for cf_add_2lib in $cf_add_libs; do
3824                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3825                         cf_add_1lib=
3826                         break
3827                 fi
3828         done
3829         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3830 done
3831 LIBS="$cf_add_libs"
3832
3833 for ac_header in bsd/string.h
3834 do
3835 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3836 echo "$as_me:3836: checking for $ac_header" >&5
3837 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3838 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3839   echo $ECHO_N "(cached) $ECHO_C" >&6
3840 else
3841   cat >"conftest.$ac_ext" <<_ACEOF
3842 #line 3842 "configure"
3843 #include "confdefs.h"
3844 #include <$ac_header>
3845 _ACEOF
3846 if { (eval echo "$as_me:3846: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3847   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3848   ac_status=$?
3849   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3850   rm -f conftest.er1
3851   cat conftest.err >&5
3852   echo "$as_me:3852: \$? = $ac_status" >&5
3853   (exit "$ac_status"); } >/dev/null; then
3854   if test -s conftest.err; then
3855     ac_cpp_err=$ac_c_preproc_warn_flag
3856   else
3857     ac_cpp_err=
3858   fi
3859 else
3860   ac_cpp_err=yes
3861 fi
3862 if test -z "$ac_cpp_err"; then
3863   eval "$as_ac_Header=yes"
3864 else
3865   echo "$as_me: failed program was:" >&5
3866   cat "conftest.$ac_ext" >&5
3867   eval "$as_ac_Header=no"
3868 fi
3869 rm -f conftest.err "conftest.$ac_ext"
3870 fi
3871 echo "$as_me:3871: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3872 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3873 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3874   cat >>confdefs.h <<EOF
3875 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3876 EOF
3877
3878 fi
3879 done
3880
3881 cat >>confdefs.h <<\EOF
3882 #define HAVE_STRLCAT 1
3883 EOF
3884
3885 fi
3886
3887 fi
3888
3889 for ac_func in strlcpy snprintf
3890 do
3891 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3892 echo "$as_me:3892: checking for $ac_func" >&5
3893 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3894 if eval "test \"\${$as_ac_var+set}\" = set"; then
3895   echo $ECHO_N "(cached) $ECHO_C" >&6
3896 else
3897   cat >"conftest.$ac_ext" <<_ACEOF
3898 #line 3898 "configure"
3899 #include "confdefs.h"
3900 #define $ac_func autoconf_temporary
3901 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3902 #undef $ac_func
3903
3904 #ifdef __cplusplus
3905 extern "C"
3906 #endif
3907
3908 /* We use char because int might match the return type of a gcc2
3909    builtin and then its argument prototype would still apply.  */
3910 char $ac_func (void);
3911
3912 int
3913 main (void)
3914 {
3915
3916 /* The GNU C library defines stubs for functions which it implements
3917     to always fail with ENOSYS.  Some functions are actually named
3918     something starting with __ and the normal name is an alias.  */
3919 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3920 #error found stub for $ac_func
3921 #endif
3922
3923         return $ac_func ();
3924   ;
3925   return 0;
3926 }
3927 _ACEOF
3928 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3929 if { (eval echo "$as_me:3929: \"$ac_link\"") >&5
3930   (eval $ac_link) 2>&5
3931   ac_status=$?
3932   echo "$as_me:3932: \$? = $ac_status" >&5
3933   (exit "$ac_status"); } &&
3934          { ac_try='test -s "conftest$ac_exeext"'
3935   { (eval echo "$as_me:3935: \"$ac_try\"") >&5
3936   (eval $ac_try) 2>&5
3937   ac_status=$?
3938   echo "$as_me:3938: \$? = $ac_status" >&5
3939   (exit "$ac_status"); }; }; then
3940   eval "$as_ac_var=yes"
3941 else
3942   echo "$as_me: failed program was:" >&5
3943 cat "conftest.$ac_ext" >&5
3944 eval "$as_ac_var=no"
3945 fi
3946 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3947 fi
3948 echo "$as_me:3948: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3949 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3950 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3951   cat >>confdefs.h <<EOF
3952 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3953 EOF
3954
3955 fi
3956 done
3957
3958 fi
3959
3960 echo "$as_me:3960: checking if the POSIX test-macros are already defined" >&5
3961 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3962 if test "${cf_cv_posix_visible+set}" = set; then
3963   echo $ECHO_N "(cached) $ECHO_C" >&6
3964 else
3965
3966 cat >"conftest.$ac_ext" <<_ACEOF
3967 #line 3967 "configure"
3968 #include "confdefs.h"
3969 #include <stdio.h>
3970 int
3971 main (void)
3972 {
3973
3974 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3975         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3976         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3977         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3978 #error conflicting symbols found
3979 #endif
3980
3981   ;
3982   return 0;
3983 }
3984 _ACEOF
3985 rm -f "conftest.$ac_objext"
3986 if { (eval echo "$as_me:3986: \"$ac_compile\"") >&5
3987   (eval $ac_compile) 2>&5
3988   ac_status=$?
3989   echo "$as_me:3989: \$? = $ac_status" >&5
3990   (exit "$ac_status"); } &&
3991          { ac_try='test -s "conftest.$ac_objext"'
3992   { (eval echo "$as_me:3992: \"$ac_try\"") >&5
3993   (eval $ac_try) 2>&5
3994   ac_status=$?
3995   echo "$as_me:3995: \$? = $ac_status" >&5
3996   (exit "$ac_status"); }; }; then
3997   cf_cv_posix_visible=no
3998 else
3999   echo "$as_me: failed program was:" >&5
4000 cat "conftest.$ac_ext" >&5
4001 cf_cv_posix_visible=yes
4002 fi
4003 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4004
4005 fi
4006 echo "$as_me:4006: result: $cf_cv_posix_visible" >&5
4007 echo "${ECHO_T}$cf_cv_posix_visible" >&6
4008
4009 if test "$cf_cv_posix_visible" = no; then
4010
4011 cf_XOPEN_SOURCE=600
4012 cf_POSIX_C_SOURCE=199506L
4013 cf_xopen_source=
4014
4015 case "$host_os" in
4016 (aix[4-7]*)
4017         cf_xopen_source="-D_ALL_SOURCE"
4018         ;;
4019 (msys)
4020         cf_XOPEN_SOURCE=600
4021         ;;
4022 (darwin[0-8].*)
4023         cf_xopen_source="-D_APPLE_C_SOURCE"
4024         ;;
4025 (darwin*)
4026         cf_xopen_source="-D_DARWIN_C_SOURCE"
4027         cf_XOPEN_SOURCE=
4028         ;;
4029 (freebsd*|dragonfly*|midnightbsd*)
4030         # 5.x headers associate
4031         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
4032         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
4033         cf_POSIX_C_SOURCE=200112L
4034         cf_XOPEN_SOURCE=600
4035         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4036         ;;
4037 (hpux11*)
4038         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
4039         ;;
4040 (hpux*)
4041         cf_xopen_source="-D_HPUX_SOURCE"
4042         ;;
4043 (irix[56].*)
4044         cf_xopen_source="-D_SGI_SOURCE"
4045         cf_XOPEN_SOURCE=
4046         ;;
4047 (linux*gnu|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
4048
4049 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
4050
4051 echo "$as_me:4051: checking if this is the GNU C library" >&5
4052 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
4053 if test "${cf_cv_gnu_library+set}" = set; then
4054   echo $ECHO_N "(cached) $ECHO_C" >&6
4055 else
4056
4057 cat >"conftest.$ac_ext" <<_ACEOF
4058 #line 4058 "configure"
4059 #include "confdefs.h"
4060 #include <sys/types.h>
4061 int
4062 main (void)
4063 {
4064
4065         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
4066                 return 0;
4067         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
4068                 return 0;
4069         #else
4070         #       error not GNU C library
4071         #endif
4072   ;
4073   return 0;
4074 }
4075 _ACEOF
4076 rm -f "conftest.$ac_objext"
4077 if { (eval echo "$as_me:4077: \"$ac_compile\"") >&5
4078   (eval $ac_compile) 2>&5
4079   ac_status=$?
4080   echo "$as_me:4080: \$? = $ac_status" >&5
4081   (exit "$ac_status"); } &&
4082          { ac_try='test -s "conftest.$ac_objext"'
4083   { (eval echo "$as_me:4083: \"$ac_try\"") >&5
4084   (eval $ac_try) 2>&5
4085   ac_status=$?
4086   echo "$as_me:4086: \$? = $ac_status" >&5
4087   (exit "$ac_status"); }; }; then
4088   cf_cv_gnu_library=yes
4089 else
4090   echo "$as_me: failed program was:" >&5
4091 cat "conftest.$ac_ext" >&5
4092 cf_cv_gnu_library=no
4093 fi
4094 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4095
4096 fi
4097 echo "$as_me:4097: result: $cf_cv_gnu_library" >&5
4098 echo "${ECHO_T}$cf_cv_gnu_library" >&6
4099
4100 if test x$cf_cv_gnu_library = xyes; then
4101
4102         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
4103         # was changed to help a little.  newlib incorporated the change about 4
4104         # years later.
4105         echo "$as_me:4105: checking if _DEFAULT_SOURCE can be used as a basis" >&5
4106 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
4107 if test "${cf_cv_gnu_library_219+set}" = set; then
4108   echo $ECHO_N "(cached) $ECHO_C" >&6
4109 else
4110
4111                 cf_save="$CPPFLAGS"
4112
4113         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4114         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4115
4116                 cat >"conftest.$ac_ext" <<_ACEOF
4117 #line 4117 "configure"
4118 #include "confdefs.h"
4119 #include <sys/types.h>
4120 int
4121 main (void)
4122 {
4123
4124                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
4125                                 return 0;
4126                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4127                                 return 0;
4128                         #else
4129                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4130                         #endif
4131   ;
4132   return 0;
4133 }
4134 _ACEOF
4135 rm -f "conftest.$ac_objext"
4136 if { (eval echo "$as_me:4136: \"$ac_compile\"") >&5
4137   (eval $ac_compile) 2>&5
4138   ac_status=$?
4139   echo "$as_me:4139: \$? = $ac_status" >&5
4140   (exit "$ac_status"); } &&
4141          { ac_try='test -s "conftest.$ac_objext"'
4142   { (eval echo "$as_me:4142: \"$ac_try\"") >&5
4143   (eval $ac_try) 2>&5
4144   ac_status=$?
4145   echo "$as_me:4145: \$? = $ac_status" >&5
4146   (exit "$ac_status"); }; }; then
4147   cf_cv_gnu_library_219=yes
4148 else
4149   echo "$as_me: failed program was:" >&5
4150 cat "conftest.$ac_ext" >&5
4151 cf_cv_gnu_library_219=no
4152 fi
4153 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4154                 CPPFLAGS="$cf_save"
4155
4156 fi
4157 echo "$as_me:4157: result: $cf_cv_gnu_library_219" >&5
4158 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4159
4160         if test "x$cf_cv_gnu_library_219" = xyes; then
4161                 cf_save="$CPPFLAGS"
4162                 echo "$as_me:4162: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4163 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4164 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4165   echo $ECHO_N "(cached) $ECHO_C" >&6
4166 else
4167
4168 cf_fix_cppflags=no
4169 cf_new_cflags=
4170 cf_new_cppflags=
4171 cf_new_extra_cppflags=
4172
4173 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4174 do
4175 case "$cf_fix_cppflags" in
4176 (no)
4177         case "$cf_add_cflags" in
4178         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4179                 case "$cf_add_cflags" in
4180                 (-D*)
4181                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4182
4183                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4184                                 && test -z "${cf_tst_cflags}" \
4185                                 && cf_fix_cppflags=yes
4186
4187                         if test "$cf_fix_cppflags" = yes ; then
4188
4189         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4190         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4191
4192                                 continue
4193                         elif test "${cf_tst_cflags}" = "\"'" ; then
4194
4195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4197
4198                                 continue
4199                         fi
4200                         ;;
4201                 esac
4202                 case "$CPPFLAGS" in
4203                 (*$cf_add_cflags)
4204                         ;;
4205                 (*)
4206                         case "$cf_add_cflags" in
4207                         (-D*)
4208                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4209
4210 CPPFLAGS=`echo "$CPPFLAGS" | \
4211         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4212                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4213
4214                                 ;;
4215                         esac
4216
4217         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4218         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4219
4220                         ;;
4221                 esac
4222                 ;;
4223         (*)
4224
4225         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4226         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4227
4228                 ;;
4229         esac
4230         ;;
4231 (yes)
4232
4233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4235
4236         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4237
4238         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4239                 && test -z "${cf_tst_cflags}" \
4240                 && cf_fix_cppflags=no
4241         ;;
4242 esac
4243 done
4244
4245 if test -n "$cf_new_cflags" ; then
4246
4247         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4248         CFLAGS="${CFLAGS}$cf_new_cflags"
4249
4250 fi
4251
4252 if test -n "$cf_new_cppflags" ; then
4253
4254         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4255         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4256
4257 fi
4258
4259 if test -n "$cf_new_extra_cppflags" ; then
4260
4261         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4262         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4263
4264 fi
4265
4266                         cat >"conftest.$ac_ext" <<_ACEOF
4267 #line 4267 "configure"
4268 #include "confdefs.h"
4269
4270                                 #include <limits.h>
4271                                 #include <sys/types.h>
4272
4273 int
4274 main (void)
4275 {
4276
4277                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4278                                         return 0;
4279                                 #else
4280                                 #       error GNU C library is too old
4281                                 #endif
4282   ;
4283   return 0;
4284 }
4285 _ACEOF
4286 rm -f "conftest.$ac_objext"
4287 if { (eval echo "$as_me:4287: \"$ac_compile\"") >&5
4288   (eval $ac_compile) 2>&5
4289   ac_status=$?
4290   echo "$as_me:4290: \$? = $ac_status" >&5
4291   (exit "$ac_status"); } &&
4292          { ac_try='test -s "conftest.$ac_objext"'
4293   { (eval echo "$as_me:4293: \"$ac_try\"") >&5
4294   (eval $ac_try) 2>&5
4295   ac_status=$?
4296   echo "$as_me:4296: \$? = $ac_status" >&5
4297   (exit "$ac_status"); }; }; then
4298   cf_cv_gnu_dftsrc_219=yes
4299 else
4300   echo "$as_me: failed program was:" >&5
4301 cat "conftest.$ac_ext" >&5
4302 cf_cv_gnu_dftsrc_219=no
4303 fi
4304 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4305
4306 fi
4307 echo "$as_me:4307: result: $cf_cv_gnu_dftsrc_219" >&5
4308 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4309                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4310         else
4311                 cf_cv_gnu_dftsrc_219=maybe
4312         fi
4313
4314         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4315
4316                 echo "$as_me:4316: checking if we must define _GNU_SOURCE" >&5
4317 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4318 if test "${cf_cv_gnu_source+set}" = set; then
4319   echo $ECHO_N "(cached) $ECHO_C" >&6
4320 else
4321
4322                 cat >"conftest.$ac_ext" <<_ACEOF
4323 #line 4323 "configure"
4324 #include "confdefs.h"
4325 #include <sys/types.h>
4326 int
4327 main (void)
4328 {
4329
4330                         #ifndef _XOPEN_SOURCE
4331                         #error  expected _XOPEN_SOURCE to be defined
4332                         #endif
4333   ;
4334   return 0;
4335 }
4336 _ACEOF
4337 rm -f "conftest.$ac_objext"
4338 if { (eval echo "$as_me:4338: \"$ac_compile\"") >&5
4339   (eval $ac_compile) 2>&5
4340   ac_status=$?
4341   echo "$as_me:4341: \$? = $ac_status" >&5
4342   (exit "$ac_status"); } &&
4343          { ac_try='test -s "conftest.$ac_objext"'
4344   { (eval echo "$as_me:4344: \"$ac_try\"") >&5
4345   (eval $ac_try) 2>&5
4346   ac_status=$?
4347   echo "$as_me:4347: \$? = $ac_status" >&5
4348   (exit "$ac_status"); }; }; then
4349   cf_cv_gnu_source=no
4350 else
4351   echo "$as_me: failed program was:" >&5
4352 cat "conftest.$ac_ext" >&5
4353 cf_save="$CPPFLAGS"
4354
4355 cf_fix_cppflags=no
4356 cf_new_cflags=
4357 cf_new_cppflags=
4358 cf_new_extra_cppflags=
4359
4360 for cf_add_cflags in -D_GNU_SOURCE
4361 do
4362 case "$cf_fix_cppflags" in
4363 (no)
4364         case "$cf_add_cflags" in
4365         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4366                 case "$cf_add_cflags" in
4367                 (-D*)
4368                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4369
4370                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4371                                 && test -z "${cf_tst_cflags}" \
4372                                 && cf_fix_cppflags=yes
4373
4374                         if test "$cf_fix_cppflags" = yes ; then
4375
4376         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4377         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4378
4379                                 continue
4380                         elif test "${cf_tst_cflags}" = "\"'" ; then
4381
4382         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4383         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4384
4385                                 continue
4386                         fi
4387                         ;;
4388                 esac
4389                 case "$CPPFLAGS" in
4390                 (*$cf_add_cflags)
4391                         ;;
4392                 (*)
4393                         case "$cf_add_cflags" in
4394                         (-D*)
4395                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4396
4397 CPPFLAGS=`echo "$CPPFLAGS" | \
4398         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4399                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4400
4401                                 ;;
4402                         esac
4403
4404         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4405         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4406
4407                         ;;
4408                 esac
4409                 ;;
4410         (*)
4411
4412         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4413         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4414
4415                 ;;
4416         esac
4417         ;;
4418 (yes)
4419
4420         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4421         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4422
4423         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4424
4425         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4426                 && test -z "${cf_tst_cflags}" \
4427                 && cf_fix_cppflags=no
4428         ;;
4429 esac
4430 done
4431
4432 if test -n "$cf_new_cflags" ; then
4433
4434         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4435         CFLAGS="${CFLAGS}$cf_new_cflags"
4436
4437 fi
4438
4439 if test -n "$cf_new_cppflags" ; then
4440
4441         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4442         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4443
4444 fi
4445
4446 if test -n "$cf_new_extra_cppflags" ; then
4447
4448         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4449         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4450
4451 fi
4452
4453                          cat >"conftest.$ac_ext" <<_ACEOF
4454 #line 4454 "configure"
4455 #include "confdefs.h"
4456 #include <sys/types.h>
4457 int
4458 main (void)
4459 {
4460
4461                                 #ifdef _XOPEN_SOURCE
4462                                 #error  expected _XOPEN_SOURCE to be undefined
4463                                 #endif
4464   ;
4465   return 0;
4466 }
4467 _ACEOF
4468 rm -f "conftest.$ac_objext"
4469 if { (eval echo "$as_me:4469: \"$ac_compile\"") >&5
4470   (eval $ac_compile) 2>&5
4471   ac_status=$?
4472   echo "$as_me:4472: \$? = $ac_status" >&5
4473   (exit "$ac_status"); } &&
4474          { ac_try='test -s "conftest.$ac_objext"'
4475   { (eval echo "$as_me:4475: \"$ac_try\"") >&5
4476   (eval $ac_try) 2>&5
4477   ac_status=$?
4478   echo "$as_me:4478: \$? = $ac_status" >&5
4479   (exit "$ac_status"); }; }; then
4480   cf_cv_gnu_source=no
4481 else
4482   echo "$as_me: failed program was:" >&5
4483 cat "conftest.$ac_ext" >&5
4484 cf_cv_gnu_source=yes
4485 fi
4486 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4487                         CPPFLAGS="$cf_save"
4488
4489 fi
4490 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4491
4492 fi
4493 echo "$as_me:4493: result: $cf_cv_gnu_source" >&5
4494 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4495
4496                 if test "$cf_cv_gnu_source" = yes
4497                 then
4498                 echo "$as_me:4498: checking if we should also define _DEFAULT_SOURCE" >&5
4499 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4500 if test "${cf_cv_default_source+set}" = set; then
4501   echo $ECHO_N "(cached) $ECHO_C" >&6
4502 else
4503
4504         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4505         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4506
4507                         cat >"conftest.$ac_ext" <<_ACEOF
4508 #line 4508 "configure"
4509 #include "confdefs.h"
4510 #include <sys/types.h>
4511 int
4512 main (void)
4513 {
4514
4515                                 #ifdef _DEFAULT_SOURCE
4516                                 #error  expected _DEFAULT_SOURCE to be undefined
4517                                 #endif
4518   ;
4519   return 0;
4520 }
4521 _ACEOF
4522 rm -f "conftest.$ac_objext"
4523 if { (eval echo "$as_me:4523: \"$ac_compile\"") >&5
4524   (eval $ac_compile) 2>&5
4525   ac_status=$?
4526   echo "$as_me:4526: \$? = $ac_status" >&5
4527   (exit "$ac_status"); } &&
4528          { ac_try='test -s "conftest.$ac_objext"'
4529   { (eval echo "$as_me:4529: \"$ac_try\"") >&5
4530   (eval $ac_try) 2>&5
4531   ac_status=$?
4532   echo "$as_me:4532: \$? = $ac_status" >&5
4533   (exit "$ac_status"); }; }; then
4534   cf_cv_default_source=no
4535 else
4536   echo "$as_me: failed program was:" >&5
4537 cat "conftest.$ac_ext" >&5
4538 cf_cv_default_source=yes
4539 fi
4540 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4541
4542 fi
4543 echo "$as_me:4543: result: $cf_cv_default_source" >&5
4544 echo "${ECHO_T}$cf_cv_default_source" >&6
4545                         if test "$cf_cv_default_source" = yes
4546                         then
4547
4548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4549         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4550
4551                         fi
4552                 fi
4553         fi
4554
4555 fi
4556
4557         ;;
4558 (minix*)
4559         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4560         ;;
4561 (mirbsd*)
4562         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4563         cf_XOPEN_SOURCE=
4564
4565 if test "$cf_cv_posix_visible" = no; then
4566
4567 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4568
4569 cf_save_CFLAGS="$CFLAGS"
4570 cf_save_CPPFLAGS="$CPPFLAGS"
4571
4572 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4573         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4574                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4575
4576 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4577         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4578                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4579
4580 echo "$as_me:4580: checking if we should define _POSIX_C_SOURCE" >&5
4581 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4582 if test "${cf_cv_posix_c_source+set}" = set; then
4583   echo $ECHO_N "(cached) $ECHO_C" >&6
4584 else
4585
4586 echo "${as_me:-configure}:4586: testing if the symbol is already defined go no further ..." 1>&5
4587
4588         cat >"conftest.$ac_ext" <<_ACEOF
4589 #line 4589 "configure"
4590 #include "confdefs.h"
4591 #include <sys/types.h>
4592 int
4593 main (void)
4594 {
4595
4596 #ifndef _POSIX_C_SOURCE
4597 make an error
4598 #endif
4599   ;
4600   return 0;
4601 }
4602 _ACEOF
4603 rm -f "conftest.$ac_objext"
4604 if { (eval echo "$as_me:4604: \"$ac_compile\"") >&5
4605   (eval $ac_compile) 2>&5
4606   ac_status=$?
4607   echo "$as_me:4607: \$? = $ac_status" >&5
4608   (exit "$ac_status"); } &&
4609          { ac_try='test -s "conftest.$ac_objext"'
4610   { (eval echo "$as_me:4610: \"$ac_try\"") >&5
4611   (eval $ac_try) 2>&5
4612   ac_status=$?
4613   echo "$as_me:4613: \$? = $ac_status" >&5
4614   (exit "$ac_status"); }; }; then
4615   cf_cv_posix_c_source=no
4616 else
4617   echo "$as_me: failed program was:" >&5
4618 cat "conftest.$ac_ext" >&5
4619 cf_want_posix_source=no
4620          case .$cf_POSIX_C_SOURCE in
4621          (.[12]??*)
4622                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4623                 ;;
4624          (.2)
4625                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4626                 cf_want_posix_source=yes
4627                 ;;
4628          (.*)
4629                 cf_want_posix_source=yes
4630                 ;;
4631          esac
4632          if test "$cf_want_posix_source" = yes ; then
4633                 cat >"conftest.$ac_ext" <<_ACEOF
4634 #line 4634 "configure"
4635 #include "confdefs.h"
4636 #include <sys/types.h>
4637 int
4638 main (void)
4639 {
4640
4641 #ifdef _POSIX_SOURCE
4642 make an error
4643 #endif
4644   ;
4645   return 0;
4646 }
4647 _ACEOF
4648 rm -f "conftest.$ac_objext"
4649 if { (eval echo "$as_me:4649: \"$ac_compile\"") >&5
4650   (eval $ac_compile) 2>&5
4651   ac_status=$?
4652   echo "$as_me:4652: \$? = $ac_status" >&5
4653   (exit "$ac_status"); } &&
4654          { ac_try='test -s "conftest.$ac_objext"'
4655   { (eval echo "$as_me:4655: \"$ac_try\"") >&5
4656   (eval $ac_try) 2>&5
4657   ac_status=$?
4658   echo "$as_me:4658: \$? = $ac_status" >&5
4659   (exit "$ac_status"); }; }; then
4660   :
4661 else
4662   echo "$as_me: failed program was:" >&5
4663 cat "conftest.$ac_ext" >&5
4664 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4665 fi
4666 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4667          fi
4668
4669 echo "${as_me:-configure}:4669: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4670
4671          CFLAGS="$cf_trim_CFLAGS"
4672          CPPFLAGS="$cf_trim_CPPFLAGS"
4673
4674         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4675         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4676
4677 echo "${as_me:-configure}:4677: testing if the second compile does not leave our definition intact error ..." 1>&5
4678
4679          cat >"conftest.$ac_ext" <<_ACEOF
4680 #line 4680 "configure"
4681 #include "confdefs.h"
4682 #include <sys/types.h>
4683 int
4684 main (void)
4685 {
4686
4687 #ifndef _POSIX_C_SOURCE
4688 make an error
4689 #endif
4690   ;
4691   return 0;
4692 }
4693 _ACEOF
4694 rm -f "conftest.$ac_objext"
4695 if { (eval echo "$as_me:4695: \"$ac_compile\"") >&5
4696   (eval $ac_compile) 2>&5
4697   ac_status=$?
4698   echo "$as_me:4698: \$? = $ac_status" >&5
4699   (exit "$ac_status"); } &&
4700          { ac_try='test -s "conftest.$ac_objext"'
4701   { (eval echo "$as_me:4701: \"$ac_try\"") >&5
4702   (eval $ac_try) 2>&5
4703   ac_status=$?
4704   echo "$as_me:4704: \$? = $ac_status" >&5
4705   (exit "$ac_status"); }; }; then
4706   :
4707 else
4708   echo "$as_me: failed program was:" >&5
4709 cat "conftest.$ac_ext" >&5
4710 cf_cv_posix_c_source=no
4711 fi
4712 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4713          CFLAGS="$cf_save_CFLAGS"
4714          CPPFLAGS="$cf_save_CPPFLAGS"
4715
4716 fi
4717 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4718
4719 fi
4720 echo "$as_me:4720: result: $cf_cv_posix_c_source" >&5
4721 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4722
4723 if test "$cf_cv_posix_c_source" != no ; then
4724         CFLAGS="$cf_trim_CFLAGS"
4725         CPPFLAGS="$cf_trim_CPPFLAGS"
4726
4727 cf_fix_cppflags=no
4728 cf_new_cflags=
4729 cf_new_cppflags=
4730 cf_new_extra_cppflags=
4731
4732 for cf_add_cflags in $cf_cv_posix_c_source
4733 do
4734 case "$cf_fix_cppflags" in
4735 (no)
4736         case "$cf_add_cflags" in
4737         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4738                 case "$cf_add_cflags" in
4739                 (-D*)
4740                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4741
4742                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4743                                 && test -z "${cf_tst_cflags}" \
4744                                 && cf_fix_cppflags=yes
4745
4746                         if test "$cf_fix_cppflags" = yes ; then
4747
4748         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4749         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4750
4751                                 continue
4752                         elif test "${cf_tst_cflags}" = "\"'" ; then
4753
4754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4756
4757                                 continue
4758                         fi
4759                         ;;
4760                 esac
4761                 case "$CPPFLAGS" in
4762                 (*$cf_add_cflags)
4763                         ;;
4764                 (*)
4765                         case "$cf_add_cflags" in
4766                         (-D*)
4767                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4768
4769 CPPFLAGS=`echo "$CPPFLAGS" | \
4770         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4771                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4772
4773                                 ;;
4774                         esac
4775
4776         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4777         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4778
4779                         ;;
4780                 esac
4781                 ;;
4782         (*)
4783
4784         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4785         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4786
4787                 ;;
4788         esac
4789         ;;
4790 (yes)
4791
4792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4794
4795         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4796
4797         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4798                 && test -z "${cf_tst_cflags}" \
4799                 && cf_fix_cppflags=no
4800         ;;
4801 esac
4802 done
4803
4804 if test -n "$cf_new_cflags" ; then
4805
4806         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4807         CFLAGS="${CFLAGS}$cf_new_cflags"
4808
4809 fi
4810
4811 if test -n "$cf_new_cppflags" ; then
4812
4813         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4814         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4815
4816 fi
4817
4818 if test -n "$cf_new_extra_cppflags" ; then
4819
4820         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4821         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4822
4823 fi
4824
4825 fi
4826
4827 fi # cf_cv_posix_visible
4828
4829         ;;
4830 (netbsd*)
4831         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4832         ;;
4833 (openbsd[6-9]*)
4834         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
4835         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
4836         # Abusing the conformance level is a workaround.
4837         { echo "$as_me:4837: WARNING: this system does not provide usable locale support" >&5
4838 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
4839         cf_xopen_source="-D_BSD_SOURCE"
4840         cf_XOPEN_SOURCE=700
4841         ;;
4842 (openbsd[4-5]*)
4843         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4844         cf_xopen_source="-D_BSD_SOURCE"
4845         cf_XOPEN_SOURCE=600
4846         ;;
4847 (openbsd*)
4848         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4849         ;;
4850 (osf[45]*)
4851         cf_xopen_source="-D_OSF_SOURCE"
4852         ;;
4853 (nto-qnx*)
4854         cf_xopen_source="-D_QNX_SOURCE"
4855         ;;
4856 (sco*)
4857         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4858         ;;
4859 (solaris2.*)
4860         cf_xopen_source="-D__EXTENSIONS__"
4861         cf_cv_xopen_source=broken
4862         ;;
4863 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4864         cf_XOPEN_SOURCE=
4865         cf_POSIX_C_SOURCE=
4866         ;;
4867 (*)
4868
4869 echo "$as_me:4869: checking if we should define _XOPEN_SOURCE" >&5
4870 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4871 if test "${cf_cv_xopen_source+set}" = set; then
4872   echo $ECHO_N "(cached) $ECHO_C" >&6
4873 else
4874
4875         cat >"conftest.$ac_ext" <<_ACEOF
4876 #line 4876 "configure"
4877 #include "confdefs.h"
4878
4879 #include <stdlib.h>
4880 #include <string.h>
4881 #include <sys/types.h>
4882
4883 int
4884 main (void)
4885 {
4886
4887 #ifndef _XOPEN_SOURCE
4888 make an error
4889 #endif
4890
4891   ;
4892   return 0;
4893 }
4894 _ACEOF
4895 rm -f "conftest.$ac_objext"
4896 if { (eval echo "$as_me:4896: \"$ac_compile\"") >&5
4897   (eval $ac_compile) 2>&5
4898   ac_status=$?
4899   echo "$as_me:4899: \$? = $ac_status" >&5
4900   (exit "$ac_status"); } &&
4901          { ac_try='test -s "conftest.$ac_objext"'
4902   { (eval echo "$as_me:4902: \"$ac_try\"") >&5
4903   (eval $ac_try) 2>&5
4904   ac_status=$?
4905   echo "$as_me:4905: \$? = $ac_status" >&5
4906   (exit "$ac_status"); }; }; then
4907   cf_cv_xopen_source=no
4908 else
4909   echo "$as_me: failed program was:" >&5
4910 cat "conftest.$ac_ext" >&5
4911 cf_save="$CPPFLAGS"
4912
4913         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4914         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4915
4916          cat >"conftest.$ac_ext" <<_ACEOF
4917 #line 4917 "configure"
4918 #include "confdefs.h"
4919
4920 #include <stdlib.h>
4921 #include <string.h>
4922 #include <sys/types.h>
4923
4924 int
4925 main (void)
4926 {
4927
4928 #ifndef _XOPEN_SOURCE
4929 make an error
4930 #endif
4931
4932   ;
4933   return 0;
4934 }
4935 _ACEOF
4936 rm -f "conftest.$ac_objext"
4937 if { (eval echo "$as_me:4937: \"$ac_compile\"") >&5
4938   (eval $ac_compile) 2>&5
4939   ac_status=$?
4940   echo "$as_me:4940: \$? = $ac_status" >&5
4941   (exit "$ac_status"); } &&
4942          { ac_try='test -s "conftest.$ac_objext"'
4943   { (eval echo "$as_me:4943: \"$ac_try\"") >&5
4944   (eval $ac_try) 2>&5
4945   ac_status=$?
4946   echo "$as_me:4946: \$? = $ac_status" >&5
4947   (exit "$ac_status"); }; }; then
4948   cf_cv_xopen_source=no
4949 else
4950   echo "$as_me: failed program was:" >&5
4951 cat "conftest.$ac_ext" >&5
4952 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4953 fi
4954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4955                 CPPFLAGS="$cf_save"
4956
4957 fi
4958 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4959
4960 fi
4961 echo "$as_me:4961: result: $cf_cv_xopen_source" >&5
4962 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4963
4964 if test "$cf_cv_xopen_source" != no ; then
4965
4966 CFLAGS=`echo "$CFLAGS" | \
4967         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4968                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4969
4970 CPPFLAGS=`echo "$CPPFLAGS" | \
4971         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4972                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4973
4974         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4975
4976 for cf_add_cflags in $cf_temp_xopen_source
4977 do
4978         case "x$cf_add_cflags" in
4979         (x-[DU]*)
4980
4981 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4982 while true
4983 do
4984         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'`
4985         test "$CFLAGS" != "$cf_old_cflag" || break
4986
4987         CFLAGS="$cf_old_cflag"
4988 done
4989
4990 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4991 while true
4992 do
4993         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'`
4994         test "$CPPFLAGS" != "$cf_old_cflag" || break
4995
4996         CPPFLAGS="$cf_old_cflag"
4997 done
4998
4999                 ;;
5000         esac
5001
5002 cf_fix_cppflags=no
5003 cf_new_cflags=
5004 cf_new_cppflags=
5005 cf_new_extra_cppflags=
5006
5007 for cf_add_cflags in $cf_add_cflags
5008 do
5009 case "$cf_fix_cppflags" in
5010 (no)
5011         case "$cf_add_cflags" in
5012         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5013                 case "$cf_add_cflags" in
5014                 (-D*)
5015                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5016
5017                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5018                                 && test -z "${cf_tst_cflags}" \
5019                                 && cf_fix_cppflags=yes
5020
5021                         if test "$cf_fix_cppflags" = yes ; then
5022
5023         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5024         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5025
5026                                 continue
5027                         elif test "${cf_tst_cflags}" = "\"'" ; then
5028
5029         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5030         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5031
5032                                 continue
5033                         fi
5034                         ;;
5035                 esac
5036                 case "$CPPFLAGS" in
5037                 (*$cf_add_cflags)
5038                         ;;
5039                 (*)
5040                         case "$cf_add_cflags" in
5041                         (-D*)
5042                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5043
5044 CPPFLAGS=`echo "$CPPFLAGS" | \
5045         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5046                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5047
5048                                 ;;
5049                         esac
5050
5051         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5052         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5053
5054                         ;;
5055                 esac
5056                 ;;
5057         (*)
5058
5059         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5060         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5061
5062                 ;;
5063         esac
5064         ;;
5065 (yes)
5066
5067         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5068         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5069
5070         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5071
5072         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5073                 && test -z "${cf_tst_cflags}" \
5074                 && cf_fix_cppflags=no
5075         ;;
5076 esac
5077 done
5078
5079 if test -n "$cf_new_cflags" ; then
5080
5081         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5082         CFLAGS="${CFLAGS}$cf_new_cflags"
5083
5084 fi
5085
5086 if test -n "$cf_new_cppflags" ; then
5087
5088         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5089         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5090
5091 fi
5092
5093 if test -n "$cf_new_extra_cppflags" ; then
5094
5095         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5096         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5097
5098 fi
5099
5100 done
5101
5102 fi
5103
5104         cf_save_xopen_cppflags="$CPPFLAGS"
5105
5106 if test "$cf_cv_posix_visible" = no; then
5107
5108 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
5109
5110 cf_save_CFLAGS="$CFLAGS"
5111 cf_save_CPPFLAGS="$CPPFLAGS"
5112
5113 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
5114         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5115                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5116
5117 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
5118         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5119                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5120
5121 echo "$as_me:5121: checking if we should define _POSIX_C_SOURCE" >&5
5122 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
5123 if test "${cf_cv_posix_c_source+set}" = set; then
5124   echo $ECHO_N "(cached) $ECHO_C" >&6
5125 else
5126
5127 echo "${as_me:-configure}:5127: testing if the symbol is already defined go no further ..." 1>&5
5128
5129         cat >"conftest.$ac_ext" <<_ACEOF
5130 #line 5130 "configure"
5131 #include "confdefs.h"
5132 #include <sys/types.h>
5133 int
5134 main (void)
5135 {
5136
5137 #ifndef _POSIX_C_SOURCE
5138 make an error
5139 #endif
5140   ;
5141   return 0;
5142 }
5143 _ACEOF
5144 rm -f "conftest.$ac_objext"
5145 if { (eval echo "$as_me:5145: \"$ac_compile\"") >&5
5146   (eval $ac_compile) 2>&5
5147   ac_status=$?
5148   echo "$as_me:5148: \$? = $ac_status" >&5
5149   (exit "$ac_status"); } &&
5150          { ac_try='test -s "conftest.$ac_objext"'
5151   { (eval echo "$as_me:5151: \"$ac_try\"") >&5
5152   (eval $ac_try) 2>&5
5153   ac_status=$?
5154   echo "$as_me:5154: \$? = $ac_status" >&5
5155   (exit "$ac_status"); }; }; then
5156   cf_cv_posix_c_source=no
5157 else
5158   echo "$as_me: failed program was:" >&5
5159 cat "conftest.$ac_ext" >&5
5160 cf_want_posix_source=no
5161          case .$cf_POSIX_C_SOURCE in
5162          (.[12]??*)
5163                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5164                 ;;
5165          (.2)
5166                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5167                 cf_want_posix_source=yes
5168                 ;;
5169          (.*)
5170                 cf_want_posix_source=yes
5171                 ;;
5172          esac
5173          if test "$cf_want_posix_source" = yes ; then
5174                 cat >"conftest.$ac_ext" <<_ACEOF
5175 #line 5175 "configure"
5176 #include "confdefs.h"
5177 #include <sys/types.h>
5178 int
5179 main (void)
5180 {
5181
5182 #ifdef _POSIX_SOURCE
5183 make an error
5184 #endif
5185   ;
5186   return 0;
5187 }
5188 _ACEOF
5189 rm -f "conftest.$ac_objext"
5190 if { (eval echo "$as_me:5190: \"$ac_compile\"") >&5
5191   (eval $ac_compile) 2>&5
5192   ac_status=$?
5193   echo "$as_me:5193: \$? = $ac_status" >&5
5194   (exit "$ac_status"); } &&
5195          { ac_try='test -s "conftest.$ac_objext"'
5196   { (eval echo "$as_me:5196: \"$ac_try\"") >&5
5197   (eval $ac_try) 2>&5
5198   ac_status=$?
5199   echo "$as_me:5199: \$? = $ac_status" >&5
5200   (exit "$ac_status"); }; }; then
5201   :
5202 else
5203   echo "$as_me: failed program was:" >&5
5204 cat "conftest.$ac_ext" >&5
5205 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5206 fi
5207 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5208          fi
5209
5210 echo "${as_me:-configure}:5210: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5211
5212          CFLAGS="$cf_trim_CFLAGS"
5213          CPPFLAGS="$cf_trim_CPPFLAGS"
5214
5215         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5216         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5217
5218 echo "${as_me:-configure}:5218: testing if the second compile does not leave our definition intact error ..." 1>&5
5219
5220          cat >"conftest.$ac_ext" <<_ACEOF
5221 #line 5221 "configure"
5222 #include "confdefs.h"
5223 #include <sys/types.h>
5224 int
5225 main (void)
5226 {
5227
5228 #ifndef _POSIX_C_SOURCE
5229 make an error
5230 #endif
5231   ;
5232   return 0;
5233 }
5234 _ACEOF
5235 rm -f "conftest.$ac_objext"
5236 if { (eval echo "$as_me:5236: \"$ac_compile\"") >&5
5237   (eval $ac_compile) 2>&5
5238   ac_status=$?
5239   echo "$as_me:5239: \$? = $ac_status" >&5
5240   (exit "$ac_status"); } &&
5241          { ac_try='test -s "conftest.$ac_objext"'
5242   { (eval echo "$as_me:5242: \"$ac_try\"") >&5
5243   (eval $ac_try) 2>&5
5244   ac_status=$?
5245   echo "$as_me:5245: \$? = $ac_status" >&5
5246   (exit "$ac_status"); }; }; then
5247   :
5248 else
5249   echo "$as_me: failed program was:" >&5
5250 cat "conftest.$ac_ext" >&5
5251 cf_cv_posix_c_source=no
5252 fi
5253 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5254          CFLAGS="$cf_save_CFLAGS"
5255          CPPFLAGS="$cf_save_CPPFLAGS"
5256
5257 fi
5258 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5259
5260 fi
5261 echo "$as_me:5261: result: $cf_cv_posix_c_source" >&5
5262 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5263
5264 if test "$cf_cv_posix_c_source" != no ; then
5265         CFLAGS="$cf_trim_CFLAGS"
5266         CPPFLAGS="$cf_trim_CPPFLAGS"
5267
5268 cf_fix_cppflags=no
5269 cf_new_cflags=
5270 cf_new_cppflags=
5271 cf_new_extra_cppflags=
5272
5273 for cf_add_cflags in $cf_cv_posix_c_source
5274 do
5275 case "$cf_fix_cppflags" in
5276 (no)
5277         case "$cf_add_cflags" in
5278         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5279                 case "$cf_add_cflags" in
5280                 (-D*)
5281                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5282
5283                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5284                                 && test -z "${cf_tst_cflags}" \
5285                                 && cf_fix_cppflags=yes
5286
5287                         if test "$cf_fix_cppflags" = yes ; then
5288
5289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5291
5292                                 continue
5293                         elif test "${cf_tst_cflags}" = "\"'" ; then
5294
5295         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5296         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5297
5298                                 continue
5299                         fi
5300                         ;;
5301                 esac
5302                 case "$CPPFLAGS" in
5303                 (*$cf_add_cflags)
5304                         ;;
5305                 (*)
5306                         case "$cf_add_cflags" in
5307                         (-D*)
5308                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5309
5310 CPPFLAGS=`echo "$CPPFLAGS" | \
5311         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5312                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5313
5314                                 ;;
5315                         esac
5316
5317         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5318         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5319
5320                         ;;
5321                 esac
5322                 ;;
5323         (*)
5324
5325         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5326         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5327
5328                 ;;
5329         esac
5330         ;;
5331 (yes)
5332
5333         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5334         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5335
5336         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5337
5338         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5339                 && test -z "${cf_tst_cflags}" \
5340                 && cf_fix_cppflags=no
5341         ;;
5342 esac
5343 done
5344
5345 if test -n "$cf_new_cflags" ; then
5346
5347         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5348         CFLAGS="${CFLAGS}$cf_new_cflags"
5349
5350 fi
5351
5352 if test -n "$cf_new_cppflags" ; then
5353
5354         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5355         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5356
5357 fi
5358
5359 if test -n "$cf_new_extra_cppflags" ; then
5360
5361         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5362         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5363
5364 fi
5365
5366 fi
5367
5368 fi # cf_cv_posix_visible
5369
5370         # Some of these niche implementations use copy/paste, double-check...
5371         test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
5372
5373 echo "${as_me:-configure}:5373: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
5374
5375         cat >"conftest.$ac_ext" <<_ACEOF
5376 #line 5376 "configure"
5377 #include "confdefs.h"
5378
5379 #include <stdlib.h>
5380 #include <string.h>
5381 #include <sys/types.h>
5382
5383 int
5384 main (void)
5385 {
5386
5387 #ifndef _XOPEN_SOURCE
5388 make an error
5389 #endif
5390
5391   ;
5392   return 0;
5393 }
5394 _ACEOF
5395 rm -f "conftest.$ac_objext"
5396 if { (eval echo "$as_me:5396: \"$ac_compile\"") >&5
5397   (eval $ac_compile) 2>&5
5398   ac_status=$?
5399   echo "$as_me:5399: \$? = $ac_status" >&5
5400   (exit "$ac_status"); } &&
5401          { ac_try='test -s "conftest.$ac_objext"'
5402   { (eval echo "$as_me:5402: \"$ac_try\"") >&5
5403   (eval $ac_try) 2>&5
5404   ac_status=$?
5405   echo "$as_me:5405: \$? = $ac_status" >&5
5406   (exit "$ac_status"); }; }; then
5407   :
5408 else
5409   echo "$as_me: failed program was:" >&5
5410 cat "conftest.$ac_ext" >&5
5411
5412                 { echo "$as_me:5412: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
5413 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
5414                 CPPFLAGS="$cf_save_xopen_cppflags"
5415 fi
5416 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5417         ;;
5418 esac
5419
5420 if test -n "$cf_xopen_source" ; then
5421
5422 for cf_add_cflags in $cf_xopen_source
5423 do
5424         case "x$cf_add_cflags" in
5425         (x-[DU]*)
5426
5427 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5428 while true
5429 do
5430         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'`
5431         test "$CFLAGS" != "$cf_old_cflag" || break
5432         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
5433
5434 echo "${as_me:-configure}:5434: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
5435
5436         CFLAGS="$cf_old_cflag"
5437 done
5438
5439 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5440 while true
5441 do
5442         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'`
5443         test "$CPPFLAGS" != "$cf_old_cflag" || break
5444         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
5445
5446 echo "${as_me:-configure}:5446: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
5447
5448         CPPFLAGS="$cf_old_cflag"
5449 done
5450
5451                 ;;
5452         esac
5453
5454 cf_fix_cppflags=no
5455 cf_new_cflags=
5456 cf_new_cppflags=
5457 cf_new_extra_cppflags=
5458
5459 for cf_add_cflags in $cf_add_cflags
5460 do
5461 case "$cf_fix_cppflags" in
5462 (no)
5463         case "$cf_add_cflags" in
5464         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5465                 case "$cf_add_cflags" in
5466                 (-D*)
5467                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5468
5469                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5470                                 && test -z "${cf_tst_cflags}" \
5471                                 && cf_fix_cppflags=yes
5472
5473                         if test "$cf_fix_cppflags" = yes ; then
5474
5475         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5476         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5477
5478                                 continue
5479                         elif test "${cf_tst_cflags}" = "\"'" ; then
5480
5481         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5482         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5483
5484                                 continue
5485                         fi
5486                         ;;
5487                 esac
5488                 case "$CPPFLAGS" in
5489                 (*$cf_add_cflags)
5490                         ;;
5491                 (*)
5492                         case "$cf_add_cflags" in
5493                         (-D*)
5494                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5495
5496 CPPFLAGS=`echo "$CPPFLAGS" | \
5497         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5498                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5499
5500                                 ;;
5501                         esac
5502
5503         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5504         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5505
5506                         ;;
5507                 esac
5508                 ;;
5509         (*)
5510
5511         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5512         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5513
5514                 ;;
5515         esac
5516         ;;
5517 (yes)
5518
5519         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5520         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5521
5522         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5523
5524         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5525                 && test -z "${cf_tst_cflags}" \
5526                 && cf_fix_cppflags=no
5527         ;;
5528 esac
5529 done
5530
5531 if test -n "$cf_new_cflags" ; then
5532         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5533
5534 echo "${as_me:-configure}:5534: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5535
5536         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5537         CFLAGS="${CFLAGS}$cf_new_cflags"
5538
5539 fi
5540
5541 if test -n "$cf_new_cppflags" ; then
5542         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5543
5544 echo "${as_me:-configure}:5544: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5545
5546         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5547         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5548
5549 fi
5550
5551 if test -n "$cf_new_extra_cppflags" ; then
5552         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5553
5554 echo "${as_me:-configure}:5554: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5555
5556         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5557         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5558
5559 fi
5560
5561 done
5562
5563 fi
5564
5565 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5566         echo "$as_me:5566: checking if _XOPEN_SOURCE really is set" >&5
5567 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5568         cat >"conftest.$ac_ext" <<_ACEOF
5569 #line 5569 "configure"
5570 #include "confdefs.h"
5571 #include <stdlib.h>
5572 int
5573 main (void)
5574 {
5575
5576 #ifndef _XOPEN_SOURCE
5577 make an error
5578 #endif
5579   ;
5580   return 0;
5581 }
5582 _ACEOF
5583 rm -f "conftest.$ac_objext"
5584 if { (eval echo "$as_me:5584: \"$ac_compile\"") >&5
5585   (eval $ac_compile) 2>&5
5586   ac_status=$?
5587   echo "$as_me:5587: \$? = $ac_status" >&5
5588   (exit "$ac_status"); } &&
5589          { ac_try='test -s "conftest.$ac_objext"'
5590   { (eval echo "$as_me:5590: \"$ac_try\"") >&5
5591   (eval $ac_try) 2>&5
5592   ac_status=$?
5593   echo "$as_me:5593: \$? = $ac_status" >&5
5594   (exit "$ac_status"); }; }; then
5595   cf_XOPEN_SOURCE_set=yes
5596 else
5597   echo "$as_me: failed program was:" >&5
5598 cat "conftest.$ac_ext" >&5
5599 cf_XOPEN_SOURCE_set=no
5600 fi
5601 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5602         echo "$as_me:5602: result: $cf_XOPEN_SOURCE_set" >&5
5603 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5604         if test "$cf_XOPEN_SOURCE_set" = yes
5605         then
5606                 cat >"conftest.$ac_ext" <<_ACEOF
5607 #line 5607 "configure"
5608 #include "confdefs.h"
5609 #include <stdlib.h>
5610 int
5611 main (void)
5612 {
5613
5614 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5615 make an error
5616 #endif
5617   ;
5618   return 0;
5619 }
5620 _ACEOF
5621 rm -f "conftest.$ac_objext"
5622 if { (eval echo "$as_me:5622: \"$ac_compile\"") >&5
5623   (eval $ac_compile) 2>&5
5624   ac_status=$?
5625   echo "$as_me:5625: \$? = $ac_status" >&5
5626   (exit "$ac_status"); } &&
5627          { ac_try='test -s "conftest.$ac_objext"'
5628   { (eval echo "$as_me:5628: \"$ac_try\"") >&5
5629   (eval $ac_try) 2>&5
5630   ac_status=$?
5631   echo "$as_me:5631: \$? = $ac_status" >&5
5632   (exit "$ac_status"); }; }; then
5633   cf_XOPEN_SOURCE_set_ok=yes
5634 else
5635   echo "$as_me: failed program was:" >&5
5636 cat "conftest.$ac_ext" >&5
5637 cf_XOPEN_SOURCE_set_ok=no
5638 fi
5639 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5640                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5641                 then
5642                         { echo "$as_me:5642: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5643 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5644                 fi
5645         else
5646
5647 echo "$as_me:5647: checking if we should define _XOPEN_SOURCE" >&5
5648 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5649 if test "${cf_cv_xopen_source+set}" = set; then
5650   echo $ECHO_N "(cached) $ECHO_C" >&6
5651 else
5652
5653         cat >"conftest.$ac_ext" <<_ACEOF
5654 #line 5654 "configure"
5655 #include "confdefs.h"
5656
5657 #include <stdlib.h>
5658 #include <string.h>
5659 #include <sys/types.h>
5660
5661 int
5662 main (void)
5663 {
5664
5665 #ifndef _XOPEN_SOURCE
5666 make an error
5667 #endif
5668
5669   ;
5670   return 0;
5671 }
5672 _ACEOF
5673 rm -f "conftest.$ac_objext"
5674 if { (eval echo "$as_me:5674: \"$ac_compile\"") >&5
5675   (eval $ac_compile) 2>&5
5676   ac_status=$?
5677   echo "$as_me:5677: \$? = $ac_status" >&5
5678   (exit "$ac_status"); } &&
5679          { ac_try='test -s "conftest.$ac_objext"'
5680   { (eval echo "$as_me:5680: \"$ac_try\"") >&5
5681   (eval $ac_try) 2>&5
5682   ac_status=$?
5683   echo "$as_me:5683: \$? = $ac_status" >&5
5684   (exit "$ac_status"); }; }; then
5685   cf_cv_xopen_source=no
5686 else
5687   echo "$as_me: failed program was:" >&5
5688 cat "conftest.$ac_ext" >&5
5689 cf_save="$CPPFLAGS"
5690
5691         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5692         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5693
5694          cat >"conftest.$ac_ext" <<_ACEOF
5695 #line 5695 "configure"
5696 #include "confdefs.h"
5697
5698 #include <stdlib.h>
5699 #include <string.h>
5700 #include <sys/types.h>
5701
5702 int
5703 main (void)
5704 {
5705
5706 #ifndef _XOPEN_SOURCE
5707 make an error
5708 #endif
5709
5710   ;
5711   return 0;
5712 }
5713 _ACEOF
5714 rm -f "conftest.$ac_objext"
5715 if { (eval echo "$as_me:5715: \"$ac_compile\"") >&5
5716   (eval $ac_compile) 2>&5
5717   ac_status=$?
5718   echo "$as_me:5718: \$? = $ac_status" >&5
5719   (exit "$ac_status"); } &&
5720          { ac_try='test -s "conftest.$ac_objext"'
5721   { (eval echo "$as_me:5721: \"$ac_try\"") >&5
5722   (eval $ac_try) 2>&5
5723   ac_status=$?
5724   echo "$as_me:5724: \$? = $ac_status" >&5
5725   (exit "$ac_status"); }; }; then
5726   cf_cv_xopen_source=no
5727 else
5728   echo "$as_me: failed program was:" >&5
5729 cat "conftest.$ac_ext" >&5
5730 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5731 fi
5732 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5733                 CPPFLAGS="$cf_save"
5734
5735 fi
5736 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5737
5738 fi
5739 echo "$as_me:5739: result: $cf_cv_xopen_source" >&5
5740 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5741
5742 if test "$cf_cv_xopen_source" != no ; then
5743
5744 CFLAGS=`echo "$CFLAGS" | \
5745         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5746                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5747
5748 CPPFLAGS=`echo "$CPPFLAGS" | \
5749         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5750                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5751
5752         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5753
5754 for cf_add_cflags in $cf_temp_xopen_source
5755 do
5756         case "x$cf_add_cflags" in
5757         (x-[DU]*)
5758
5759 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5760 while true
5761 do
5762         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'`
5763         test "$CFLAGS" != "$cf_old_cflag" || break
5764
5765         CFLAGS="$cf_old_cflag"
5766 done
5767
5768 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5769 while true
5770 do
5771         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'`
5772         test "$CPPFLAGS" != "$cf_old_cflag" || break
5773
5774         CPPFLAGS="$cf_old_cflag"
5775 done
5776
5777                 ;;
5778         esac
5779
5780 cf_fix_cppflags=no
5781 cf_new_cflags=
5782 cf_new_cppflags=
5783 cf_new_extra_cppflags=
5784
5785 for cf_add_cflags in $cf_add_cflags
5786 do
5787 case "$cf_fix_cppflags" in
5788 (no)
5789         case "$cf_add_cflags" in
5790         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5791                 case "$cf_add_cflags" in
5792                 (-D*)
5793                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5794
5795                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5796                                 && test -z "${cf_tst_cflags}" \
5797                                 && cf_fix_cppflags=yes
5798
5799                         if test "$cf_fix_cppflags" = yes ; then
5800
5801         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5802         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5803
5804                                 continue
5805                         elif test "${cf_tst_cflags}" = "\"'" ; then
5806
5807         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5808         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5809
5810                                 continue
5811                         fi
5812                         ;;
5813                 esac
5814                 case "$CPPFLAGS" in
5815                 (*$cf_add_cflags)
5816                         ;;
5817                 (*)
5818                         case "$cf_add_cflags" in
5819                         (-D*)
5820                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5821
5822 CPPFLAGS=`echo "$CPPFLAGS" | \
5823         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5824                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5825
5826                                 ;;
5827                         esac
5828
5829         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5830         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5831
5832                         ;;
5833                 esac
5834                 ;;
5835         (*)
5836
5837         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5838         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5839
5840                 ;;
5841         esac
5842         ;;
5843 (yes)
5844
5845         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5846         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5847
5848         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5849
5850         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5851                 && test -z "${cf_tst_cflags}" \
5852                 && cf_fix_cppflags=no
5853         ;;
5854 esac
5855 done
5856
5857 if test -n "$cf_new_cflags" ; then
5858
5859         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5860         CFLAGS="${CFLAGS}$cf_new_cflags"
5861
5862 fi
5863
5864 if test -n "$cf_new_cppflags" ; then
5865
5866         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5867         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5868
5869 fi
5870
5871 if test -n "$cf_new_extra_cppflags" ; then
5872
5873         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5874         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5875
5876 fi
5877
5878 done
5879
5880 fi
5881
5882         fi
5883 fi
5884 fi # cf_cv_posix_visible
5885
5886 echo "$as_me:5886: checking for signal global datatype" >&5
5887 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5888 if test "${cf_cv_sig_atomic_t+set}" = set; then
5889   echo $ECHO_N "(cached) $ECHO_C" >&6
5890 else
5891
5892         for cf_type in \
5893                 "volatile sig_atomic_t" \
5894                 "sig_atomic_t" \
5895                 "int"
5896         do
5897         cat >"conftest.$ac_ext" <<_ACEOF
5898 #line 5898 "configure"
5899 #include "confdefs.h"
5900
5901 #include <sys/types.h>
5902 #include <signal.h>
5903 #include <stdio.h>
5904
5905 extern $cf_type x;
5906 $cf_type x;
5907 static void handler(int sig)
5908 {
5909         (void)sig;
5910         x = 5;
5911 }
5912 int
5913 main (void)
5914 {
5915 signal(SIGINT, handler);
5916                  x = 1
5917   ;
5918   return 0;
5919 }
5920 _ACEOF
5921 rm -f "conftest.$ac_objext"
5922 if { (eval echo "$as_me:5922: \"$ac_compile\"") >&5
5923   (eval $ac_compile) 2>&5
5924   ac_status=$?
5925   echo "$as_me:5925: \$? = $ac_status" >&5
5926   (exit "$ac_status"); } &&
5927          { ac_try='test -s "conftest.$ac_objext"'
5928   { (eval echo "$as_me:5928: \"$ac_try\"") >&5
5929   (eval $ac_try) 2>&5
5930   ac_status=$?
5931   echo "$as_me:5931: \$? = $ac_status" >&5
5932   (exit "$ac_status"); }; }; then
5933   cf_cv_sig_atomic_t=$cf_type
5934 else
5935   echo "$as_me: failed program was:" >&5
5936 cat "conftest.$ac_ext" >&5
5937 cf_cv_sig_atomic_t=no
5938 fi
5939 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5940                 test "$cf_cv_sig_atomic_t" != no && break
5941         done
5942
5943 fi
5944
5945 echo "$as_me:5945: result: $cf_cv_sig_atomic_t" >&5
5946 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5947 test "$cf_cv_sig_atomic_t" != no &&
5948 cat >>confdefs.h <<EOF
5949 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5950 EOF
5951
5952 # Work around breakage on OS X
5953
5954 echo "$as_me:5954: checking if SIGWINCH is defined" >&5
5955 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5956 if test "${cf_cv_define_sigwinch+set}" = set; then
5957   echo $ECHO_N "(cached) $ECHO_C" >&6
5958 else
5959
5960         cat >"conftest.$ac_ext" <<_ACEOF
5961 #line 5961 "configure"
5962 #include "confdefs.h"
5963
5964 #include <sys/types.h>
5965 #include <sys/signal.h>
5966
5967 int
5968 main (void)
5969 {
5970 int x = SIGWINCH; (void)x
5971   ;
5972   return 0;
5973 }
5974 _ACEOF
5975 rm -f "conftest.$ac_objext"
5976 if { (eval echo "$as_me:5976: \"$ac_compile\"") >&5
5977   (eval $ac_compile) 2>&5
5978   ac_status=$?
5979   echo "$as_me:5979: \$? = $ac_status" >&5
5980   (exit "$ac_status"); } &&
5981          { ac_try='test -s "conftest.$ac_objext"'
5982   { (eval echo "$as_me:5982: \"$ac_try\"") >&5
5983   (eval $ac_try) 2>&5
5984   ac_status=$?
5985   echo "$as_me:5985: \$? = $ac_status" >&5
5986   (exit "$ac_status"); }; }; then
5987   cf_cv_define_sigwinch=yes
5988 else
5989   echo "$as_me: failed program was:" >&5
5990 cat "conftest.$ac_ext" >&5
5991 cat >"conftest.$ac_ext" <<_ACEOF
5992 #line 5992 "configure"
5993 #include "confdefs.h"
5994
5995 #undef _XOPEN_SOURCE
5996 #undef _POSIX_SOURCE
5997 #undef _POSIX_C_SOURCE
5998 #include <sys/types.h>
5999 #include <sys/signal.h>
6000
6001 int
6002 main (void)
6003 {
6004 int x = SIGWINCH; (void)x
6005   ;
6006   return 0;
6007 }
6008 _ACEOF
6009 rm -f "conftest.$ac_objext"
6010 if { (eval echo "$as_me:6010: \"$ac_compile\"") >&5
6011   (eval $ac_compile) 2>&5
6012   ac_status=$?
6013   echo "$as_me:6013: \$? = $ac_status" >&5
6014   (exit "$ac_status"); } &&
6015          { ac_try='test -s "conftest.$ac_objext"'
6016   { (eval echo "$as_me:6016: \"$ac_try\"") >&5
6017   (eval $ac_try) 2>&5
6018   ac_status=$?
6019   echo "$as_me:6019: \$? = $ac_status" >&5
6020   (exit "$ac_status"); }; }; then
6021   cf_cv_define_sigwinch=maybe
6022 else
6023   echo "$as_me: failed program was:" >&5
6024 cat "conftest.$ac_ext" >&5
6025 cf_cv_define_sigwinch=no
6026 fi
6027 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6028
6029 fi
6030 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6031
6032 fi
6033 echo "$as_me:6033: result: $cf_cv_define_sigwinch" >&5
6034 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
6035
6036 if test "$cf_cv_define_sigwinch" = maybe ; then
6037 echo "$as_me:6037: checking for actual SIGWINCH definition" >&5
6038 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
6039 if test "${cf_cv_fixup_sigwinch+set}" = set; then
6040   echo $ECHO_N "(cached) $ECHO_C" >&6
6041 else
6042
6043 cf_cv_fixup_sigwinch=unknown
6044 cf_sigwinch=32
6045 while test "$cf_sigwinch" != 1
6046 do
6047         cat >"conftest.$ac_ext" <<_ACEOF
6048 #line 6048 "configure"
6049 #include "confdefs.h"
6050
6051 #undef _XOPEN_SOURCE
6052 #undef _POSIX_SOURCE
6053 #undef _POSIX_C_SOURCE
6054 #include <sys/types.h>
6055 #include <sys/signal.h>
6056
6057 int
6058 main (void)
6059 {
6060
6061 #if SIGWINCH != $cf_sigwinch
6062 make an error
6063 #endif
6064 int x = SIGWINCH; (void)x
6065   ;
6066   return 0;
6067 }
6068 _ACEOF
6069 rm -f "conftest.$ac_objext"
6070 if { (eval echo "$as_me:6070: \"$ac_compile\"") >&5
6071   (eval $ac_compile) 2>&5
6072   ac_status=$?
6073   echo "$as_me:6073: \$? = $ac_status" >&5
6074   (exit "$ac_status"); } &&
6075          { ac_try='test -s "conftest.$ac_objext"'
6076   { (eval echo "$as_me:6076: \"$ac_try\"") >&5
6077   (eval $ac_try) 2>&5
6078   ac_status=$?
6079   echo "$as_me:6079: \$? = $ac_status" >&5
6080   (exit "$ac_status"); }; }; then
6081   cf_cv_fixup_sigwinch=$cf_sigwinch
6082          break
6083 else
6084   echo "$as_me: failed program was:" >&5
6085 cat "conftest.$ac_ext" >&5
6086 fi
6087 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6088
6089 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
6090 done
6091
6092 fi
6093 echo "$as_me:6093: result: $cf_cv_fixup_sigwinch" >&5
6094 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
6095
6096         if test "$cf_cv_fixup_sigwinch" != unknown ; then
6097                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
6098         fi
6099 fi
6100
6101 # Checks for CODESET support.
6102
6103 echo "$as_me:6103: checking for nl_langinfo and CODESET" >&5
6104 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
6105 if test "${am_cv_langinfo_codeset+set}" = set; then
6106   echo $ECHO_N "(cached) $ECHO_C" >&6
6107 else
6108   cat >"conftest.$ac_ext" <<_ACEOF
6109 #line 6109 "configure"
6110 #include "confdefs.h"
6111 #include <langinfo.h>
6112 int
6113 main (void)
6114 {
6115 char* cs = nl_langinfo(CODESET); (void)cs
6116   ;
6117   return 0;
6118 }
6119 _ACEOF
6120 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6121 if { (eval echo "$as_me:6121: \"$ac_link\"") >&5
6122   (eval $ac_link) 2>&5
6123   ac_status=$?
6124   echo "$as_me:6124: \$? = $ac_status" >&5
6125   (exit "$ac_status"); } &&
6126          { ac_try='test -s "conftest$ac_exeext"'
6127   { (eval echo "$as_me:6127: \"$ac_try\"") >&5
6128   (eval $ac_try) 2>&5
6129   ac_status=$?
6130   echo "$as_me:6130: \$? = $ac_status" >&5
6131   (exit "$ac_status"); }; }; then
6132   am_cv_langinfo_codeset=yes
6133 else
6134   echo "$as_me: failed program was:" >&5
6135 cat "conftest.$ac_ext" >&5
6136 am_cv_langinfo_codeset=no
6137 fi
6138 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6139
6140 fi
6141 echo "$as_me:6141: result: $am_cv_langinfo_codeset" >&5
6142 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
6143         if test "$am_cv_langinfo_codeset" = yes; then
6144
6145 cat >>confdefs.h <<\EOF
6146 #define HAVE_LANGINFO_CODESET 1
6147 EOF
6148
6149         fi
6150
6151 echo "$as_me:6151: checking if you want to use pkg-config" >&5
6152 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
6153
6154 # Check whether --with-pkg-config or --without-pkg-config was given.
6155 if test "${with_pkg_config+set}" = set; then
6156   withval="$with_pkg_config"
6157   cf_pkg_config=$withval
6158 else
6159   cf_pkg_config=yes
6160 fi;
6161 echo "$as_me:6161: result: $cf_pkg_config" >&5
6162 echo "${ECHO_T}$cf_pkg_config" >&6
6163
6164 case "$cf_pkg_config" in
6165 (no)
6166         PKG_CONFIG=none
6167         ;;
6168 (yes)
6169
6170 if test -n "$ac_tool_prefix"; then
6171   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
6172 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
6173 echo "$as_me:6173: checking for $ac_word" >&5
6174 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6175 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
6176   echo $ECHO_N "(cached) $ECHO_C" >&6
6177 else
6178   case $PKG_CONFIG in
6179   [\\/]* | ?:[\\/]*)
6180   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
6181   ;;
6182   *)
6183   ac_save_IFS=$IFS; IFS=$ac_path_separator
6184 ac_dummy="$PATH"
6185 for ac_dir in $ac_dummy; do
6186   IFS=$ac_save_IFS
6187   test -z "$ac_dir" && ac_dir=.
6188   if $as_executable_p "$ac_dir/$ac_word"; then
6189    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
6190    echo "$as_me:6190: found $ac_dir/$ac_word" >&5
6191    break
6192 fi
6193 done
6194
6195   ;;
6196 esac
6197 fi
6198 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
6199
6200 if test -n "$PKG_CONFIG"; then
6201   echo "$as_me:6201: result: $PKG_CONFIG" >&5
6202 echo "${ECHO_T}$PKG_CONFIG" >&6
6203 else
6204   echo "$as_me:6204: result: no" >&5
6205 echo "${ECHO_T}no" >&6
6206 fi
6207
6208 fi
6209 if test -z "$ac_cv_path_PKG_CONFIG"; then
6210   ac_pt_PKG_CONFIG=$PKG_CONFIG
6211   # Extract the first word of "pkg-config", so it can be a program name with args.
6212 set dummy pkg-config; ac_word=$2
6213 echo "$as_me:6213: checking for $ac_word" >&5
6214 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6215 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
6216   echo $ECHO_N "(cached) $ECHO_C" >&6
6217 else
6218   case $ac_pt_PKG_CONFIG in
6219   [\\/]* | ?:[\\/]*)
6220   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
6221   ;;
6222   *)
6223   ac_save_IFS=$IFS; IFS=$ac_path_separator
6224 ac_dummy="$PATH"
6225 for ac_dir in $ac_dummy; do
6226   IFS=$ac_save_IFS
6227   test -z "$ac_dir" && ac_dir=.
6228   if $as_executable_p "$ac_dir/$ac_word"; then
6229    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
6230    echo "$as_me:6230: found $ac_dir/$ac_word" >&5
6231    break
6232 fi
6233 done
6234
6235   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
6236   ;;
6237 esac
6238 fi
6239 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6240
6241 if test -n "$ac_pt_PKG_CONFIG"; then
6242   echo "$as_me:6242: result: $ac_pt_PKG_CONFIG" >&5
6243 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
6244 else
6245   echo "$as_me:6245: result: no" >&5
6246 echo "${ECHO_T}no" >&6
6247 fi
6248
6249   PKG_CONFIG=$ac_pt_PKG_CONFIG
6250 else
6251   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6252 fi
6253
6254         ;;
6255 (*)
6256         PKG_CONFIG=$withval
6257         ;;
6258 esac
6259
6260 test -z "$PKG_CONFIG" && PKG_CONFIG=none
6261 if test "$PKG_CONFIG" != none ; then
6262
6263 if test "x$prefix" != xNONE; then
6264         cf_path_syntax="$prefix"
6265 else
6266         cf_path_syntax="$ac_default_prefix"
6267 fi
6268
6269 case ".$PKG_CONFIG" in
6270 (.\$\(*\)*|.\'*\'*)
6271         ;;
6272 (..|./*|.\\*)
6273         ;;
6274 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6275         ;;
6276 (.\$\{*prefix\}*|.\$\{*dir\}*)
6277         eval PKG_CONFIG="$PKG_CONFIG"
6278         case ".$PKG_CONFIG" in
6279         (.NONE/*)
6280                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6281                 ;;
6282         esac
6283         ;;
6284 (.no|.NONE/*)
6285         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6286         ;;
6287 (*)
6288         { { echo "$as_me:6288: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6289 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6290    { (exit 1); exit 1; }; }
6291         ;;
6292 esac
6293
6294 elif test "x$cf_pkg_config" != xno ; then
6295         { echo "$as_me:6295: WARNING: pkg-config is not installed" >&5
6296 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6297 fi
6298
6299 echo "$as_me:6299: checking if you want to see long compiling messages" >&5
6300 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6301
6302 # Check whether --enable-echo or --disable-echo was given.
6303 if test "${enable_echo+set}" = set; then
6304   enableval="$enable_echo"
6305   test "$enableval" != no && enableval=yes
6306         if test "$enableval" != "yes" ; then
6307
6308         ECHO_LT='--silent'
6309         ECHO_LD='@echo linking $@;'
6310         RULE_CC='@echo compiling $<'
6311         SHOW_CC='@echo compiling $@'
6312         ECHO_CC='@'
6313
6314         else
6315
6316         ECHO_LT=''
6317         ECHO_LD=''
6318         RULE_CC=''
6319         SHOW_CC=''
6320         ECHO_CC=''
6321
6322         fi
6323 else
6324   enableval=yes
6325
6326         ECHO_LT=''
6327         ECHO_LD=''
6328         RULE_CC=''
6329         SHOW_CC=''
6330         ECHO_CC=''
6331
6332 fi;
6333 echo "$as_me:6333: result: $enableval" >&5
6334 echo "${ECHO_T}$enableval" >&6
6335
6336 echo "$as_me:6336: checking for ncurses wrap-prefix" >&5
6337 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6338
6339 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6340 if test "${with_ncurses_wrap_prefix+set}" = set; then
6341   withval="$with_ncurses_wrap_prefix"
6342   NCURSES_WRAP_PREFIX=$withval
6343 else
6344   NCURSES_WRAP_PREFIX=_nc_
6345 fi;
6346 echo "$as_me:6346: result: $NCURSES_WRAP_PREFIX" >&5
6347 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6348
6349 echo "$as_me:6349: checking if you want to check for wide-character functions" >&5
6350 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6351
6352 # Check whether --enable-widec or --disable-widec was given.
6353 if test "${enable_widec+set}" = set; then
6354   enableval="$enable_widec"
6355   test "$enableval" != no && enableval=yes
6356         if test "$enableval" != "yes" ; then
6357     cf_enable_widec=no
6358         else
6359                 cf_enable_widec=yes
6360         fi
6361 else
6362   enableval=yes
6363         cf_enable_widec=yes
6364
6365 fi;
6366 echo "$as_me:6366: result: $cf_enable_widec" >&5
6367 echo "${ECHO_T}$cf_enable_widec" >&6
6368
6369 echo "$as_me:6369: checking for specific curses-directory" >&5
6370 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6371
6372 # Check whether --with-curses-dir or --without-curses-dir was given.
6373 if test "${with_curses_dir+set}" = set; then
6374   withval="$with_curses_dir"
6375   cf_cv_curses_dir=$withval
6376 else
6377   cf_cv_curses_dir=no
6378 fi;
6379 echo "$as_me:6379: result: $cf_cv_curses_dir" >&5
6380 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6381
6382 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6383 then
6384
6385 if test "x$prefix" != xNONE; then
6386         cf_path_syntax="$prefix"
6387 else
6388         cf_path_syntax="$ac_default_prefix"
6389 fi
6390
6391 case ".$withval" in
6392 (.\$\(*\)*|.\'*\'*)
6393         ;;
6394 (..|./*|.\\*)
6395         ;;
6396 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6397         ;;
6398 (.\$\{*prefix\}*|.\$\{*dir\}*)
6399         eval withval="$withval"
6400         case ".$withval" in
6401         (.NONE/*)
6402                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6403                 ;;
6404         esac
6405         ;;
6406 (.no|.NONE/*)
6407         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6408         ;;
6409 (*)
6410         { { echo "$as_me:6410: error: expected a pathname, not \"$withval\"" >&5
6411 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6412    { (exit 1); exit 1; }; }
6413         ;;
6414 esac
6415
6416         if test -d "$cf_cv_curses_dir"
6417         then
6418
6419 if test -n "$cf_cv_curses_dir/include" ; then
6420   for cf_add_incdir in $cf_cv_curses_dir/include
6421   do
6422         while test "$cf_add_incdir" != /usr/include
6423         do
6424           if test -d "$cf_add_incdir"
6425           then
6426                 cf_have_incdir=no
6427                 if test -n "$CFLAGS$CPPFLAGS" ; then
6428                   # a loop is needed to ensure we can add subdirs of existing dirs
6429                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6430                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6431                           cf_have_incdir=yes; break
6432                         fi
6433                   done
6434                 fi
6435
6436                 if test "$cf_have_incdir" = no ; then
6437                   if test "$cf_add_incdir" = /usr/local/include ; then
6438                         if test "$GCC" = yes
6439                         then
6440                           cf_save_CPPFLAGS=$CPPFLAGS
6441
6442         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6443         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6444
6445                           cat >"conftest.$ac_ext" <<_ACEOF
6446 #line 6446 "configure"
6447 #include "confdefs.h"
6448 #include <stdio.h>
6449 int
6450 main (void)
6451 {
6452 printf("Hello")
6453   ;
6454   return 0;
6455 }
6456 _ACEOF
6457 rm -f "conftest.$ac_objext"
6458 if { (eval echo "$as_me:6458: \"$ac_compile\"") >&5
6459   (eval $ac_compile) 2>&5
6460   ac_status=$?
6461   echo "$as_me:6461: \$? = $ac_status" >&5
6462   (exit "$ac_status"); } &&
6463          { ac_try='test -s "conftest.$ac_objext"'
6464   { (eval echo "$as_me:6464: \"$ac_try\"") >&5
6465   (eval $ac_try) 2>&5
6466   ac_status=$?
6467   echo "$as_me:6467: \$? = $ac_status" >&5
6468   (exit "$ac_status"); }; }; then
6469   :
6470 else
6471   echo "$as_me: failed program was:" >&5
6472 cat "conftest.$ac_ext" >&5
6473 cf_have_incdir=yes
6474 fi
6475 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6476                           CPPFLAGS=$cf_save_CPPFLAGS
6477                         fi
6478                   fi
6479                 fi
6480
6481                 if test "$cf_have_incdir" = no ; then
6482                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6483
6484 echo "${as_me:-configure}:6484: testing adding $cf_add_incdir to include-path ..." 1>&5
6485
6486                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6487
6488                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6489                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6490                   cf_add_incdir="$cf_top_incdir"
6491                 else
6492                   break
6493                 fi
6494           else
6495                 break
6496           fi
6497         done
6498   done
6499 fi
6500
6501 if test -n "$cf_cv_curses_dir/lib" ; then
6502         for cf_add_libdir in $cf_cv_curses_dir/lib
6503         do
6504                 if test "$cf_add_libdir" = /usr/lib ; then
6505                         :
6506                 elif test -d "$cf_add_libdir"
6507                 then
6508                         cf_have_libdir=no
6509                         if test -n "$LDFLAGS$LIBS" ; then
6510                                 # a loop is needed to ensure we can add subdirs of existing dirs
6511                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6512                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6513                                                 cf_have_libdir=yes; break
6514                                         fi
6515                                 done
6516                         fi
6517                         if test "$cf_have_libdir" = no ; then
6518                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6519
6520 echo "${as_me:-configure}:6520: testing adding $cf_add_libdir to library-path ..." 1>&5
6521
6522                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6523                         fi
6524                 fi
6525         done
6526 fi
6527
6528         fi
6529 fi
6530
6531 cf_cv_screen=curses
6532
6533 echo "$as_me:6533: checking for specified curses library type" >&5
6534 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6535
6536 # Check whether --with-screen or --without-screen was given.
6537 if test "${with_screen+set}" = set; then
6538   withval="$with_screen"
6539   cf_cv_screen=$withval
6540 else
6541
6542 # Check whether --with-ncursesw or --without-ncursesw was given.
6543 if test "${with_ncursesw+set}" = set; then
6544   withval="$with_ncursesw"
6545   cf_cv_screen=ncursesw
6546 else
6547
6548 # Check whether --with-ncurses or --without-ncurses was given.
6549 if test "${with_ncurses+set}" = set; then
6550   withval="$with_ncurses"
6551   cf_cv_screen=ncurses
6552 else
6553
6554 # Check whether --with-pdcurses or --without-pdcurses was given.
6555 if test "${with_pdcurses+set}" = set; then
6556   withval="$with_pdcurses"
6557   cf_cv_screen=pdcurses
6558 else
6559
6560 # Check whether --with-curses-colr or --without-curses-colr was given.
6561 if test "${with_curses_colr+set}" = set; then
6562   withval="$with_curses_colr"
6563   cf_cv_screen=curses_colr
6564 else
6565
6566 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6567 if test "${with_curses_5lib+set}" = set; then
6568   withval="$with_curses_5lib"
6569   cf_cv_screen=curses_5lib
6570 fi;
6571 fi;
6572 fi;
6573 fi;
6574 fi;
6575 fi;
6576
6577 echo "$as_me:6577: result: $cf_cv_screen" >&5
6578 echo "${ECHO_T}$cf_cv_screen" >&6
6579
6580 case $cf_cv_screen in
6581 (curses|curses_*)
6582
6583 echo "$as_me:6583: checking for extra include directories" >&5
6584 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6585 if test "${cf_cv_curses_incdir+set}" = set; then
6586   echo $ECHO_N "(cached) $ECHO_C" >&6
6587 else
6588
6589 cf_cv_curses_incdir=no
6590 case "$host_os" in
6591 (hpux10.*)
6592         if test "x$cf_cv_screen" = "xcurses_colr"
6593         then
6594                 test -d /usr/include/curses_colr && \
6595                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6596         fi
6597         ;;
6598 (sunos3*|sunos4*)
6599         if test "x$cf_cv_screen" = "xcurses_5lib"
6600         then
6601                 test -d /usr/5lib && \
6602                 test -d /usr/5include && \
6603                 cf_cv_curses_incdir="-I/usr/5include"
6604         fi
6605         ;;
6606 esac
6607
6608 fi
6609 echo "$as_me:6609: result: $cf_cv_curses_incdir" >&5
6610 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6611 if test "$cf_cv_curses_incdir" != no
6612 then
6613
6614         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6615         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6616
6617 fi
6618
6619 echo "$as_me:6619: checking if we have identified curses headers" >&5
6620 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6621 if test "${cf_cv_ncurses_header+set}" = set; then
6622   echo $ECHO_N "(cached) $ECHO_C" >&6
6623 else
6624
6625 cf_cv_ncurses_header=none
6626 for cf_header in \
6627         ncurses.h  \
6628         curses.h  ncurses/ncurses.h ncurses/curses.h
6629 do
6630 cat >"conftest.$ac_ext" <<_ACEOF
6631 #line 6631 "configure"
6632 #include "confdefs.h"
6633 #include <${cf_header}>
6634 int
6635 main (void)
6636 {
6637 initscr(); tgoto("?", 0,0)
6638   ;
6639   return 0;
6640 }
6641 _ACEOF
6642 rm -f "conftest.$ac_objext"
6643 if { (eval echo "$as_me:6643: \"$ac_compile\"") >&5
6644   (eval $ac_compile) 2>&5
6645   ac_status=$?
6646   echo "$as_me:6646: \$? = $ac_status" >&5
6647   (exit "$ac_status"); } &&
6648          { ac_try='test -s "conftest.$ac_objext"'
6649   { (eval echo "$as_me:6649: \"$ac_try\"") >&5
6650   (eval $ac_try) 2>&5
6651   ac_status=$?
6652   echo "$as_me:6652: \$? = $ac_status" >&5
6653   (exit "$ac_status"); }; }; then
6654   cf_cv_ncurses_header=$cf_header; break
6655 else
6656   echo "$as_me: failed program was:" >&5
6657 cat "conftest.$ac_ext" >&5
6658 fi
6659 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6660 done
6661
6662 fi
6663 echo "$as_me:6663: result: $cf_cv_ncurses_header" >&5
6664 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6665
6666 if test "$cf_cv_ncurses_header" = none ; then
6667         { { echo "$as_me:6667: error: No curses header-files found" >&5
6668 echo "$as_me: error: No curses header-files found" >&2;}
6669    { (exit 1); exit 1; }; }
6670 fi
6671
6672 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6673
6674 for ac_header in $cf_cv_ncurses_header
6675 do
6676 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6677 echo "$as_me:6677: checking for $ac_header" >&5
6678 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6679 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6680   echo $ECHO_N "(cached) $ECHO_C" >&6
6681 else
6682   cat >"conftest.$ac_ext" <<_ACEOF
6683 #line 6683 "configure"
6684 #include "confdefs.h"
6685 #include <$ac_header>
6686 _ACEOF
6687 if { (eval echo "$as_me:6687: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6688   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6689   ac_status=$?
6690   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6691   rm -f conftest.er1
6692   cat conftest.err >&5
6693   echo "$as_me:6693: \$? = $ac_status" >&5
6694   (exit "$ac_status"); } >/dev/null; then
6695   if test -s conftest.err; then
6696     ac_cpp_err=$ac_c_preproc_warn_flag
6697   else
6698     ac_cpp_err=
6699   fi
6700 else
6701   ac_cpp_err=yes
6702 fi
6703 if test -z "$ac_cpp_err"; then
6704   eval "$as_ac_Header=yes"
6705 else
6706   echo "$as_me: failed program was:" >&5
6707   cat "conftest.$ac_ext" >&5
6708   eval "$as_ac_Header=no"
6709 fi
6710 rm -f conftest.err "conftest.$ac_ext"
6711 fi
6712 echo "$as_me:6712: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6713 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6714 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6715   cat >>confdefs.h <<EOF
6716 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6717 EOF
6718
6719 fi
6720 done
6721
6722 echo "$as_me:6722: checking for terminfo header" >&5
6723 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6724 if test "${cf_cv_term_header+set}" = set; then
6725   echo $ECHO_N "(cached) $ECHO_C" >&6
6726 else
6727
6728 case "${cf_cv_ncurses_header}" in
6729 (*/ncurses.h|*/ncursesw.h)
6730         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6731         ;;
6732 (*)
6733         cf_term_header=term.h
6734         ;;
6735 esac
6736
6737 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6738 do
6739 cat >"conftest.$ac_ext" <<_ACEOF
6740 #line 6740 "configure"
6741 #include "confdefs.h"
6742 #include <stdio.h>
6743 #include <${cf_cv_ncurses_header:-curses.h}>
6744 #include <$cf_test>
6745
6746 int
6747 main (void)
6748 {
6749 int x = auto_left_margin; (void)x
6750   ;
6751   return 0;
6752 }
6753 _ACEOF
6754 rm -f "conftest.$ac_objext"
6755 if { (eval echo "$as_me:6755: \"$ac_compile\"") >&5
6756   (eval $ac_compile) 2>&5
6757   ac_status=$?
6758   echo "$as_me:6758: \$? = $ac_status" >&5
6759   (exit "$ac_status"); } &&
6760          { ac_try='test -s "conftest.$ac_objext"'
6761   { (eval echo "$as_me:6761: \"$ac_try\"") >&5
6762   (eval $ac_try) 2>&5
6763   ac_status=$?
6764   echo "$as_me:6764: \$? = $ac_status" >&5
6765   (exit "$ac_status"); }; }; then
6766
6767         cf_cv_term_header="$cf_test"
6768 else
6769   echo "$as_me: failed program was:" >&5
6770 cat "conftest.$ac_ext" >&5
6771
6772         cf_cv_term_header=unknown
6773
6774 fi
6775 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6776         test "$cf_cv_term_header" != unknown && break
6777 done
6778
6779 fi
6780 echo "$as_me:6780: result: $cf_cv_term_header" >&5
6781 echo "${ECHO_T}$cf_cv_term_header" >&6
6782
6783 # Set definitions to allow ifdef'ing to accommodate subdirectories
6784
6785 case "$cf_cv_term_header" in
6786 (*term.h)
6787
6788 cat >>confdefs.h <<\EOF
6789 #define HAVE_TERM_H 1
6790 EOF
6791
6792         ;;
6793 esac
6794
6795 case "$cf_cv_term_header" in
6796 (ncurses/term.h)
6797
6798 cat >>confdefs.h <<\EOF
6799 #define HAVE_NCURSES_TERM_H 1
6800 EOF
6801
6802         ;;
6803 (ncursesw/term.h)
6804
6805 cat >>confdefs.h <<\EOF
6806 #define HAVE_NCURSESW_TERM_H 1
6807 EOF
6808
6809         ;;
6810 esac
6811
6812 echo "$as_me:6812: checking for ncurses version" >&5
6813 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6814 if test "${cf_cv_ncurses_version+set}" = set; then
6815   echo $ECHO_N "(cached) $ECHO_C" >&6
6816 else
6817
6818         cf_cv_ncurses_version=no
6819         cf_tempfile=out$$
6820         rm -f "$cf_tempfile"
6821         if test "$cross_compiling" = yes; then
6822
6823         # This will not work if the preprocessor splits the line after the
6824         # Autoconf token.  The 'unproto' program does that.
6825         cat > "conftest.$ac_ext" <<EOF
6826 #include <${cf_cv_ncurses_header:-curses.h}>
6827 #undef Autoconf
6828 #ifdef NCURSES_VERSION
6829 Autoconf NCURSES_VERSION
6830 #else
6831 #ifdef __NCURSES_H
6832 Autoconf "old"
6833 #endif
6834 ;
6835 #endif
6836 EOF
6837         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6838         { (eval echo "$as_me:6838: \"$cf_try\"") >&5
6839   (eval $cf_try) 2>&5
6840   ac_status=$?
6841   echo "$as_me:6841: \$? = $ac_status" >&5
6842   (exit "$ac_status"); }
6843         if test -f conftest.out ; then
6844                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6845                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6846                 rm -f conftest.out
6847         fi
6848
6849 else
6850   cat >"conftest.$ac_ext" <<_ACEOF
6851 #line 6851 "configure"
6852 #include "confdefs.h"
6853
6854 #include <${cf_cv_ncurses_header:-curses.h}>
6855 #include <stdio.h>
6856 int main(void)
6857 {
6858         FILE *fp = fopen("$cf_tempfile", "w");
6859 #ifdef NCURSES_VERSION
6860 # ifdef NCURSES_VERSION_PATCH
6861         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6862 # else
6863         fprintf(fp, "%s\\n", NCURSES_VERSION);
6864 # endif
6865 #else
6866 # ifdef __NCURSES_H
6867         fprintf(fp, "old\\n");
6868 # else
6869         make an error
6870 # endif
6871 #endif
6872         ${cf_cv_main_return:-return}(0);
6873 }
6874 _ACEOF
6875 rm -f "conftest$ac_exeext"
6876 if { (eval echo "$as_me:6876: \"$ac_link\"") >&5
6877   (eval $ac_link) 2>&5
6878   ac_status=$?
6879   echo "$as_me:6879: \$? = $ac_status" >&5
6880   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6881   { (eval echo "$as_me:6881: \"$ac_try\"") >&5
6882   (eval $ac_try) 2>&5
6883   ac_status=$?
6884   echo "$as_me:6884: \$? = $ac_status" >&5
6885   (exit "$ac_status"); }; }; then
6886
6887         cf_cv_ncurses_version=`cat $cf_tempfile`
6888 else
6889   echo "$as_me: program exited with status $ac_status" >&5
6890 echo "$as_me: failed program was:" >&5
6891 cat "conftest.$ac_ext" >&5
6892 fi
6893 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6894 fi
6895         rm -f "$cf_tempfile"
6896
6897 fi
6898 echo "$as_me:6898: result: $cf_cv_ncurses_version" >&5
6899 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6900 test "$cf_cv_ncurses_version" = no ||
6901 cat >>confdefs.h <<\EOF
6902 #define NCURSES 1
6903 EOF
6904
6905 echo "$as_me:6905: checking if we have identified curses libraries" >&5
6906 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6907 cat >"conftest.$ac_ext" <<_ACEOF
6908 #line 6908 "configure"
6909 #include "confdefs.h"
6910 #include <${cf_cv_ncurses_header:-curses.h}>
6911 int
6912 main (void)
6913 {
6914 initscr(); tgoto("?", 0,0)
6915   ;
6916   return 0;
6917 }
6918 _ACEOF
6919 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6920 if { (eval echo "$as_me:6920: \"$ac_link\"") >&5
6921   (eval $ac_link) 2>&5
6922   ac_status=$?
6923   echo "$as_me:6923: \$? = $ac_status" >&5
6924   (exit "$ac_status"); } &&
6925          { ac_try='test -s "conftest$ac_exeext"'
6926   { (eval echo "$as_me:6926: \"$ac_try\"") >&5
6927   (eval $ac_try) 2>&5
6928   ac_status=$?
6929   echo "$as_me:6929: \$? = $ac_status" >&5
6930   (exit "$ac_status"); }; }; then
6931   cf_result=yes
6932 else
6933   echo "$as_me: failed program was:" >&5
6934 cat "conftest.$ac_ext" >&5
6935 cf_result=no
6936 fi
6937 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6938 echo "$as_me:6938: result: $cf_result" >&5
6939 echo "${ECHO_T}$cf_result" >&6
6940
6941 if test "$cf_result" = no ; then
6942 case "$host_os" in
6943 (freebsd*)
6944         echo "$as_me:6944: checking for tgoto in -lmytinfo" >&5
6945 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6946 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6947   echo $ECHO_N "(cached) $ECHO_C" >&6
6948 else
6949   ac_check_lib_save_LIBS=$LIBS
6950 LIBS="-lmytinfo  $LIBS"
6951 cat >"conftest.$ac_ext" <<_ACEOF
6952 #line 6952 "configure"
6953 #include "confdefs.h"
6954
6955 /* Override any gcc2 internal prototype to avoid an error.  */
6956 #ifdef __cplusplus
6957 extern "C"
6958 #endif
6959 /* We use char because int might match the return type of a gcc2
6960    builtin and then its argument prototype would still apply.  */
6961 char tgoto ();
6962 int
6963 main (void)
6964 {
6965 tgoto ();
6966   ;
6967   return 0;
6968 }
6969 _ACEOF
6970 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6971 if { (eval echo "$as_me:6971: \"$ac_link\"") >&5
6972   (eval $ac_link) 2>&5
6973   ac_status=$?
6974   echo "$as_me:6974: \$? = $ac_status" >&5
6975   (exit "$ac_status"); } &&
6976          { ac_try='test -s "conftest$ac_exeext"'
6977   { (eval echo "$as_me:6977: \"$ac_try\"") >&5
6978   (eval $ac_try) 2>&5
6979   ac_status=$?
6980   echo "$as_me:6980: \$? = $ac_status" >&5
6981   (exit "$ac_status"); }; }; then
6982   ac_cv_lib_mytinfo_tgoto=yes
6983 else
6984   echo "$as_me: failed program was:" >&5
6985 cat "conftest.$ac_ext" >&5
6986 ac_cv_lib_mytinfo_tgoto=no
6987 fi
6988 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6989 LIBS=$ac_check_lib_save_LIBS
6990 fi
6991 echo "$as_me:6991: result: $ac_cv_lib_mytinfo_tgoto" >&5
6992 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6993 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6994
6995 cf_add_libs="$LIBS"
6996 # reverse order
6997 cf_add_0lib=
6998 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6999 # filter duplicates
7000 for cf_add_1lib in $cf_add_0lib; do
7001         for cf_add_2lib in $cf_add_libs; do
7002                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7003                         cf_add_1lib=
7004                         break
7005                 fi
7006         done
7007         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7008 done
7009 LIBS="$cf_add_libs"
7010
7011 fi
7012
7013         ;;
7014 (hpux10.*)
7015         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
7016         # next (1998), and xcurses "newer" (2000).  There is no header file for
7017         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
7018         # term.h) for cur_colr
7019         if test "x$cf_cv_screen" = "xcurses_colr"
7020         then
7021                 echo "$as_me:7021: checking for initscr in -lcur_colr" >&5
7022 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
7023 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
7024   echo $ECHO_N "(cached) $ECHO_C" >&6
7025 else
7026   ac_check_lib_save_LIBS=$LIBS
7027 LIBS="-lcur_colr  $LIBS"
7028 cat >"conftest.$ac_ext" <<_ACEOF
7029 #line 7029 "configure"
7030 #include "confdefs.h"
7031
7032 /* Override any gcc2 internal prototype to avoid an error.  */
7033 #ifdef __cplusplus
7034 extern "C"
7035 #endif
7036 /* We use char because int might match the return type of a gcc2
7037    builtin and then its argument prototype would still apply.  */
7038 char initscr ();
7039 int
7040 main (void)
7041 {
7042 initscr ();
7043   ;
7044   return 0;
7045 }
7046 _ACEOF
7047 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7048 if { (eval echo "$as_me:7048: \"$ac_link\"") >&5
7049   (eval $ac_link) 2>&5
7050   ac_status=$?
7051   echo "$as_me:7051: \$? = $ac_status" >&5
7052   (exit "$ac_status"); } &&
7053          { ac_try='test -s "conftest$ac_exeext"'
7054   { (eval echo "$as_me:7054: \"$ac_try\"") >&5
7055   (eval $ac_try) 2>&5
7056   ac_status=$?
7057   echo "$as_me:7057: \$? = $ac_status" >&5
7058   (exit "$ac_status"); }; }; then
7059   ac_cv_lib_cur_colr_initscr=yes
7060 else
7061   echo "$as_me: failed program was:" >&5
7062 cat "conftest.$ac_ext" >&5
7063 ac_cv_lib_cur_colr_initscr=no
7064 fi
7065 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7066 LIBS=$ac_check_lib_save_LIBS
7067 fi
7068 echo "$as_me:7068: result: $ac_cv_lib_cur_colr_initscr" >&5
7069 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
7070 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
7071
7072 cf_add_libs="$LIBS"
7073 # reverse order
7074 cf_add_0lib=
7075 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7076 # filter duplicates
7077 for cf_add_1lib in $cf_add_0lib; do
7078         for cf_add_2lib in $cf_add_libs; do
7079                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7080                         cf_add_1lib=
7081                         break
7082                 fi
7083         done
7084         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7085 done
7086 LIBS="$cf_add_libs"
7087
7088                         ac_cv_func_initscr=yes
7089
7090 else
7091
7092                 echo "$as_me:7092: checking for initscr in -lHcurses" >&5
7093 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
7094 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
7095   echo $ECHO_N "(cached) $ECHO_C" >&6
7096 else
7097   ac_check_lib_save_LIBS=$LIBS
7098 LIBS="-lHcurses  $LIBS"
7099 cat >"conftest.$ac_ext" <<_ACEOF
7100 #line 7100 "configure"
7101 #include "confdefs.h"
7102
7103 /* Override any gcc2 internal prototype to avoid an error.  */
7104 #ifdef __cplusplus
7105 extern "C"
7106 #endif
7107 /* We use char because int might match the return type of a gcc2
7108    builtin and then its argument prototype would still apply.  */
7109 char initscr ();
7110 int
7111 main (void)
7112 {
7113 initscr ();
7114   ;
7115   return 0;
7116 }
7117 _ACEOF
7118 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7119 if { (eval echo "$as_me:7119: \"$ac_link\"") >&5
7120   (eval $ac_link) 2>&5
7121   ac_status=$?
7122   echo "$as_me:7122: \$? = $ac_status" >&5
7123   (exit "$ac_status"); } &&
7124          { ac_try='test -s "conftest$ac_exeext"'
7125   { (eval echo "$as_me:7125: \"$ac_try\"") >&5
7126   (eval $ac_try) 2>&5
7127   ac_status=$?
7128   echo "$as_me:7128: \$? = $ac_status" >&5
7129   (exit "$ac_status"); }; }; then
7130   ac_cv_lib_Hcurses_initscr=yes
7131 else
7132   echo "$as_me: failed program was:" >&5
7133 cat "conftest.$ac_ext" >&5
7134 ac_cv_lib_Hcurses_initscr=no
7135 fi
7136 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7137 LIBS=$ac_check_lib_save_LIBS
7138 fi
7139 echo "$as_me:7139: result: $ac_cv_lib_Hcurses_initscr" >&5
7140 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
7141 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
7142
7143                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
7144
7145 cf_add_libs="$LIBS"
7146 # reverse order
7147 cf_add_0lib=
7148 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7149 # filter duplicates
7150 for cf_add_1lib in $cf_add_0lib; do
7151         for cf_add_2lib in $cf_add_libs; do
7152                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7153                         cf_add_1lib=
7154                         break
7155                 fi
7156         done
7157         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7158 done
7159 LIBS="$cf_add_libs"
7160
7161         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7162         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
7163
7164                         ac_cv_func_initscr=yes
7165
7166 fi
7167
7168 fi
7169
7170         fi
7171         ;;
7172 (linux*)
7173         case `arch 2>/dev/null` in
7174         (x86_64)
7175                 if test -d /lib64
7176                 then
7177
7178 if test -n "/lib64" ; then
7179         for cf_add_libdir in /lib64
7180         do
7181                 if test "$cf_add_libdir" = /usr/lib ; then
7182                         :
7183                 elif test -d "$cf_add_libdir"
7184                 then
7185                         cf_have_libdir=no
7186                         if test -n "$LDFLAGS$LIBS" ; then
7187                                 # a loop is needed to ensure we can add subdirs of existing dirs
7188                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7189                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7190                                                 cf_have_libdir=yes; break
7191                                         fi
7192                                 done
7193                         fi
7194                         if test "$cf_have_libdir" = no ; then
7195                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7196
7197 echo "${as_me:-configure}:7197: testing adding $cf_add_libdir to library-path ..." 1>&5
7198
7199                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7200                         fi
7201                 fi
7202         done
7203 fi
7204
7205                 else
7206
7207 if test -n "/lib" ; then
7208         for cf_add_libdir in /lib
7209         do
7210                 if test "$cf_add_libdir" = /usr/lib ; then
7211                         :
7212                 elif test -d "$cf_add_libdir"
7213                 then
7214                         cf_have_libdir=no
7215                         if test -n "$LDFLAGS$LIBS" ; then
7216                                 # a loop is needed to ensure we can add subdirs of existing dirs
7217                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7218                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7219                                                 cf_have_libdir=yes; break
7220                                         fi
7221                                 done
7222                         fi
7223                         if test "$cf_have_libdir" = no ; then
7224                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7225
7226 echo "${as_me:-configure}:7226: testing adding $cf_add_libdir to library-path ..." 1>&5
7227
7228                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7229                         fi
7230                 fi
7231         done
7232 fi
7233
7234                 fi
7235                 ;;
7236         (*)
7237
7238 if test -n "/lib" ; then
7239         for cf_add_libdir in /lib
7240         do
7241                 if test "$cf_add_libdir" = /usr/lib ; then
7242                         :
7243                 elif test -d "$cf_add_libdir"
7244                 then
7245                         cf_have_libdir=no
7246                         if test -n "$LDFLAGS$LIBS" ; then
7247                                 # a loop is needed to ensure we can add subdirs of existing dirs
7248                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7249                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7250                                                 cf_have_libdir=yes; break
7251                                         fi
7252                                 done
7253                         fi
7254                         if test "$cf_have_libdir" = no ; then
7255                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7256
7257 echo "${as_me:-configure}:7257: testing adding $cf_add_libdir to library-path ..." 1>&5
7258
7259                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7260                         fi
7261                 fi
7262         done
7263 fi
7264
7265                 ;;
7266         esac
7267         ;;
7268 (sunos3*|sunos4*)
7269         if test "x$cf_cv_screen" = "xcurses_5lib"
7270         then
7271                 if test -d /usr/5lib ; then
7272
7273 if test -n "/usr/5lib" ; then
7274         for cf_add_libdir in /usr/5lib
7275         do
7276                 if test "$cf_add_libdir" = /usr/lib ; then
7277                         :
7278                 elif test -d "$cf_add_libdir"
7279                 then
7280                         cf_have_libdir=no
7281                         if test -n "$LDFLAGS$LIBS" ; then
7282                                 # a loop is needed to ensure we can add subdirs of existing dirs
7283                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7284                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7285                                                 cf_have_libdir=yes; break
7286                                         fi
7287                                 done
7288                         fi
7289                         if test "$cf_have_libdir" = no ; then
7290                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7291
7292 echo "${as_me:-configure}:7292: testing adding $cf_add_libdir to library-path ..." 1>&5
7293
7294                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7295                         fi
7296                 fi
7297         done
7298 fi
7299
7300 cf_add_libs="$LIBS"
7301 # reverse order
7302 cf_add_0lib=
7303 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7304 # filter duplicates
7305 for cf_add_1lib in $cf_add_0lib; do
7306         for cf_add_2lib in $cf_add_libs; do
7307                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7308                         cf_add_1lib=
7309                         break
7310                 fi
7311         done
7312         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7313 done
7314 LIBS="$cf_add_libs"
7315
7316                 fi
7317         fi
7318         ac_cv_func_initscr=yes
7319         ;;
7320 esac
7321
7322 if test ".$ac_cv_func_initscr" != .yes ; then
7323         cf_save_LIBS="$LIBS"
7324
7325         if test ".${cf_cv_ncurses_version:-no}" != .no
7326         then
7327                 cf_check_list="ncurses curses cursesX"
7328         else
7329                 cf_check_list="cursesX curses ncurses"
7330         fi
7331
7332         # Check for library containing tgoto.  Do this before curses library
7333         # because it may be needed to link the test-case for initscr.
7334         if test "x$cf_term_lib" = x
7335         then
7336                 echo "$as_me:7336: checking for tgoto" >&5
7337 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7338 if test "${ac_cv_func_tgoto+set}" = set; then
7339   echo $ECHO_N "(cached) $ECHO_C" >&6
7340 else
7341   cat >"conftest.$ac_ext" <<_ACEOF
7342 #line 7342 "configure"
7343 #include "confdefs.h"
7344 #define tgoto autoconf_temporary
7345 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7346 #undef tgoto
7347
7348 #ifdef __cplusplus
7349 extern "C"
7350 #endif
7351
7352 /* We use char because int might match the return type of a gcc2
7353    builtin and then its argument prototype would still apply.  */
7354 char tgoto (void);
7355
7356 int
7357 main (void)
7358 {
7359
7360 /* The GNU C library defines stubs for functions which it implements
7361     to always fail with ENOSYS.  Some functions are actually named
7362     something starting with __ and the normal name is an alias.  */
7363 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7364 #error found stub for tgoto
7365 #endif
7366
7367         return tgoto ();
7368   ;
7369   return 0;
7370 }
7371 _ACEOF
7372 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7373 if { (eval echo "$as_me:7373: \"$ac_link\"") >&5
7374   (eval $ac_link) 2>&5
7375   ac_status=$?
7376   echo "$as_me:7376: \$? = $ac_status" >&5
7377   (exit "$ac_status"); } &&
7378          { ac_try='test -s "conftest$ac_exeext"'
7379   { (eval echo "$as_me:7379: \"$ac_try\"") >&5
7380   (eval $ac_try) 2>&5
7381   ac_status=$?
7382   echo "$as_me:7382: \$? = $ac_status" >&5
7383   (exit "$ac_status"); }; }; then
7384   ac_cv_func_tgoto=yes
7385 else
7386   echo "$as_me: failed program was:" >&5
7387 cat "conftest.$ac_ext" >&5
7388 ac_cv_func_tgoto=no
7389 fi
7390 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7391 fi
7392 echo "$as_me:7392: result: $ac_cv_func_tgoto" >&5
7393 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7394 if test "$ac_cv_func_tgoto" = yes; then
7395   cf_term_lib=predefined
7396 else
7397
7398                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7399                         do
7400                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7401 echo "$as_me:7401: checking for tgoto in -l$cf_term_lib" >&5
7402 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7403 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7404   echo $ECHO_N "(cached) $ECHO_C" >&6
7405 else
7406   ac_check_lib_save_LIBS=$LIBS
7407 LIBS="-l$cf_term_lib  $LIBS"
7408 cat >"conftest.$ac_ext" <<_ACEOF
7409 #line 7409 "configure"
7410 #include "confdefs.h"
7411
7412 /* Override any gcc2 internal prototype to avoid an error.  */
7413 #ifdef __cplusplus
7414 extern "C"
7415 #endif
7416 /* We use char because int might match the return type of a gcc2
7417    builtin and then its argument prototype would still apply.  */
7418 char tgoto ();
7419 int
7420 main (void)
7421 {
7422 tgoto ();
7423   ;
7424   return 0;
7425 }
7426 _ACEOF
7427 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7428 if { (eval echo "$as_me:7428: \"$ac_link\"") >&5
7429   (eval $ac_link) 2>&5
7430   ac_status=$?
7431   echo "$as_me:7431: \$? = $ac_status" >&5
7432   (exit "$ac_status"); } &&
7433          { ac_try='test -s "conftest$ac_exeext"'
7434   { (eval echo "$as_me:7434: \"$ac_try\"") >&5
7435   (eval $ac_try) 2>&5
7436   ac_status=$?
7437   echo "$as_me:7437: \$? = $ac_status" >&5
7438   (exit "$ac_status"); }; }; then
7439   eval "$as_ac_Lib=yes"
7440 else
7441   echo "$as_me: failed program was:" >&5
7442 cat "conftest.$ac_ext" >&5
7443 eval "$as_ac_Lib=no"
7444 fi
7445 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7446 LIBS=$ac_check_lib_save_LIBS
7447 fi
7448 echo "$as_me:7448: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7449 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7450 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7451
7452                                         : "${cf_nculib_root:=$cf_term_lib}"
7453                                         break
7454
7455 fi
7456
7457                         done
7458
7459 fi
7460
7461         fi
7462
7463         # Check for library containing initscr
7464         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7465         if test "x$cf_curs_lib" = x
7466         then
7467                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7468                 do
7469                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7470                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7471                                 echo "$as_me:7471: checking if we can link with $cf_curs_lib library" >&5
7472 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7473                                 cat >"conftest.$ac_ext" <<_ACEOF
7474 #line 7474 "configure"
7475 #include "confdefs.h"
7476 #include <${cf_cv_ncurses_header:-curses.h}>
7477 int
7478 main (void)
7479 {
7480 initscr()
7481   ;
7482   return 0;
7483 }
7484 _ACEOF
7485 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7486 if { (eval echo "$as_me:7486: \"$ac_link\"") >&5
7487   (eval $ac_link) 2>&5
7488   ac_status=$?
7489   echo "$as_me:7489: \$? = $ac_status" >&5
7490   (exit "$ac_status"); } &&
7491          { ac_try='test -s "conftest$ac_exeext"'
7492   { (eval echo "$as_me:7492: \"$ac_try\"") >&5
7493   (eval $ac_try) 2>&5
7494   ac_status=$?
7495   echo "$as_me:7495: \$? = $ac_status" >&5
7496   (exit "$ac_status"); }; }; then
7497   cf_result=yes
7498 else
7499   echo "$as_me: failed program was:" >&5
7500 cat "conftest.$ac_ext" >&5
7501 cf_result=no
7502 fi
7503 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7504                                 echo "$as_me:7504: result: $cf_result" >&5
7505 echo "${ECHO_T}$cf_result" >&6
7506                                 test "$cf_result" = yes && break
7507                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7508                                 cf_result=no
7509                         elif test "$cf_term_lib" != predefined ; then
7510                                 echo "$as_me:7510: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7511 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7512                                 cat >"conftest.$ac_ext" <<_ACEOF
7513 #line 7513 "configure"
7514 #include "confdefs.h"
7515 #include <${cf_cv_ncurses_header:-curses.h}>
7516 int
7517 main (void)
7518 {
7519 initscr(); tgoto((char *)0, 0, 0);
7520   ;
7521   return 0;
7522 }
7523 _ACEOF
7524 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7525 if { (eval echo "$as_me:7525: \"$ac_link\"") >&5
7526   (eval $ac_link) 2>&5
7527   ac_status=$?
7528   echo "$as_me:7528: \$? = $ac_status" >&5
7529   (exit "$ac_status"); } &&
7530          { ac_try='test -s "conftest$ac_exeext"'
7531   { (eval echo "$as_me:7531: \"$ac_try\"") >&5
7532   (eval $ac_try) 2>&5
7533   ac_status=$?
7534   echo "$as_me:7534: \$? = $ac_status" >&5
7535   (exit "$ac_status"); }; }; then
7536   cf_result=no
7537 else
7538   echo "$as_me: failed program was:" >&5
7539 cat "conftest.$ac_ext" >&5
7540
7541                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7542                                         cat >"conftest.$ac_ext" <<_ACEOF
7543 #line 7543 "configure"
7544 #include "confdefs.h"
7545 #include <${cf_cv_ncurses_header:-curses.h}>
7546 int
7547 main (void)
7548 {
7549 initscr()
7550   ;
7551   return 0;
7552 }
7553 _ACEOF
7554 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7555 if { (eval echo "$as_me:7555: \"$ac_link\"") >&5
7556   (eval $ac_link) 2>&5
7557   ac_status=$?
7558   echo "$as_me:7558: \$? = $ac_status" >&5
7559   (exit "$ac_status"); } &&
7560          { ac_try='test -s "conftest$ac_exeext"'
7561   { (eval echo "$as_me:7561: \"$ac_try\"") >&5
7562   (eval $ac_try) 2>&5
7563   ac_status=$?
7564   echo "$as_me:7564: \$? = $ac_status" >&5
7565   (exit "$ac_status"); }; }; then
7566   cf_result=yes
7567 else
7568   echo "$as_me: failed program was:" >&5
7569 cat "conftest.$ac_ext" >&5
7570 cf_result=error
7571 fi
7572 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7573
7574 fi
7575 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7576                                 echo "$as_me:7576: result: $cf_result" >&5
7577 echo "${ECHO_T}$cf_result" >&6
7578                                 test "$cf_result" != error && break
7579                         fi
7580                 done
7581         fi
7582         test "$cf_curs_lib" = unknown && { { echo "$as_me:7582: error: no curses library found" >&5
7583 echo "$as_me: error: no curses library found" >&2;}
7584    { (exit 1); exit 1; }; }
7585 fi
7586 fi
7587
7588         ;;
7589 (ncursesw*)
7590
7591 for ac_header in wchar.h
7592 do
7593 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7594 echo "$as_me:7594: checking for $ac_header" >&5
7595 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7596 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7597   echo $ECHO_N "(cached) $ECHO_C" >&6
7598 else
7599   cat >"conftest.$ac_ext" <<_ACEOF
7600 #line 7600 "configure"
7601 #include "confdefs.h"
7602 #include <$ac_header>
7603 _ACEOF
7604 if { (eval echo "$as_me:7604: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7605   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7606   ac_status=$?
7607   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7608   rm -f conftest.er1
7609   cat conftest.err >&5
7610   echo "$as_me:7610: \$? = $ac_status" >&5
7611   (exit "$ac_status"); } >/dev/null; then
7612   if test -s conftest.err; then
7613     ac_cpp_err=$ac_c_preproc_warn_flag
7614   else
7615     ac_cpp_err=
7616   fi
7617 else
7618   ac_cpp_err=yes
7619 fi
7620 if test -z "$ac_cpp_err"; then
7621   eval "$as_ac_Header=yes"
7622 else
7623   echo "$as_me: failed program was:" >&5
7624   cat "conftest.$ac_ext" >&5
7625   eval "$as_ac_Header=no"
7626 fi
7627 rm -f conftest.err "conftest.$ac_ext"
7628 fi
7629 echo "$as_me:7629: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7630 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7631 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7632   cat >>confdefs.h <<EOF
7633 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7634 EOF
7635
7636 fi
7637 done
7638
7639 echo "$as_me:7639: checking for multibyte character support" >&5
7640 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7641 if test "${cf_cv_utf8_lib+set}" = set; then
7642   echo $ECHO_N "(cached) $ECHO_C" >&6
7643 else
7644
7645         cf_save_LIBS="$LIBS"
7646         cat >"conftest.$ac_ext" <<_ACEOF
7647 #line 7647 "configure"
7648 #include "confdefs.h"
7649
7650 #include <stdlib.h>
7651 #include <stdio.h>
7652 #ifdef HAVE_WCHAR_H
7653 #include <wchar.h>
7654 #endif
7655
7656 int
7657 main (void)
7658 {
7659 putwc(0,0);
7660   ;
7661   return 0;
7662 }
7663 _ACEOF
7664 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7665 if { (eval echo "$as_me:7665: \"$ac_link\"") >&5
7666   (eval $ac_link) 2>&5
7667   ac_status=$?
7668   echo "$as_me:7668: \$? = $ac_status" >&5
7669   (exit "$ac_status"); } &&
7670          { ac_try='test -s "conftest$ac_exeext"'
7671   { (eval echo "$as_me:7671: \"$ac_try\"") >&5
7672   (eval $ac_try) 2>&5
7673   ac_status=$?
7674   echo "$as_me:7674: \$? = $ac_status" >&5
7675   (exit "$ac_status"); }; }; then
7676   cf_cv_utf8_lib=yes
7677 else
7678   echo "$as_me: failed program was:" >&5
7679 cat "conftest.$ac_ext" >&5
7680
7681 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7682 # will be set on completion of the AC_TRY_LINK below.
7683 cf_cv_header_path_utf8=
7684 cf_cv_library_path_utf8=
7685
7686 echo "${as_me:-configure}:7686: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7687
7688 cf_save_LIBS="$LIBS"
7689
7690 cat >"conftest.$ac_ext" <<_ACEOF
7691 #line 7691 "configure"
7692 #include "confdefs.h"
7693
7694 #include <libutf8.h>
7695 int
7696 main (void)
7697 {
7698 putwc(0,0);
7699   ;
7700   return 0;
7701 }
7702 _ACEOF
7703 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7704 if { (eval echo "$as_me:7704: \"$ac_link\"") >&5
7705   (eval $ac_link) 2>&5
7706   ac_status=$?
7707   echo "$as_me:7707: \$? = $ac_status" >&5
7708   (exit "$ac_status"); } &&
7709          { ac_try='test -s "conftest$ac_exeext"'
7710   { (eval echo "$as_me:7710: \"$ac_try\"") >&5
7711   (eval $ac_try) 2>&5
7712   ac_status=$?
7713   echo "$as_me:7713: \$? = $ac_status" >&5
7714   (exit "$ac_status"); }; }; then
7715
7716         cf_cv_find_linkage_utf8=yes
7717         cf_cv_header_path_utf8=/usr/include
7718         cf_cv_library_path_utf8=/usr/lib
7719
7720 else
7721   echo "$as_me: failed program was:" >&5
7722 cat "conftest.$ac_ext" >&5
7723
7724 LIBS="-lutf8  $cf_save_LIBS"
7725
7726 cat >"conftest.$ac_ext" <<_ACEOF
7727 #line 7727 "configure"
7728 #include "confdefs.h"
7729
7730 #include <libutf8.h>
7731 int
7732 main (void)
7733 {
7734 putwc(0,0);
7735   ;
7736   return 0;
7737 }
7738 _ACEOF
7739 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7740 if { (eval echo "$as_me:7740: \"$ac_link\"") >&5
7741   (eval $ac_link) 2>&5
7742   ac_status=$?
7743   echo "$as_me:7743: \$? = $ac_status" >&5
7744   (exit "$ac_status"); } &&
7745          { ac_try='test -s "conftest$ac_exeext"'
7746   { (eval echo "$as_me:7746: \"$ac_try\"") >&5
7747   (eval $ac_try) 2>&5
7748   ac_status=$?
7749   echo "$as_me:7749: \$? = $ac_status" >&5
7750   (exit "$ac_status"); }; }; then
7751
7752         cf_cv_find_linkage_utf8=yes
7753         cf_cv_header_path_utf8=/usr/include
7754         cf_cv_library_path_utf8=/usr/lib
7755         cf_cv_library_file_utf8="-lutf8"
7756
7757 else
7758   echo "$as_me: failed program was:" >&5
7759 cat "conftest.$ac_ext" >&5
7760
7761         cf_cv_find_linkage_utf8=no
7762         LIBS="$cf_save_LIBS"
7763
7764         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7765
7766 echo "${as_me:-configure}:7766: testing find linkage for utf8 library ..." 1>&5
7767
7768 echo "${as_me:-configure}:7768: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7769
7770         cf_save_CPPFLAGS="$CPPFLAGS"
7771         cf_test_CPPFLAGS="$CPPFLAGS"
7772
7773 cf_search=
7774
7775 # collect the current set of include-directories from compiler flags
7776 cf_header_path_list=""
7777 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7778         for cf_header_path in $CPPFLAGS $CFLAGS
7779         do
7780                 case "$cf_header_path" in
7781                 (-I*)
7782                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7783
7784 test "x$cf_header_path" != "xNONE" && \
7785 test -d "$cf_header_path" && \
7786  {
7787         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7788         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7789         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7790         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7791         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7792         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7793 }
7794
7795                         cf_header_path_list="$cf_header_path_list $cf_search"
7796                         ;;
7797                 esac
7798         done
7799 fi
7800
7801 # add the variations for the package we are looking for
7802
7803 cf_search=
7804
7805 test "x$prefix" != "xNONE" && \
7806 test -d "$prefix" && \
7807  {
7808         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7809         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7810         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7811         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7812         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7813         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7814 }
7815
7816 for cf_subdir_prefix in \
7817         /usr \
7818         /usr/local \
7819         /usr/pkg \
7820         /opt \
7821         /opt/local \
7822         $HOME
7823 do
7824
7825 test "x$cf_subdir_prefix" != "x$prefix" && \
7826 test -d "$cf_subdir_prefix" && \
7827 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7828         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7829         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7830         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7831         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7832         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7833         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7834 }
7835
7836 done
7837
7838 test "$includedir" != NONE && \
7839 test "$includedir" != "/usr/include" && \
7840 test -d "$includedir" && {
7841         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7842         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7843 }
7844
7845 test "$oldincludedir" != NONE && \
7846 test "$oldincludedir" != "/usr/include" && \
7847 test -d "$oldincludedir" && {
7848         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7849         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7850 }
7851
7852 cf_search="$cf_search $cf_header_path_list"
7853
7854         for cf_cv_header_path_utf8 in $cf_search
7855         do
7856                 if test -d "$cf_cv_header_path_utf8" ; then
7857                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7858
7859 echo "${as_me:-configure}:7859: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7860
7861                         CPPFLAGS="$cf_save_CPPFLAGS"
7862
7863         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7864         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7865
7866                         cat >"conftest.$ac_ext" <<_ACEOF
7867 #line 7867 "configure"
7868 #include "confdefs.h"
7869
7870 #include <libutf8.h>
7871 int
7872 main (void)
7873 {
7874 putwc(0,0);
7875   ;
7876   return 0;
7877 }
7878 _ACEOF
7879 rm -f "conftest.$ac_objext"
7880 if { (eval echo "$as_me:7880: \"$ac_compile\"") >&5
7881   (eval $ac_compile) 2>&5
7882   ac_status=$?
7883   echo "$as_me:7883: \$? = $ac_status" >&5
7884   (exit "$ac_status"); } &&
7885          { ac_try='test -s "conftest.$ac_objext"'
7886   { (eval echo "$as_me:7886: \"$ac_try\"") >&5
7887   (eval $ac_try) 2>&5
7888   ac_status=$?
7889   echo "$as_me:7889: \$? = $ac_status" >&5
7890   (exit "$ac_status"); }; }; then
7891
7892                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7893
7894 echo "${as_me:-configure}:7894: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7895
7896                                 cf_cv_find_linkage_utf8=maybe
7897                                 cf_test_CPPFLAGS="$CPPFLAGS"
7898                                 break
7899 else
7900   echo "$as_me: failed program was:" >&5
7901 cat "conftest.$ac_ext" >&5
7902
7903                                 CPPFLAGS="$cf_save_CPPFLAGS"
7904
7905 fi
7906 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7907                 fi
7908         done
7909
7910         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7911
7912 echo "${as_me:-configure}:7912: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7913
7914                 cf_save_LIBS="$LIBS"
7915                 cf_save_LDFLAGS="$LDFLAGS"
7916
7917                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7918
7919 cf_search=
7920 cf_library_path_list=""
7921 if test -n "${LDFLAGS}${LIBS}" ; then
7922         for cf_library_path in $LDFLAGS $LIBS
7923         do
7924                 case "$cf_library_path" in
7925                 (-L*)
7926                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7927
7928 test "x$cf_library_path" != "xNONE" && \
7929 test -d "$cf_library_path" && \
7930  {
7931         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7932         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7933         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7934         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7935         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7936         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7937 }
7938
7939                         cf_library_path_list="$cf_library_path_list $cf_search"
7940                         ;;
7941                 esac
7942         done
7943 fi
7944
7945 cf_search=
7946
7947 test "x$prefix" != "xNONE" && \
7948 test -d "$prefix" && \
7949  {
7950         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7951         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7952         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7953         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7954         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7955         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7956 }
7957
7958 for cf_subdir_prefix in \
7959         /usr \
7960         /usr/local \
7961         /usr/pkg \
7962         /opt \
7963         /opt/local \
7964         $HOME
7965 do
7966
7967 test "x$cf_subdir_prefix" != "x$prefix" && \
7968 test -d "$cf_subdir_prefix" && \
7969 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7970         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7971         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7972         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7973         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7974         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7975         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7976 }
7977
7978 done
7979
7980 cf_search="$cf_library_path_list $cf_search"
7981
7982                         for cf_cv_library_path_utf8 in $cf_search
7983                         do
7984                                 if test -d "$cf_cv_library_path_utf8" ; then
7985                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7986
7987 echo "${as_me:-configure}:7987: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7988
7989                                         CPPFLAGS="$cf_test_CPPFLAGS"
7990                                         LIBS="-lutf8  $cf_save_LIBS"
7991                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7992                                         cat >"conftest.$ac_ext" <<_ACEOF
7993 #line 7993 "configure"
7994 #include "confdefs.h"
7995
7996 #include <libutf8.h>
7997 int
7998 main (void)
7999 {
8000 putwc(0,0);
8001   ;
8002   return 0;
8003 }
8004 _ACEOF
8005 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8006 if { (eval echo "$as_me:8006: \"$ac_link\"") >&5
8007   (eval $ac_link) 2>&5
8008   ac_status=$?
8009   echo "$as_me:8009: \$? = $ac_status" >&5
8010   (exit "$ac_status"); } &&
8011          { ac_try='test -s "conftest$ac_exeext"'
8012   { (eval echo "$as_me:8012: \"$ac_try\"") >&5
8013   (eval $ac_try) 2>&5
8014   ac_status=$?
8015   echo "$as_me:8015: \$? = $ac_status" >&5
8016   (exit "$ac_status"); }; }; then
8017
8018                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8019
8020 echo "${as_me:-configure}:8020: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8021
8022                                         cf_cv_find_linkage_utf8=yes
8023                                         cf_cv_library_file_utf8="-lutf8"
8024                                         break
8025 else
8026   echo "$as_me: failed program was:" >&5
8027 cat "conftest.$ac_ext" >&5
8028
8029                                         CPPFLAGS="$cf_save_CPPFLAGS"
8030                                         LIBS="$cf_save_LIBS"
8031                                         LDFLAGS="$cf_save_LDFLAGS"
8032
8033 fi
8034 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8035                                 fi
8036                         done
8037                         CPPFLAGS="$cf_save_CPPFLAGS"
8038                         LDFLAGS="$cf_save_LDFLAGS"
8039                 fi
8040
8041         else
8042                 cf_cv_find_linkage_utf8=no
8043         fi
8044
8045 fi
8046 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8047
8048 fi
8049 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8050
8051 LIBS="$cf_save_LIBS"
8052
8053 if test "$cf_cv_find_linkage_utf8" = yes ; then
8054 cf_cv_utf8_lib=add-on
8055 else
8056 cf_cv_utf8_lib=no
8057 fi
8058
8059 fi
8060 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8061 fi
8062 echo "$as_me:8062: result: $cf_cv_utf8_lib" >&5
8063 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8064
8065 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8066 # ncurses/ncursesw:
8067 if test "$cf_cv_utf8_lib" = "add-on" ; then
8068
8069 cat >>confdefs.h <<\EOF
8070 #define HAVE_LIBUTF8_H 1
8071 EOF
8072
8073 if test -n "$cf_cv_header_path_utf8" ; then
8074   for cf_add_incdir in $cf_cv_header_path_utf8
8075   do
8076         while test "$cf_add_incdir" != /usr/include
8077         do
8078           if test -d "$cf_add_incdir"
8079           then
8080                 cf_have_incdir=no
8081                 if test -n "$CFLAGS$CPPFLAGS" ; then
8082                   # a loop is needed to ensure we can add subdirs of existing dirs
8083                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8084                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8085                           cf_have_incdir=yes; break
8086                         fi
8087                   done
8088                 fi
8089
8090                 if test "$cf_have_incdir" = no ; then
8091                   if test "$cf_add_incdir" = /usr/local/include ; then
8092                         if test "$GCC" = yes
8093                         then
8094                           cf_save_CPPFLAGS=$CPPFLAGS
8095
8096         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8097         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8098
8099                           cat >"conftest.$ac_ext" <<_ACEOF
8100 #line 8100 "configure"
8101 #include "confdefs.h"
8102 #include <stdio.h>
8103 int
8104 main (void)
8105 {
8106 printf("Hello")
8107   ;
8108   return 0;
8109 }
8110 _ACEOF
8111 rm -f "conftest.$ac_objext"
8112 if { (eval echo "$as_me:8112: \"$ac_compile\"") >&5
8113   (eval $ac_compile) 2>&5
8114   ac_status=$?
8115   echo "$as_me:8115: \$? = $ac_status" >&5
8116   (exit "$ac_status"); } &&
8117          { ac_try='test -s "conftest.$ac_objext"'
8118   { (eval echo "$as_me:8118: \"$ac_try\"") >&5
8119   (eval $ac_try) 2>&5
8120   ac_status=$?
8121   echo "$as_me:8121: \$? = $ac_status" >&5
8122   (exit "$ac_status"); }; }; then
8123   :
8124 else
8125   echo "$as_me: failed program was:" >&5
8126 cat "conftest.$ac_ext" >&5
8127 cf_have_incdir=yes
8128 fi
8129 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8130                           CPPFLAGS=$cf_save_CPPFLAGS
8131                         fi
8132                   fi
8133                 fi
8134
8135                 if test "$cf_have_incdir" = no ; then
8136                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8137
8138 echo "${as_me:-configure}:8138: testing adding $cf_add_incdir to include-path ..." 1>&5
8139
8140                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8141
8142                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8143                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8144                   cf_add_incdir="$cf_top_incdir"
8145                 else
8146                   break
8147                 fi
8148           else
8149                 break
8150           fi
8151         done
8152   done
8153 fi
8154
8155 if test -n "$cf_cv_library_path_utf8" ; then
8156         for cf_add_libdir in $cf_cv_library_path_utf8
8157         do
8158                 if test "$cf_add_libdir" = /usr/lib ; then
8159                         :
8160                 elif test -d "$cf_add_libdir"
8161                 then
8162                         cf_have_libdir=no
8163                         if test -n "$LDFLAGS$LIBS" ; then
8164                                 # a loop is needed to ensure we can add subdirs of existing dirs
8165                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
8166                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8167                                                 cf_have_libdir=yes; break
8168                                         fi
8169                                 done
8170                         fi
8171                         if test "$cf_have_libdir" = no ; then
8172                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8173
8174 echo "${as_me:-configure}:8174: testing adding $cf_add_libdir to library-path ..." 1>&5
8175
8176                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8177                         fi
8178                 fi
8179         done
8180 fi
8181
8182 cf_add_libs="$LIBS"
8183 # reverse order
8184 cf_add_0lib=
8185 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8186 # filter duplicates
8187 for cf_add_1lib in $cf_add_0lib; do
8188         for cf_add_2lib in $cf_add_libs; do
8189                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8190                         cf_add_1lib=
8191                         break
8192                 fi
8193         done
8194         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8195 done
8196 LIBS="$cf_add_libs"
8197
8198 fi
8199
8200 cf_ncuconfig_root=$cf_cv_screen
8201 cf_have_ncuconfig=no
8202
8203 if test "x${PKG_CONFIG:=none}" != xnone; then
8204         echo "$as_me:8204: checking pkg-config for $cf_ncuconfig_root" >&5
8205 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8206         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8207                 echo "$as_me:8207: result: yes" >&5
8208 echo "${ECHO_T}yes" >&6
8209
8210                 echo "$as_me:8210: checking if the $cf_ncuconfig_root package files work" >&5
8211 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8212                 cf_have_ncuconfig=unknown
8213
8214                 cf_save_CFLAGS="$CFLAGS"
8215                 cf_save_CPPFLAGS="$CPPFLAGS"
8216                 cf_save_LIBS="$LIBS"
8217
8218                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8219                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8220
8221                 # while -W for passing linker flags is prevalent, it is not "standard".
8222                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8223                 # incompatible _and_ non-standard -W option which gives an error.  Work
8224                 # around that pitfall.
8225                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8226                 (x*c[89]9@@*-W*)
8227
8228 cf_fix_cppflags=no
8229 cf_new_cflags=
8230 cf_new_cppflags=
8231 cf_new_extra_cppflags=
8232
8233 for cf_add_cflags in $cf_pkg_cflags
8234 do
8235 case "$cf_fix_cppflags" in
8236 (no)
8237         case "$cf_add_cflags" in
8238         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8239                 case "$cf_add_cflags" in
8240                 (-D*)
8241                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8242
8243                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8244                                 && test -z "${cf_tst_cflags}" \
8245                                 && cf_fix_cppflags=yes
8246
8247                         if test "$cf_fix_cppflags" = yes ; then
8248
8249         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8250         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8251
8252                                 continue
8253                         elif test "${cf_tst_cflags}" = "\"'" ; then
8254
8255         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8256         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8257
8258                                 continue
8259                         fi
8260                         ;;
8261                 esac
8262                 case "$CPPFLAGS" in
8263                 (*$cf_add_cflags)
8264                         ;;
8265                 (*)
8266                         case "$cf_add_cflags" in
8267                         (-D*)
8268                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8269
8270 CPPFLAGS=`echo "$CPPFLAGS" | \
8271         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8272                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8273
8274                                 ;;
8275                         esac
8276
8277         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8278         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8279
8280                         ;;
8281                 esac
8282                 ;;
8283         (*)
8284
8285         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8286         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8287
8288                 ;;
8289         esac
8290         ;;
8291 (yes)
8292
8293         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8294         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8295
8296         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8297
8298         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8299                 && test -z "${cf_tst_cflags}" \
8300                 && cf_fix_cppflags=no
8301         ;;
8302 esac
8303 done
8304
8305 if test -n "$cf_new_cflags" ; then
8306
8307         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8308         CFLAGS="${CFLAGS}$cf_new_cflags"
8309
8310 fi
8311
8312 if test -n "$cf_new_cppflags" ; then
8313
8314         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8315         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8316
8317 fi
8318
8319 if test -n "$cf_new_extra_cppflags" ; then
8320
8321         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8322         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8323
8324 fi
8325
8326 cf_add_libs="$LIBS"
8327 # reverse order
8328 cf_add_0lib=
8329 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8330 # filter duplicates
8331 for cf_add_1lib in $cf_add_0lib; do
8332         for cf_add_2lib in $cf_add_libs; do
8333                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8334                         cf_add_1lib=
8335                         break
8336                 fi
8337         done
8338         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8339 done
8340 LIBS="$cf_add_libs"
8341
8342                         cat >"conftest.$ac_ext" <<_ACEOF
8343 #line 8343 "configure"
8344 #include "confdefs.h"
8345 #include <${cf_cv_ncurses_header:-curses.h}>
8346 int
8347 main (void)
8348 {
8349 initscr(); mousemask(0,0); tigetstr((char *)0);
8350   ;
8351   return 0;
8352 }
8353 _ACEOF
8354 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8355 if { (eval echo "$as_me:8355: \"$ac_link\"") >&5
8356   (eval $ac_link) 2>&5
8357   ac_status=$?
8358   echo "$as_me:8358: \$? = $ac_status" >&5
8359   (exit "$ac_status"); } &&
8360          { ac_try='test -s "conftest$ac_exeext"'
8361   { (eval echo "$as_me:8361: \"$ac_try\"") >&5
8362   (eval $ac_try) 2>&5
8363   ac_status=$?
8364   echo "$as_me:8364: \$? = $ac_status" >&5
8365   (exit "$ac_status"); }; }; then
8366   if test "$cross_compiling" = yes; then
8367   cf_test_ncuconfig=maybe
8368 else
8369   cat >"conftest.$ac_ext" <<_ACEOF
8370 #line 8370 "configure"
8371 #include "confdefs.h"
8372 #include <${cf_cv_ncurses_header:-curses.h}>
8373                                         int main(void)
8374                                         { const char *xx = curses_version(); return (xx == 0); }
8375 _ACEOF
8376 rm -f "conftest$ac_exeext"
8377 if { (eval echo "$as_me:8377: \"$ac_link\"") >&5
8378   (eval $ac_link) 2>&5
8379   ac_status=$?
8380   echo "$as_me:8380: \$? = $ac_status" >&5
8381   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8382   { (eval echo "$as_me:8382: \"$ac_try\"") >&5
8383   (eval $ac_try) 2>&5
8384   ac_status=$?
8385   echo "$as_me:8385: \$? = $ac_status" >&5
8386   (exit "$ac_status"); }; }; then
8387   cf_test_ncuconfig=yes
8388 else
8389   echo "$as_me: program exited with status $ac_status" >&5
8390 echo "$as_me: failed program was:" >&5
8391 cat "conftest.$ac_ext" >&5
8392 cf_test_ncuconfig=no
8393 fi
8394 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8395 fi
8396 else
8397   echo "$as_me: failed program was:" >&5
8398 cat "conftest.$ac_ext" >&5
8399 cf_test_ncuconfig=no
8400 fi
8401 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8402
8403                         CFLAGS="$cf_save_CFLAGS"
8404                         CPPFLAGS="$cf_save_CPPFLAGS"
8405                         LIBS="$cf_save_LIBS"
8406
8407                         if test "x$cf_test_ncuconfig" != xyes; then
8408                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8409                                 cf_pkg_cflags="$cf_temp"
8410                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8411                                 cf_pkg_libs="$cf_temp"
8412                         fi
8413                         ;;
8414                 esac
8415
8416 for cf_add_cflags in $cf_pkg_cflags
8417 do
8418         case "x$cf_add_cflags" in
8419         (x-[DU]*)
8420
8421 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8422 while true
8423 do
8424         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'`
8425         test "$CFLAGS" != "$cf_old_cflag" || break
8426
8427         CFLAGS="$cf_old_cflag"
8428 done
8429
8430 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8431 while true
8432 do
8433         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'`
8434         test "$CPPFLAGS" != "$cf_old_cflag" || break
8435
8436         CPPFLAGS="$cf_old_cflag"
8437 done
8438
8439                 ;;
8440         esac
8441
8442 cf_fix_cppflags=no
8443 cf_new_cflags=
8444 cf_new_cppflags=
8445 cf_new_extra_cppflags=
8446
8447 for cf_add_cflags in $cf_add_cflags
8448 do
8449 case "$cf_fix_cppflags" in
8450 (no)
8451         case "$cf_add_cflags" in
8452         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8453                 case "$cf_add_cflags" in
8454                 (-D*)
8455                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8456
8457                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8458                                 && test -z "${cf_tst_cflags}" \
8459                                 && cf_fix_cppflags=yes
8460
8461                         if test "$cf_fix_cppflags" = yes ; then
8462
8463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8465
8466                                 continue
8467                         elif test "${cf_tst_cflags}" = "\"'" ; then
8468
8469         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8470         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8471
8472                                 continue
8473                         fi
8474                         ;;
8475                 esac
8476                 case "$CPPFLAGS" in
8477                 (*$cf_add_cflags)
8478                         ;;
8479                 (*)
8480                         case "$cf_add_cflags" in
8481                         (-D*)
8482                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8483
8484 CPPFLAGS=`echo "$CPPFLAGS" | \
8485         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8486                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8487
8488                                 ;;
8489                         esac
8490
8491         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8492         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8493
8494                         ;;
8495                 esac
8496                 ;;
8497         (*)
8498
8499         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8500         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8501
8502                 ;;
8503         esac
8504         ;;
8505 (yes)
8506
8507         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8508         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8509
8510         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8511
8512         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8513                 && test -z "${cf_tst_cflags}" \
8514                 && cf_fix_cppflags=no
8515         ;;
8516 esac
8517 done
8518
8519 if test -n "$cf_new_cflags" ; then
8520
8521         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8522         CFLAGS="${CFLAGS}$cf_new_cflags"
8523
8524 fi
8525
8526 if test -n "$cf_new_cppflags" ; then
8527
8528         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8529         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8530
8531 fi
8532
8533 if test -n "$cf_new_extra_cppflags" ; then
8534
8535         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8536         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8537
8538 fi
8539
8540 done
8541
8542 cf_add_libs="$LIBS"
8543 # reverse order
8544 cf_add_0lib=
8545 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8546 # filter duplicates
8547 for cf_add_1lib in $cf_add_0lib; do
8548         for cf_add_2lib in $cf_add_libs; do
8549                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8550                         cf_add_1lib=
8551                         break
8552                 fi
8553         done
8554         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8555 done
8556 LIBS="$cf_add_libs"
8557
8558                 cat >"conftest.$ac_ext" <<_ACEOF
8559 #line 8559 "configure"
8560 #include "confdefs.h"
8561 #include <${cf_cv_ncurses_header:-curses.h}>
8562 int
8563 main (void)
8564 {
8565 initscr(); mousemask(0,0); tigetstr((char *)0);
8566   ;
8567   return 0;
8568 }
8569 _ACEOF
8570 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8571 if { (eval echo "$as_me:8571: \"$ac_link\"") >&5
8572   (eval $ac_link) 2>&5
8573   ac_status=$?
8574   echo "$as_me:8574: \$? = $ac_status" >&5
8575   (exit "$ac_status"); } &&
8576          { ac_try='test -s "conftest$ac_exeext"'
8577   { (eval echo "$as_me:8577: \"$ac_try\"") >&5
8578   (eval $ac_try) 2>&5
8579   ac_status=$?
8580   echo "$as_me:8580: \$? = $ac_status" >&5
8581   (exit "$ac_status"); }; }; then
8582   if test "$cross_compiling" = yes; then
8583   cf_have_ncuconfig=maybe
8584 else
8585   cat >"conftest.$ac_ext" <<_ACEOF
8586 #line 8586 "configure"
8587 #include "confdefs.h"
8588 #include <${cf_cv_ncurses_header:-curses.h}>
8589                                 int main(void)
8590                                 { const char *xx = curses_version(); return (xx == 0); }
8591 _ACEOF
8592 rm -f "conftest$ac_exeext"
8593 if { (eval echo "$as_me:8593: \"$ac_link\"") >&5
8594   (eval $ac_link) 2>&5
8595   ac_status=$?
8596   echo "$as_me:8596: \$? = $ac_status" >&5
8597   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8598   { (eval echo "$as_me:8598: \"$ac_try\"") >&5
8599   (eval $ac_try) 2>&5
8600   ac_status=$?
8601   echo "$as_me:8601: \$? = $ac_status" >&5
8602   (exit "$ac_status"); }; }; then
8603   cf_have_ncuconfig=yes
8604 else
8605   echo "$as_me: program exited with status $ac_status" >&5
8606 echo "$as_me: failed program was:" >&5
8607 cat "conftest.$ac_ext" >&5
8608 cf_have_ncuconfig=no
8609 fi
8610 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8611 fi
8612 else
8613   echo "$as_me: failed program was:" >&5
8614 cat "conftest.$ac_ext" >&5
8615 cf_have_ncuconfig=no
8616 fi
8617 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8618                 echo "$as_me:8618: result: $cf_have_ncuconfig" >&5
8619 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8620                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8621                 if test "$cf_have_ncuconfig" != "yes"
8622                 then
8623                         CPPFLAGS="$cf_save_CPPFLAGS"
8624                         LIBS="$cf_save_LIBS"
8625                         NCURSES_CONFIG_PKG=none
8626                 else
8627
8628 cat >>confdefs.h <<\EOF
8629 #define NCURSES 1
8630 EOF
8631
8632                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8633
8634 echo "$as_me:8634: checking for terminfo header" >&5
8635 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8636 if test "${cf_cv_term_header+set}" = set; then
8637   echo $ECHO_N "(cached) $ECHO_C" >&6
8638 else
8639
8640 case "${cf_cv_ncurses_header}" in
8641 (*/ncurses.h|*/ncursesw.h)
8642         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8643         ;;
8644 (*)
8645         cf_term_header=term.h
8646         ;;
8647 esac
8648
8649 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8650 do
8651 cat >"conftest.$ac_ext" <<_ACEOF
8652 #line 8652 "configure"
8653 #include "confdefs.h"
8654 #include <stdio.h>
8655 #include <${cf_cv_ncurses_header:-curses.h}>
8656 #include <$cf_test>
8657
8658 int
8659 main (void)
8660 {
8661 int x = auto_left_margin; (void)x
8662   ;
8663   return 0;
8664 }
8665 _ACEOF
8666 rm -f "conftest.$ac_objext"
8667 if { (eval echo "$as_me:8667: \"$ac_compile\"") >&5
8668   (eval $ac_compile) 2>&5
8669   ac_status=$?
8670   echo "$as_me:8670: \$? = $ac_status" >&5
8671   (exit "$ac_status"); } &&
8672          { ac_try='test -s "conftest.$ac_objext"'
8673   { (eval echo "$as_me:8673: \"$ac_try\"") >&5
8674   (eval $ac_try) 2>&5
8675   ac_status=$?
8676   echo "$as_me:8676: \$? = $ac_status" >&5
8677   (exit "$ac_status"); }; }; then
8678
8679         cf_cv_term_header="$cf_test"
8680 else
8681   echo "$as_me: failed program was:" >&5
8682 cat "conftest.$ac_ext" >&5
8683
8684         cf_cv_term_header=unknown
8685
8686 fi
8687 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8688         test "$cf_cv_term_header" != unknown && break
8689 done
8690
8691 fi
8692 echo "$as_me:8692: result: $cf_cv_term_header" >&5
8693 echo "${ECHO_T}$cf_cv_term_header" >&6
8694
8695 # Set definitions to allow ifdef'ing to accommodate subdirectories
8696
8697 case "$cf_cv_term_header" in
8698 (*term.h)
8699
8700 cat >>confdefs.h <<\EOF
8701 #define HAVE_TERM_H 1
8702 EOF
8703
8704         ;;
8705 esac
8706
8707 case "$cf_cv_term_header" in
8708 (ncurses/term.h)
8709
8710 cat >>confdefs.h <<\EOF
8711 #define HAVE_NCURSES_TERM_H 1
8712 EOF
8713
8714         ;;
8715 (ncursesw/term.h)
8716
8717 cat >>confdefs.h <<\EOF
8718 #define HAVE_NCURSESW_TERM_H 1
8719 EOF
8720
8721         ;;
8722 esac
8723
8724                 fi
8725
8726         else
8727                 echo "$as_me:8727: result: no" >&5
8728 echo "${ECHO_T}no" >&6
8729                 NCURSES_CONFIG_PKG=none
8730         fi
8731 else
8732         NCURSES_CONFIG_PKG=none
8733 fi
8734
8735 if test "x$cf_have_ncuconfig" = "xno"; then
8736         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8737
8738 if test -n "$ac_tool_prefix"; then
8739   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8740   do
8741     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8742 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8743 echo "$as_me:8743: checking for $ac_word" >&5
8744 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8745 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8746   echo $ECHO_N "(cached) $ECHO_C" >&6
8747 else
8748   if test -n "$NCURSES_CONFIG"; then
8749   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8750 else
8751   ac_save_IFS=$IFS; IFS=$ac_path_separator
8752 ac_dummy="$PATH"
8753 for ac_dir in $ac_dummy; do
8754   IFS=$ac_save_IFS
8755   test -z "$ac_dir" && ac_dir=.
8756   $as_executable_p "$ac_dir/$ac_word" || continue
8757 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8758 echo "$as_me:8758: found $ac_dir/$ac_word" >&5
8759 break
8760 done
8761
8762 fi
8763 fi
8764 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8765 if test -n "$NCURSES_CONFIG"; then
8766   echo "$as_me:8766: result: $NCURSES_CONFIG" >&5
8767 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8768 else
8769   echo "$as_me:8769: result: no" >&5
8770 echo "${ECHO_T}no" >&6
8771 fi
8772
8773     test -n "$NCURSES_CONFIG" && break
8774   done
8775 fi
8776 if test -z "$NCURSES_CONFIG"; then
8777   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8778   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8779 do
8780   # Extract the first word of "$ac_prog", so it can be a program name with args.
8781 set dummy $ac_prog; ac_word=$2
8782 echo "$as_me:8782: checking for $ac_word" >&5
8783 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8784 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8785   echo $ECHO_N "(cached) $ECHO_C" >&6
8786 else
8787   if test -n "$ac_ct_NCURSES_CONFIG"; then
8788   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8789 else
8790   ac_save_IFS=$IFS; IFS=$ac_path_separator
8791 ac_dummy="$PATH"
8792 for ac_dir in $ac_dummy; do
8793   IFS=$ac_save_IFS
8794   test -z "$ac_dir" && ac_dir=.
8795   $as_executable_p "$ac_dir/$ac_word" || continue
8796 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8797 echo "$as_me:8797: found $ac_dir/$ac_word" >&5
8798 break
8799 done
8800
8801 fi
8802 fi
8803 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8804 if test -n "$ac_ct_NCURSES_CONFIG"; then
8805   echo "$as_me:8805: result: $ac_ct_NCURSES_CONFIG" >&5
8806 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8807 else
8808   echo "$as_me:8808: result: no" >&5
8809 echo "${ECHO_T}no" >&6
8810 fi
8811
8812   test -n "$ac_ct_NCURSES_CONFIG" && break
8813 done
8814 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8815
8816   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8817 fi
8818
8819         if test "$NCURSES_CONFIG" != none ; then
8820
8821 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8822 do
8823         case "x$cf_add_cflags" in
8824         (x-[DU]*)
8825
8826 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8827 while true
8828 do
8829         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'`
8830         test "$CFLAGS" != "$cf_old_cflag" || break
8831
8832         CFLAGS="$cf_old_cflag"
8833 done
8834
8835 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8836 while true
8837 do
8838         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'`
8839         test "$CPPFLAGS" != "$cf_old_cflag" || break
8840
8841         CPPFLAGS="$cf_old_cflag"
8842 done
8843
8844                 ;;
8845         esac
8846
8847 cf_fix_cppflags=no
8848 cf_new_cflags=
8849 cf_new_cppflags=
8850 cf_new_extra_cppflags=
8851
8852 for cf_add_cflags in $cf_add_cflags
8853 do
8854 case "$cf_fix_cppflags" in
8855 (no)
8856         case "$cf_add_cflags" in
8857         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8858                 case "$cf_add_cflags" in
8859                 (-D*)
8860                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8861
8862                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8863                                 && test -z "${cf_tst_cflags}" \
8864                                 && cf_fix_cppflags=yes
8865
8866                         if test "$cf_fix_cppflags" = yes ; then
8867
8868         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8869         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8870
8871                                 continue
8872                         elif test "${cf_tst_cflags}" = "\"'" ; then
8873
8874         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8875         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8876
8877                                 continue
8878                         fi
8879                         ;;
8880                 esac
8881                 case "$CPPFLAGS" in
8882                 (*$cf_add_cflags)
8883                         ;;
8884                 (*)
8885                         case "$cf_add_cflags" in
8886                         (-D*)
8887                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8888
8889 CPPFLAGS=`echo "$CPPFLAGS" | \
8890         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8891                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8892
8893                                 ;;
8894                         esac
8895
8896         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8897         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8898
8899                         ;;
8900                 esac
8901                 ;;
8902         (*)
8903
8904         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8905         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8906
8907                 ;;
8908         esac
8909         ;;
8910 (yes)
8911
8912         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8913         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8914
8915         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8916
8917         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8918                 && test -z "${cf_tst_cflags}" \
8919                 && cf_fix_cppflags=no
8920         ;;
8921 esac
8922 done
8923
8924 if test -n "$cf_new_cflags" ; then
8925
8926         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8927         CFLAGS="${CFLAGS}$cf_new_cflags"
8928
8929 fi
8930
8931 if test -n "$cf_new_cppflags" ; then
8932
8933         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8934         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8935
8936 fi
8937
8938 if test -n "$cf_new_extra_cppflags" ; then
8939
8940         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8941         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8942
8943 fi
8944
8945 done
8946
8947 cf_add_libs="$LIBS"
8948 # reverse order
8949 cf_add_0lib=
8950 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8951 # filter duplicates
8952 for cf_add_1lib in $cf_add_0lib; do
8953         for cf_add_2lib in $cf_add_libs; do
8954                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8955                         cf_add_1lib=
8956                         break
8957                 fi
8958         done
8959         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8960 done
8961 LIBS="$cf_add_libs"
8962
8963                 # even with config script, some packages use no-override for curses.h
8964
8965 echo "$as_me:8965: checking if we have identified curses headers" >&5
8966 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8967 if test "${cf_cv_ncurses_header+set}" = set; then
8968   echo $ECHO_N "(cached) $ECHO_C" >&6
8969 else
8970
8971 cf_cv_ncurses_header=none
8972 for cf_header in \
8973         ncurses.h $cf_cv_screen/ncurses.h \
8974         curses.h $cf_cv_screen/curses.h
8975 do
8976 cat >"conftest.$ac_ext" <<_ACEOF
8977 #line 8977 "configure"
8978 #include "confdefs.h"
8979 #include <${cf_header}>
8980 int
8981 main (void)
8982 {
8983 initscr(); tgoto("?", 0,0)
8984   ;
8985   return 0;
8986 }
8987 _ACEOF
8988 rm -f "conftest.$ac_objext"
8989 if { (eval echo "$as_me:8989: \"$ac_compile\"") >&5
8990   (eval $ac_compile) 2>&5
8991   ac_status=$?
8992   echo "$as_me:8992: \$? = $ac_status" >&5
8993   (exit "$ac_status"); } &&
8994          { ac_try='test -s "conftest.$ac_objext"'
8995   { (eval echo "$as_me:8995: \"$ac_try\"") >&5
8996   (eval $ac_try) 2>&5
8997   ac_status=$?
8998   echo "$as_me:8998: \$? = $ac_status" >&5
8999   (exit "$ac_status"); }; }; then
9000   cf_cv_ncurses_header=$cf_header; break
9001 else
9002   echo "$as_me: failed program was:" >&5
9003 cat "conftest.$ac_ext" >&5
9004 fi
9005 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9006 done
9007
9008 fi
9009 echo "$as_me:9009: result: $cf_cv_ncurses_header" >&5
9010 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9011
9012 if test "$cf_cv_ncurses_header" = none ; then
9013         { { echo "$as_me:9013: error: No curses header-files found" >&5
9014 echo "$as_me: error: No curses header-files found" >&2;}
9015    { (exit 1); exit 1; }; }
9016 fi
9017
9018 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9019
9020 for ac_header in $cf_cv_ncurses_header
9021 do
9022 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9023 echo "$as_me:9023: checking for $ac_header" >&5
9024 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9025 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9026   echo $ECHO_N "(cached) $ECHO_C" >&6
9027 else
9028   cat >"conftest.$ac_ext" <<_ACEOF
9029 #line 9029 "configure"
9030 #include "confdefs.h"
9031 #include <$ac_header>
9032 _ACEOF
9033 if { (eval echo "$as_me:9033: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9034   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9035   ac_status=$?
9036   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9037   rm -f conftest.er1
9038   cat conftest.err >&5
9039   echo "$as_me:9039: \$? = $ac_status" >&5
9040   (exit "$ac_status"); } >/dev/null; then
9041   if test -s conftest.err; then
9042     ac_cpp_err=$ac_c_preproc_warn_flag
9043   else
9044     ac_cpp_err=
9045   fi
9046 else
9047   ac_cpp_err=yes
9048 fi
9049 if test -z "$ac_cpp_err"; then
9050   eval "$as_ac_Header=yes"
9051 else
9052   echo "$as_me: failed program was:" >&5
9053   cat "conftest.$ac_ext" >&5
9054   eval "$as_ac_Header=no"
9055 fi
9056 rm -f conftest.err "conftest.$ac_ext"
9057 fi
9058 echo "$as_me:9058: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9059 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9060 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9061   cat >>confdefs.h <<EOF
9062 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9063 EOF
9064
9065 fi
9066 done
9067
9068 cat >>confdefs.h <<\EOF
9069 #define NCURSES 1
9070 EOF
9071
9072 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9073
9074                 cat >>confdefs.h <<EOF
9075 #define $cf_nculib_ROOT 1
9076 EOF
9077
9078                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9079
9080         else
9081
9082 cf_ncuhdr_root=$cf_cv_screen
9083
9084 test -n "$cf_cv_curses_dir" && \
9085 test "$cf_cv_curses_dir" != "no" && { \
9086
9087 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9088   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9089   do
9090         while test "$cf_add_incdir" != /usr/include
9091         do
9092           if test -d "$cf_add_incdir"
9093           then
9094                 cf_have_incdir=no
9095                 if test -n "$CFLAGS$CPPFLAGS" ; then
9096                   # a loop is needed to ensure we can add subdirs of existing dirs
9097                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9098                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9099                           cf_have_incdir=yes; break
9100                         fi
9101                   done
9102                 fi
9103
9104                 if test "$cf_have_incdir" = no ; then
9105                   if test "$cf_add_incdir" = /usr/local/include ; then
9106                         if test "$GCC" = yes
9107                         then
9108                           cf_save_CPPFLAGS=$CPPFLAGS
9109
9110         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9111         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9112
9113                           cat >"conftest.$ac_ext" <<_ACEOF
9114 #line 9114 "configure"
9115 #include "confdefs.h"
9116 #include <stdio.h>
9117 int
9118 main (void)
9119 {
9120 printf("Hello")
9121   ;
9122   return 0;
9123 }
9124 _ACEOF
9125 rm -f "conftest.$ac_objext"
9126 if { (eval echo "$as_me:9126: \"$ac_compile\"") >&5
9127   (eval $ac_compile) 2>&5
9128   ac_status=$?
9129   echo "$as_me:9129: \$? = $ac_status" >&5
9130   (exit "$ac_status"); } &&
9131          { ac_try='test -s "conftest.$ac_objext"'
9132   { (eval echo "$as_me:9132: \"$ac_try\"") >&5
9133   (eval $ac_try) 2>&5
9134   ac_status=$?
9135   echo "$as_me:9135: \$? = $ac_status" >&5
9136   (exit "$ac_status"); }; }; then
9137   :
9138 else
9139   echo "$as_me: failed program was:" >&5
9140 cat "conftest.$ac_ext" >&5
9141 cf_have_incdir=yes
9142 fi
9143 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9144                           CPPFLAGS=$cf_save_CPPFLAGS
9145                         fi
9146                   fi
9147                 fi
9148
9149                 if test "$cf_have_incdir" = no ; then
9150                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9151
9152 echo "${as_me:-configure}:9152: testing adding $cf_add_incdir to include-path ..." 1>&5
9153
9154                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9155
9156                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9157                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9158                   cf_add_incdir="$cf_top_incdir"
9159                 else
9160                   break
9161                 fi
9162           else
9163                 break
9164           fi
9165         done
9166   done
9167 fi
9168
9169 }
9170
9171 echo "$as_me:9171: checking for $cf_ncuhdr_root header in include-path" >&5
9172 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9173 if test "${cf_cv_ncurses_h+set}" = set; then
9174   echo $ECHO_N "(cached) $ECHO_C" >&6
9175 else
9176
9177         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9178         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
9179         for cf_header in $cf_header_list
9180         do
9181
9182         cat >"conftest.$ac_ext" <<_ACEOF
9183 #line 9183 "configure"
9184 #include "confdefs.h"
9185
9186 #include <$cf_header>
9187 int
9188 main (void)
9189 {
9190
9191 #ifdef NCURSES_VERSION
9192
9193 printf("%s\\n", NCURSES_VERSION);
9194 #else
9195 #ifdef __NCURSES_H
9196 printf("old\\n");
9197 #else
9198         make an error
9199 #endif
9200 #endif
9201
9202   ;
9203   return 0;
9204 }
9205 _ACEOF
9206 rm -f "conftest.$ac_objext"
9207 if { (eval echo "$as_me:9207: \"$ac_compile\"") >&5
9208   (eval $ac_compile) 2>&5
9209   ac_status=$?
9210   echo "$as_me:9210: \$? = $ac_status" >&5
9211   (exit "$ac_status"); } &&
9212          { ac_try='test -s "conftest.$ac_objext"'
9213   { (eval echo "$as_me:9213: \"$ac_try\"") >&5
9214   (eval $ac_try) 2>&5
9215   ac_status=$?
9216   echo "$as_me:9216: \$? = $ac_status" >&5
9217   (exit "$ac_status"); }; }; then
9218   cf_cv_ncurses_h=$cf_header
9219
9220 else
9221   echo "$as_me: failed program was:" >&5
9222 cat "conftest.$ac_ext" >&5
9223 cf_cv_ncurses_h=no
9224 fi
9225 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9226
9227                 test "$cf_cv_ncurses_h" != no && break
9228         done
9229
9230 fi
9231 echo "$as_me:9231: result: $cf_cv_ncurses_h" >&5
9232 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9233
9234 if test "$cf_cv_ncurses_h" != no ; then
9235         cf_cv_ncurses_header=$cf_cv_ncurses_h
9236 else
9237
9238 echo "$as_me:9238: checking for $cf_ncuhdr_root include-path" >&5
9239 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9240 if test "${cf_cv_ncurses_h2+set}" = set; then
9241   echo $ECHO_N "(cached) $ECHO_C" >&6
9242 else
9243
9244         test -n "$verbose" && echo
9245
9246 cf_search=
9247
9248 # collect the current set of include-directories from compiler flags
9249 cf_header_path_list=""
9250 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9251         for cf_header_path in $CPPFLAGS $CFLAGS
9252         do
9253                 case "$cf_header_path" in
9254                 (-I*)
9255                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9256
9257 test "x$cf_header_path" != "xNONE" && \
9258 test -d "$cf_header_path" && \
9259  {
9260         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9261         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
9262         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9263         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9264         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9265         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"
9266 }
9267
9268                         cf_header_path_list="$cf_header_path_list $cf_search"
9269                         ;;
9270                 esac
9271         done
9272 fi
9273
9274 # add the variations for the package we are looking for
9275
9276 cf_search=
9277
9278 test "x$prefix" != "xNONE" && \
9279 test -d "$prefix" && \
9280  {
9281         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9282         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
9283         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9284         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9285         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9286         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9287 }
9288
9289 for cf_subdir_prefix in \
9290         /usr \
9291         /usr/local \
9292         /usr/pkg \
9293         /opt \
9294         /opt/local \
9295         $HOME
9296 do
9297
9298 test "x$cf_subdir_prefix" != "x$prefix" && \
9299 test -d "$cf_subdir_prefix" && \
9300 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9301         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9302         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
9303         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9304         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9305         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9306         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"
9307 }
9308
9309 done
9310
9311 test "$includedir" != NONE && \
9312 test "$includedir" != "/usr/include" && \
9313 test -d "$includedir" && {
9314         test -d "$includedir" &&    cf_search="$cf_search $includedir"
9315         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9316 }
9317
9318 test "$oldincludedir" != NONE && \
9319 test "$oldincludedir" != "/usr/include" && \
9320 test -d "$oldincludedir" && {
9321         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
9322         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9323 }
9324
9325 cf_search="$cf_search $cf_header_path_list"
9326
9327         test -n "$verbose" && echo "search path $cf_search"
9328         cf_save2_CPPFLAGS="$CPPFLAGS"
9329         for cf_incdir in $cf_search
9330         do
9331
9332 if test -n "$cf_incdir" ; then
9333   for cf_add_incdir in $cf_incdir
9334   do
9335         while test "$cf_add_incdir" != /usr/include
9336         do
9337           if test -d "$cf_add_incdir"
9338           then
9339                 cf_have_incdir=no
9340                 if test -n "$CFLAGS$CPPFLAGS" ; then
9341                   # a loop is needed to ensure we can add subdirs of existing dirs
9342                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9343                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9344                           cf_have_incdir=yes; break
9345                         fi
9346                   done
9347                 fi
9348
9349                 if test "$cf_have_incdir" = no ; then
9350                   if test "$cf_add_incdir" = /usr/local/include ; then
9351                         if test "$GCC" = yes
9352                         then
9353                           cf_save_CPPFLAGS=$CPPFLAGS
9354
9355         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9356         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9357
9358                           cat >"conftest.$ac_ext" <<_ACEOF
9359 #line 9359 "configure"
9360 #include "confdefs.h"
9361 #include <stdio.h>
9362 int
9363 main (void)
9364 {
9365 printf("Hello")
9366   ;
9367   return 0;
9368 }
9369 _ACEOF
9370 rm -f "conftest.$ac_objext"
9371 if { (eval echo "$as_me:9371: \"$ac_compile\"") >&5
9372   (eval $ac_compile) 2>&5
9373   ac_status=$?
9374   echo "$as_me:9374: \$? = $ac_status" >&5
9375   (exit "$ac_status"); } &&
9376          { ac_try='test -s "conftest.$ac_objext"'
9377   { (eval echo "$as_me:9377: \"$ac_try\"") >&5
9378   (eval $ac_try) 2>&5
9379   ac_status=$?
9380   echo "$as_me:9380: \$? = $ac_status" >&5
9381   (exit "$ac_status"); }; }; then
9382   :
9383 else
9384   echo "$as_me: failed program was:" >&5
9385 cat "conftest.$ac_ext" >&5
9386 cf_have_incdir=yes
9387 fi
9388 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9389                           CPPFLAGS=$cf_save_CPPFLAGS
9390                         fi
9391                   fi
9392                 fi
9393
9394                 if test "$cf_have_incdir" = no ; then
9395                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9396
9397 echo "${as_me:-configure}:9397: testing adding $cf_add_incdir to include-path ..." 1>&5
9398
9399                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9400
9401                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9402                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9403                   cf_add_incdir="$cf_top_incdir"
9404                 else
9405                   break
9406                 fi
9407           else
9408                 break
9409           fi
9410         done
9411   done
9412 fi
9413
9414                 for cf_header in \
9415                         ncurses.h \
9416                         curses.h
9417                 do
9418
9419         cat >"conftest.$ac_ext" <<_ACEOF
9420 #line 9420 "configure"
9421 #include "confdefs.h"
9422
9423 #include <$cf_header>
9424 int
9425 main (void)
9426 {
9427
9428 #ifdef NCURSES_VERSION
9429
9430 printf("%s\\n", NCURSES_VERSION);
9431 #else
9432 #ifdef __NCURSES_H
9433 printf("old\\n");
9434 #else
9435         make an error
9436 #endif
9437 #endif
9438
9439   ;
9440   return 0;
9441 }
9442 _ACEOF
9443 rm -f "conftest.$ac_objext"
9444 if { (eval echo "$as_me:9444: \"$ac_compile\"") >&5
9445   (eval $ac_compile) 2>&5
9446   ac_status=$?
9447   echo "$as_me:9447: \$? = $ac_status" >&5
9448   (exit "$ac_status"); } &&
9449          { ac_try='test -s "conftest.$ac_objext"'
9450   { (eval echo "$as_me:9450: \"$ac_try\"") >&5
9451   (eval $ac_try) 2>&5
9452   ac_status=$?
9453   echo "$as_me:9453: \$? = $ac_status" >&5
9454   (exit "$ac_status"); }; }; then
9455   cf_cv_ncurses_h2=$cf_header
9456
9457 else
9458   echo "$as_me: failed program was:" >&5
9459 cat "conftest.$ac_ext" >&5
9460 cf_cv_ncurses_h2=no
9461 fi
9462 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9463
9464                         if test "$cf_cv_ncurses_h2" != no ; then
9465                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9466                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9467                                 break
9468                         fi
9469                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9470                 done
9471                 CPPFLAGS="$cf_save2_CPPFLAGS"
9472                 test "$cf_cv_ncurses_h2" != no && break
9473         done
9474         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9474: error: not found" >&5
9475 echo "$as_me: error: not found" >&2;}
9476    { (exit 1); exit 1; }; }
9477
9478 fi
9479 echo "$as_me:9479: result: $cf_cv_ncurses_h2" >&5
9480 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9481
9482         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9483         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9484         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9485                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9486         fi
9487
9488 if test -n "$cf_1st_incdir" ; then
9489   for cf_add_incdir in $cf_1st_incdir
9490   do
9491         while test "$cf_add_incdir" != /usr/include
9492         do
9493           if test -d "$cf_add_incdir"
9494           then
9495                 cf_have_incdir=no
9496                 if test -n "$CFLAGS$CPPFLAGS" ; then
9497                   # a loop is needed to ensure we can add subdirs of existing dirs
9498                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9499                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9500                           cf_have_incdir=yes; break
9501                         fi
9502                   done
9503                 fi
9504
9505                 if test "$cf_have_incdir" = no ; then
9506                   if test "$cf_add_incdir" = /usr/local/include ; then
9507                         if test "$GCC" = yes
9508                         then
9509                           cf_save_CPPFLAGS=$CPPFLAGS
9510
9511         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9512         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9513
9514                           cat >"conftest.$ac_ext" <<_ACEOF
9515 #line 9515 "configure"
9516 #include "confdefs.h"
9517 #include <stdio.h>
9518 int
9519 main (void)
9520 {
9521 printf("Hello")
9522   ;
9523   return 0;
9524 }
9525 _ACEOF
9526 rm -f "conftest.$ac_objext"
9527 if { (eval echo "$as_me:9527: \"$ac_compile\"") >&5
9528   (eval $ac_compile) 2>&5
9529   ac_status=$?
9530   echo "$as_me:9530: \$? = $ac_status" >&5
9531   (exit "$ac_status"); } &&
9532          { ac_try='test -s "conftest.$ac_objext"'
9533   { (eval echo "$as_me:9533: \"$ac_try\"") >&5
9534   (eval $ac_try) 2>&5
9535   ac_status=$?
9536   echo "$as_me:9536: \$? = $ac_status" >&5
9537   (exit "$ac_status"); }; }; then
9538   :
9539 else
9540   echo "$as_me: failed program was:" >&5
9541 cat "conftest.$ac_ext" >&5
9542 cf_have_incdir=yes
9543 fi
9544 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9545                           CPPFLAGS=$cf_save_CPPFLAGS
9546                         fi
9547                   fi
9548                 fi
9549
9550                 if test "$cf_have_incdir" = no ; then
9551                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9552
9553 echo "${as_me:-configure}:9553: testing adding $cf_add_incdir to include-path ..." 1>&5
9554
9555                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9556
9557                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9558                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9559                   cf_add_incdir="$cf_top_incdir"
9560                 else
9561                   break
9562                 fi
9563           else
9564                 break
9565           fi
9566         done
9567   done
9568 fi
9569
9570 fi
9571
9572 # Set definitions to allow ifdef'ing for ncurses.h
9573
9574 case "$cf_cv_ncurses_header" in
9575 (*ncurses.h)
9576
9577 cat >>confdefs.h <<\EOF
9578 #define HAVE_NCURSES_H 1
9579 EOF
9580
9581         ;;
9582 esac
9583
9584 case "$cf_cv_ncurses_header" in
9585 (ncurses/curses.h|ncurses/ncurses.h)
9586
9587 cat >>confdefs.h <<\EOF
9588 #define HAVE_NCURSES_NCURSES_H 1
9589 EOF
9590
9591         ;;
9592 (ncursesw/curses.h|ncursesw/ncurses.h)
9593
9594 cat >>confdefs.h <<\EOF
9595 #define HAVE_NCURSESW_NCURSES_H 1
9596 EOF
9597
9598         ;;
9599 esac
9600
9601 echo "$as_me:9601: checking for terminfo header" >&5
9602 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9603 if test "${cf_cv_term_header+set}" = set; then
9604   echo $ECHO_N "(cached) $ECHO_C" >&6
9605 else
9606
9607 case "${cf_cv_ncurses_header}" in
9608 (*/ncurses.h|*/ncursesw.h)
9609         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9610         ;;
9611 (*)
9612         cf_term_header=term.h
9613         ;;
9614 esac
9615
9616 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9617 do
9618 cat >"conftest.$ac_ext" <<_ACEOF
9619 #line 9619 "configure"
9620 #include "confdefs.h"
9621 #include <stdio.h>
9622 #include <${cf_cv_ncurses_header:-curses.h}>
9623 #include <$cf_test>
9624
9625 int
9626 main (void)
9627 {
9628 int x = auto_left_margin; (void)x
9629   ;
9630   return 0;
9631 }
9632 _ACEOF
9633 rm -f "conftest.$ac_objext"
9634 if { (eval echo "$as_me:9634: \"$ac_compile\"") >&5
9635   (eval $ac_compile) 2>&5
9636   ac_status=$?
9637   echo "$as_me:9637: \$? = $ac_status" >&5
9638   (exit "$ac_status"); } &&
9639          { ac_try='test -s "conftest.$ac_objext"'
9640   { (eval echo "$as_me:9640: \"$ac_try\"") >&5
9641   (eval $ac_try) 2>&5
9642   ac_status=$?
9643   echo "$as_me:9643: \$? = $ac_status" >&5
9644   (exit "$ac_status"); }; }; then
9645
9646         cf_cv_term_header="$cf_test"
9647 else
9648   echo "$as_me: failed program was:" >&5
9649 cat "conftest.$ac_ext" >&5
9650
9651         cf_cv_term_header=unknown
9652
9653 fi
9654 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9655         test "$cf_cv_term_header" != unknown && break
9656 done
9657
9658 fi
9659 echo "$as_me:9659: result: $cf_cv_term_header" >&5
9660 echo "${ECHO_T}$cf_cv_term_header" >&6
9661
9662 # Set definitions to allow ifdef'ing to accommodate subdirectories
9663
9664 case "$cf_cv_term_header" in
9665 (*term.h)
9666
9667 cat >>confdefs.h <<\EOF
9668 #define HAVE_TERM_H 1
9669 EOF
9670
9671         ;;
9672 esac
9673
9674 case "$cf_cv_term_header" in
9675 (ncurses/term.h)
9676
9677 cat >>confdefs.h <<\EOF
9678 #define HAVE_NCURSES_TERM_H 1
9679 EOF
9680
9681         ;;
9682 (ncursesw/term.h)
9683
9684 cat >>confdefs.h <<\EOF
9685 #define HAVE_NCURSESW_TERM_H 1
9686 EOF
9687
9688         ;;
9689 esac
9690
9691 # some applications need this, but should check for NCURSES_VERSION
9692
9693 cat >>confdefs.h <<\EOF
9694 #define NCURSES 1
9695 EOF
9696
9697 echo "$as_me:9697: checking for ncurses version" >&5
9698 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9699 if test "${cf_cv_ncurses_version+set}" = set; then
9700   echo $ECHO_N "(cached) $ECHO_C" >&6
9701 else
9702
9703         cf_cv_ncurses_version=no
9704         cf_tempfile=out$$
9705         rm -f "$cf_tempfile"
9706         if test "$cross_compiling" = yes; then
9707
9708         # This will not work if the preprocessor splits the line after the
9709         # Autoconf token.  The 'unproto' program does that.
9710         cat > "conftest.$ac_ext" <<EOF
9711 #include <${cf_cv_ncurses_header:-curses.h}>
9712 #undef Autoconf
9713 #ifdef NCURSES_VERSION
9714 Autoconf NCURSES_VERSION
9715 #else
9716 #ifdef __NCURSES_H
9717 Autoconf "old"
9718 #endif
9719 ;
9720 #endif
9721 EOF
9722         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9723         { (eval echo "$as_me:9723: \"$cf_try\"") >&5
9724   (eval $cf_try) 2>&5
9725   ac_status=$?
9726   echo "$as_me:9726: \$? = $ac_status" >&5
9727   (exit "$ac_status"); }
9728         if test -f conftest.out ; then
9729                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9730                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9731                 rm -f conftest.out
9732         fi
9733
9734 else
9735   cat >"conftest.$ac_ext" <<_ACEOF
9736 #line 9736 "configure"
9737 #include "confdefs.h"
9738
9739 #include <${cf_cv_ncurses_header:-curses.h}>
9740 #include <stdio.h>
9741 int main(void)
9742 {
9743         FILE *fp = fopen("$cf_tempfile", "w");
9744 #ifdef NCURSES_VERSION
9745 # ifdef NCURSES_VERSION_PATCH
9746         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9747 # else
9748         fprintf(fp, "%s\\n", NCURSES_VERSION);
9749 # endif
9750 #else
9751 # ifdef __NCURSES_H
9752         fprintf(fp, "old\\n");
9753 # else
9754         make an error
9755 # endif
9756 #endif
9757         ${cf_cv_main_return:-return}(0);
9758 }
9759 _ACEOF
9760 rm -f "conftest$ac_exeext"
9761 if { (eval echo "$as_me:9761: \"$ac_link\"") >&5
9762   (eval $ac_link) 2>&5
9763   ac_status=$?
9764   echo "$as_me:9764: \$? = $ac_status" >&5
9765   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9766   { (eval echo "$as_me:9766: \"$ac_try\"") >&5
9767   (eval $ac_try) 2>&5
9768   ac_status=$?
9769   echo "$as_me:9769: \$? = $ac_status" >&5
9770   (exit "$ac_status"); }; }; then
9771
9772         cf_cv_ncurses_version=`cat $cf_tempfile`
9773 else
9774   echo "$as_me: program exited with status $ac_status" >&5
9775 echo "$as_me: failed program was:" >&5
9776 cat "conftest.$ac_ext" >&5
9777 fi
9778 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9779 fi
9780         rm -f "$cf_tempfile"
9781
9782 fi
9783 echo "$as_me:9783: result: $cf_cv_ncurses_version" >&5
9784 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9785 test "$cf_cv_ncurses_version" = no ||
9786 cat >>confdefs.h <<\EOF
9787 #define NCURSES 1
9788 EOF
9789
9790 cf_nculib_root=$cf_cv_screen
9791         # This works, except for the special case where we find gpm, but
9792         # ncurses is in a nonstandard location via $LIBS, and we really want
9793         # to link gpm.
9794 cf_ncurses_LIBS=""
9795 cf_ncurses_SAVE="$LIBS"
9796 echo "$as_me:9796: checking for Gpm_Open in -lgpm" >&5
9797 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9798 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9799   echo $ECHO_N "(cached) $ECHO_C" >&6
9800 else
9801   ac_check_lib_save_LIBS=$LIBS
9802 LIBS="-lgpm  $LIBS"
9803 cat >"conftest.$ac_ext" <<_ACEOF
9804 #line 9804 "configure"
9805 #include "confdefs.h"
9806
9807 /* Override any gcc2 internal prototype to avoid an error.  */
9808 #ifdef __cplusplus
9809 extern "C"
9810 #endif
9811 /* We use char because int might match the return type of a gcc2
9812    builtin and then its argument prototype would still apply.  */
9813 char Gpm_Open ();
9814 int
9815 main (void)
9816 {
9817 Gpm_Open ();
9818   ;
9819   return 0;
9820 }
9821 _ACEOF
9822 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9823 if { (eval echo "$as_me:9823: \"$ac_link\"") >&5
9824   (eval $ac_link) 2>&5
9825   ac_status=$?
9826   echo "$as_me:9826: \$? = $ac_status" >&5
9827   (exit "$ac_status"); } &&
9828          { ac_try='test -s "conftest$ac_exeext"'
9829   { (eval echo "$as_me:9829: \"$ac_try\"") >&5
9830   (eval $ac_try) 2>&5
9831   ac_status=$?
9832   echo "$as_me:9832: \$? = $ac_status" >&5
9833   (exit "$ac_status"); }; }; then
9834   ac_cv_lib_gpm_Gpm_Open=yes
9835 else
9836   echo "$as_me: failed program was:" >&5
9837 cat "conftest.$ac_ext" >&5
9838 ac_cv_lib_gpm_Gpm_Open=no
9839 fi
9840 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9841 LIBS=$ac_check_lib_save_LIBS
9842 fi
9843 echo "$as_me:9843: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9844 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9845 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9846   echo "$as_me:9846: checking for initscr in -lgpm" >&5
9847 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9848 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9849   echo $ECHO_N "(cached) $ECHO_C" >&6
9850 else
9851   ac_check_lib_save_LIBS=$LIBS
9852 LIBS="-lgpm  $LIBS"
9853 cat >"conftest.$ac_ext" <<_ACEOF
9854 #line 9854 "configure"
9855 #include "confdefs.h"
9856
9857 /* Override any gcc2 internal prototype to avoid an error.  */
9858 #ifdef __cplusplus
9859 extern "C"
9860 #endif
9861 /* We use char because int might match the return type of a gcc2
9862    builtin and then its argument prototype would still apply.  */
9863 char initscr ();
9864 int
9865 main (void)
9866 {
9867 initscr ();
9868   ;
9869   return 0;
9870 }
9871 _ACEOF
9872 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9873 if { (eval echo "$as_me:9873: \"$ac_link\"") >&5
9874   (eval $ac_link) 2>&5
9875   ac_status=$?
9876   echo "$as_me:9876: \$? = $ac_status" >&5
9877   (exit "$ac_status"); } &&
9878          { ac_try='test -s "conftest$ac_exeext"'
9879   { (eval echo "$as_me:9879: \"$ac_try\"") >&5
9880   (eval $ac_try) 2>&5
9881   ac_status=$?
9882   echo "$as_me:9882: \$? = $ac_status" >&5
9883   (exit "$ac_status"); }; }; then
9884   ac_cv_lib_gpm_initscr=yes
9885 else
9886   echo "$as_me: failed program was:" >&5
9887 cat "conftest.$ac_ext" >&5
9888 ac_cv_lib_gpm_initscr=no
9889 fi
9890 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9891 LIBS=$ac_check_lib_save_LIBS
9892 fi
9893 echo "$as_me:9893: result: $ac_cv_lib_gpm_initscr" >&5
9894 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9895 if test "$ac_cv_lib_gpm_initscr" = yes; then
9896   LIBS="$cf_ncurses_SAVE"
9897 else
9898   cf_ncurses_LIBS="-lgpm"
9899 fi
9900
9901 fi
9902
9903 case "$host_os" in
9904 (freebsd*)
9905         # This is only necessary if you are linking against an obsolete
9906         # version of ncurses (but it should do no harm, since it is static).
9907         if test "$cf_nculib_root" = ncurses ; then
9908                 echo "$as_me:9908: checking for tgoto in -lmytinfo" >&5
9909 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9910 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9911   echo $ECHO_N "(cached) $ECHO_C" >&6
9912 else
9913   ac_check_lib_save_LIBS=$LIBS
9914 LIBS="-lmytinfo  $LIBS"
9915 cat >"conftest.$ac_ext" <<_ACEOF
9916 #line 9916 "configure"
9917 #include "confdefs.h"
9918
9919 /* Override any gcc2 internal prototype to avoid an error.  */
9920 #ifdef __cplusplus
9921 extern "C"
9922 #endif
9923 /* We use char because int might match the return type of a gcc2
9924    builtin and then its argument prototype would still apply.  */
9925 char tgoto ();
9926 int
9927 main (void)
9928 {
9929 tgoto ();
9930   ;
9931   return 0;
9932 }
9933 _ACEOF
9934 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9935 if { (eval echo "$as_me:9935: \"$ac_link\"") >&5
9936   (eval $ac_link) 2>&5
9937   ac_status=$?
9938   echo "$as_me:9938: \$? = $ac_status" >&5
9939   (exit "$ac_status"); } &&
9940          { ac_try='test -s "conftest$ac_exeext"'
9941   { (eval echo "$as_me:9941: \"$ac_try\"") >&5
9942   (eval $ac_try) 2>&5
9943   ac_status=$?
9944   echo "$as_me:9944: \$? = $ac_status" >&5
9945   (exit "$ac_status"); }; }; then
9946   ac_cv_lib_mytinfo_tgoto=yes
9947 else
9948   echo "$as_me: failed program was:" >&5
9949 cat "conftest.$ac_ext" >&5
9950 ac_cv_lib_mytinfo_tgoto=no
9951 fi
9952 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9953 LIBS=$ac_check_lib_save_LIBS
9954 fi
9955 echo "$as_me:9955: result: $ac_cv_lib_mytinfo_tgoto" >&5
9956 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9957 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9958   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9959 fi
9960
9961         fi
9962         ;;
9963 esac
9964
9965 cf_add_libs="$LIBS"
9966 # reverse order
9967 cf_add_0lib=
9968 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9969 # filter duplicates
9970 for cf_add_1lib in $cf_add_0lib; do
9971         for cf_add_2lib in $cf_add_libs; do
9972                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9973                         cf_add_1lib=
9974                         break
9975                 fi
9976         done
9977         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9978 done
9979 LIBS="$cf_add_libs"
9980
9981 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9982 then
9983
9984 cf_add_libs="$LIBS"
9985 # reverse order
9986 cf_add_0lib=
9987 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9988 # filter duplicates
9989 for cf_add_1lib in $cf_add_0lib; do
9990         for cf_add_2lib in $cf_add_libs; do
9991                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9992                         cf_add_1lib=
9993                         break
9994                 fi
9995         done
9996         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9997 done
9998 LIBS="$cf_add_libs"
9999
10000 else
10001
10002         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
10003         cf_libdir=""
10004         echo "$as_me:10004: checking for initscr" >&5
10005 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10006 if test "${ac_cv_func_initscr+set}" = set; then
10007   echo $ECHO_N "(cached) $ECHO_C" >&6
10008 else
10009   cat >"conftest.$ac_ext" <<_ACEOF
10010 #line 10010 "configure"
10011 #include "confdefs.h"
10012 #define initscr autoconf_temporary
10013 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10014 #undef initscr
10015
10016 #ifdef __cplusplus
10017 extern "C"
10018 #endif
10019
10020 /* We use char because int might match the return type of a gcc2
10021    builtin and then its argument prototype would still apply.  */
10022 char initscr (void);
10023
10024 int
10025 main (void)
10026 {
10027
10028 /* The GNU C library defines stubs for functions which it implements
10029     to always fail with ENOSYS.  Some functions are actually named
10030     something starting with __ and the normal name is an alias.  */
10031 #if defined (__stub_initscr) || defined (__stub___initscr)
10032 #error found stub for initscr
10033 #endif
10034
10035         return initscr ();
10036   ;
10037   return 0;
10038 }
10039 _ACEOF
10040 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10041 if { (eval echo "$as_me:10041: \"$ac_link\"") >&5
10042   (eval $ac_link) 2>&5
10043   ac_status=$?
10044   echo "$as_me:10044: \$? = $ac_status" >&5
10045   (exit "$ac_status"); } &&
10046          { ac_try='test -s "conftest$ac_exeext"'
10047   { (eval echo "$as_me:10047: \"$ac_try\"") >&5
10048   (eval $ac_try) 2>&5
10049   ac_status=$?
10050   echo "$as_me:10050: \$? = $ac_status" >&5
10051   (exit "$ac_status"); }; }; then
10052   ac_cv_func_initscr=yes
10053 else
10054   echo "$as_me: failed program was:" >&5
10055 cat "conftest.$ac_ext" >&5
10056 ac_cv_func_initscr=no
10057 fi
10058 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10059 fi
10060 echo "$as_me:10060: result: $ac_cv_func_initscr" >&5
10061 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10062 if test "$ac_cv_func_initscr" = yes; then
10063   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10064 else
10065
10066                 cf_save_LIBS="$LIBS"
10067                 echo "$as_me:10067: checking for initscr in -l$cf_nculib_root" >&5
10068 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10069                 LIBS="-l$cf_nculib_root $LIBS"
10070                 cat >"conftest.$ac_ext" <<_ACEOF
10071 #line 10071 "configure"
10072 #include "confdefs.h"
10073 #include <${cf_cv_ncurses_header:-curses.h}>
10074 int
10075 main (void)
10076 {
10077 initscr()
10078   ;
10079   return 0;
10080 }
10081 _ACEOF
10082 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10083 if { (eval echo "$as_me:10083: \"$ac_link\"") >&5
10084   (eval $ac_link) 2>&5
10085   ac_status=$?
10086   echo "$as_me:10086: \$? = $ac_status" >&5
10087   (exit "$ac_status"); } &&
10088          { ac_try='test -s "conftest$ac_exeext"'
10089   { (eval echo "$as_me:10089: \"$ac_try\"") >&5
10090   (eval $ac_try) 2>&5
10091   ac_status=$?
10092   echo "$as_me:10092: \$? = $ac_status" >&5
10093   (exit "$ac_status"); }; }; then
10094   echo "$as_me:10094: result: yes" >&5
10095 echo "${ECHO_T}yes" >&6
10096                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10097
10098 else
10099   echo "$as_me: failed program was:" >&5
10100 cat "conftest.$ac_ext" >&5
10101 echo "$as_me:10101: result: no" >&5
10102 echo "${ECHO_T}no" >&6
10103
10104 cf_search=
10105 cf_library_path_list=""
10106 if test -n "${LDFLAGS}${LIBS}" ; then
10107         for cf_library_path in $LDFLAGS $LIBS
10108         do
10109                 case "$cf_library_path" in
10110                 (-L*)
10111                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10112
10113 test "x$cf_library_path" != "xNONE" && \
10114 test -d "$cf_library_path" && \
10115  {
10116         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10117         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10118         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10119         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10120         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10121         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"
10122 }
10123
10124                         cf_library_path_list="$cf_library_path_list $cf_search"
10125                         ;;
10126                 esac
10127         done
10128 fi
10129
10130 cf_search=
10131
10132 test "x$prefix" != "xNONE" && \
10133 test -d "$prefix" && \
10134  {
10135         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10136         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10137         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10138         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10139         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10140         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10141 }
10142
10143 for cf_subdir_prefix in \
10144         /usr \
10145         /usr/local \
10146         /usr/pkg \
10147         /opt \
10148         /opt/local \
10149         $HOME
10150 do
10151
10152 test "x$cf_subdir_prefix" != "x$prefix" && \
10153 test -d "$cf_subdir_prefix" && \
10154 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10155         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10156         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10157         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10158         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10159         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10160         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"
10161 }
10162
10163 done
10164
10165 cf_search="$cf_library_path_list $cf_search"
10166
10167                         for cf_libdir in $cf_search
10168                         do
10169                                 echo "$as_me:10169: checking for -l$cf_nculib_root in $cf_libdir" >&5
10170 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10171                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10172                                 cat >"conftest.$ac_ext" <<_ACEOF
10173 #line 10173 "configure"
10174 #include "confdefs.h"
10175 #include <${cf_cv_ncurses_header:-curses.h}>
10176 int
10177 main (void)
10178 {
10179 initscr()
10180   ;
10181   return 0;
10182 }
10183 _ACEOF
10184 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10185 if { (eval echo "$as_me:10185: \"$ac_link\"") >&5
10186   (eval $ac_link) 2>&5
10187   ac_status=$?
10188   echo "$as_me:10188: \$? = $ac_status" >&5
10189   (exit "$ac_status"); } &&
10190          { ac_try='test -s "conftest$ac_exeext"'
10191   { (eval echo "$as_me:10191: \"$ac_try\"") >&5
10192   (eval $ac_try) 2>&5
10193   ac_status=$?
10194   echo "$as_me:10194: \$? = $ac_status" >&5
10195   (exit "$ac_status"); }; }; then
10196   echo "$as_me:10196: result: yes" >&5
10197 echo "${ECHO_T}yes" >&6
10198                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10199                                          break
10200 else
10201   echo "$as_me: failed program was:" >&5
10202 cat "conftest.$ac_ext" >&5
10203 echo "$as_me:10203: result: no" >&5
10204 echo "${ECHO_T}no" >&6
10205                                          LIBS="$cf_save_LIBS"
10206 fi
10207 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10208                         done
10209
10210 fi
10211 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10212
10213 fi
10214
10215 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
10216
10217 if test "$cf_found_library" = no ; then
10218         { { echo "$as_me:10218: error: Cannot link $cf_nculib_root library" >&5
10219 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10220    { (exit 1); exit 1; }; }
10221 fi
10222
10223 fi
10224
10225 if test -n "$cf_ncurses_LIBS" ; then
10226         echo "$as_me:10226: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10227 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10228         cf_ncurses_SAVE="$LIBS"
10229         for p in $cf_ncurses_LIBS ; do
10230                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
10231                 if test "$q" != "$LIBS" ; then
10232                         LIBS="$q"
10233                 fi
10234         done
10235         cat >"conftest.$ac_ext" <<_ACEOF
10236 #line 10236 "configure"
10237 #include "confdefs.h"
10238 #include <${cf_cv_ncurses_header:-curses.h}>
10239 int
10240 main (void)
10241 {
10242 initscr(); mousemask(0,0); tigetstr((char *)0);
10243   ;
10244   return 0;
10245 }
10246 _ACEOF
10247 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10248 if { (eval echo "$as_me:10248: \"$ac_link\"") >&5
10249   (eval $ac_link) 2>&5
10250   ac_status=$?
10251   echo "$as_me:10251: \$? = $ac_status" >&5
10252   (exit "$ac_status"); } &&
10253          { ac_try='test -s "conftest$ac_exeext"'
10254   { (eval echo "$as_me:10254: \"$ac_try\"") >&5
10255   (eval $ac_try) 2>&5
10256   ac_status=$?
10257   echo "$as_me:10257: \$? = $ac_status" >&5
10258   (exit "$ac_status"); }; }; then
10259   echo "$as_me:10259: result: yes" >&5
10260 echo "${ECHO_T}yes" >&6
10261 else
10262   echo "$as_me: failed program was:" >&5
10263 cat "conftest.$ac_ext" >&5
10264 echo "$as_me:10264: result: no" >&5
10265 echo "${ECHO_T}no" >&6
10266                  LIBS="$cf_ncurses_SAVE"
10267 fi
10268 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10269 fi
10270
10271 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10272
10273 cat >>confdefs.h <<EOF
10274 #define $cf_nculib_ROOT 1
10275 EOF
10276
10277         fi
10278 else
10279         NCURSES_CONFIG=none
10280 fi
10281
10282         ;;
10283 (ncurses*)
10284
10285 cf_ncuconfig_root=$cf_cv_screen
10286 cf_have_ncuconfig=no
10287
10288 if test "x${PKG_CONFIG:=none}" != xnone; then
10289         echo "$as_me:10289: checking pkg-config for $cf_ncuconfig_root" >&5
10290 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
10291         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
10292                 echo "$as_me:10292: result: yes" >&5
10293 echo "${ECHO_T}yes" >&6
10294
10295                 echo "$as_me:10295: checking if the $cf_ncuconfig_root package files work" >&5
10296 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
10297                 cf_have_ncuconfig=unknown
10298
10299                 cf_save_CFLAGS="$CFLAGS"
10300                 cf_save_CPPFLAGS="$CPPFLAGS"
10301                 cf_save_LIBS="$LIBS"
10302
10303                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
10304                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
10305
10306                 # while -W for passing linker flags is prevalent, it is not "standard".
10307                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
10308                 # incompatible _and_ non-standard -W option which gives an error.  Work
10309                 # around that pitfall.
10310                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
10311                 (x*c[89]9@@*-W*)
10312
10313 cf_fix_cppflags=no
10314 cf_new_cflags=
10315 cf_new_cppflags=
10316 cf_new_extra_cppflags=
10317
10318 for cf_add_cflags in $cf_pkg_cflags
10319 do
10320 case "$cf_fix_cppflags" in
10321 (no)
10322         case "$cf_add_cflags" in
10323         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10324                 case "$cf_add_cflags" in
10325                 (-D*)
10326                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10327
10328                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10329                                 && test -z "${cf_tst_cflags}" \
10330                                 && cf_fix_cppflags=yes
10331
10332                         if test "$cf_fix_cppflags" = yes ; then
10333
10334         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10335         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10336
10337                                 continue
10338                         elif test "${cf_tst_cflags}" = "\"'" ; then
10339
10340         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10341         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10342
10343                                 continue
10344                         fi
10345                         ;;
10346                 esac
10347                 case "$CPPFLAGS" in
10348                 (*$cf_add_cflags)
10349                         ;;
10350                 (*)
10351                         case "$cf_add_cflags" in
10352                         (-D*)
10353                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10354
10355 CPPFLAGS=`echo "$CPPFLAGS" | \
10356         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10357                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10358
10359                                 ;;
10360                         esac
10361
10362         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10363         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10364
10365                         ;;
10366                 esac
10367                 ;;
10368         (*)
10369
10370         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10371         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10372
10373                 ;;
10374         esac
10375         ;;
10376 (yes)
10377
10378         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10379         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10380
10381         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10382
10383         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10384                 && test -z "${cf_tst_cflags}" \
10385                 && cf_fix_cppflags=no
10386         ;;
10387 esac
10388 done
10389
10390 if test -n "$cf_new_cflags" ; then
10391
10392         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10393         CFLAGS="${CFLAGS}$cf_new_cflags"
10394
10395 fi
10396
10397 if test -n "$cf_new_cppflags" ; then
10398
10399         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10400         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10401
10402 fi
10403
10404 if test -n "$cf_new_extra_cppflags" ; then
10405
10406         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10407         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10408
10409 fi
10410
10411 cf_add_libs="$LIBS"
10412 # reverse order
10413 cf_add_0lib=
10414 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10415 # filter duplicates
10416 for cf_add_1lib in $cf_add_0lib; do
10417         for cf_add_2lib in $cf_add_libs; do
10418                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10419                         cf_add_1lib=
10420                         break
10421                 fi
10422         done
10423         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10424 done
10425 LIBS="$cf_add_libs"
10426
10427                         cat >"conftest.$ac_ext" <<_ACEOF
10428 #line 10428 "configure"
10429 #include "confdefs.h"
10430 #include <${cf_cv_ncurses_header:-curses.h}>
10431 int
10432 main (void)
10433 {
10434 initscr(); mousemask(0,0); tigetstr((char *)0);
10435   ;
10436   return 0;
10437 }
10438 _ACEOF
10439 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10440 if { (eval echo "$as_me:10440: \"$ac_link\"") >&5
10441   (eval $ac_link) 2>&5
10442   ac_status=$?
10443   echo "$as_me:10443: \$? = $ac_status" >&5
10444   (exit "$ac_status"); } &&
10445          { ac_try='test -s "conftest$ac_exeext"'
10446   { (eval echo "$as_me:10446: \"$ac_try\"") >&5
10447   (eval $ac_try) 2>&5
10448   ac_status=$?
10449   echo "$as_me:10449: \$? = $ac_status" >&5
10450   (exit "$ac_status"); }; }; then
10451   if test "$cross_compiling" = yes; then
10452   cf_test_ncuconfig=maybe
10453 else
10454   cat >"conftest.$ac_ext" <<_ACEOF
10455 #line 10455 "configure"
10456 #include "confdefs.h"
10457 #include <${cf_cv_ncurses_header:-curses.h}>
10458                                         int main(void)
10459                                         { const char *xx = curses_version(); return (xx == 0); }
10460 _ACEOF
10461 rm -f "conftest$ac_exeext"
10462 if { (eval echo "$as_me:10462: \"$ac_link\"") >&5
10463   (eval $ac_link) 2>&5
10464   ac_status=$?
10465   echo "$as_me:10465: \$? = $ac_status" >&5
10466   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10467   { (eval echo "$as_me:10467: \"$ac_try\"") >&5
10468   (eval $ac_try) 2>&5
10469   ac_status=$?
10470   echo "$as_me:10470: \$? = $ac_status" >&5
10471   (exit "$ac_status"); }; }; then
10472   cf_test_ncuconfig=yes
10473 else
10474   echo "$as_me: program exited with status $ac_status" >&5
10475 echo "$as_me: failed program was:" >&5
10476 cat "conftest.$ac_ext" >&5
10477 cf_test_ncuconfig=no
10478 fi
10479 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10480 fi
10481 else
10482   echo "$as_me: failed program was:" >&5
10483 cat "conftest.$ac_ext" >&5
10484 cf_test_ncuconfig=no
10485 fi
10486 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10487
10488                         CFLAGS="$cf_save_CFLAGS"
10489                         CPPFLAGS="$cf_save_CPPFLAGS"
10490                         LIBS="$cf_save_LIBS"
10491
10492                         if test "x$cf_test_ncuconfig" != xyes; then
10493                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10494                                 cf_pkg_cflags="$cf_temp"
10495                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10496                                 cf_pkg_libs="$cf_temp"
10497                         fi
10498                         ;;
10499                 esac
10500
10501 for cf_add_cflags in $cf_pkg_cflags
10502 do
10503         case "x$cf_add_cflags" in
10504         (x-[DU]*)
10505
10506 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10507 while true
10508 do
10509         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'`
10510         test "$CFLAGS" != "$cf_old_cflag" || break
10511
10512         CFLAGS="$cf_old_cflag"
10513 done
10514
10515 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10516 while true
10517 do
10518         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'`
10519         test "$CPPFLAGS" != "$cf_old_cflag" || break
10520
10521         CPPFLAGS="$cf_old_cflag"
10522 done
10523
10524                 ;;
10525         esac
10526
10527 cf_fix_cppflags=no
10528 cf_new_cflags=
10529 cf_new_cppflags=
10530 cf_new_extra_cppflags=
10531
10532 for cf_add_cflags in $cf_add_cflags
10533 do
10534 case "$cf_fix_cppflags" in
10535 (no)
10536         case "$cf_add_cflags" in
10537         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10538                 case "$cf_add_cflags" in
10539                 (-D*)
10540                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10541
10542                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10543                                 && test -z "${cf_tst_cflags}" \
10544                                 && cf_fix_cppflags=yes
10545
10546                         if test "$cf_fix_cppflags" = yes ; then
10547
10548         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10549         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10550
10551                                 continue
10552                         elif test "${cf_tst_cflags}" = "\"'" ; then
10553
10554         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10555         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10556
10557                                 continue
10558                         fi
10559                         ;;
10560                 esac
10561                 case "$CPPFLAGS" in
10562                 (*$cf_add_cflags)
10563                         ;;
10564                 (*)
10565                         case "$cf_add_cflags" in
10566                         (-D*)
10567                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10568
10569 CPPFLAGS=`echo "$CPPFLAGS" | \
10570         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10571                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10572
10573                                 ;;
10574                         esac
10575
10576         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10577         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10578
10579                         ;;
10580                 esac
10581                 ;;
10582         (*)
10583
10584         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10585         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10586
10587                 ;;
10588         esac
10589         ;;
10590 (yes)
10591
10592         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10593         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10594
10595         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10596
10597         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10598                 && test -z "${cf_tst_cflags}" \
10599                 && cf_fix_cppflags=no
10600         ;;
10601 esac
10602 done
10603
10604 if test -n "$cf_new_cflags" ; then
10605
10606         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10607         CFLAGS="${CFLAGS}$cf_new_cflags"
10608
10609 fi
10610
10611 if test -n "$cf_new_cppflags" ; then
10612
10613         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10614         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10615
10616 fi
10617
10618 if test -n "$cf_new_extra_cppflags" ; then
10619
10620         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10621         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10622
10623 fi
10624
10625 done
10626
10627 cf_add_libs="$LIBS"
10628 # reverse order
10629 cf_add_0lib=
10630 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10631 # filter duplicates
10632 for cf_add_1lib in $cf_add_0lib; do
10633         for cf_add_2lib in $cf_add_libs; do
10634                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10635                         cf_add_1lib=
10636                         break
10637                 fi
10638         done
10639         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10640 done
10641 LIBS="$cf_add_libs"
10642
10643                 cat >"conftest.$ac_ext" <<_ACEOF
10644 #line 10644 "configure"
10645 #include "confdefs.h"
10646 #include <${cf_cv_ncurses_header:-curses.h}>
10647 int
10648 main (void)
10649 {
10650 initscr(); mousemask(0,0); tigetstr((char *)0);
10651   ;
10652   return 0;
10653 }
10654 _ACEOF
10655 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10656 if { (eval echo "$as_me:10656: \"$ac_link\"") >&5
10657   (eval $ac_link) 2>&5
10658   ac_status=$?
10659   echo "$as_me:10659: \$? = $ac_status" >&5
10660   (exit "$ac_status"); } &&
10661          { ac_try='test -s "conftest$ac_exeext"'
10662   { (eval echo "$as_me:10662: \"$ac_try\"") >&5
10663   (eval $ac_try) 2>&5
10664   ac_status=$?
10665   echo "$as_me:10665: \$? = $ac_status" >&5
10666   (exit "$ac_status"); }; }; then
10667   if test "$cross_compiling" = yes; then
10668   cf_have_ncuconfig=maybe
10669 else
10670   cat >"conftest.$ac_ext" <<_ACEOF
10671 #line 10671 "configure"
10672 #include "confdefs.h"
10673 #include <${cf_cv_ncurses_header:-curses.h}>
10674                                 int main(void)
10675                                 { const char *xx = curses_version(); return (xx == 0); }
10676 _ACEOF
10677 rm -f "conftest$ac_exeext"
10678 if { (eval echo "$as_me:10678: \"$ac_link\"") >&5
10679   (eval $ac_link) 2>&5
10680   ac_status=$?
10681   echo "$as_me:10681: \$? = $ac_status" >&5
10682   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10683   { (eval echo "$as_me:10683: \"$ac_try\"") >&5
10684   (eval $ac_try) 2>&5
10685   ac_status=$?
10686   echo "$as_me:10686: \$? = $ac_status" >&5
10687   (exit "$ac_status"); }; }; then
10688   cf_have_ncuconfig=yes
10689 else
10690   echo "$as_me: program exited with status $ac_status" >&5
10691 echo "$as_me: failed program was:" >&5
10692 cat "conftest.$ac_ext" >&5
10693 cf_have_ncuconfig=no
10694 fi
10695 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10696 fi
10697 else
10698   echo "$as_me: failed program was:" >&5
10699 cat "conftest.$ac_ext" >&5
10700 cf_have_ncuconfig=no
10701 fi
10702 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10703                 echo "$as_me:10703: result: $cf_have_ncuconfig" >&5
10704 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10705                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10706                 if test "$cf_have_ncuconfig" != "yes"
10707                 then
10708                         CPPFLAGS="$cf_save_CPPFLAGS"
10709                         LIBS="$cf_save_LIBS"
10710                         NCURSES_CONFIG_PKG=none
10711                 else
10712
10713 cat >>confdefs.h <<\EOF
10714 #define NCURSES 1
10715 EOF
10716
10717                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10718
10719 echo "$as_me:10719: checking for terminfo header" >&5
10720 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10721 if test "${cf_cv_term_header+set}" = set; then
10722   echo $ECHO_N "(cached) $ECHO_C" >&6
10723 else
10724
10725 case "${cf_cv_ncurses_header}" in
10726 (*/ncurses.h|*/ncursesw.h)
10727         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10728         ;;
10729 (*)
10730         cf_term_header=term.h
10731         ;;
10732 esac
10733
10734 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10735 do
10736 cat >"conftest.$ac_ext" <<_ACEOF
10737 #line 10737 "configure"
10738 #include "confdefs.h"
10739 #include <stdio.h>
10740 #include <${cf_cv_ncurses_header:-curses.h}>
10741 #include <$cf_test>
10742
10743 int
10744 main (void)
10745 {
10746 int x = auto_left_margin; (void)x
10747   ;
10748   return 0;
10749 }
10750 _ACEOF
10751 rm -f "conftest.$ac_objext"
10752 if { (eval echo "$as_me:10752: \"$ac_compile\"") >&5
10753   (eval $ac_compile) 2>&5
10754   ac_status=$?
10755   echo "$as_me:10755: \$? = $ac_status" >&5
10756   (exit "$ac_status"); } &&
10757          { ac_try='test -s "conftest.$ac_objext"'
10758   { (eval echo "$as_me:10758: \"$ac_try\"") >&5
10759   (eval $ac_try) 2>&5
10760   ac_status=$?
10761   echo "$as_me:10761: \$? = $ac_status" >&5
10762   (exit "$ac_status"); }; }; then
10763
10764         cf_cv_term_header="$cf_test"
10765 else
10766   echo "$as_me: failed program was:" >&5
10767 cat "conftest.$ac_ext" >&5
10768
10769         cf_cv_term_header=unknown
10770
10771 fi
10772 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10773         test "$cf_cv_term_header" != unknown && break
10774 done
10775
10776 fi
10777 echo "$as_me:10777: result: $cf_cv_term_header" >&5
10778 echo "${ECHO_T}$cf_cv_term_header" >&6
10779
10780 # Set definitions to allow ifdef'ing to accommodate subdirectories
10781
10782 case "$cf_cv_term_header" in
10783 (*term.h)
10784
10785 cat >>confdefs.h <<\EOF
10786 #define HAVE_TERM_H 1
10787 EOF
10788
10789         ;;
10790 esac
10791
10792 case "$cf_cv_term_header" in
10793 (ncurses/term.h)
10794
10795 cat >>confdefs.h <<\EOF
10796 #define HAVE_NCURSES_TERM_H 1
10797 EOF
10798
10799         ;;
10800 (ncursesw/term.h)
10801
10802 cat >>confdefs.h <<\EOF
10803 #define HAVE_NCURSESW_TERM_H 1
10804 EOF
10805
10806         ;;
10807 esac
10808
10809                 fi
10810
10811         else
10812                 echo "$as_me:10812: result: no" >&5
10813 echo "${ECHO_T}no" >&6
10814                 NCURSES_CONFIG_PKG=none
10815         fi
10816 else
10817         NCURSES_CONFIG_PKG=none
10818 fi
10819
10820 if test "x$cf_have_ncuconfig" = "xno"; then
10821         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10822
10823 if test -n "$ac_tool_prefix"; then
10824   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10825   do
10826     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10827 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10828 echo "$as_me:10828: checking for $ac_word" >&5
10829 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10830 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10831   echo $ECHO_N "(cached) $ECHO_C" >&6
10832 else
10833   if test -n "$NCURSES_CONFIG"; then
10834   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10835 else
10836   ac_save_IFS=$IFS; IFS=$ac_path_separator
10837 ac_dummy="$PATH"
10838 for ac_dir in $ac_dummy; do
10839   IFS=$ac_save_IFS
10840   test -z "$ac_dir" && ac_dir=.
10841   $as_executable_p "$ac_dir/$ac_word" || continue
10842 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10843 echo "$as_me:10843: found $ac_dir/$ac_word" >&5
10844 break
10845 done
10846
10847 fi
10848 fi
10849 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10850 if test -n "$NCURSES_CONFIG"; then
10851   echo "$as_me:10851: result: $NCURSES_CONFIG" >&5
10852 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10853 else
10854   echo "$as_me:10854: result: no" >&5
10855 echo "${ECHO_T}no" >&6
10856 fi
10857
10858     test -n "$NCURSES_CONFIG" && break
10859   done
10860 fi
10861 if test -z "$NCURSES_CONFIG"; then
10862   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10863   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10864 do
10865   # Extract the first word of "$ac_prog", so it can be a program name with args.
10866 set dummy $ac_prog; ac_word=$2
10867 echo "$as_me:10867: checking for $ac_word" >&5
10868 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10869 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10870   echo $ECHO_N "(cached) $ECHO_C" >&6
10871 else
10872   if test -n "$ac_ct_NCURSES_CONFIG"; then
10873   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10874 else
10875   ac_save_IFS=$IFS; IFS=$ac_path_separator
10876 ac_dummy="$PATH"
10877 for ac_dir in $ac_dummy; do
10878   IFS=$ac_save_IFS
10879   test -z "$ac_dir" && ac_dir=.
10880   $as_executable_p "$ac_dir/$ac_word" || continue
10881 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10882 echo "$as_me:10882: found $ac_dir/$ac_word" >&5
10883 break
10884 done
10885
10886 fi
10887 fi
10888 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10889 if test -n "$ac_ct_NCURSES_CONFIG"; then
10890   echo "$as_me:10890: result: $ac_ct_NCURSES_CONFIG" >&5
10891 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10892 else
10893   echo "$as_me:10893: result: no" >&5
10894 echo "${ECHO_T}no" >&6
10895 fi
10896
10897   test -n "$ac_ct_NCURSES_CONFIG" && break
10898 done
10899 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10900
10901   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10902 fi
10903
10904         if test "$NCURSES_CONFIG" != none ; then
10905
10906 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10907 do
10908         case "x$cf_add_cflags" in
10909         (x-[DU]*)
10910
10911 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10912 while true
10913 do
10914         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'`
10915         test "$CFLAGS" != "$cf_old_cflag" || break
10916
10917         CFLAGS="$cf_old_cflag"
10918 done
10919
10920 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10921 while true
10922 do
10923         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'`
10924         test "$CPPFLAGS" != "$cf_old_cflag" || break
10925
10926         CPPFLAGS="$cf_old_cflag"
10927 done
10928
10929                 ;;
10930         esac
10931
10932 cf_fix_cppflags=no
10933 cf_new_cflags=
10934 cf_new_cppflags=
10935 cf_new_extra_cppflags=
10936
10937 for cf_add_cflags in $cf_add_cflags
10938 do
10939 case "$cf_fix_cppflags" in
10940 (no)
10941         case "$cf_add_cflags" in
10942         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10943                 case "$cf_add_cflags" in
10944                 (-D*)
10945                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10946
10947                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10948                                 && test -z "${cf_tst_cflags}" \
10949                                 && cf_fix_cppflags=yes
10950
10951                         if test "$cf_fix_cppflags" = yes ; then
10952
10953         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10954         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10955
10956                                 continue
10957                         elif test "${cf_tst_cflags}" = "\"'" ; then
10958
10959         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10960         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10961
10962                                 continue
10963                         fi
10964                         ;;
10965                 esac
10966                 case "$CPPFLAGS" in
10967                 (*$cf_add_cflags)
10968                         ;;
10969                 (*)
10970                         case "$cf_add_cflags" in
10971                         (-D*)
10972                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10973
10974 CPPFLAGS=`echo "$CPPFLAGS" | \
10975         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10976                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10977
10978                                 ;;
10979                         esac
10980
10981         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10982         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10983
10984                         ;;
10985                 esac
10986                 ;;
10987         (*)
10988
10989         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10990         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10991
10992                 ;;
10993         esac
10994         ;;
10995 (yes)
10996
10997         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10998         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10999
11000         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
11001
11002         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11003                 && test -z "${cf_tst_cflags}" \
11004                 && cf_fix_cppflags=no
11005         ;;
11006 esac
11007 done
11008
11009 if test -n "$cf_new_cflags" ; then
11010
11011         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11012         CFLAGS="${CFLAGS}$cf_new_cflags"
11013
11014 fi
11015
11016 if test -n "$cf_new_cppflags" ; then
11017
11018         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11019         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11020
11021 fi
11022
11023 if test -n "$cf_new_extra_cppflags" ; then
11024
11025         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11026         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11027
11028 fi
11029
11030 done
11031
11032 cf_add_libs="$LIBS"
11033 # reverse order
11034 cf_add_0lib=
11035 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11036 # filter duplicates
11037 for cf_add_1lib in $cf_add_0lib; do
11038         for cf_add_2lib in $cf_add_libs; do
11039                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11040                         cf_add_1lib=
11041                         break
11042                 fi
11043         done
11044         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11045 done
11046 LIBS="$cf_add_libs"
11047
11048                 # even with config script, some packages use no-override for curses.h
11049
11050 echo "$as_me:11050: checking if we have identified curses headers" >&5
11051 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
11052 if test "${cf_cv_ncurses_header+set}" = set; then
11053   echo $ECHO_N "(cached) $ECHO_C" >&6
11054 else
11055
11056 cf_cv_ncurses_header=none
11057 for cf_header in \
11058         ncurses.h $cf_cv_screen/ncurses.h \
11059         curses.h $cf_cv_screen/curses.h
11060 do
11061 cat >"conftest.$ac_ext" <<_ACEOF
11062 #line 11062 "configure"
11063 #include "confdefs.h"
11064 #include <${cf_header}>
11065 int
11066 main (void)
11067 {
11068 initscr(); tgoto("?", 0,0)
11069   ;
11070   return 0;
11071 }
11072 _ACEOF
11073 rm -f "conftest.$ac_objext"
11074 if { (eval echo "$as_me:11074: \"$ac_compile\"") >&5
11075   (eval $ac_compile) 2>&5
11076   ac_status=$?
11077   echo "$as_me:11077: \$? = $ac_status" >&5
11078   (exit "$ac_status"); } &&
11079          { ac_try='test -s "conftest.$ac_objext"'
11080   { (eval echo "$as_me:11080: \"$ac_try\"") >&5
11081   (eval $ac_try) 2>&5
11082   ac_status=$?
11083   echo "$as_me:11083: \$? = $ac_status" >&5
11084   (exit "$ac_status"); }; }; then
11085   cf_cv_ncurses_header=$cf_header; break
11086 else
11087   echo "$as_me: failed program was:" >&5
11088 cat "conftest.$ac_ext" >&5
11089 fi
11090 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11091 done
11092
11093 fi
11094 echo "$as_me:11094: result: $cf_cv_ncurses_header" >&5
11095 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
11096
11097 if test "$cf_cv_ncurses_header" = none ; then
11098         { { echo "$as_me:11098: error: No curses header-files found" >&5
11099 echo "$as_me: error: No curses header-files found" >&2;}
11100    { (exit 1); exit 1; }; }
11101 fi
11102
11103 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
11104
11105 for ac_header in $cf_cv_ncurses_header
11106 do
11107 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11108 echo "$as_me:11108: checking for $ac_header" >&5
11109 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11110 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11111   echo $ECHO_N "(cached) $ECHO_C" >&6
11112 else
11113   cat >"conftest.$ac_ext" <<_ACEOF
11114 #line 11114 "configure"
11115 #include "confdefs.h"
11116 #include <$ac_header>
11117 _ACEOF
11118 if { (eval echo "$as_me:11118: \"$ac_cpp "conftest.$ac_ext"\"") >&5
11119   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
11120   ac_status=$?
11121   $EGREP -v '^ *\+' conftest.er1 >conftest.err
11122   rm -f conftest.er1
11123   cat conftest.err >&5
11124   echo "$as_me:11124: \$? = $ac_status" >&5
11125   (exit "$ac_status"); } >/dev/null; then
11126   if test -s conftest.err; then
11127     ac_cpp_err=$ac_c_preproc_warn_flag
11128   else
11129     ac_cpp_err=
11130   fi
11131 else
11132   ac_cpp_err=yes
11133 fi
11134 if test -z "$ac_cpp_err"; then
11135   eval "$as_ac_Header=yes"
11136 else
11137   echo "$as_me: failed program was:" >&5
11138   cat "conftest.$ac_ext" >&5
11139   eval "$as_ac_Header=no"
11140 fi
11141 rm -f conftest.err "conftest.$ac_ext"
11142 fi
11143 echo "$as_me:11143: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
11144 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
11145 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
11146   cat >>confdefs.h <<EOF
11147 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11148 EOF
11149
11150 fi
11151 done
11152
11153 cat >>confdefs.h <<\EOF
11154 #define NCURSES 1
11155 EOF
11156
11157 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11158
11159                 cat >>confdefs.h <<EOF
11160 #define $cf_nculib_ROOT 1
11161 EOF
11162
11163                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
11164
11165         else
11166
11167 cf_ncuhdr_root=$cf_cv_screen
11168
11169 test -n "$cf_cv_curses_dir" && \
11170 test "$cf_cv_curses_dir" != "no" && { \
11171
11172 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
11173   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
11174   do
11175         while test "$cf_add_incdir" != /usr/include
11176         do
11177           if test -d "$cf_add_incdir"
11178           then
11179                 cf_have_incdir=no
11180                 if test -n "$CFLAGS$CPPFLAGS" ; then
11181                   # a loop is needed to ensure we can add subdirs of existing dirs
11182                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11183                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11184                           cf_have_incdir=yes; break
11185                         fi
11186                   done
11187                 fi
11188
11189                 if test "$cf_have_incdir" = no ; then
11190                   if test "$cf_add_incdir" = /usr/local/include ; then
11191                         if test "$GCC" = yes
11192                         then
11193                           cf_save_CPPFLAGS=$CPPFLAGS
11194
11195         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11196         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11197
11198                           cat >"conftest.$ac_ext" <<_ACEOF
11199 #line 11199 "configure"
11200 #include "confdefs.h"
11201 #include <stdio.h>
11202 int
11203 main (void)
11204 {
11205 printf("Hello")
11206   ;
11207   return 0;
11208 }
11209 _ACEOF
11210 rm -f "conftest.$ac_objext"
11211 if { (eval echo "$as_me:11211: \"$ac_compile\"") >&5
11212   (eval $ac_compile) 2>&5
11213   ac_status=$?
11214   echo "$as_me:11214: \$? = $ac_status" >&5
11215   (exit "$ac_status"); } &&
11216          { ac_try='test -s "conftest.$ac_objext"'
11217   { (eval echo "$as_me:11217: \"$ac_try\"") >&5
11218   (eval $ac_try) 2>&5
11219   ac_status=$?
11220   echo "$as_me:11220: \$? = $ac_status" >&5
11221   (exit "$ac_status"); }; }; then
11222   :
11223 else
11224   echo "$as_me: failed program was:" >&5
11225 cat "conftest.$ac_ext" >&5
11226 cf_have_incdir=yes
11227 fi
11228 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11229                           CPPFLAGS=$cf_save_CPPFLAGS
11230                         fi
11231                   fi
11232                 fi
11233
11234                 if test "$cf_have_incdir" = no ; then
11235                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11236
11237 echo "${as_me:-configure}:11237: testing adding $cf_add_incdir to include-path ..." 1>&5
11238
11239                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11240
11241                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11242                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11243                   cf_add_incdir="$cf_top_incdir"
11244                 else
11245                   break
11246                 fi
11247           else
11248                 break
11249           fi
11250         done
11251   done
11252 fi
11253
11254 }
11255
11256 echo "$as_me:11256: checking for $cf_ncuhdr_root header in include-path" >&5
11257 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
11258 if test "${cf_cv_ncurses_h+set}" = set; then
11259   echo $ECHO_N "(cached) $ECHO_C" >&6
11260 else
11261
11262         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
11263         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
11264         for cf_header in $cf_header_list
11265         do
11266
11267         cat >"conftest.$ac_ext" <<_ACEOF
11268 #line 11268 "configure"
11269 #include "confdefs.h"
11270
11271 #include <$cf_header>
11272 int
11273 main (void)
11274 {
11275
11276 #ifdef NCURSES_VERSION
11277
11278 printf("%s\\n", NCURSES_VERSION);
11279 #else
11280 #ifdef __NCURSES_H
11281 printf("old\\n");
11282 #else
11283         make an error
11284 #endif
11285 #endif
11286
11287   ;
11288   return 0;
11289 }
11290 _ACEOF
11291 rm -f "conftest.$ac_objext"
11292 if { (eval echo "$as_me:11292: \"$ac_compile\"") >&5
11293   (eval $ac_compile) 2>&5
11294   ac_status=$?
11295   echo "$as_me:11295: \$? = $ac_status" >&5
11296   (exit "$ac_status"); } &&
11297          { ac_try='test -s "conftest.$ac_objext"'
11298   { (eval echo "$as_me:11298: \"$ac_try\"") >&5
11299   (eval $ac_try) 2>&5
11300   ac_status=$?
11301   echo "$as_me:11301: \$? = $ac_status" >&5
11302   (exit "$ac_status"); }; }; then
11303   cf_cv_ncurses_h=$cf_header
11304
11305 else
11306   echo "$as_me: failed program was:" >&5
11307 cat "conftest.$ac_ext" >&5
11308 cf_cv_ncurses_h=no
11309 fi
11310 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11311
11312                 test "$cf_cv_ncurses_h" != no && break
11313         done
11314
11315 fi
11316 echo "$as_me:11316: result: $cf_cv_ncurses_h" >&5
11317 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
11318
11319 if test "$cf_cv_ncurses_h" != no ; then
11320         cf_cv_ncurses_header=$cf_cv_ncurses_h
11321 else
11322
11323 echo "$as_me:11323: checking for $cf_ncuhdr_root include-path" >&5
11324 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
11325 if test "${cf_cv_ncurses_h2+set}" = set; then
11326   echo $ECHO_N "(cached) $ECHO_C" >&6
11327 else
11328
11329         test -n "$verbose" && echo
11330
11331 cf_search=
11332
11333 # collect the current set of include-directories from compiler flags
11334 cf_header_path_list=""
11335 if test -n "${CFLAGS}${CPPFLAGS}" ; then
11336         for cf_header_path in $CPPFLAGS $CFLAGS
11337         do
11338                 case "$cf_header_path" in
11339                 (-I*)
11340                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
11341
11342 test "x$cf_header_path" != "xNONE" && \
11343 test -d "$cf_header_path" && \
11344  {
11345         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
11346         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
11347         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
11348         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
11349         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
11350         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"
11351 }
11352
11353                         cf_header_path_list="$cf_header_path_list $cf_search"
11354                         ;;
11355                 esac
11356         done
11357 fi
11358
11359 # add the variations for the package we are looking for
11360
11361 cf_search=
11362
11363 test "x$prefix" != "xNONE" && \
11364 test -d "$prefix" && \
11365  {
11366         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
11367         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
11368         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
11369         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
11370         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
11371         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
11372 }
11373
11374 for cf_subdir_prefix in \
11375         /usr \
11376         /usr/local \
11377         /usr/pkg \
11378         /opt \
11379         /opt/local \
11380         $HOME
11381 do
11382
11383 test "x$cf_subdir_prefix" != "x$prefix" && \
11384 test -d "$cf_subdir_prefix" && \
11385 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11386         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
11387         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
11388         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11389         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11390         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11391         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"
11392 }
11393
11394 done
11395
11396 test "$includedir" != NONE && \
11397 test "$includedir" != "/usr/include" && \
11398 test -d "$includedir" && {
11399         test -d "$includedir" &&    cf_search="$cf_search $includedir"
11400         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
11401 }
11402
11403 test "$oldincludedir" != NONE && \
11404 test "$oldincludedir" != "/usr/include" && \
11405 test -d "$oldincludedir" && {
11406         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
11407         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
11408 }
11409
11410 cf_search="$cf_search $cf_header_path_list"
11411
11412         test -n "$verbose" && echo "search path $cf_search"
11413         cf_save2_CPPFLAGS="$CPPFLAGS"
11414         for cf_incdir in $cf_search
11415         do
11416
11417 if test -n "$cf_incdir" ; then
11418   for cf_add_incdir in $cf_incdir
11419   do
11420         while test "$cf_add_incdir" != /usr/include
11421         do
11422           if test -d "$cf_add_incdir"
11423           then
11424                 cf_have_incdir=no
11425                 if test -n "$CFLAGS$CPPFLAGS" ; then
11426                   # a loop is needed to ensure we can add subdirs of existing dirs
11427                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11428                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11429                           cf_have_incdir=yes; break
11430                         fi
11431                   done
11432                 fi
11433
11434                 if test "$cf_have_incdir" = no ; then
11435                   if test "$cf_add_incdir" = /usr/local/include ; then
11436                         if test "$GCC" = yes
11437                         then
11438                           cf_save_CPPFLAGS=$CPPFLAGS
11439
11440         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11441         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11442
11443                           cat >"conftest.$ac_ext" <<_ACEOF
11444 #line 11444 "configure"
11445 #include "confdefs.h"
11446 #include <stdio.h>
11447 int
11448 main (void)
11449 {
11450 printf("Hello")
11451   ;
11452   return 0;
11453 }
11454 _ACEOF
11455 rm -f "conftest.$ac_objext"
11456 if { (eval echo "$as_me:11456: \"$ac_compile\"") >&5
11457   (eval $ac_compile) 2>&5
11458   ac_status=$?
11459   echo "$as_me:11459: \$? = $ac_status" >&5
11460   (exit "$ac_status"); } &&
11461          { ac_try='test -s "conftest.$ac_objext"'
11462   { (eval echo "$as_me:11462: \"$ac_try\"") >&5
11463   (eval $ac_try) 2>&5
11464   ac_status=$?
11465   echo "$as_me:11465: \$? = $ac_status" >&5
11466   (exit "$ac_status"); }; }; then
11467   :
11468 else
11469   echo "$as_me: failed program was:" >&5
11470 cat "conftest.$ac_ext" >&5
11471 cf_have_incdir=yes
11472 fi
11473 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11474                           CPPFLAGS=$cf_save_CPPFLAGS
11475                         fi
11476                   fi
11477                 fi
11478
11479                 if test "$cf_have_incdir" = no ; then
11480                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11481
11482 echo "${as_me:-configure}:11482: testing adding $cf_add_incdir to include-path ..." 1>&5
11483
11484                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11485
11486                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11487                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11488                   cf_add_incdir="$cf_top_incdir"
11489                 else
11490                   break
11491                 fi
11492           else
11493                 break
11494           fi
11495         done
11496   done
11497 fi
11498
11499                 for cf_header in \
11500                         ncurses.h \
11501                         curses.h
11502                 do
11503
11504         cat >"conftest.$ac_ext" <<_ACEOF
11505 #line 11505 "configure"
11506 #include "confdefs.h"
11507
11508 #include <$cf_header>
11509 int
11510 main (void)
11511 {
11512
11513 #ifdef NCURSES_VERSION
11514
11515 printf("%s\\n", NCURSES_VERSION);
11516 #else
11517 #ifdef __NCURSES_H
11518 printf("old\\n");
11519 #else
11520         make an error
11521 #endif
11522 #endif
11523
11524   ;
11525   return 0;
11526 }
11527 _ACEOF
11528 rm -f "conftest.$ac_objext"
11529 if { (eval echo "$as_me:11529: \"$ac_compile\"") >&5
11530   (eval $ac_compile) 2>&5
11531   ac_status=$?
11532   echo "$as_me:11532: \$? = $ac_status" >&5
11533   (exit "$ac_status"); } &&
11534          { ac_try='test -s "conftest.$ac_objext"'
11535   { (eval echo "$as_me:11535: \"$ac_try\"") >&5
11536   (eval $ac_try) 2>&5
11537   ac_status=$?
11538   echo "$as_me:11538: \$? = $ac_status" >&5
11539   (exit "$ac_status"); }; }; then
11540   cf_cv_ncurses_h2=$cf_header
11541
11542 else
11543   echo "$as_me: failed program was:" >&5
11544 cat "conftest.$ac_ext" >&5
11545 cf_cv_ncurses_h2=no
11546 fi
11547 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11548
11549                         if test "$cf_cv_ncurses_h2" != no ; then
11550                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11551                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11552                                 break
11553                         fi
11554                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11555                 done
11556                 CPPFLAGS="$cf_save2_CPPFLAGS"
11557                 test "$cf_cv_ncurses_h2" != no && break
11558         done
11559         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11559: error: not found" >&5
11560 echo "$as_me: error: not found" >&2;}
11561    { (exit 1); exit 1; }; }
11562
11563 fi
11564 echo "$as_me:11564: result: $cf_cv_ncurses_h2" >&5
11565 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11566
11567         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11568         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11569         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11570                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11571         fi
11572
11573 if test -n "$cf_1st_incdir" ; then
11574   for cf_add_incdir in $cf_1st_incdir
11575   do
11576         while test "$cf_add_incdir" != /usr/include
11577         do
11578           if test -d "$cf_add_incdir"
11579           then
11580                 cf_have_incdir=no
11581                 if test -n "$CFLAGS$CPPFLAGS" ; then
11582                   # a loop is needed to ensure we can add subdirs of existing dirs
11583                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11584                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11585                           cf_have_incdir=yes; break
11586                         fi
11587                   done
11588                 fi
11589
11590                 if test "$cf_have_incdir" = no ; then
11591                   if test "$cf_add_incdir" = /usr/local/include ; then
11592                         if test "$GCC" = yes
11593                         then
11594                           cf_save_CPPFLAGS=$CPPFLAGS
11595
11596         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11597         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11598
11599                           cat >"conftest.$ac_ext" <<_ACEOF
11600 #line 11600 "configure"
11601 #include "confdefs.h"
11602 #include <stdio.h>
11603 int
11604 main (void)
11605 {
11606 printf("Hello")
11607   ;
11608   return 0;
11609 }
11610 _ACEOF
11611 rm -f "conftest.$ac_objext"
11612 if { (eval echo "$as_me:11612: \"$ac_compile\"") >&5
11613   (eval $ac_compile) 2>&5
11614   ac_status=$?
11615   echo "$as_me:11615: \$? = $ac_status" >&5
11616   (exit "$ac_status"); } &&
11617          { ac_try='test -s "conftest.$ac_objext"'
11618   { (eval echo "$as_me:11618: \"$ac_try\"") >&5
11619   (eval $ac_try) 2>&5
11620   ac_status=$?
11621   echo "$as_me:11621: \$? = $ac_status" >&5
11622   (exit "$ac_status"); }; }; then
11623   :
11624 else
11625   echo "$as_me: failed program was:" >&5
11626 cat "conftest.$ac_ext" >&5
11627 cf_have_incdir=yes
11628 fi
11629 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11630                           CPPFLAGS=$cf_save_CPPFLAGS
11631                         fi
11632                   fi
11633                 fi
11634
11635                 if test "$cf_have_incdir" = no ; then
11636                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11637
11638 echo "${as_me:-configure}:11638: testing adding $cf_add_incdir to include-path ..." 1>&5
11639
11640                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11641
11642                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11643                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11644                   cf_add_incdir="$cf_top_incdir"
11645                 else
11646                   break
11647                 fi
11648           else
11649                 break
11650           fi
11651         done
11652   done
11653 fi
11654
11655 fi
11656
11657 # Set definitions to allow ifdef'ing for ncurses.h
11658
11659 case "$cf_cv_ncurses_header" in
11660 (*ncurses.h)
11661
11662 cat >>confdefs.h <<\EOF
11663 #define HAVE_NCURSES_H 1
11664 EOF
11665
11666         ;;
11667 esac
11668
11669 case "$cf_cv_ncurses_header" in
11670 (ncurses/curses.h|ncurses/ncurses.h)
11671
11672 cat >>confdefs.h <<\EOF
11673 #define HAVE_NCURSES_NCURSES_H 1
11674 EOF
11675
11676         ;;
11677 (ncursesw/curses.h|ncursesw/ncurses.h)
11678
11679 cat >>confdefs.h <<\EOF
11680 #define HAVE_NCURSESW_NCURSES_H 1
11681 EOF
11682
11683         ;;
11684 esac
11685
11686 echo "$as_me:11686: checking for terminfo header" >&5
11687 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11688 if test "${cf_cv_term_header+set}" = set; then
11689   echo $ECHO_N "(cached) $ECHO_C" >&6
11690 else
11691
11692 case "${cf_cv_ncurses_header}" in
11693 (*/ncurses.h|*/ncursesw.h)
11694         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11695         ;;
11696 (*)
11697         cf_term_header=term.h
11698         ;;
11699 esac
11700
11701 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11702 do
11703 cat >"conftest.$ac_ext" <<_ACEOF
11704 #line 11704 "configure"
11705 #include "confdefs.h"
11706 #include <stdio.h>
11707 #include <${cf_cv_ncurses_header:-curses.h}>
11708 #include <$cf_test>
11709
11710 int
11711 main (void)
11712 {
11713 int x = auto_left_margin; (void)x
11714   ;
11715   return 0;
11716 }
11717 _ACEOF
11718 rm -f "conftest.$ac_objext"
11719 if { (eval echo "$as_me:11719: \"$ac_compile\"") >&5
11720   (eval $ac_compile) 2>&5
11721   ac_status=$?
11722   echo "$as_me:11722: \$? = $ac_status" >&5
11723   (exit "$ac_status"); } &&
11724          { ac_try='test -s "conftest.$ac_objext"'
11725   { (eval echo "$as_me:11725: \"$ac_try\"") >&5
11726   (eval $ac_try) 2>&5
11727   ac_status=$?
11728   echo "$as_me:11728: \$? = $ac_status" >&5
11729   (exit "$ac_status"); }; }; then
11730
11731         cf_cv_term_header="$cf_test"
11732 else
11733   echo "$as_me: failed program was:" >&5
11734 cat "conftest.$ac_ext" >&5
11735
11736         cf_cv_term_header=unknown
11737
11738 fi
11739 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11740         test "$cf_cv_term_header" != unknown && break
11741 done
11742
11743 fi
11744 echo "$as_me:11744: result: $cf_cv_term_header" >&5
11745 echo "${ECHO_T}$cf_cv_term_header" >&6
11746
11747 # Set definitions to allow ifdef'ing to accommodate subdirectories
11748
11749 case "$cf_cv_term_header" in
11750 (*term.h)
11751
11752 cat >>confdefs.h <<\EOF
11753 #define HAVE_TERM_H 1
11754 EOF
11755
11756         ;;
11757 esac
11758
11759 case "$cf_cv_term_header" in
11760 (ncurses/term.h)
11761
11762 cat >>confdefs.h <<\EOF
11763 #define HAVE_NCURSES_TERM_H 1
11764 EOF
11765
11766         ;;
11767 (ncursesw/term.h)
11768
11769 cat >>confdefs.h <<\EOF
11770 #define HAVE_NCURSESW_TERM_H 1
11771 EOF
11772
11773         ;;
11774 esac
11775
11776 # some applications need this, but should check for NCURSES_VERSION
11777
11778 cat >>confdefs.h <<\EOF
11779 #define NCURSES 1
11780 EOF
11781
11782 echo "$as_me:11782: checking for ncurses version" >&5
11783 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11784 if test "${cf_cv_ncurses_version+set}" = set; then
11785   echo $ECHO_N "(cached) $ECHO_C" >&6
11786 else
11787
11788         cf_cv_ncurses_version=no
11789         cf_tempfile=out$$
11790         rm -f "$cf_tempfile"
11791         if test "$cross_compiling" = yes; then
11792
11793         # This will not work if the preprocessor splits the line after the
11794         # Autoconf token.  The 'unproto' program does that.
11795         cat > "conftest.$ac_ext" <<EOF
11796 #include <${cf_cv_ncurses_header:-curses.h}>
11797 #undef Autoconf
11798 #ifdef NCURSES_VERSION
11799 Autoconf NCURSES_VERSION
11800 #else
11801 #ifdef __NCURSES_H
11802 Autoconf "old"
11803 #endif
11804 ;
11805 #endif
11806 EOF
11807         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11808         { (eval echo "$as_me:11808: \"$cf_try\"") >&5
11809   (eval $cf_try) 2>&5
11810   ac_status=$?
11811   echo "$as_me:11811: \$? = $ac_status" >&5
11812   (exit "$ac_status"); }
11813         if test -f conftest.out ; then
11814                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11815                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11816                 rm -f conftest.out
11817         fi
11818
11819 else
11820   cat >"conftest.$ac_ext" <<_ACEOF
11821 #line 11821 "configure"
11822 #include "confdefs.h"
11823
11824 #include <${cf_cv_ncurses_header:-curses.h}>
11825 #include <stdio.h>
11826 int main(void)
11827 {
11828         FILE *fp = fopen("$cf_tempfile", "w");
11829 #ifdef NCURSES_VERSION
11830 # ifdef NCURSES_VERSION_PATCH
11831         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11832 # else
11833         fprintf(fp, "%s\\n", NCURSES_VERSION);
11834 # endif
11835 #else
11836 # ifdef __NCURSES_H
11837         fprintf(fp, "old\\n");
11838 # else
11839         make an error
11840 # endif
11841 #endif
11842         ${cf_cv_main_return:-return}(0);
11843 }
11844 _ACEOF
11845 rm -f "conftest$ac_exeext"
11846 if { (eval echo "$as_me:11846: \"$ac_link\"") >&5
11847   (eval $ac_link) 2>&5
11848   ac_status=$?
11849   echo "$as_me:11849: \$? = $ac_status" >&5
11850   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11851   { (eval echo "$as_me:11851: \"$ac_try\"") >&5
11852   (eval $ac_try) 2>&5
11853   ac_status=$?
11854   echo "$as_me:11854: \$? = $ac_status" >&5
11855   (exit "$ac_status"); }; }; then
11856
11857         cf_cv_ncurses_version=`cat $cf_tempfile`
11858 else
11859   echo "$as_me: program exited with status $ac_status" >&5
11860 echo "$as_me: failed program was:" >&5
11861 cat "conftest.$ac_ext" >&5
11862 fi
11863 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11864 fi
11865         rm -f "$cf_tempfile"
11866
11867 fi
11868 echo "$as_me:11868: result: $cf_cv_ncurses_version" >&5
11869 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11870 test "$cf_cv_ncurses_version" = no ||
11871 cat >>confdefs.h <<\EOF
11872 #define NCURSES 1
11873 EOF
11874
11875 cf_nculib_root=$cf_cv_screen
11876         # This works, except for the special case where we find gpm, but
11877         # ncurses is in a nonstandard location via $LIBS, and we really want
11878         # to link gpm.
11879 cf_ncurses_LIBS=""
11880 cf_ncurses_SAVE="$LIBS"
11881 echo "$as_me:11881: checking for Gpm_Open in -lgpm" >&5
11882 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11883 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11884   echo $ECHO_N "(cached) $ECHO_C" >&6
11885 else
11886   ac_check_lib_save_LIBS=$LIBS
11887 LIBS="-lgpm  $LIBS"
11888 cat >"conftest.$ac_ext" <<_ACEOF
11889 #line 11889 "configure"
11890 #include "confdefs.h"
11891
11892 /* Override any gcc2 internal prototype to avoid an error.  */
11893 #ifdef __cplusplus
11894 extern "C"
11895 #endif
11896 /* We use char because int might match the return type of a gcc2
11897    builtin and then its argument prototype would still apply.  */
11898 char Gpm_Open ();
11899 int
11900 main (void)
11901 {
11902 Gpm_Open ();
11903   ;
11904   return 0;
11905 }
11906 _ACEOF
11907 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11908 if { (eval echo "$as_me:11908: \"$ac_link\"") >&5
11909   (eval $ac_link) 2>&5
11910   ac_status=$?
11911   echo "$as_me:11911: \$? = $ac_status" >&5
11912   (exit "$ac_status"); } &&
11913          { ac_try='test -s "conftest$ac_exeext"'
11914   { (eval echo "$as_me:11914: \"$ac_try\"") >&5
11915   (eval $ac_try) 2>&5
11916   ac_status=$?
11917   echo "$as_me:11917: \$? = $ac_status" >&5
11918   (exit "$ac_status"); }; }; then
11919   ac_cv_lib_gpm_Gpm_Open=yes
11920 else
11921   echo "$as_me: failed program was:" >&5
11922 cat "conftest.$ac_ext" >&5
11923 ac_cv_lib_gpm_Gpm_Open=no
11924 fi
11925 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11926 LIBS=$ac_check_lib_save_LIBS
11927 fi
11928 echo "$as_me:11928: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11929 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11930 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11931   echo "$as_me:11931: checking for initscr in -lgpm" >&5
11932 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11933 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11934   echo $ECHO_N "(cached) $ECHO_C" >&6
11935 else
11936   ac_check_lib_save_LIBS=$LIBS
11937 LIBS="-lgpm  $LIBS"
11938 cat >"conftest.$ac_ext" <<_ACEOF
11939 #line 11939 "configure"
11940 #include "confdefs.h"
11941
11942 /* Override any gcc2 internal prototype to avoid an error.  */
11943 #ifdef __cplusplus
11944 extern "C"
11945 #endif
11946 /* We use char because int might match the return type of a gcc2
11947    builtin and then its argument prototype would still apply.  */
11948 char initscr ();
11949 int
11950 main (void)
11951 {
11952 initscr ();
11953   ;
11954   return 0;
11955 }
11956 _ACEOF
11957 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11958 if { (eval echo "$as_me:11958: \"$ac_link\"") >&5
11959   (eval $ac_link) 2>&5
11960   ac_status=$?
11961   echo "$as_me:11961: \$? = $ac_status" >&5
11962   (exit "$ac_status"); } &&
11963          { ac_try='test -s "conftest$ac_exeext"'
11964   { (eval echo "$as_me:11964: \"$ac_try\"") >&5
11965   (eval $ac_try) 2>&5
11966   ac_status=$?
11967   echo "$as_me:11967: \$? = $ac_status" >&5
11968   (exit "$ac_status"); }; }; then
11969   ac_cv_lib_gpm_initscr=yes
11970 else
11971   echo "$as_me: failed program was:" >&5
11972 cat "conftest.$ac_ext" >&5
11973 ac_cv_lib_gpm_initscr=no
11974 fi
11975 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11976 LIBS=$ac_check_lib_save_LIBS
11977 fi
11978 echo "$as_me:11978: result: $ac_cv_lib_gpm_initscr" >&5
11979 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11980 if test "$ac_cv_lib_gpm_initscr" = yes; then
11981   LIBS="$cf_ncurses_SAVE"
11982 else
11983   cf_ncurses_LIBS="-lgpm"
11984 fi
11985
11986 fi
11987
11988 case "$host_os" in
11989 (freebsd*)
11990         # This is only necessary if you are linking against an obsolete
11991         # version of ncurses (but it should do no harm, since it is static).
11992         if test "$cf_nculib_root" = ncurses ; then
11993                 echo "$as_me:11993: checking for tgoto in -lmytinfo" >&5
11994 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11995 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11996   echo $ECHO_N "(cached) $ECHO_C" >&6
11997 else
11998   ac_check_lib_save_LIBS=$LIBS
11999 LIBS="-lmytinfo  $LIBS"
12000 cat >"conftest.$ac_ext" <<_ACEOF
12001 #line 12001 "configure"
12002 #include "confdefs.h"
12003
12004 /* Override any gcc2 internal prototype to avoid an error.  */
12005 #ifdef __cplusplus
12006 extern "C"
12007 #endif
12008 /* We use char because int might match the return type of a gcc2
12009    builtin and then its argument prototype would still apply.  */
12010 char tgoto ();
12011 int
12012 main (void)
12013 {
12014 tgoto ();
12015   ;
12016   return 0;
12017 }
12018 _ACEOF
12019 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12020 if { (eval echo "$as_me:12020: \"$ac_link\"") >&5
12021   (eval $ac_link) 2>&5
12022   ac_status=$?
12023   echo "$as_me:12023: \$? = $ac_status" >&5
12024   (exit "$ac_status"); } &&
12025          { ac_try='test -s "conftest$ac_exeext"'
12026   { (eval echo "$as_me:12026: \"$ac_try\"") >&5
12027   (eval $ac_try) 2>&5
12028   ac_status=$?
12029   echo "$as_me:12029: \$? = $ac_status" >&5
12030   (exit "$ac_status"); }; }; then
12031   ac_cv_lib_mytinfo_tgoto=yes
12032 else
12033   echo "$as_me: failed program was:" >&5
12034 cat "conftest.$ac_ext" >&5
12035 ac_cv_lib_mytinfo_tgoto=no
12036 fi
12037 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12038 LIBS=$ac_check_lib_save_LIBS
12039 fi
12040 echo "$as_me:12040: result: $ac_cv_lib_mytinfo_tgoto" >&5
12041 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
12042 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
12043   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
12044 fi
12045
12046         fi
12047         ;;
12048 esac
12049
12050 cf_add_libs="$LIBS"
12051 # reverse order
12052 cf_add_0lib=
12053 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12054 # filter duplicates
12055 for cf_add_1lib in $cf_add_0lib; do
12056         for cf_add_2lib in $cf_add_libs; do
12057                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12058                         cf_add_1lib=
12059                         break
12060                 fi
12061         done
12062         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12063 done
12064 LIBS="$cf_add_libs"
12065
12066 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
12067 then
12068
12069 cf_add_libs="$LIBS"
12070 # reverse order
12071 cf_add_0lib=
12072 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12073 # filter duplicates
12074 for cf_add_1lib in $cf_add_0lib; do
12075         for cf_add_2lib in $cf_add_libs; do
12076                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12077                         cf_add_1lib=
12078                         break
12079                 fi
12080         done
12081         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12082 done
12083 LIBS="$cf_add_libs"
12084
12085 else
12086
12087         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
12088         cf_libdir=""
12089         echo "$as_me:12089: checking for initscr" >&5
12090 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
12091 if test "${ac_cv_func_initscr+set}" = set; then
12092   echo $ECHO_N "(cached) $ECHO_C" >&6
12093 else
12094   cat >"conftest.$ac_ext" <<_ACEOF
12095 #line 12095 "configure"
12096 #include "confdefs.h"
12097 #define initscr autoconf_temporary
12098 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12099 #undef initscr
12100
12101 #ifdef __cplusplus
12102 extern "C"
12103 #endif
12104
12105 /* We use char because int might match the return type of a gcc2
12106    builtin and then its argument prototype would still apply.  */
12107 char initscr (void);
12108
12109 int
12110 main (void)
12111 {
12112
12113 /* The GNU C library defines stubs for functions which it implements
12114     to always fail with ENOSYS.  Some functions are actually named
12115     something starting with __ and the normal name is an alias.  */
12116 #if defined (__stub_initscr) || defined (__stub___initscr)
12117 #error found stub for initscr
12118 #endif
12119
12120         return initscr ();
12121   ;
12122   return 0;
12123 }
12124 _ACEOF
12125 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12126 if { (eval echo "$as_me:12126: \"$ac_link\"") >&5
12127   (eval $ac_link) 2>&5
12128   ac_status=$?
12129   echo "$as_me:12129: \$? = $ac_status" >&5
12130   (exit "$ac_status"); } &&
12131          { ac_try='test -s "conftest$ac_exeext"'
12132   { (eval echo "$as_me:12132: \"$ac_try\"") >&5
12133   (eval $ac_try) 2>&5
12134   ac_status=$?
12135   echo "$as_me:12135: \$? = $ac_status" >&5
12136   (exit "$ac_status"); }; }; then
12137   ac_cv_func_initscr=yes
12138 else
12139   echo "$as_me: failed program was:" >&5
12140 cat "conftest.$ac_ext" >&5
12141 ac_cv_func_initscr=no
12142 fi
12143 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12144 fi
12145 echo "$as_me:12145: result: $ac_cv_func_initscr" >&5
12146 echo "${ECHO_T}$ac_cv_func_initscr" >&6
12147 if test "$ac_cv_func_initscr" = yes; then
12148   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12149 else
12150
12151                 cf_save_LIBS="$LIBS"
12152                 echo "$as_me:12152: checking for initscr in -l$cf_nculib_root" >&5
12153 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
12154                 LIBS="-l$cf_nculib_root $LIBS"
12155                 cat >"conftest.$ac_ext" <<_ACEOF
12156 #line 12156 "configure"
12157 #include "confdefs.h"
12158 #include <${cf_cv_ncurses_header:-curses.h}>
12159 int
12160 main (void)
12161 {
12162 initscr()
12163   ;
12164   return 0;
12165 }
12166 _ACEOF
12167 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12168 if { (eval echo "$as_me:12168: \"$ac_link\"") >&5
12169   (eval $ac_link) 2>&5
12170   ac_status=$?
12171   echo "$as_me:12171: \$? = $ac_status" >&5
12172   (exit "$ac_status"); } &&
12173          { ac_try='test -s "conftest$ac_exeext"'
12174   { (eval echo "$as_me:12174: \"$ac_try\"") >&5
12175   (eval $ac_try) 2>&5
12176   ac_status=$?
12177   echo "$as_me:12177: \$? = $ac_status" >&5
12178   (exit "$ac_status"); }; }; then
12179   echo "$as_me:12179: result: yes" >&5
12180 echo "${ECHO_T}yes" >&6
12181                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12182
12183 else
12184   echo "$as_me: failed program was:" >&5
12185 cat "conftest.$ac_ext" >&5
12186 echo "$as_me:12186: result: no" >&5
12187 echo "${ECHO_T}no" >&6
12188
12189 cf_search=
12190 cf_library_path_list=""
12191 if test -n "${LDFLAGS}${LIBS}" ; then
12192         for cf_library_path in $LDFLAGS $LIBS
12193         do
12194                 case "$cf_library_path" in
12195                 (-L*)
12196                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
12197
12198 test "x$cf_library_path" != "xNONE" && \
12199 test -d "$cf_library_path" && \
12200  {
12201         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
12202         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
12203         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
12204         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
12205         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
12206         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"
12207 }
12208
12209                         cf_library_path_list="$cf_library_path_list $cf_search"
12210                         ;;
12211                 esac
12212         done
12213 fi
12214
12215 cf_search=
12216
12217 test "x$prefix" != "xNONE" && \
12218 test -d "$prefix" && \
12219  {
12220         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
12221         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
12222         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
12223         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
12224         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
12225         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
12226 }
12227
12228 for cf_subdir_prefix in \
12229         /usr \
12230         /usr/local \
12231         /usr/pkg \
12232         /opt \
12233         /opt/local \
12234         $HOME
12235 do
12236
12237 test "x$cf_subdir_prefix" != "x$prefix" && \
12238 test -d "$cf_subdir_prefix" && \
12239 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
12240         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
12241         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
12242         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
12243         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
12244         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
12245         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"
12246 }
12247
12248 done
12249
12250 cf_search="$cf_library_path_list $cf_search"
12251
12252                         for cf_libdir in $cf_search
12253                         do
12254                                 echo "$as_me:12254: checking for -l$cf_nculib_root in $cf_libdir" >&5
12255 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
12256                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
12257                                 cat >"conftest.$ac_ext" <<_ACEOF
12258 #line 12258 "configure"
12259 #include "confdefs.h"
12260 #include <${cf_cv_ncurses_header:-curses.h}>
12261 int
12262 main (void)
12263 {
12264 initscr()
12265   ;
12266   return 0;
12267 }
12268 _ACEOF
12269 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12270 if { (eval echo "$as_me:12270: \"$ac_link\"") >&5
12271   (eval $ac_link) 2>&5
12272   ac_status=$?
12273   echo "$as_me:12273: \$? = $ac_status" >&5
12274   (exit "$ac_status"); } &&
12275          { ac_try='test -s "conftest$ac_exeext"'
12276   { (eval echo "$as_me:12276: \"$ac_try\"") >&5
12277   (eval $ac_try) 2>&5
12278   ac_status=$?
12279   echo "$as_me:12279: \$? = $ac_status" >&5
12280   (exit "$ac_status"); }; }; then
12281   echo "$as_me:12281: result: yes" >&5
12282 echo "${ECHO_T}yes" >&6
12283                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12284                                          break
12285 else
12286   echo "$as_me: failed program was:" >&5
12287 cat "conftest.$ac_ext" >&5
12288 echo "$as_me:12288: result: no" >&5
12289 echo "${ECHO_T}no" >&6
12290                                          LIBS="$cf_save_LIBS"
12291 fi
12292 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12293                         done
12294
12295 fi
12296 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12297
12298 fi
12299
12300 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
12301
12302 if test "$cf_found_library" = no ; then
12303         { { echo "$as_me:12303: error: Cannot link $cf_nculib_root library" >&5
12304 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
12305    { (exit 1); exit 1; }; }
12306 fi
12307
12308 fi
12309
12310 if test -n "$cf_ncurses_LIBS" ; then
12311         echo "$as_me:12311: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
12312 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
12313         cf_ncurses_SAVE="$LIBS"
12314         for p in $cf_ncurses_LIBS ; do
12315                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
12316                 if test "$q" != "$LIBS" ; then
12317                         LIBS="$q"
12318                 fi
12319         done
12320         cat >"conftest.$ac_ext" <<_ACEOF
12321 #line 12321 "configure"
12322 #include "confdefs.h"
12323 #include <${cf_cv_ncurses_header:-curses.h}>
12324 int
12325 main (void)
12326 {
12327 initscr(); mousemask(0,0); tigetstr((char *)0);
12328   ;
12329   return 0;
12330 }
12331 _ACEOF
12332 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12333 if { (eval echo "$as_me:12333: \"$ac_link\"") >&5
12334   (eval $ac_link) 2>&5
12335   ac_status=$?
12336   echo "$as_me:12336: \$? = $ac_status" >&5
12337   (exit "$ac_status"); } &&
12338          { ac_try='test -s "conftest$ac_exeext"'
12339   { (eval echo "$as_me:12339: \"$ac_try\"") >&5
12340   (eval $ac_try) 2>&5
12341   ac_status=$?
12342   echo "$as_me:12342: \$? = $ac_status" >&5
12343   (exit "$ac_status"); }; }; then
12344   echo "$as_me:12344: result: yes" >&5
12345 echo "${ECHO_T}yes" >&6
12346 else
12347   echo "$as_me: failed program was:" >&5
12348 cat "conftest.$ac_ext" >&5
12349 echo "$as_me:12349: result: no" >&5
12350 echo "${ECHO_T}no" >&6
12351                  LIBS="$cf_ncurses_SAVE"
12352 fi
12353 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12354 fi
12355
12356 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12357
12358 cat >>confdefs.h <<EOF
12359 #define $cf_nculib_ROOT 1
12360 EOF
12361
12362         fi
12363 else
12364         NCURSES_CONFIG=none
12365 fi
12366
12367         ;;
12368 (pdcurses)
12369         echo "$as_me:12369: checking for X" >&5
12370 echo $ECHO_N "checking for X... $ECHO_C" >&6
12371
12372 # Check whether --with-x or --without-x was given.
12373 if test "${with_x+set}" = set; then
12374   withval="$with_x"
12375
12376 fi;
12377 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
12378 if test "x$with_x" = xno; then
12379   # The user explicitly disabled X.
12380   have_x=disabled
12381 else
12382   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12383     # Both variables are already set.
12384     have_x=yes
12385   else
12386     if test "${ac_cv_have_x+set}" = set; then
12387   echo $ECHO_N "(cached) $ECHO_C" >&6
12388 else
12389   # One or both of the vars are not set, and there is no cached value.
12390 ac_x_includes=no ac_x_libraries=no
12391 rm -fr conftest.dir
12392 if mkdir conftest.dir; then
12393   cd conftest.dir
12394   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12395   cat >Imakefile <<'EOF'
12396 acfindx:
12397         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12398 EOF
12399   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12400     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
12401     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
12402     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12403     for ac_extension in a so sl dylib dll; do
12404       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12405          test -f "$ac_im_libdir/libX11.$ac_extension"; then
12406         ac_im_usrlibdir=$ac_im_libdir; break
12407       fi
12408     done
12409     # Screen out bogus values from the imake configuration.  They are
12410     # bogus both because they are the default anyway, and because
12411     # using them would break gcc on systems where it needs fixed includes.
12412     case $ac_im_incroot in
12413         /usr/include) ;;
12414         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12415     esac
12416     case $ac_im_usrlibdir in
12417         /usr/lib | /lib) ;;
12418         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12419     esac
12420   fi
12421   cd ..
12422   rm -fr conftest.dir
12423 fi
12424
12425 # Standard set of common directories for X headers.
12426 # Check X11 before X11Rn because it is often a symlink to the current release.
12427 ac_x_header_dirs='
12428 /usr/X11/include
12429 /usr/X11R7/include
12430 /usr/X11R6/include
12431 /usr/X11R5/include
12432 /usr/X11R4/include
12433
12434 /opt/local/include
12435 /opt/X11/include
12436
12437 /usr/include/X11
12438 /usr/include/X11R7
12439 /usr/include/X11R6
12440 /usr/include/X11R5
12441 /usr/include/X11R4
12442
12443 /usr/local/X11/include
12444 /usr/local/X11R7/include
12445 /usr/local/X11R6/include
12446 /usr/local/X11R5/include
12447 /usr/local/X11R4/include
12448
12449 /usr/local/include/X11
12450 /usr/local/include/X11R7
12451 /usr/local/include/X11R6
12452 /usr/local/include/X11R5
12453 /usr/local/include/X11R4
12454
12455 /usr/X386/include
12456 /usr/x386/include
12457 /usr/XFree86/include/X11
12458
12459 /usr/include
12460 /usr/local/include
12461 /usr/unsupported/include
12462 /usr/athena/include
12463 /usr/local/x11r5/include
12464 /usr/lpp/Xamples/include
12465
12466 /usr/openwin/include
12467 /usr/openwin/share/include'
12468
12469 if test "$ac_x_includes" = no; then
12470   # Guess where to find include files, by looking for Intrinsic.h.
12471   # First, try using that file with no special directory specified.
12472   cat >"conftest.$ac_ext" <<_ACEOF
12473 #line 12473 "configure"
12474 #include "confdefs.h"
12475 #include <X11/Intrinsic.h>
12476 _ACEOF
12477 if { (eval echo "$as_me:12477: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12478   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12479   ac_status=$?
12480   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12481   rm -f conftest.er1
12482   cat conftest.err >&5
12483   echo "$as_me:12483: \$? = $ac_status" >&5
12484   (exit "$ac_status"); } >/dev/null; then
12485   if test -s conftest.err; then
12486     ac_cpp_err=$ac_c_preproc_warn_flag
12487   else
12488     ac_cpp_err=
12489   fi
12490 else
12491   ac_cpp_err=yes
12492 fi
12493 if test -z "$ac_cpp_err"; then
12494   # We can compile using X headers with no special include directory.
12495 ac_x_includes=
12496 else
12497   echo "$as_me: failed program was:" >&5
12498   cat "conftest.$ac_ext" >&5
12499   for ac_dir in $ac_x_header_dirs; do
12500   if test -r "$ac_dir/X11/Intrinsic.h"; then
12501     ac_x_includes=$ac_dir
12502     break
12503   fi
12504 done
12505 fi
12506 rm -f conftest.err "conftest.$ac_ext"
12507 fi # $ac_x_includes = no
12508
12509 if test "$ac_x_libraries" = no; then
12510   # Check for the libraries.
12511   # See if we find them without any special options.
12512   # Don't add to $LIBS permanently.
12513   ac_save_LIBS=$LIBS
12514   LIBS="-lXt $LIBS"
12515   cat >"conftest.$ac_ext" <<_ACEOF
12516 #line 12516 "configure"
12517 #include "confdefs.h"
12518 #include <X11/Intrinsic.h>
12519 int
12520 main (void)
12521 {
12522 XtMalloc (0)
12523   ;
12524   return 0;
12525 }
12526 _ACEOF
12527 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12528 if { (eval echo "$as_me:12528: \"$ac_link\"") >&5
12529   (eval $ac_link) 2>&5
12530   ac_status=$?
12531   echo "$as_me:12531: \$? = $ac_status" >&5
12532   (exit "$ac_status"); } &&
12533          { ac_try='test -s "conftest$ac_exeext"'
12534   { (eval echo "$as_me:12534: \"$ac_try\"") >&5
12535   (eval $ac_try) 2>&5
12536   ac_status=$?
12537   echo "$as_me:12537: \$? = $ac_status" >&5
12538   (exit "$ac_status"); }; }; then
12539   LIBS=$ac_save_LIBS
12540 # We can link X programs with no special library path.
12541 ac_x_libraries=
12542 else
12543   echo "$as_me: failed program was:" >&5
12544 cat "conftest.$ac_ext" >&5
12545 LIBS=$ac_save_LIBS
12546 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12547 do
12548   # Don't even attempt the hair of trying to link an X program!
12549   for ac_extension in a so sl dylib dll; do
12550     if test -r "$ac_dir/libXt.$ac_extension"; then
12551       ac_x_libraries=$ac_dir
12552       break 2
12553     fi
12554   done
12555 done
12556 fi
12557 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12558 fi # $ac_x_libraries = no
12559
12560 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12561   # Didn't find X anywhere.  Cache the known absence of X.
12562   ac_cv_have_x="have_x=no"
12563 else
12564   # Record where we found X for the cache.
12565   ac_cv_have_x="have_x=yes \
12566                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12567 fi
12568 fi
12569
12570   fi
12571   eval "$ac_cv_have_x"
12572 fi # $with_x != no
12573
12574 if test "$have_x" != yes; then
12575   echo "$as_me:12575: result: $have_x" >&5
12576 echo "${ECHO_T}$have_x" >&6
12577   no_x=yes
12578 else
12579   # If each of the values was on the command line, it overrides each guess.
12580   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12581   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12582   # Update the cache value to reflect the command line values.
12583   ac_cv_have_x="have_x=yes \
12584                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12585   echo "$as_me:12585: result: libraries $x_libraries, headers $x_includes" >&5
12586 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12587 fi
12588
12589 if test "$no_x" = yes; then
12590   # Not all programs may use this symbol, but it does not hurt to define it.
12591
12592 cat >>confdefs.h <<\EOF
12593 #define X_DISPLAY_MISSING 1
12594 EOF
12595
12596   X_CFLAGS=
12597   X_PRE_LIBS=
12598   X_LIBS=
12599   X_EXTRA_LIBS=
12600 else
12601   if test -n "$x_includes"; then
12602     X_CFLAGS="$X_CFLAGS -I$x_includes"
12603   fi
12604
12605   # It would also be nice to do this for all -L options, not just this one.
12606   if test -n "$x_libraries"; then
12607     X_LIBS="$X_LIBS -L$x_libraries"
12608     # For Solaris; some versions of Sun CC require a space after -R and
12609     # others require no space.  Words are not sufficient . . . .
12610     case `(uname -sr) 2>/dev/null` in
12611     "SunOS 5"*)
12612       echo "$as_me:12612: checking whether -R must be followed by a space" >&5
12613 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12614       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12615       cat >"conftest.$ac_ext" <<_ACEOF
12616 #line 12616 "configure"
12617 #include "confdefs.h"
12618
12619 int
12620 main (void)
12621 {
12622
12623   ;
12624   return 0;
12625 }
12626 _ACEOF
12627 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12628 if { (eval echo "$as_me:12628: \"$ac_link\"") >&5
12629   (eval $ac_link) 2>&5
12630   ac_status=$?
12631   echo "$as_me:12631: \$? = $ac_status" >&5
12632   (exit "$ac_status"); } &&
12633          { ac_try='test -s "conftest$ac_exeext"'
12634   { (eval echo "$as_me:12634: \"$ac_try\"") >&5
12635   (eval $ac_try) 2>&5
12636   ac_status=$?
12637   echo "$as_me:12637: \$? = $ac_status" >&5
12638   (exit "$ac_status"); }; }; then
12639   ac_R_nospace=yes
12640 else
12641   echo "$as_me: failed program was:" >&5
12642 cat "conftest.$ac_ext" >&5
12643 ac_R_nospace=no
12644 fi
12645 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12646       if test $ac_R_nospace = yes; then
12647         echo "$as_me:12647: result: no" >&5
12648 echo "${ECHO_T}no" >&6
12649         X_LIBS="$X_LIBS -R$x_libraries"
12650       else
12651         LIBS="$ac_xsave_LIBS -R $x_libraries"
12652         cat >"conftest.$ac_ext" <<_ACEOF
12653 #line 12653 "configure"
12654 #include "confdefs.h"
12655
12656 int
12657 main (void)
12658 {
12659
12660   ;
12661   return 0;
12662 }
12663 _ACEOF
12664 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12665 if { (eval echo "$as_me:12665: \"$ac_link\"") >&5
12666   (eval $ac_link) 2>&5
12667   ac_status=$?
12668   echo "$as_me:12668: \$? = $ac_status" >&5
12669   (exit "$ac_status"); } &&
12670          { ac_try='test -s "conftest$ac_exeext"'
12671   { (eval echo "$as_me:12671: \"$ac_try\"") >&5
12672   (eval $ac_try) 2>&5
12673   ac_status=$?
12674   echo "$as_me:12674: \$? = $ac_status" >&5
12675   (exit "$ac_status"); }; }; then
12676   ac_R_space=yes
12677 else
12678   echo "$as_me: failed program was:" >&5
12679 cat "conftest.$ac_ext" >&5
12680 ac_R_space=no
12681 fi
12682 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12683         if test $ac_R_space = yes; then
12684           echo "$as_me:12684: result: yes" >&5
12685 echo "${ECHO_T}yes" >&6
12686           X_LIBS="$X_LIBS -R $x_libraries"
12687         else
12688           echo "$as_me:12688: result: neither works" >&5
12689 echo "${ECHO_T}neither works" >&6
12690         fi
12691       fi
12692       LIBS=$ac_xsave_LIBS
12693     esac
12694   fi
12695
12696   # Check for system-dependent libraries X programs must link with.
12697   # Do this before checking for the system-independent R6 libraries
12698   # (-lICE), since we may need -lsocket or whatever for X linking.
12699
12700   if test "$ISC" = yes; then
12701     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12702   else
12703     # Martyn Johnson says this is needed for Ultrix, if the X
12704     # libraries were built with DECnet support.  And Karl Berry says
12705     # the Alpha needs dnet_stub (dnet does not exist).
12706     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12707     cat >"conftest.$ac_ext" <<_ACEOF
12708 #line 12708 "configure"
12709 #include "confdefs.h"
12710
12711 /* Override any gcc2 internal prototype to avoid an error.  */
12712 #ifdef __cplusplus
12713 extern "C"
12714 #endif
12715 /* We use char because int might match the return type of a gcc2
12716    builtin and then its argument prototype would still apply.  */
12717 char XOpenDisplay ();
12718 int
12719 main (void)
12720 {
12721 XOpenDisplay ();
12722   ;
12723   return 0;
12724 }
12725 _ACEOF
12726 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12727 if { (eval echo "$as_me:12727: \"$ac_link\"") >&5
12728   (eval $ac_link) 2>&5
12729   ac_status=$?
12730   echo "$as_me:12730: \$? = $ac_status" >&5
12731   (exit "$ac_status"); } &&
12732          { ac_try='test -s "conftest$ac_exeext"'
12733   { (eval echo "$as_me:12733: \"$ac_try\"") >&5
12734   (eval $ac_try) 2>&5
12735   ac_status=$?
12736   echo "$as_me:12736: \$? = $ac_status" >&5
12737   (exit "$ac_status"); }; }; then
12738   :
12739 else
12740   echo "$as_me: failed program was:" >&5
12741 cat "conftest.$ac_ext" >&5
12742 echo "$as_me:12742: checking for dnet_ntoa in -ldnet" >&5
12743 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12744 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12745   echo $ECHO_N "(cached) $ECHO_C" >&6
12746 else
12747   ac_check_lib_save_LIBS=$LIBS
12748 LIBS="-ldnet  $LIBS"
12749 cat >"conftest.$ac_ext" <<_ACEOF
12750 #line 12750 "configure"
12751 #include "confdefs.h"
12752
12753 /* Override any gcc2 internal prototype to avoid an error.  */
12754 #ifdef __cplusplus
12755 extern "C"
12756 #endif
12757 /* We use char because int might match the return type of a gcc2
12758    builtin and then its argument prototype would still apply.  */
12759 char dnet_ntoa ();
12760 int
12761 main (void)
12762 {
12763 dnet_ntoa ();
12764   ;
12765   return 0;
12766 }
12767 _ACEOF
12768 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12769 if { (eval echo "$as_me:12769: \"$ac_link\"") >&5
12770   (eval $ac_link) 2>&5
12771   ac_status=$?
12772   echo "$as_me:12772: \$? = $ac_status" >&5
12773   (exit "$ac_status"); } &&
12774          { ac_try='test -s "conftest$ac_exeext"'
12775   { (eval echo "$as_me:12775: \"$ac_try\"") >&5
12776   (eval $ac_try) 2>&5
12777   ac_status=$?
12778   echo "$as_me:12778: \$? = $ac_status" >&5
12779   (exit "$ac_status"); }; }; then
12780   ac_cv_lib_dnet_dnet_ntoa=yes
12781 else
12782   echo "$as_me: failed program was:" >&5
12783 cat "conftest.$ac_ext" >&5
12784 ac_cv_lib_dnet_dnet_ntoa=no
12785 fi
12786 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12787 LIBS=$ac_check_lib_save_LIBS
12788 fi
12789 echo "$as_me:12789: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12790 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12791 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12792   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12793 fi
12794
12795     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12796       echo "$as_me:12796: checking for dnet_ntoa in -ldnet_stub" >&5
12797 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12798 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12799   echo $ECHO_N "(cached) $ECHO_C" >&6
12800 else
12801   ac_check_lib_save_LIBS=$LIBS
12802 LIBS="-ldnet_stub  $LIBS"
12803 cat >"conftest.$ac_ext" <<_ACEOF
12804 #line 12804 "configure"
12805 #include "confdefs.h"
12806
12807 /* Override any gcc2 internal prototype to avoid an error.  */
12808 #ifdef __cplusplus
12809 extern "C"
12810 #endif
12811 /* We use char because int might match the return type of a gcc2
12812    builtin and then its argument prototype would still apply.  */
12813 char dnet_ntoa ();
12814 int
12815 main (void)
12816 {
12817 dnet_ntoa ();
12818   ;
12819   return 0;
12820 }
12821 _ACEOF
12822 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12823 if { (eval echo "$as_me:12823: \"$ac_link\"") >&5
12824   (eval $ac_link) 2>&5
12825   ac_status=$?
12826   echo "$as_me:12826: \$? = $ac_status" >&5
12827   (exit "$ac_status"); } &&
12828          { ac_try='test -s "conftest$ac_exeext"'
12829   { (eval echo "$as_me:12829: \"$ac_try\"") >&5
12830   (eval $ac_try) 2>&5
12831   ac_status=$?
12832   echo "$as_me:12832: \$? = $ac_status" >&5
12833   (exit "$ac_status"); }; }; then
12834   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12835 else
12836   echo "$as_me: failed program was:" >&5
12837 cat "conftest.$ac_ext" >&5
12838 ac_cv_lib_dnet_stub_dnet_ntoa=no
12839 fi
12840 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12841 LIBS=$ac_check_lib_save_LIBS
12842 fi
12843 echo "$as_me:12843: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12844 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12845 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12846   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12847 fi
12848
12849     fi
12850 fi
12851 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12852     LIBS="$ac_xsave_LIBS"
12853
12854     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12855     # to get the SysV transport functions.
12856     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12857     # needs -lnsl.
12858     # The nsl library prevents programs from opening the X display
12859     # on Irix 5.2, according to T.E. Dickey.
12860     # The functions gethostbyname, getservbyname, and inet_addr are
12861     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12862     echo "$as_me:12862: checking for gethostbyname" >&5
12863 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12864 if test "${ac_cv_func_gethostbyname+set}" = set; then
12865   echo $ECHO_N "(cached) $ECHO_C" >&6
12866 else
12867   cat >"conftest.$ac_ext" <<_ACEOF
12868 #line 12868 "configure"
12869 #include "confdefs.h"
12870 #define gethostbyname autoconf_temporary
12871 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12872 #undef gethostbyname
12873
12874 #ifdef __cplusplus
12875 extern "C"
12876 #endif
12877
12878 /* We use char because int might match the return type of a gcc2
12879    builtin and then its argument prototype would still apply.  */
12880 char gethostbyname (void);
12881
12882 int
12883 main (void)
12884 {
12885
12886 /* The GNU C library defines stubs for functions which it implements
12887     to always fail with ENOSYS.  Some functions are actually named
12888     something starting with __ and the normal name is an alias.  */
12889 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12890 #error found stub for gethostbyname
12891 #endif
12892
12893         return gethostbyname ();
12894   ;
12895   return 0;
12896 }
12897 _ACEOF
12898 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12899 if { (eval echo "$as_me:12899: \"$ac_link\"") >&5
12900   (eval $ac_link) 2>&5
12901   ac_status=$?
12902   echo "$as_me:12902: \$? = $ac_status" >&5
12903   (exit "$ac_status"); } &&
12904          { ac_try='test -s "conftest$ac_exeext"'
12905   { (eval echo "$as_me:12905: \"$ac_try\"") >&5
12906   (eval $ac_try) 2>&5
12907   ac_status=$?
12908   echo "$as_me:12908: \$? = $ac_status" >&5
12909   (exit "$ac_status"); }; }; then
12910   ac_cv_func_gethostbyname=yes
12911 else
12912   echo "$as_me: failed program was:" >&5
12913 cat "conftest.$ac_ext" >&5
12914 ac_cv_func_gethostbyname=no
12915 fi
12916 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12917 fi
12918 echo "$as_me:12918: result: $ac_cv_func_gethostbyname" >&5
12919 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12920
12921     if test $ac_cv_func_gethostbyname = no; then
12922       echo "$as_me:12922: checking for gethostbyname in -lnsl" >&5
12923 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12924 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12925   echo $ECHO_N "(cached) $ECHO_C" >&6
12926 else
12927   ac_check_lib_save_LIBS=$LIBS
12928 LIBS="-lnsl  $LIBS"
12929 cat >"conftest.$ac_ext" <<_ACEOF
12930 #line 12930 "configure"
12931 #include "confdefs.h"
12932
12933 /* Override any gcc2 internal prototype to avoid an error.  */
12934 #ifdef __cplusplus
12935 extern "C"
12936 #endif
12937 /* We use char because int might match the return type of a gcc2
12938    builtin and then its argument prototype would still apply.  */
12939 char gethostbyname ();
12940 int
12941 main (void)
12942 {
12943 gethostbyname ();
12944   ;
12945   return 0;
12946 }
12947 _ACEOF
12948 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12949 if { (eval echo "$as_me:12949: \"$ac_link\"") >&5
12950   (eval $ac_link) 2>&5
12951   ac_status=$?
12952   echo "$as_me:12952: \$? = $ac_status" >&5
12953   (exit "$ac_status"); } &&
12954          { ac_try='test -s "conftest$ac_exeext"'
12955   { (eval echo "$as_me:12955: \"$ac_try\"") >&5
12956   (eval $ac_try) 2>&5
12957   ac_status=$?
12958   echo "$as_me:12958: \$? = $ac_status" >&5
12959   (exit "$ac_status"); }; }; then
12960   ac_cv_lib_nsl_gethostbyname=yes
12961 else
12962   echo "$as_me: failed program was:" >&5
12963 cat "conftest.$ac_ext" >&5
12964 ac_cv_lib_nsl_gethostbyname=no
12965 fi
12966 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12967 LIBS=$ac_check_lib_save_LIBS
12968 fi
12969 echo "$as_me:12969: result: $ac_cv_lib_nsl_gethostbyname" >&5
12970 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12971 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12972   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12973 fi
12974
12975       if test $ac_cv_lib_nsl_gethostbyname = no; then
12976         echo "$as_me:12976: checking for gethostbyname in -lbsd" >&5
12977 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12978 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12979   echo $ECHO_N "(cached) $ECHO_C" >&6
12980 else
12981   ac_check_lib_save_LIBS=$LIBS
12982 LIBS="-lbsd  $LIBS"
12983 cat >"conftest.$ac_ext" <<_ACEOF
12984 #line 12984 "configure"
12985 #include "confdefs.h"
12986
12987 /* Override any gcc2 internal prototype to avoid an error.  */
12988 #ifdef __cplusplus
12989 extern "C"
12990 #endif
12991 /* We use char because int might match the return type of a gcc2
12992    builtin and then its argument prototype would still apply.  */
12993 char gethostbyname ();
12994 int
12995 main (void)
12996 {
12997 gethostbyname ();
12998   ;
12999   return 0;
13000 }
13001 _ACEOF
13002 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13003 if { (eval echo "$as_me:13003: \"$ac_link\"") >&5
13004   (eval $ac_link) 2>&5
13005   ac_status=$?
13006   echo "$as_me:13006: \$? = $ac_status" >&5
13007   (exit "$ac_status"); } &&
13008          { ac_try='test -s "conftest$ac_exeext"'
13009   { (eval echo "$as_me:13009: \"$ac_try\"") >&5
13010   (eval $ac_try) 2>&5
13011   ac_status=$?
13012   echo "$as_me:13012: \$? = $ac_status" >&5
13013   (exit "$ac_status"); }; }; then
13014   ac_cv_lib_bsd_gethostbyname=yes
13015 else
13016   echo "$as_me: failed program was:" >&5
13017 cat "conftest.$ac_ext" >&5
13018 ac_cv_lib_bsd_gethostbyname=no
13019 fi
13020 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13021 LIBS=$ac_check_lib_save_LIBS
13022 fi
13023 echo "$as_me:13023: result: $ac_cv_lib_bsd_gethostbyname" >&5
13024 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
13025 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
13026   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
13027 fi
13028
13029       fi
13030     fi
13031
13032     # lieder@skyler.mavd.honeywell.com says without -lsocket,
13033     # socket/setsockopt and other routines are undefined under SCO ODT
13034     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
13035     # on later versions), says Simon Leinen: it contains gethostby*
13036     # variants that don't use the nameserver (or something).  -lsocket
13037     # must be given before -lnsl if both are needed.  We assume that
13038     # if connect needs -lnsl, so does gethostbyname.
13039     echo "$as_me:13039: checking for connect" >&5
13040 echo $ECHO_N "checking for connect... $ECHO_C" >&6
13041 if test "${ac_cv_func_connect+set}" = set; then
13042   echo $ECHO_N "(cached) $ECHO_C" >&6
13043 else
13044   cat >"conftest.$ac_ext" <<_ACEOF
13045 #line 13045 "configure"
13046 #include "confdefs.h"
13047 #define connect autoconf_temporary
13048 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13049 #undef connect
13050
13051 #ifdef __cplusplus
13052 extern "C"
13053 #endif
13054
13055 /* We use char because int might match the return type of a gcc2
13056    builtin and then its argument prototype would still apply.  */
13057 char connect (void);
13058
13059 int
13060 main (void)
13061 {
13062
13063 /* The GNU C library defines stubs for functions which it implements
13064     to always fail with ENOSYS.  Some functions are actually named
13065     something starting with __ and the normal name is an alias.  */
13066 #if defined (__stub_connect) || defined (__stub___connect)
13067 #error found stub for connect
13068 #endif
13069
13070         return connect ();
13071   ;
13072   return 0;
13073 }
13074 _ACEOF
13075 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13076 if { (eval echo "$as_me:13076: \"$ac_link\"") >&5
13077   (eval $ac_link) 2>&5
13078   ac_status=$?
13079   echo "$as_me:13079: \$? = $ac_status" >&5
13080   (exit "$ac_status"); } &&
13081          { ac_try='test -s "conftest$ac_exeext"'
13082   { (eval echo "$as_me:13082: \"$ac_try\"") >&5
13083   (eval $ac_try) 2>&5
13084   ac_status=$?
13085   echo "$as_me:13085: \$? = $ac_status" >&5
13086   (exit "$ac_status"); }; }; then
13087   ac_cv_func_connect=yes
13088 else
13089   echo "$as_me: failed program was:" >&5
13090 cat "conftest.$ac_ext" >&5
13091 ac_cv_func_connect=no
13092 fi
13093 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13094 fi
13095 echo "$as_me:13095: result: $ac_cv_func_connect" >&5
13096 echo "${ECHO_T}$ac_cv_func_connect" >&6
13097
13098     if test $ac_cv_func_connect = no; then
13099       echo "$as_me:13099: checking for connect in -lsocket" >&5
13100 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
13101 if test "${ac_cv_lib_socket_connect+set}" = set; then
13102   echo $ECHO_N "(cached) $ECHO_C" >&6
13103 else
13104   ac_check_lib_save_LIBS=$LIBS
13105 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
13106 cat >"conftest.$ac_ext" <<_ACEOF
13107 #line 13107 "configure"
13108 #include "confdefs.h"
13109
13110 /* Override any gcc2 internal prototype to avoid an error.  */
13111 #ifdef __cplusplus
13112 extern "C"
13113 #endif
13114 /* We use char because int might match the return type of a gcc2
13115    builtin and then its argument prototype would still apply.  */
13116 char connect ();
13117 int
13118 main (void)
13119 {
13120 connect ();
13121   ;
13122   return 0;
13123 }
13124 _ACEOF
13125 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13126 if { (eval echo "$as_me:13126: \"$ac_link\"") >&5
13127   (eval $ac_link) 2>&5
13128   ac_status=$?
13129   echo "$as_me:13129: \$? = $ac_status" >&5
13130   (exit "$ac_status"); } &&
13131          { ac_try='test -s "conftest$ac_exeext"'
13132   { (eval echo "$as_me:13132: \"$ac_try\"") >&5
13133   (eval $ac_try) 2>&5
13134   ac_status=$?
13135   echo "$as_me:13135: \$? = $ac_status" >&5
13136   (exit "$ac_status"); }; }; then
13137   ac_cv_lib_socket_connect=yes
13138 else
13139   echo "$as_me: failed program was:" >&5
13140 cat "conftest.$ac_ext" >&5
13141 ac_cv_lib_socket_connect=no
13142 fi
13143 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13144 LIBS=$ac_check_lib_save_LIBS
13145 fi
13146 echo "$as_me:13146: result: $ac_cv_lib_socket_connect" >&5
13147 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
13148 if test "$ac_cv_lib_socket_connect" = yes; then
13149   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
13150 fi
13151
13152     fi
13153
13154     # Guillermo Gomez says -lposix is necessary on A/UX.
13155     echo "$as_me:13155: checking for remove" >&5
13156 echo $ECHO_N "checking for remove... $ECHO_C" >&6
13157 if test "${ac_cv_func_remove+set}" = set; then
13158   echo $ECHO_N "(cached) $ECHO_C" >&6
13159 else
13160   cat >"conftest.$ac_ext" <<_ACEOF
13161 #line 13161 "configure"
13162 #include "confdefs.h"
13163 #define remove autoconf_temporary
13164 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13165 #undef remove
13166
13167 #ifdef __cplusplus
13168 extern "C"
13169 #endif
13170
13171 /* We use char because int might match the return type of a gcc2
13172    builtin and then its argument prototype would still apply.  */
13173 char remove (void);
13174
13175 int
13176 main (void)
13177 {
13178
13179 /* The GNU C library defines stubs for functions which it implements
13180     to always fail with ENOSYS.  Some functions are actually named
13181     something starting with __ and the normal name is an alias.  */
13182 #if defined (__stub_remove) || defined (__stub___remove)
13183 #error found stub for remove
13184 #endif
13185
13186         return remove ();
13187   ;
13188   return 0;
13189 }
13190 _ACEOF
13191 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13192 if { (eval echo "$as_me:13192: \"$ac_link\"") >&5
13193   (eval $ac_link) 2>&5
13194   ac_status=$?
13195   echo "$as_me:13195: \$? = $ac_status" >&5
13196   (exit "$ac_status"); } &&
13197          { ac_try='test -s "conftest$ac_exeext"'
13198   { (eval echo "$as_me:13198: \"$ac_try\"") >&5
13199   (eval $ac_try) 2>&5
13200   ac_status=$?
13201   echo "$as_me:13201: \$? = $ac_status" >&5
13202   (exit "$ac_status"); }; }; then
13203   ac_cv_func_remove=yes
13204 else
13205   echo "$as_me: failed program was:" >&5
13206 cat "conftest.$ac_ext" >&5
13207 ac_cv_func_remove=no
13208 fi
13209 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13210 fi
13211 echo "$as_me:13211: result: $ac_cv_func_remove" >&5
13212 echo "${ECHO_T}$ac_cv_func_remove" >&6
13213
13214     if test $ac_cv_func_remove = no; then
13215       echo "$as_me:13215: checking for remove in -lposix" >&5
13216 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
13217 if test "${ac_cv_lib_posix_remove+set}" = set; then
13218   echo $ECHO_N "(cached) $ECHO_C" >&6
13219 else
13220   ac_check_lib_save_LIBS=$LIBS
13221 LIBS="-lposix  $LIBS"
13222 cat >"conftest.$ac_ext" <<_ACEOF
13223 #line 13223 "configure"
13224 #include "confdefs.h"
13225
13226 /* Override any gcc2 internal prototype to avoid an error.  */
13227 #ifdef __cplusplus
13228 extern "C"
13229 #endif
13230 /* We use char because int might match the return type of a gcc2
13231    builtin and then its argument prototype would still apply.  */
13232 char remove ();
13233 int
13234 main (void)
13235 {
13236 remove ();
13237   ;
13238   return 0;
13239 }
13240 _ACEOF
13241 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13242 if { (eval echo "$as_me:13242: \"$ac_link\"") >&5
13243   (eval $ac_link) 2>&5
13244   ac_status=$?
13245   echo "$as_me:13245: \$? = $ac_status" >&5
13246   (exit "$ac_status"); } &&
13247          { ac_try='test -s "conftest$ac_exeext"'
13248   { (eval echo "$as_me:13248: \"$ac_try\"") >&5
13249   (eval $ac_try) 2>&5
13250   ac_status=$?
13251   echo "$as_me:13251: \$? = $ac_status" >&5
13252   (exit "$ac_status"); }; }; then
13253   ac_cv_lib_posix_remove=yes
13254 else
13255   echo "$as_me: failed program was:" >&5
13256 cat "conftest.$ac_ext" >&5
13257 ac_cv_lib_posix_remove=no
13258 fi
13259 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13260 LIBS=$ac_check_lib_save_LIBS
13261 fi
13262 echo "$as_me:13262: result: $ac_cv_lib_posix_remove" >&5
13263 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
13264 if test "$ac_cv_lib_posix_remove" = yes; then
13265   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
13266 fi
13267
13268     fi
13269
13270     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
13271     echo "$as_me:13271: checking for shmat" >&5
13272 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
13273 if test "${ac_cv_func_shmat+set}" = set; then
13274   echo $ECHO_N "(cached) $ECHO_C" >&6
13275 else
13276   cat >"conftest.$ac_ext" <<_ACEOF
13277 #line 13277 "configure"
13278 #include "confdefs.h"
13279 #define shmat autoconf_temporary
13280 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13281 #undef shmat
13282
13283 #ifdef __cplusplus
13284 extern "C"
13285 #endif
13286
13287 /* We use char because int might match the return type of a gcc2
13288    builtin and then its argument prototype would still apply.  */
13289 char shmat (void);
13290
13291 int
13292 main (void)
13293 {
13294
13295 /* The GNU C library defines stubs for functions which it implements
13296     to always fail with ENOSYS.  Some functions are actually named
13297     something starting with __ and the normal name is an alias.  */
13298 #if defined (__stub_shmat) || defined (__stub___shmat)
13299 #error found stub for shmat
13300 #endif
13301
13302         return shmat ();
13303   ;
13304   return 0;
13305 }
13306 _ACEOF
13307 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13308 if { (eval echo "$as_me:13308: \"$ac_link\"") >&5
13309   (eval $ac_link) 2>&5
13310   ac_status=$?
13311   echo "$as_me:13311: \$? = $ac_status" >&5
13312   (exit "$ac_status"); } &&
13313          { ac_try='test -s "conftest$ac_exeext"'
13314   { (eval echo "$as_me:13314: \"$ac_try\"") >&5
13315   (eval $ac_try) 2>&5
13316   ac_status=$?
13317   echo "$as_me:13317: \$? = $ac_status" >&5
13318   (exit "$ac_status"); }; }; then
13319   ac_cv_func_shmat=yes
13320 else
13321   echo "$as_me: failed program was:" >&5
13322 cat "conftest.$ac_ext" >&5
13323 ac_cv_func_shmat=no
13324 fi
13325 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13326 fi
13327 echo "$as_me:13327: result: $ac_cv_func_shmat" >&5
13328 echo "${ECHO_T}$ac_cv_func_shmat" >&6
13329
13330     if test $ac_cv_func_shmat = no; then
13331       echo "$as_me:13331: checking for shmat in -lipc" >&5
13332 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
13333 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
13334   echo $ECHO_N "(cached) $ECHO_C" >&6
13335 else
13336   ac_check_lib_save_LIBS=$LIBS
13337 LIBS="-lipc  $LIBS"
13338 cat >"conftest.$ac_ext" <<_ACEOF
13339 #line 13339 "configure"
13340 #include "confdefs.h"
13341
13342 /* Override any gcc2 internal prototype to avoid an error.  */
13343 #ifdef __cplusplus
13344 extern "C"
13345 #endif
13346 /* We use char because int might match the return type of a gcc2
13347    builtin and then its argument prototype would still apply.  */
13348 char shmat ();
13349 int
13350 main (void)
13351 {
13352 shmat ();
13353   ;
13354   return 0;
13355 }
13356 _ACEOF
13357 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13358 if { (eval echo "$as_me:13358: \"$ac_link\"") >&5
13359   (eval $ac_link) 2>&5
13360   ac_status=$?
13361   echo "$as_me:13361: \$? = $ac_status" >&5
13362   (exit "$ac_status"); } &&
13363          { ac_try='test -s "conftest$ac_exeext"'
13364   { (eval echo "$as_me:13364: \"$ac_try\"") >&5
13365   (eval $ac_try) 2>&5
13366   ac_status=$?
13367   echo "$as_me:13367: \$? = $ac_status" >&5
13368   (exit "$ac_status"); }; }; then
13369   ac_cv_lib_ipc_shmat=yes
13370 else
13371   echo "$as_me: failed program was:" >&5
13372 cat "conftest.$ac_ext" >&5
13373 ac_cv_lib_ipc_shmat=no
13374 fi
13375 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13376 LIBS=$ac_check_lib_save_LIBS
13377 fi
13378 echo "$as_me:13378: result: $ac_cv_lib_ipc_shmat" >&5
13379 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
13380 if test "$ac_cv_lib_ipc_shmat" = yes; then
13381   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13382 fi
13383
13384     fi
13385   fi
13386
13387   # Check for libraries that X11R6 Xt/Xaw programs need.
13388   ac_save_LDFLAGS=$LDFLAGS
13389   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13390   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13391   # check for ICE first), but we must link in the order -lSM -lICE or
13392   # we get undefined symbols.  So assume we have SM if we have ICE.
13393   # These have to be linked with before -lX11, unlike the other
13394   # libraries we check for below, so use a different variable.
13395   # John Interrante, Karl Berry
13396   echo "$as_me:13396: checking for IceConnectionNumber in -lICE" >&5
13397 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13398 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13399   echo $ECHO_N "(cached) $ECHO_C" >&6
13400 else
13401   ac_check_lib_save_LIBS=$LIBS
13402 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
13403 cat >"conftest.$ac_ext" <<_ACEOF
13404 #line 13404 "configure"
13405 #include "confdefs.h"
13406
13407 /* Override any gcc2 internal prototype to avoid an error.  */
13408 #ifdef __cplusplus
13409 extern "C"
13410 #endif
13411 /* We use char because int might match the return type of a gcc2
13412    builtin and then its argument prototype would still apply.  */
13413 char IceConnectionNumber ();
13414 int
13415 main (void)
13416 {
13417 IceConnectionNumber ();
13418   ;
13419   return 0;
13420 }
13421 _ACEOF
13422 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13423 if { (eval echo "$as_me:13423: \"$ac_link\"") >&5
13424   (eval $ac_link) 2>&5
13425   ac_status=$?
13426   echo "$as_me:13426: \$? = $ac_status" >&5
13427   (exit "$ac_status"); } &&
13428          { ac_try='test -s "conftest$ac_exeext"'
13429   { (eval echo "$as_me:13429: \"$ac_try\"") >&5
13430   (eval $ac_try) 2>&5
13431   ac_status=$?
13432   echo "$as_me:13432: \$? = $ac_status" >&5
13433   (exit "$ac_status"); }; }; then
13434   ac_cv_lib_ICE_IceConnectionNumber=yes
13435 else
13436   echo "$as_me: failed program was:" >&5
13437 cat "conftest.$ac_ext" >&5
13438 ac_cv_lib_ICE_IceConnectionNumber=no
13439 fi
13440 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13441 LIBS=$ac_check_lib_save_LIBS
13442 fi
13443 echo "$as_me:13443: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13444 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13445 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13446   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13447 fi
13448
13449   LDFLAGS=$ac_save_LDFLAGS
13450
13451 fi
13452
13453 cf_x_athena=${cf_x_athena:-Xaw}
13454
13455 echo "$as_me:13455: checking if you want to link with Xaw 3d library" >&5
13456 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13457 withval=
13458
13459 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13460 if test "${with_Xaw3d+set}" = set; then
13461   withval="$with_Xaw3d"
13462
13463 fi;
13464 if test "$withval" = yes ; then
13465         cf_x_athena=Xaw3d
13466         echo "$as_me:13466: result: yes" >&5
13467 echo "${ECHO_T}yes" >&6
13468 else
13469         echo "$as_me:13469: result: no" >&5
13470 echo "${ECHO_T}no" >&6
13471 fi
13472
13473 echo "$as_me:13473: checking if you want to link with Xaw 3d xft library" >&5
13474 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13475 withval=
13476
13477 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13478 if test "${with_Xaw3dxft+set}" = set; then
13479   withval="$with_Xaw3dxft"
13480
13481 fi;
13482 if test "$withval" = yes ; then
13483         cf_x_athena=Xaw3dxft
13484         echo "$as_me:13484: result: yes" >&5
13485 echo "${ECHO_T}yes" >&6
13486 else
13487         echo "$as_me:13487: result: no" >&5
13488 echo "${ECHO_T}no" >&6
13489 fi
13490
13491 echo "$as_me:13491: checking if you want to link with neXT Athena library" >&5
13492 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13493 withval=
13494
13495 # Check whether --with-neXtaw or --without-neXtaw was given.
13496 if test "${with_neXtaw+set}" = set; then
13497   withval="$with_neXtaw"
13498
13499 fi;
13500 if test "$withval" = yes ; then
13501         cf_x_athena=neXtaw
13502         echo "$as_me:13502: result: yes" >&5
13503 echo "${ECHO_T}yes" >&6
13504 else
13505         echo "$as_me:13505: result: no" >&5
13506 echo "${ECHO_T}no" >&6
13507 fi
13508
13509 echo "$as_me:13509: checking if you want to link with Athena-Plus library" >&5
13510 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13511 withval=
13512
13513 # Check whether --with-XawPlus or --without-XawPlus was given.
13514 if test "${with_XawPlus+set}" = set; then
13515   withval="$with_XawPlus"
13516
13517 fi;
13518 if test "$withval" = yes ; then
13519         cf_x_athena=XawPlus
13520         echo "$as_me:13520: result: yes" >&5
13521 echo "${ECHO_T}yes" >&6
13522 else
13523         echo "$as_me:13523: result: no" >&5
13524 echo "${ECHO_T}no" >&6
13525 fi
13526
13527 cf_x_athena_lib=""
13528
13529 if test "$PKG_CONFIG" != none ; then
13530         cf_athena_list=
13531         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13532         for cf_athena_pkg in \
13533                 $cf_athena_list \
13534                 ${cf_x_athena} \
13535                 ${cf_x_athena}-devel \
13536                 lib${cf_x_athena} \
13537                 lib${cf_x_athena}-devel
13538         do
13539
13540 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13541         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13542
13543 echo "${as_me:-configure}:13543: testing found package $cf_athena_pkg ..." 1>&5
13544
13545         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13546         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13547         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13548
13549 echo "${as_me:-configure}:13549: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13550
13551         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13552
13553 echo "${as_me:-configure}:13553: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13554
13555 cf_fix_cppflags=no
13556 cf_new_cflags=
13557 cf_new_cppflags=
13558 cf_new_extra_cppflags=
13559
13560 for cf_add_cflags in $cf_pkgconfig_incs
13561 do
13562 case "$cf_fix_cppflags" in
13563 (no)
13564         case "$cf_add_cflags" in
13565         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13566                 case "$cf_add_cflags" in
13567                 (-D*)
13568                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13569
13570                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13571                                 && test -z "${cf_tst_cflags}" \
13572                                 && cf_fix_cppflags=yes
13573
13574                         if test "$cf_fix_cppflags" = yes ; then
13575
13576         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13577         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13578
13579                                 continue
13580                         elif test "${cf_tst_cflags}" = "\"'" ; then
13581
13582         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13583         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13584
13585                                 continue
13586                         fi
13587                         ;;
13588                 esac
13589                 case "$CPPFLAGS" in
13590                 (*$cf_add_cflags)
13591                         ;;
13592                 (*)
13593                         case "$cf_add_cflags" in
13594                         (-D*)
13595                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13596
13597 CPPFLAGS=`echo "$CPPFLAGS" | \
13598         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13599                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13600
13601                                 ;;
13602                         esac
13603
13604         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13605         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13606
13607                         ;;
13608                 esac
13609                 ;;
13610         (*)
13611
13612         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13613         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13614
13615                 ;;
13616         esac
13617         ;;
13618 (yes)
13619
13620         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13621         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13622
13623         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13624
13625         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13626                 && test -z "${cf_tst_cflags}" \
13627                 && cf_fix_cppflags=no
13628         ;;
13629 esac
13630 done
13631
13632 if test -n "$cf_new_cflags" ; then
13633
13634         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13635         CFLAGS="${CFLAGS}$cf_new_cflags"
13636
13637 fi
13638
13639 if test -n "$cf_new_cppflags" ; then
13640
13641         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13642         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13643
13644 fi
13645
13646 if test -n "$cf_new_extra_cppflags" ; then
13647
13648         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13649         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13650
13651 fi
13652
13653 cf_add_libs="$LIBS"
13654 # reverse order
13655 cf_add_0lib=
13656 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13657 # filter duplicates
13658 for cf_add_1lib in $cf_add_0lib; do
13659         for cf_add_2lib in $cf_add_libs; do
13660                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13661                         cf_add_1lib=
13662                         break
13663                 fi
13664         done
13665         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13666 done
13667 LIBS="$cf_add_libs"
13668
13669                         cf_x_athena_lib="$cf_pkgconfig_libs"
13670
13671 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13672
13673                         cat >>confdefs.h <<EOF
13674 #define $cf_x_athena_LIBS 1
13675 EOF
13676
13677         for cf_trim_lib in Xmu Xt X11
13678         do
13679                 case "$LIBS" in
13680                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13681                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13682                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13683
13684 echo "${as_me:-configure}:13684: testing ..trimmed $LIBS ..." 1>&5
13685
13686                         ;;
13687                 esac
13688         done
13689
13690 echo "$as_me:13690: checking for usable $cf_x_athena/Xmu package" >&5
13691 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13692 if test "${cf_cv_xaw_compat+set}" = set; then
13693   echo $ECHO_N "(cached) $ECHO_C" >&6
13694 else
13695
13696 cat >"conftest.$ac_ext" <<_ACEOF
13697 #line 13697 "configure"
13698 #include "confdefs.h"
13699
13700 #include <X11/Xmu/CharSet.h>
13701
13702 int
13703 main (void)
13704 {
13705
13706 int check = XmuCompareISOLatin1("big", "small");
13707 (void)check;
13708
13709   ;
13710   return 0;
13711 }
13712 _ACEOF
13713 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13714 if { (eval echo "$as_me:13714: \"$ac_link\"") >&5
13715   (eval $ac_link) 2>&5
13716   ac_status=$?
13717   echo "$as_me:13717: \$? = $ac_status" >&5
13718   (exit "$ac_status"); } &&
13719          { ac_try='test -s "conftest$ac_exeext"'
13720   { (eval echo "$as_me:13720: \"$ac_try\"") >&5
13721   (eval $ac_try) 2>&5
13722   ac_status=$?
13723   echo "$as_me:13723: \$? = $ac_status" >&5
13724   (exit "$ac_status"); }; }; then
13725   cf_cv_xaw_compat=yes
13726 else
13727   echo "$as_me: failed program was:" >&5
13728 cat "conftest.$ac_ext" >&5
13729 cf_cv_xaw_compat=no
13730 fi
13731 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13732 fi
13733 echo "$as_me:13733: result: $cf_cv_xaw_compat" >&5
13734 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13735
13736                         if test "$cf_cv_xaw_compat" = no
13737                         then
13738                                 # workaround for broken ".pc" files...
13739                                 case "$cf_x_athena_lib" in
13740                                 (*-lXmu*)
13741                                         ;;
13742                                 (*)
13743                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13744
13745 echo "${as_me:-configure}:13745: testing work around broken package ..." 1>&5
13746
13747                                         cf_save_xmu="$LIBS"
13748                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13749
13750 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13751         test -n "$verbose" && echo "    found package xmu" 1>&6
13752
13753 echo "${as_me:-configure}:13753: testing found package xmu ..." 1>&5
13754
13755         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13756         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13757         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13758
13759 echo "${as_me:-configure}:13759: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13760
13761         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13762
13763 echo "${as_me:-configure}:13763: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13764
13765 cf_fix_cppflags=no
13766 cf_new_cflags=
13767 cf_new_cppflags=
13768 cf_new_extra_cppflags=
13769
13770 for cf_add_cflags in $cf_pkgconfig_incs
13771 do
13772 case "$cf_fix_cppflags" in
13773 (no)
13774         case "$cf_add_cflags" in
13775         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13776                 case "$cf_add_cflags" in
13777                 (-D*)
13778                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13779
13780                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13781                                 && test -z "${cf_tst_cflags}" \
13782                                 && cf_fix_cppflags=yes
13783
13784                         if test "$cf_fix_cppflags" = yes ; then
13785
13786         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13787         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13788
13789                                 continue
13790                         elif test "${cf_tst_cflags}" = "\"'" ; then
13791
13792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13794
13795                                 continue
13796                         fi
13797                         ;;
13798                 esac
13799                 case "$CPPFLAGS" in
13800                 (*$cf_add_cflags)
13801                         ;;
13802                 (*)
13803                         case "$cf_add_cflags" in
13804                         (-D*)
13805                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13806
13807 CPPFLAGS=`echo "$CPPFLAGS" | \
13808         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13809                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13810
13811                                 ;;
13812                         esac
13813
13814         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13815         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13816
13817                         ;;
13818                 esac
13819                 ;;
13820         (*)
13821
13822         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13823         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13824
13825                 ;;
13826         esac
13827         ;;
13828 (yes)
13829
13830         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13831         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13832
13833         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13834
13835         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13836                 && test -z "${cf_tst_cflags}" \
13837                 && cf_fix_cppflags=no
13838         ;;
13839 esac
13840 done
13841
13842 if test -n "$cf_new_cflags" ; then
13843
13844         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13845         CFLAGS="${CFLAGS}$cf_new_cflags"
13846
13847 fi
13848
13849 if test -n "$cf_new_cppflags" ; then
13850
13851         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13852         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13853
13854 fi
13855
13856 if test -n "$cf_new_extra_cppflags" ; then
13857
13858         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13859         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13860
13861 fi
13862
13863 cf_add_libs="$LIBS"
13864 # reverse order
13865 cf_add_0lib=
13866 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13867 # filter duplicates
13868 for cf_add_1lib in $cf_add_0lib; do
13869         for cf_add_2lib in $cf_add_libs; do
13870                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13871                         cf_add_1lib=
13872                         break
13873                 fi
13874         done
13875         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13876 done
13877 LIBS="$cf_add_libs"
13878
13879                                                         LIBS="$cf_save_xmu"
13880
13881 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13882
13883 echo "${as_me:-configure}:13883: testing ...before $LIBS ..." 1>&5
13884
13885 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13886 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13887
13888 echo "${as_me:-configure}:13888: testing ...after  $LIBS ..." 1>&5
13889
13890 else
13891         cf_pkgconfig_incs=
13892         cf_pkgconfig_libs=
13893
13894 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13895
13896 echo "${as_me:-configure}:13896: testing ...before $LIBS ..." 1>&5
13897
13898 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13899 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13900
13901 echo "${as_me:-configure}:13901: testing ...after  $LIBS ..." 1>&5
13902
13903 fi
13904
13905         for cf_trim_lib in Xmu Xt X11
13906         do
13907                 case "$LIBS" in
13908                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13909                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13910                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13911
13912 echo "${as_me:-configure}:13912: testing ..trimmed $LIBS ..." 1>&5
13913
13914                         ;;
13915                 esac
13916         done
13917
13918                                         ;;
13919                                 esac
13920                         fi
13921
13922                         break
13923 else
13924         cf_pkgconfig_incs=
13925         cf_pkgconfig_libs=
13926         :
13927 fi
13928
13929         done
13930 fi
13931
13932 if test -z "$cf_x_athena_lib" ; then
13933
13934 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13935         test -n "$verbose" && echo "    found package Xext" 1>&6
13936
13937 echo "${as_me:-configure}:13937: testing found package Xext ..." 1>&5
13938
13939         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13940         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13941         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13942
13943 echo "${as_me:-configure}:13943: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13944
13945         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13946
13947 echo "${as_me:-configure}:13947: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13948
13949 cf_fix_cppflags=no
13950 cf_new_cflags=
13951 cf_new_cppflags=
13952 cf_new_extra_cppflags=
13953
13954 for cf_add_cflags in $cf_pkgconfig_incs
13955 do
13956 case "$cf_fix_cppflags" in
13957 (no)
13958         case "$cf_add_cflags" in
13959         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13960                 case "$cf_add_cflags" in
13961                 (-D*)
13962                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13963
13964                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13965                                 && test -z "${cf_tst_cflags}" \
13966                                 && cf_fix_cppflags=yes
13967
13968                         if test "$cf_fix_cppflags" = yes ; then
13969
13970         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13971         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13972
13973                                 continue
13974                         elif test "${cf_tst_cflags}" = "\"'" ; then
13975
13976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13978
13979                                 continue
13980                         fi
13981                         ;;
13982                 esac
13983                 case "$CPPFLAGS" in
13984                 (*$cf_add_cflags)
13985                         ;;
13986                 (*)
13987                         case "$cf_add_cflags" in
13988                         (-D*)
13989                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13990
13991 CPPFLAGS=`echo "$CPPFLAGS" | \
13992         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13993                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13994
13995                                 ;;
13996                         esac
13997
13998         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13999         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14000
14001                         ;;
14002                 esac
14003                 ;;
14004         (*)
14005
14006         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14007         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14008
14009                 ;;
14010         esac
14011         ;;
14012 (yes)
14013
14014         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14015         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14016
14017         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14018
14019         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14020                 && test -z "${cf_tst_cflags}" \
14021                 && cf_fix_cppflags=no
14022         ;;
14023 esac
14024 done
14025
14026 if test -n "$cf_new_cflags" ; then
14027
14028         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14029         CFLAGS="${CFLAGS}$cf_new_cflags"
14030
14031 fi
14032
14033 if test -n "$cf_new_cppflags" ; then
14034
14035         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14036         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14037
14038 fi
14039
14040 if test -n "$cf_new_extra_cppflags" ; then
14041
14042         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14043         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14044
14045 fi
14046
14047 cf_add_libs="$LIBS"
14048 # reverse order
14049 cf_add_0lib=
14050 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14051 # filter duplicates
14052 for cf_add_1lib in $cf_add_0lib; do
14053         for cf_add_2lib in $cf_add_libs; do
14054                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14055                         cf_add_1lib=
14056                         break
14057                 fi
14058         done
14059         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14060 done
14061 LIBS="$cf_add_libs"
14062
14063         :
14064 else
14065         cf_pkgconfig_incs=
14066         cf_pkgconfig_libs=
14067
14068         echo "$as_me:14068: checking for XextCreateExtension in -lXext" >&5
14069 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
14070 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
14071   echo $ECHO_N "(cached) $ECHO_C" >&6
14072 else
14073   ac_check_lib_save_LIBS=$LIBS
14074 LIBS="-lXext  $LIBS"
14075 cat >"conftest.$ac_ext" <<_ACEOF
14076 #line 14076 "configure"
14077 #include "confdefs.h"
14078
14079 /* Override any gcc2 internal prototype to avoid an error.  */
14080 #ifdef __cplusplus
14081 extern "C"
14082 #endif
14083 /* We use char because int might match the return type of a gcc2
14084    builtin and then its argument prototype would still apply.  */
14085 char XextCreateExtension ();
14086 int
14087 main (void)
14088 {
14089 XextCreateExtension ();
14090   ;
14091   return 0;
14092 }
14093 _ACEOF
14094 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14095 if { (eval echo "$as_me:14095: \"$ac_link\"") >&5
14096   (eval $ac_link) 2>&5
14097   ac_status=$?
14098   echo "$as_me:14098: \$? = $ac_status" >&5
14099   (exit "$ac_status"); } &&
14100          { ac_try='test -s "conftest$ac_exeext"'
14101   { (eval echo "$as_me:14101: \"$ac_try\"") >&5
14102   (eval $ac_try) 2>&5
14103   ac_status=$?
14104   echo "$as_me:14104: \$? = $ac_status" >&5
14105   (exit "$ac_status"); }; }; then
14106   ac_cv_lib_Xext_XextCreateExtension=yes
14107 else
14108   echo "$as_me: failed program was:" >&5
14109 cat "conftest.$ac_ext" >&5
14110 ac_cv_lib_Xext_XextCreateExtension=no
14111 fi
14112 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14113 LIBS=$ac_check_lib_save_LIBS
14114 fi
14115 echo "$as_me:14115: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
14116 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
14117 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
14118
14119 cf_add_libs="$LIBS"
14120 # reverse order
14121 cf_add_0lib=
14122 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14123 # filter duplicates
14124 for cf_add_1lib in $cf_add_0lib; do
14125         for cf_add_2lib in $cf_add_libs; do
14126                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14127                         cf_add_1lib=
14128                         break
14129                 fi
14130         done
14131         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14132 done
14133 LIBS="$cf_add_libs"
14134
14135 fi
14136
14137 fi
14138
14139 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
14140 # in some cases has installed dummy files in the former, other cases replaced
14141 # it with a link to the new location).  This complicates the configure script.
14142 # Check for that pitfall, and recover using pkg-config
14143 #
14144 # If none of these are set, the configuration is almost certainly broken.
14145 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
14146 then
14147
14148 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14149         test -n "$verbose" && echo "    found package x11" 1>&6
14150
14151 echo "${as_me:-configure}:14151: testing found package x11 ..." 1>&5
14152
14153         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14154         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14155         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14156
14157 echo "${as_me:-configure}:14157: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14158
14159         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14160
14161 echo "${as_me:-configure}:14161: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14162
14163 cf_fix_cppflags=no
14164 cf_new_cflags=
14165 cf_new_cppflags=
14166 cf_new_extra_cppflags=
14167
14168 for cf_add_cflags in $cf_pkgconfig_incs
14169 do
14170 case "$cf_fix_cppflags" in
14171 (no)
14172         case "$cf_add_cflags" in
14173         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14174                 case "$cf_add_cflags" in
14175                 (-D*)
14176                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14177
14178                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14179                                 && test -z "${cf_tst_cflags}" \
14180                                 && cf_fix_cppflags=yes
14181
14182                         if test "$cf_fix_cppflags" = yes ; then
14183
14184         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14185         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14186
14187                                 continue
14188                         elif test "${cf_tst_cflags}" = "\"'" ; then
14189
14190         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14191         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14192
14193                                 continue
14194                         fi
14195                         ;;
14196                 esac
14197                 case "$CPPFLAGS" in
14198                 (*$cf_add_cflags)
14199                         ;;
14200                 (*)
14201                         case "$cf_add_cflags" in
14202                         (-D*)
14203                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14204
14205 CPPFLAGS=`echo "$CPPFLAGS" | \
14206         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14207                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14208
14209                                 ;;
14210                         esac
14211
14212         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14213         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14214
14215                         ;;
14216                 esac
14217                 ;;
14218         (*)
14219
14220         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14221         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14222
14223                 ;;
14224         esac
14225         ;;
14226 (yes)
14227
14228         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14229         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14230
14231         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14232
14233         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14234                 && test -z "${cf_tst_cflags}" \
14235                 && cf_fix_cppflags=no
14236         ;;
14237 esac
14238 done
14239
14240 if test -n "$cf_new_cflags" ; then
14241
14242         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14243         CFLAGS="${CFLAGS}$cf_new_cflags"
14244
14245 fi
14246
14247 if test -n "$cf_new_cppflags" ; then
14248
14249         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14250         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14251
14252 fi
14253
14254 if test -n "$cf_new_extra_cppflags" ; then
14255
14256         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14257         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14258
14259 fi
14260
14261 cf_add_libs="$LIBS"
14262 # reverse order
14263 cf_add_0lib=
14264 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14265 # filter duplicates
14266 for cf_add_1lib in $cf_add_0lib; do
14267         for cf_add_2lib in $cf_add_libs; do
14268                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14269                         cf_add_1lib=
14270                         break
14271                 fi
14272         done
14273         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14274 done
14275 LIBS="$cf_add_libs"
14276
14277         :
14278 else
14279         cf_pkgconfig_incs=
14280         cf_pkgconfig_libs=
14281         { echo "$as_me:14281: WARNING: unable to find X11 library" >&5
14282 echo "$as_me: WARNING: unable to find X11 library" >&2;}
14283 fi
14284
14285 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14286         test -n "$verbose" && echo "    found package ice" 1>&6
14287
14288 echo "${as_me:-configure}:14288: testing found package ice ..." 1>&5
14289
14290         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14291         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14292         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14293
14294 echo "${as_me:-configure}:14294: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14295
14296         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14297
14298 echo "${as_me:-configure}:14298: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14299
14300 cf_fix_cppflags=no
14301 cf_new_cflags=
14302 cf_new_cppflags=
14303 cf_new_extra_cppflags=
14304
14305 for cf_add_cflags in $cf_pkgconfig_incs
14306 do
14307 case "$cf_fix_cppflags" in
14308 (no)
14309         case "$cf_add_cflags" in
14310         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14311                 case "$cf_add_cflags" in
14312                 (-D*)
14313                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14314
14315                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14316                                 && test -z "${cf_tst_cflags}" \
14317                                 && cf_fix_cppflags=yes
14318
14319                         if test "$cf_fix_cppflags" = yes ; then
14320
14321         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14322         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14323
14324                                 continue
14325                         elif test "${cf_tst_cflags}" = "\"'" ; then
14326
14327         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14328         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14329
14330                                 continue
14331                         fi
14332                         ;;
14333                 esac
14334                 case "$CPPFLAGS" in
14335                 (*$cf_add_cflags)
14336                         ;;
14337                 (*)
14338                         case "$cf_add_cflags" in
14339                         (-D*)
14340                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14341
14342 CPPFLAGS=`echo "$CPPFLAGS" | \
14343         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14344                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14345
14346                                 ;;
14347                         esac
14348
14349         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14350         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14351
14352                         ;;
14353                 esac
14354                 ;;
14355         (*)
14356
14357         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14358         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14359
14360                 ;;
14361         esac
14362         ;;
14363 (yes)
14364
14365         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14366         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14367
14368         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14369
14370         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14371                 && test -z "${cf_tst_cflags}" \
14372                 && cf_fix_cppflags=no
14373         ;;
14374 esac
14375 done
14376
14377 if test -n "$cf_new_cflags" ; then
14378
14379         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14380         CFLAGS="${CFLAGS}$cf_new_cflags"
14381
14382 fi
14383
14384 if test -n "$cf_new_cppflags" ; then
14385
14386         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14387         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14388
14389 fi
14390
14391 if test -n "$cf_new_extra_cppflags" ; then
14392
14393         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14394         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14395
14396 fi
14397
14398 cf_add_libs="$LIBS"
14399 # reverse order
14400 cf_add_0lib=
14401 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14402 # filter duplicates
14403 for cf_add_1lib in $cf_add_0lib; do
14404         for cf_add_2lib in $cf_add_libs; do
14405                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14406                         cf_add_1lib=
14407                         break
14408                 fi
14409         done
14410         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14411 done
14412 LIBS="$cf_add_libs"
14413
14414         :
14415 else
14416         cf_pkgconfig_incs=
14417         cf_pkgconfig_libs=
14418         { echo "$as_me:14418: WARNING: unable to find ICE library" >&5
14419 echo "$as_me: WARNING: unable to find ICE library" >&2;}
14420 fi
14421
14422 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14423         test -n "$verbose" && echo "    found package sm" 1>&6
14424
14425 echo "${as_me:-configure}:14425: testing found package sm ..." 1>&5
14426
14427         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14428         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14429         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14430
14431 echo "${as_me:-configure}:14431: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14432
14433         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14434
14435 echo "${as_me:-configure}:14435: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14436
14437 cf_fix_cppflags=no
14438 cf_new_cflags=
14439 cf_new_cppflags=
14440 cf_new_extra_cppflags=
14441
14442 for cf_add_cflags in $cf_pkgconfig_incs
14443 do
14444 case "$cf_fix_cppflags" in
14445 (no)
14446         case "$cf_add_cflags" in
14447         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14448                 case "$cf_add_cflags" in
14449                 (-D*)
14450                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14451
14452                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14453                                 && test -z "${cf_tst_cflags}" \
14454                                 && cf_fix_cppflags=yes
14455
14456                         if test "$cf_fix_cppflags" = yes ; then
14457
14458         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14459         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14460
14461                                 continue
14462                         elif test "${cf_tst_cflags}" = "\"'" ; then
14463
14464         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14465         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14466
14467                                 continue
14468                         fi
14469                         ;;
14470                 esac
14471                 case "$CPPFLAGS" in
14472                 (*$cf_add_cflags)
14473                         ;;
14474                 (*)
14475                         case "$cf_add_cflags" in
14476                         (-D*)
14477                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14478
14479 CPPFLAGS=`echo "$CPPFLAGS" | \
14480         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14481                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14482
14483                                 ;;
14484                         esac
14485
14486         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14487         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14488
14489                         ;;
14490                 esac
14491                 ;;
14492         (*)
14493
14494         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14495         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14496
14497                 ;;
14498         esac
14499         ;;
14500 (yes)
14501
14502         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14503         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14504
14505         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14506
14507         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14508                 && test -z "${cf_tst_cflags}" \
14509                 && cf_fix_cppflags=no
14510         ;;
14511 esac
14512 done
14513
14514 if test -n "$cf_new_cflags" ; then
14515
14516         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14517         CFLAGS="${CFLAGS}$cf_new_cflags"
14518
14519 fi
14520
14521 if test -n "$cf_new_cppflags" ; then
14522
14523         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14524         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14525
14526 fi
14527
14528 if test -n "$cf_new_extra_cppflags" ; then
14529
14530         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14531         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14532
14533 fi
14534
14535 cf_add_libs="$LIBS"
14536 # reverse order
14537 cf_add_0lib=
14538 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14539 # filter duplicates
14540 for cf_add_1lib in $cf_add_0lib; do
14541         for cf_add_2lib in $cf_add_libs; do
14542                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14543                         cf_add_1lib=
14544                         break
14545                 fi
14546         done
14547         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14548 done
14549 LIBS="$cf_add_libs"
14550
14551         :
14552 else
14553         cf_pkgconfig_incs=
14554         cf_pkgconfig_libs=
14555         { echo "$as_me:14555: WARNING: unable to find SM library" >&5
14556 echo "$as_me: WARNING: unable to find SM library" >&2;}
14557 fi
14558
14559 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14560         test -n "$verbose" && echo "    found package xt" 1>&6
14561
14562 echo "${as_me:-configure}:14562: testing found package xt ..." 1>&5
14563
14564         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14565         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14566         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14567
14568 echo "${as_me:-configure}:14568: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14569
14570         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14571
14572 echo "${as_me:-configure}:14572: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14573
14574 cf_fix_cppflags=no
14575 cf_new_cflags=
14576 cf_new_cppflags=
14577 cf_new_extra_cppflags=
14578
14579 for cf_add_cflags in $cf_pkgconfig_incs
14580 do
14581 case "$cf_fix_cppflags" in
14582 (no)
14583         case "$cf_add_cflags" in
14584         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14585                 case "$cf_add_cflags" in
14586                 (-D*)
14587                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14588
14589                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14590                                 && test -z "${cf_tst_cflags}" \
14591                                 && cf_fix_cppflags=yes
14592
14593                         if test "$cf_fix_cppflags" = yes ; then
14594
14595         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14596         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14597
14598                                 continue
14599                         elif test "${cf_tst_cflags}" = "\"'" ; then
14600
14601         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14602         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14603
14604                                 continue
14605                         fi
14606                         ;;
14607                 esac
14608                 case "$CPPFLAGS" in
14609                 (*$cf_add_cflags)
14610                         ;;
14611                 (*)
14612                         case "$cf_add_cflags" in
14613                         (-D*)
14614                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14615
14616 CPPFLAGS=`echo "$CPPFLAGS" | \
14617         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14618                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14619
14620                                 ;;
14621                         esac
14622
14623         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14624         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14625
14626                         ;;
14627                 esac
14628                 ;;
14629         (*)
14630
14631         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14632         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14633
14634                 ;;
14635         esac
14636         ;;
14637 (yes)
14638
14639         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14640         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14641
14642         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14643
14644         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14645                 && test -z "${cf_tst_cflags}" \
14646                 && cf_fix_cppflags=no
14647         ;;
14648 esac
14649 done
14650
14651 if test -n "$cf_new_cflags" ; then
14652
14653         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14654         CFLAGS="${CFLAGS}$cf_new_cflags"
14655
14656 fi
14657
14658 if test -n "$cf_new_cppflags" ; then
14659
14660         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14661         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14662
14663 fi
14664
14665 if test -n "$cf_new_extra_cppflags" ; then
14666
14667         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14668         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14669
14670 fi
14671
14672 cf_add_libs="$LIBS"
14673 # reverse order
14674 cf_add_0lib=
14675 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14676 # filter duplicates
14677 for cf_add_1lib in $cf_add_0lib; do
14678         for cf_add_2lib in $cf_add_libs; do
14679                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14680                         cf_add_1lib=
14681                         break
14682                 fi
14683         done
14684         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14685 done
14686 LIBS="$cf_add_libs"
14687
14688         :
14689 else
14690         cf_pkgconfig_incs=
14691         cf_pkgconfig_libs=
14692         { echo "$as_me:14692: WARNING: unable to find Xt library" >&5
14693 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14694 fi
14695
14696 else
14697         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14698 fi
14699
14700 cf_have_X_LIBS=no
14701
14702 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14703         test -n "$verbose" && echo "    found package xt" 1>&6
14704
14705 echo "${as_me:-configure}:14705: testing found package xt ..." 1>&5
14706
14707         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14708         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14709         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14710
14711 echo "${as_me:-configure}:14711: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14712
14713         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14714
14715 echo "${as_me:-configure}:14715: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14716
14717 cf_fix_cppflags=no
14718 cf_new_cflags=
14719 cf_new_cppflags=
14720 cf_new_extra_cppflags=
14721
14722 for cf_add_cflags in $cf_pkgconfig_incs
14723 do
14724 case "$cf_fix_cppflags" in
14725 (no)
14726         case "$cf_add_cflags" in
14727         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14728                 case "$cf_add_cflags" in
14729                 (-D*)
14730                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14731
14732                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14733                                 && test -z "${cf_tst_cflags}" \
14734                                 && cf_fix_cppflags=yes
14735
14736                         if test "$cf_fix_cppflags" = yes ; then
14737
14738         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14739         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14740
14741                                 continue
14742                         elif test "${cf_tst_cflags}" = "\"'" ; then
14743
14744         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14745         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14746
14747                                 continue
14748                         fi
14749                         ;;
14750                 esac
14751                 case "$CPPFLAGS" in
14752                 (*$cf_add_cflags)
14753                         ;;
14754                 (*)
14755                         case "$cf_add_cflags" in
14756                         (-D*)
14757                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14758
14759 CPPFLAGS=`echo "$CPPFLAGS" | \
14760         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14761                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14762
14763                                 ;;
14764                         esac
14765
14766         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14767         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14768
14769                         ;;
14770                 esac
14771                 ;;
14772         (*)
14773
14774         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14775         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14776
14777                 ;;
14778         esac
14779         ;;
14780 (yes)
14781
14782         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14783         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14784
14785         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14786
14787         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14788                 && test -z "${cf_tst_cflags}" \
14789                 && cf_fix_cppflags=no
14790         ;;
14791 esac
14792 done
14793
14794 if test -n "$cf_new_cflags" ; then
14795
14796         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14797         CFLAGS="${CFLAGS}$cf_new_cflags"
14798
14799 fi
14800
14801 if test -n "$cf_new_cppflags" ; then
14802
14803         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14804         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14805
14806 fi
14807
14808 if test -n "$cf_new_extra_cppflags" ; then
14809
14810         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14811         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14812
14813 fi
14814
14815 cf_add_libs="$LIBS"
14816 # reverse order
14817 cf_add_0lib=
14818 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14819 # filter duplicates
14820 for cf_add_1lib in $cf_add_0lib; do
14821         for cf_add_2lib in $cf_add_libs; do
14822                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14823                         cf_add_1lib=
14824                         break
14825                 fi
14826         done
14827         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14828 done
14829 LIBS="$cf_add_libs"
14830
14831         case "x$LIBS" in
14832         (*-lX11*)
14833                 ;;
14834         (*)
14835 # we have an "xt" package, but it may omit Xt's dependency on X11
14836 echo "$as_me:14836: checking for usable X dependency" >&5
14837 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14838 if test "${cf_cv_xt_x11_compat+set}" = set; then
14839   echo $ECHO_N "(cached) $ECHO_C" >&6
14840 else
14841
14842 cat >"conftest.$ac_ext" <<_ACEOF
14843 #line 14843 "configure"
14844 #include "confdefs.h"
14845
14846 #include <X11/Xlib.h>
14847
14848 int
14849 main (void)
14850 {
14851
14852         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14853         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14854         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14855         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14856
14857   ;
14858   return 0;
14859 }
14860 _ACEOF
14861 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14862 if { (eval echo "$as_me:14862: \"$ac_link\"") >&5
14863   (eval $ac_link) 2>&5
14864   ac_status=$?
14865   echo "$as_me:14865: \$? = $ac_status" >&5
14866   (exit "$ac_status"); } &&
14867          { ac_try='test -s "conftest$ac_exeext"'
14868   { (eval echo "$as_me:14868: \"$ac_try\"") >&5
14869   (eval $ac_try) 2>&5
14870   ac_status=$?
14871   echo "$as_me:14871: \$? = $ac_status" >&5
14872   (exit "$ac_status"); }; }; then
14873   cf_cv_xt_x11_compat=yes
14874 else
14875   echo "$as_me: failed program was:" >&5
14876 cat "conftest.$ac_ext" >&5
14877 cf_cv_xt_x11_compat=no
14878 fi
14879 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14880 fi
14881 echo "$as_me:14881: result: $cf_cv_xt_x11_compat" >&5
14882 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14883                 if test "$cf_cv_xt_x11_compat" = no
14884                 then
14885                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14886
14887 echo "${as_me:-configure}:14887: testing work around broken X11 dependency ..." 1>&5
14888
14889                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14890
14891 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14892         test -n "$verbose" && echo "    found package x11" 1>&6
14893
14894 echo "${as_me:-configure}:14894: testing found package x11 ..." 1>&5
14895
14896         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14897         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14898         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14899
14900 echo "${as_me:-configure}:14900: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14901
14902         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14903
14904 echo "${as_me:-configure}:14904: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14905
14906 cf_fix_cppflags=no
14907 cf_new_cflags=
14908 cf_new_cppflags=
14909 cf_new_extra_cppflags=
14910
14911 for cf_add_cflags in $cf_pkgconfig_incs
14912 do
14913 case "$cf_fix_cppflags" in
14914 (no)
14915         case "$cf_add_cflags" in
14916         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14917                 case "$cf_add_cflags" in
14918                 (-D*)
14919                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14920
14921                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14922                                 && test -z "${cf_tst_cflags}" \
14923                                 && cf_fix_cppflags=yes
14924
14925                         if test "$cf_fix_cppflags" = yes ; then
14926
14927         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14928         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14929
14930                                 continue
14931                         elif test "${cf_tst_cflags}" = "\"'" ; then
14932
14933         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14934         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14935
14936                                 continue
14937                         fi
14938                         ;;
14939                 esac
14940                 case "$CPPFLAGS" in
14941                 (*$cf_add_cflags)
14942                         ;;
14943                 (*)
14944                         case "$cf_add_cflags" in
14945                         (-D*)
14946                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14947
14948 CPPFLAGS=`echo "$CPPFLAGS" | \
14949         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14950                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14951
14952                                 ;;
14953                         esac
14954
14955         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14956         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14957
14958                         ;;
14959                 esac
14960                 ;;
14961         (*)
14962
14963         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14964         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14965
14966                 ;;
14967         esac
14968         ;;
14969 (yes)
14970
14971         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14972         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14973
14974         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14975
14976         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14977                 && test -z "${cf_tst_cflags}" \
14978                 && cf_fix_cppflags=no
14979         ;;
14980 esac
14981 done
14982
14983 if test -n "$cf_new_cflags" ; then
14984
14985         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14986         CFLAGS="${CFLAGS}$cf_new_cflags"
14987
14988 fi
14989
14990 if test -n "$cf_new_cppflags" ; then
14991
14992         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14993         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14994
14995 fi
14996
14997 if test -n "$cf_new_extra_cppflags" ; then
14998
14999         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15000         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15001
15002 fi
15003
15004 cf_add_libs="$LIBS"
15005 # reverse order
15006 cf_add_0lib=
15007 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15008 # filter duplicates
15009 for cf_add_1lib in $cf_add_0lib; do
15010         for cf_add_2lib in $cf_add_libs; do
15011                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15012                         cf_add_1lib=
15013                         break
15014                 fi
15015         done
15016         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15017 done
15018 LIBS="$cf_add_libs"
15019
15020         :
15021 else
15022         cf_pkgconfig_incs=
15023         cf_pkgconfig_libs=
15024
15025 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15026
15027 echo "${as_me:-configure}:15027: testing ...before $LIBS ..." 1>&5
15028
15029 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
15030 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15031
15032 echo "${as_me:-configure}:15032: testing ...after  $LIBS ..." 1>&5
15033
15034 fi
15035
15036                 fi
15037                 ;;
15038         esac
15039
15040 echo "$as_me:15040: checking for usable X Toolkit package" >&5
15041 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
15042 if test "${cf_cv_xt_ice_compat+set}" = set; then
15043   echo $ECHO_N "(cached) $ECHO_C" >&6
15044 else
15045
15046 cat >"conftest.$ac_ext" <<_ACEOF
15047 #line 15047 "configure"
15048 #include "confdefs.h"
15049
15050 #include <X11/Shell.h>
15051
15052 int
15053 main (void)
15054 {
15055 int num = IceConnectionNumber(0); (void) num
15056
15057   ;
15058   return 0;
15059 }
15060 _ACEOF
15061 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15062 if { (eval echo "$as_me:15062: \"$ac_link\"") >&5
15063   (eval $ac_link) 2>&5
15064   ac_status=$?
15065   echo "$as_me:15065: \$? = $ac_status" >&5
15066   (exit "$ac_status"); } &&
15067          { ac_try='test -s "conftest$ac_exeext"'
15068   { (eval echo "$as_me:15068: \"$ac_try\"") >&5
15069   (eval $ac_try) 2>&5
15070   ac_status=$?
15071   echo "$as_me:15071: \$? = $ac_status" >&5
15072   (exit "$ac_status"); }; }; then
15073   cf_cv_xt_ice_compat=yes
15074 else
15075   echo "$as_me: failed program was:" >&5
15076 cat "conftest.$ac_ext" >&5
15077 cf_cv_xt_ice_compat=no
15078 fi
15079 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15080 fi
15081 echo "$as_me:15081: result: $cf_cv_xt_ice_compat" >&5
15082 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
15083
15084         if test "$cf_cv_xt_ice_compat" = no
15085         then
15086                 # workaround for broken ".pc" files used for X Toolkit.
15087                 case "x$X_PRE_LIBS" in
15088                 (*-lICE*)
15089                         case "x$LIBS" in
15090                         (*-lICE*)
15091                                 ;;
15092                         (*)
15093                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
15094
15095 echo "${as_me:-configure}:15095: testing work around broken ICE dependency ..." 1>&5
15096
15097 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
15098         test -n "$verbose" && echo "    found package ice" 1>&6
15099
15100 echo "${as_me:-configure}:15100: testing found package ice ..." 1>&5
15101
15102         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
15103         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
15104         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
15105
15106 echo "${as_me:-configure}:15106: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15107
15108         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
15109
15110 echo "${as_me:-configure}:15110: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
15111
15112 cf_fix_cppflags=no
15113 cf_new_cflags=
15114 cf_new_cppflags=
15115 cf_new_extra_cppflags=
15116
15117 for cf_add_cflags in $cf_pkgconfig_incs
15118 do
15119 case "$cf_fix_cppflags" in
15120 (no)
15121         case "$cf_add_cflags" in
15122         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15123                 case "$cf_add_cflags" in
15124                 (-D*)
15125                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15126
15127                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15128                                 && test -z "${cf_tst_cflags}" \
15129                                 && cf_fix_cppflags=yes
15130
15131                         if test "$cf_fix_cppflags" = yes ; then
15132
15133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15135
15136                                 continue
15137                         elif test "${cf_tst_cflags}" = "\"'" ; then
15138
15139         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15140         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15141
15142                                 continue
15143                         fi
15144                         ;;
15145                 esac
15146                 case "$CPPFLAGS" in
15147                 (*$cf_add_cflags)
15148                         ;;
15149                 (*)
15150                         case "$cf_add_cflags" in
15151                         (-D*)
15152                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15153
15154 CPPFLAGS=`echo "$CPPFLAGS" | \
15155         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15156                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15157
15158                                 ;;
15159                         esac
15160
15161         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15162         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15163
15164                         ;;
15165                 esac
15166                 ;;
15167         (*)
15168
15169         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15170         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15171
15172                 ;;
15173         esac
15174         ;;
15175 (yes)
15176
15177         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15178         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15179
15180         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15181
15182         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15183                 && test -z "${cf_tst_cflags}" \
15184                 && cf_fix_cppflags=no
15185         ;;
15186 esac
15187 done
15188
15189 if test -n "$cf_new_cflags" ; then
15190
15191         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15192         CFLAGS="${CFLAGS}$cf_new_cflags"
15193
15194 fi
15195
15196 if test -n "$cf_new_cppflags" ; then
15197
15198         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15199         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15200
15201 fi
15202
15203 if test -n "$cf_new_extra_cppflags" ; then
15204
15205         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15206         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15207
15208 fi
15209
15210 cf_add_libs="$LIBS"
15211 # reverse order
15212 cf_add_0lib=
15213 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15214 # filter duplicates
15215 for cf_add_1lib in $cf_add_0lib; do
15216         for cf_add_2lib in $cf_add_libs; do
15217                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15218                         cf_add_1lib=
15219                         break
15220                 fi
15221         done
15222         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15223 done
15224 LIBS="$cf_add_libs"
15225
15226 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
15227         test -n "$verbose" && echo "    found package sm" 1>&6
15228
15229 echo "${as_me:-configure}:15229: testing found package sm ..." 1>&5
15230
15231         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
15232         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
15233         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
15234
15235 echo "${as_me:-configure}:15235: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15236
15237         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
15238
15239 echo "${as_me:-configure}:15239: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
15240
15241 cf_fix_cppflags=no
15242 cf_new_cflags=
15243 cf_new_cppflags=
15244 cf_new_extra_cppflags=
15245
15246 for cf_add_cflags in $cf_pkgconfig_incs
15247 do
15248 case "$cf_fix_cppflags" in
15249 (no)
15250         case "$cf_add_cflags" in
15251         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15252                 case "$cf_add_cflags" in
15253                 (-D*)
15254                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15255
15256                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15257                                 && test -z "${cf_tst_cflags}" \
15258                                 && cf_fix_cppflags=yes
15259
15260                         if test "$cf_fix_cppflags" = yes ; then
15261
15262         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15263         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15264
15265                                 continue
15266                         elif test "${cf_tst_cflags}" = "\"'" ; then
15267
15268         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15269         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15270
15271                                 continue
15272                         fi
15273                         ;;
15274                 esac
15275                 case "$CPPFLAGS" in
15276                 (*$cf_add_cflags)
15277                         ;;
15278                 (*)
15279                         case "$cf_add_cflags" in
15280                         (-D*)
15281                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15282
15283 CPPFLAGS=`echo "$CPPFLAGS" | \
15284         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15285                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15286
15287                                 ;;
15288                         esac
15289
15290         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15291         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15292
15293                         ;;
15294                 esac
15295                 ;;
15296         (*)
15297
15298         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15299         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15300
15301                 ;;
15302         esac
15303         ;;
15304 (yes)
15305
15306         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15307         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15308
15309         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15310
15311         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15312                 && test -z "${cf_tst_cflags}" \
15313                 && cf_fix_cppflags=no
15314         ;;
15315 esac
15316 done
15317
15318 if test -n "$cf_new_cflags" ; then
15319
15320         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15321         CFLAGS="${CFLAGS}$cf_new_cflags"
15322
15323 fi
15324
15325 if test -n "$cf_new_cppflags" ; then
15326
15327         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15328         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15329
15330 fi
15331
15332 if test -n "$cf_new_extra_cppflags" ; then
15333
15334         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15335         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15336
15337 fi
15338
15339 cf_add_libs="$LIBS"
15340 # reverse order
15341 cf_add_0lib=
15342 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15343 # filter duplicates
15344 for cf_add_1lib in $cf_add_0lib; do
15345         for cf_add_2lib in $cf_add_libs; do
15346                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15347                         cf_add_1lib=
15348                         break
15349                 fi
15350         done
15351         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15352 done
15353 LIBS="$cf_add_libs"
15354
15355         :
15356 else
15357         cf_pkgconfig_incs=
15358         cf_pkgconfig_libs=
15359         :
15360 fi
15361
15362 else
15363         cf_pkgconfig_incs=
15364         cf_pkgconfig_libs=
15365
15366 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15367
15368 echo "${as_me:-configure}:15368: testing ...before $LIBS ..." 1>&5
15369
15370 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
15371 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15372
15373 echo "${as_me:-configure}:15373: testing ...after  $LIBS ..." 1>&5
15374
15375 fi
15376
15377                                 ;;
15378                         esac
15379                         ;;
15380                 esac
15381         fi
15382
15383         cf_have_X_LIBS=yes
15384
15385 else
15386         cf_pkgconfig_incs=
15387         cf_pkgconfig_libs=
15388
15389         LDFLAGS="$X_LIBS $LDFLAGS"
15390
15391 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15392
15393 echo "${as_me:-configure}:15393: testing checking additions to CFLAGS ..." 1>&5
15394
15395 cf_check_cflags="$CFLAGS"
15396 cf_check_cppflags="$CPPFLAGS"
15397
15398 cf_fix_cppflags=no
15399 cf_new_cflags=
15400 cf_new_cppflags=
15401 cf_new_extra_cppflags=
15402
15403 for cf_add_cflags in $X_CFLAGS
15404 do
15405 case "$cf_fix_cppflags" in
15406 (no)
15407         case "$cf_add_cflags" in
15408         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15409                 case "$cf_add_cflags" in
15410                 (-D*)
15411                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15412
15413                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15414                                 && test -z "${cf_tst_cflags}" \
15415                                 && cf_fix_cppflags=yes
15416
15417                         if test "$cf_fix_cppflags" = yes ; then
15418
15419         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15420         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15421
15422                                 continue
15423                         elif test "${cf_tst_cflags}" = "\"'" ; then
15424
15425         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15426         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15427
15428                                 continue
15429                         fi
15430                         ;;
15431                 esac
15432                 case "$CPPFLAGS" in
15433                 (*$cf_add_cflags)
15434                         ;;
15435                 (*)
15436                         case "$cf_add_cflags" in
15437                         (-D*)
15438                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15439
15440 CPPFLAGS=`echo "$CPPFLAGS" | \
15441         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15442                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15443
15444                                 ;;
15445                         esac
15446
15447         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15448         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15449
15450                         ;;
15451                 esac
15452                 ;;
15453         (*)
15454
15455         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15456         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15457
15458                 ;;
15459         esac
15460         ;;
15461 (yes)
15462
15463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15465
15466         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15467
15468         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15469                 && test -z "${cf_tst_cflags}" \
15470                 && cf_fix_cppflags=no
15471         ;;
15472 esac
15473 done
15474
15475 if test -n "$cf_new_cflags" ; then
15476         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15477
15478 echo "${as_me:-configure}:15478: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15479
15480         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15481         CFLAGS="${CFLAGS}$cf_new_cflags"
15482
15483 fi
15484
15485 if test -n "$cf_new_cppflags" ; then
15486         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15487
15488 echo "${as_me:-configure}:15488: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15489
15490         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15491         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15492
15493 fi
15494
15495 if test -n "$cf_new_extra_cppflags" ; then
15496         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15497
15498 echo "${as_me:-configure}:15498: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15499
15500         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15501         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15502
15503 fi
15504
15505 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15506 cat >"conftest.$ac_ext" <<_ACEOF
15507 #line 15507 "configure"
15508 #include "confdefs.h"
15509 #include <stdio.h>
15510 int
15511 main (void)
15512 {
15513 printf("Hello world");
15514   ;
15515   return 0;
15516 }
15517 _ACEOF
15518 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15519 if { (eval echo "$as_me:15519: \"$ac_link\"") >&5
15520   (eval $ac_link) 2>&5
15521   ac_status=$?
15522   echo "$as_me:15522: \$? = $ac_status" >&5
15523   (exit "$ac_status"); } &&
15524          { ac_try='test -s "conftest$ac_exeext"'
15525   { (eval echo "$as_me:15525: \"$ac_try\"") >&5
15526   (eval $ac_try) 2>&5
15527   ac_status=$?
15528   echo "$as_me:15528: \$? = $ac_status" >&5
15529   (exit "$ac_status"); }; }; then
15530   :
15531 else
15532   echo "$as_me: failed program was:" >&5
15533 cat "conftest.$ac_ext" >&5
15534 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15535
15536 echo "${as_me:-configure}:15536: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15537
15538          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15539                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15540
15541 echo "${as_me:-configure}:15541: testing but keeping change to \$CPPFLAGS ..." 1>&5
15542
15543          fi
15544          CFLAGS="$cf_check_cflags"
15545 fi
15546 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15547 fi
15548
15549         echo "$as_me:15549: checking for XOpenDisplay" >&5
15550 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15551 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15552   echo $ECHO_N "(cached) $ECHO_C" >&6
15553 else
15554   cat >"conftest.$ac_ext" <<_ACEOF
15555 #line 15555 "configure"
15556 #include "confdefs.h"
15557 #define XOpenDisplay autoconf_temporary
15558 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15559 #undef XOpenDisplay
15560
15561 #ifdef __cplusplus
15562 extern "C"
15563 #endif
15564
15565 /* We use char because int might match the return type of a gcc2
15566    builtin and then its argument prototype would still apply.  */
15567 char XOpenDisplay (void);
15568
15569 int
15570 main (void)
15571 {
15572
15573 /* The GNU C library defines stubs for functions which it implements
15574     to always fail with ENOSYS.  Some functions are actually named
15575     something starting with __ and the normal name is an alias.  */
15576 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15577 #error found stub for XOpenDisplay
15578 #endif
15579
15580         return XOpenDisplay ();
15581   ;
15582   return 0;
15583 }
15584 _ACEOF
15585 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15586 if { (eval echo "$as_me:15586: \"$ac_link\"") >&5
15587   (eval $ac_link) 2>&5
15588   ac_status=$?
15589   echo "$as_me:15589: \$? = $ac_status" >&5
15590   (exit "$ac_status"); } &&
15591          { ac_try='test -s "conftest$ac_exeext"'
15592   { (eval echo "$as_me:15592: \"$ac_try\"") >&5
15593   (eval $ac_try) 2>&5
15594   ac_status=$?
15595   echo "$as_me:15595: \$? = $ac_status" >&5
15596   (exit "$ac_status"); }; }; then
15597   ac_cv_func_XOpenDisplay=yes
15598 else
15599   echo "$as_me: failed program was:" >&5
15600 cat "conftest.$ac_ext" >&5
15601 ac_cv_func_XOpenDisplay=no
15602 fi
15603 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15604 fi
15605 echo "$as_me:15605: result: $ac_cv_func_XOpenDisplay" >&5
15606 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15607 if test "$ac_cv_func_XOpenDisplay" = yes; then
15608   :
15609 else
15610
15611         echo "$as_me:15611: checking for XOpenDisplay in -lX11" >&5
15612 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15613 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15614   echo $ECHO_N "(cached) $ECHO_C" >&6
15615 else
15616   ac_check_lib_save_LIBS=$LIBS
15617 LIBS="-lX11  $LIBS"
15618 cat >"conftest.$ac_ext" <<_ACEOF
15619 #line 15619 "configure"
15620 #include "confdefs.h"
15621
15622 /* Override any gcc2 internal prototype to avoid an error.  */
15623 #ifdef __cplusplus
15624 extern "C"
15625 #endif
15626 /* We use char because int might match the return type of a gcc2
15627    builtin and then its argument prototype would still apply.  */
15628 char XOpenDisplay ();
15629 int
15630 main (void)
15631 {
15632 XOpenDisplay ();
15633   ;
15634   return 0;
15635 }
15636 _ACEOF
15637 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15638 if { (eval echo "$as_me:15638: \"$ac_link\"") >&5
15639   (eval $ac_link) 2>&5
15640   ac_status=$?
15641   echo "$as_me:15641: \$? = $ac_status" >&5
15642   (exit "$ac_status"); } &&
15643          { ac_try='test -s "conftest$ac_exeext"'
15644   { (eval echo "$as_me:15644: \"$ac_try\"") >&5
15645   (eval $ac_try) 2>&5
15646   ac_status=$?
15647   echo "$as_me:15647: \$? = $ac_status" >&5
15648   (exit "$ac_status"); }; }; then
15649   ac_cv_lib_X11_XOpenDisplay=yes
15650 else
15651   echo "$as_me: failed program was:" >&5
15652 cat "conftest.$ac_ext" >&5
15653 ac_cv_lib_X11_XOpenDisplay=no
15654 fi
15655 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15656 LIBS=$ac_check_lib_save_LIBS
15657 fi
15658 echo "$as_me:15658: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15659 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15660 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15661
15662 cf_add_libs="$LIBS"
15663 # reverse order
15664 cf_add_0lib=
15665 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15666 # filter duplicates
15667 for cf_add_1lib in $cf_add_0lib; do
15668         for cf_add_2lib in $cf_add_libs; do
15669                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15670                         cf_add_1lib=
15671                         break
15672                 fi
15673         done
15674         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15675 done
15676 LIBS="$cf_add_libs"
15677
15678 fi
15679
15680 fi
15681
15682         echo "$as_me:15682: checking for XtAppInitialize" >&5
15683 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15684 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15685   echo $ECHO_N "(cached) $ECHO_C" >&6
15686 else
15687   cat >"conftest.$ac_ext" <<_ACEOF
15688 #line 15688 "configure"
15689 #include "confdefs.h"
15690 #define XtAppInitialize autoconf_temporary
15691 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15692 #undef XtAppInitialize
15693
15694 #ifdef __cplusplus
15695 extern "C"
15696 #endif
15697
15698 /* We use char because int might match the return type of a gcc2
15699    builtin and then its argument prototype would still apply.  */
15700 char XtAppInitialize (void);
15701
15702 int
15703 main (void)
15704 {
15705
15706 /* The GNU C library defines stubs for functions which it implements
15707     to always fail with ENOSYS.  Some functions are actually named
15708     something starting with __ and the normal name is an alias.  */
15709 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15710 #error found stub for XtAppInitialize
15711 #endif
15712
15713         return XtAppInitialize ();
15714   ;
15715   return 0;
15716 }
15717 _ACEOF
15718 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15719 if { (eval echo "$as_me:15719: \"$ac_link\"") >&5
15720   (eval $ac_link) 2>&5
15721   ac_status=$?
15722   echo "$as_me:15722: \$? = $ac_status" >&5
15723   (exit "$ac_status"); } &&
15724          { ac_try='test -s "conftest$ac_exeext"'
15725   { (eval echo "$as_me:15725: \"$ac_try\"") >&5
15726   (eval $ac_try) 2>&5
15727   ac_status=$?
15728   echo "$as_me:15728: \$? = $ac_status" >&5
15729   (exit "$ac_status"); }; }; then
15730   ac_cv_func_XtAppInitialize=yes
15731 else
15732   echo "$as_me: failed program was:" >&5
15733 cat "conftest.$ac_ext" >&5
15734 ac_cv_func_XtAppInitialize=no
15735 fi
15736 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15737 fi
15738 echo "$as_me:15738: result: $ac_cv_func_XtAppInitialize" >&5
15739 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15740 if test "$ac_cv_func_XtAppInitialize" = yes; then
15741   :
15742 else
15743
15744         echo "$as_me:15744: checking for XtAppInitialize in -lXt" >&5
15745 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15746 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15747   echo $ECHO_N "(cached) $ECHO_C" >&6
15748 else
15749   ac_check_lib_save_LIBS=$LIBS
15750 LIBS="-lXt  $LIBS"
15751 cat >"conftest.$ac_ext" <<_ACEOF
15752 #line 15752 "configure"
15753 #include "confdefs.h"
15754
15755 /* Override any gcc2 internal prototype to avoid an error.  */
15756 #ifdef __cplusplus
15757 extern "C"
15758 #endif
15759 /* We use char because int might match the return type of a gcc2
15760    builtin and then its argument prototype would still apply.  */
15761 char XtAppInitialize ();
15762 int
15763 main (void)
15764 {
15765 XtAppInitialize ();
15766   ;
15767   return 0;
15768 }
15769 _ACEOF
15770 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15771 if { (eval echo "$as_me:15771: \"$ac_link\"") >&5
15772   (eval $ac_link) 2>&5
15773   ac_status=$?
15774   echo "$as_me:15774: \$? = $ac_status" >&5
15775   (exit "$ac_status"); } &&
15776          { ac_try='test -s "conftest$ac_exeext"'
15777   { (eval echo "$as_me:15777: \"$ac_try\"") >&5
15778   (eval $ac_try) 2>&5
15779   ac_status=$?
15780   echo "$as_me:15780: \$? = $ac_status" >&5
15781   (exit "$ac_status"); }; }; then
15782   ac_cv_lib_Xt_XtAppInitialize=yes
15783 else
15784   echo "$as_me: failed program was:" >&5
15785 cat "conftest.$ac_ext" >&5
15786 ac_cv_lib_Xt_XtAppInitialize=no
15787 fi
15788 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15789 LIBS=$ac_check_lib_save_LIBS
15790 fi
15791 echo "$as_me:15791: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15792 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15793 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15794
15795 cat >>confdefs.h <<\EOF
15796 #define HAVE_LIBXT 1
15797 EOF
15798
15799                  cf_have_X_LIBS=Xt
15800                  LIBS="-lXt $LIBS"
15801 fi
15802
15803 fi
15804
15805 fi
15806
15807 if test "$cf_have_X_LIBS" = no ; then
15808         { echo "$as_me:15808: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15809 test program.  You will have to check and add the proper libraries by hand
15810 to makefile." >&5
15811 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15812 test program.  You will have to check and add the proper libraries by hand
15813 to makefile." >&2;}
15814 fi
15815
15816 cf_x_athena_root=$cf_x_athena
15817 cf_x_athena_inc=""
15818
15819 for cf_path in default \
15820         /usr/contrib/X11R6 \
15821         /usr/contrib/X11R5 \
15822         /usr/lib/X11R5 \
15823         /usr/local
15824 do
15825         if test -z "$cf_x_athena_inc" ; then
15826
15827 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15828 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15829 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15830 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15831 for cf_X_CFLAGS in $X_CFLAGS
15832 do
15833         case "x$cf_X_CFLAGS" in
15834         x-[IUD]*)
15835                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15836                 ;;
15837         *)
15838                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15839                 ;;
15840         esac
15841 done
15842
15843                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15844                 if test "$cf_path" != default ; then
15845
15846         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15847         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15848
15849                         echo "$as_me:15849: checking for $cf_test in $cf_path" >&5
15850 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15851                 else
15852                         echo "$as_me:15852: checking for $cf_test" >&5
15853 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15854                 fi
15855                 cat >"conftest.$ac_ext" <<_ACEOF
15856 #line 15856 "configure"
15857 #include "confdefs.h"
15858
15859 #include <X11/Intrinsic.h>
15860 #include <$cf_test>
15861 int
15862 main (void)
15863 {
15864
15865   ;
15866   return 0;
15867 }
15868 _ACEOF
15869 rm -f "conftest.$ac_objext"
15870 if { (eval echo "$as_me:15870: \"$ac_compile\"") >&5
15871   (eval $ac_compile) 2>&5
15872   ac_status=$?
15873   echo "$as_me:15873: \$? = $ac_status" >&5
15874   (exit "$ac_status"); } &&
15875          { ac_try='test -s "conftest.$ac_objext"'
15876   { (eval echo "$as_me:15876: \"$ac_try\"") >&5
15877   (eval $ac_try) 2>&5
15878   ac_status=$?
15879   echo "$as_me:15879: \$? = $ac_status" >&5
15880   (exit "$ac_status"); }; }; then
15881   cf_result=yes
15882 else
15883   echo "$as_me: failed program was:" >&5
15884 cat "conftest.$ac_ext" >&5
15885 cf_result=no
15886 fi
15887 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15888                 echo "$as_me:15888: result: $cf_result" >&5
15889 echo "${ECHO_T}$cf_result" >&6
15890
15891 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15892 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15893 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15894
15895                 if test "$cf_result" = yes ; then
15896                         test "$cf_path"  = default && cf_x_athena_inc=default
15897                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15898                         break
15899                 fi
15900         fi
15901 done
15902
15903 if test -z "$cf_x_athena_inc" ; then
15904         { echo "$as_me:15904: WARNING: Unable to find Athena header files" >&5
15905 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15906 elif test "$cf_x_athena_inc" != default ; then
15907
15908         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15909         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15910
15911 fi
15912
15913 cf_x_athena_root=$cf_x_athena
15914 cf_x_athena_lib=""
15915
15916 for cf_path in default \
15917         /usr/contrib/X11R6 \
15918         /usr/contrib/X11R5 \
15919         /usr/lib/X11R5 \
15920         /usr/local
15921 do
15922         for cf_lib in \
15923                 ${cf_x_athena_root} \
15924                 ${cf_x_athena_root}7 \
15925                 ${cf_x_athena_root}6
15926         do
15927         for cf_libs in \
15928                 "-l$cf_lib -lXmu" \
15929                 "-l$cf_lib -lXpm -lXmu" \
15930                 "-l${cf_lib}_s -lXmu_s"
15931         do
15932                 test -n "$cf_x_athena_lib" && break
15933
15934 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15935 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15936 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15937 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15938 for cf_X_CFLAGS in $X_CFLAGS
15939 do
15940         case "x$cf_X_CFLAGS" in
15941         x-[IUD]*)
15942                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15943                 ;;
15944         *)
15945                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15946                 ;;
15947         esac
15948 done
15949
15950                 cf_test=XawSimpleMenuAddGlobalActions
15951                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15952
15953 cf_add_libs="$LIBS"
15954 # reverse order
15955 cf_add_0lib=
15956 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15957 # filter duplicates
15958 for cf_add_1lib in $cf_add_0lib; do
15959         for cf_add_2lib in $cf_add_libs; do
15960                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15961                         cf_add_1lib=
15962                         break
15963                 fi
15964         done
15965         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15966 done
15967 LIBS="$cf_add_libs"
15968
15969                 echo "$as_me:15969: checking for $cf_test in $cf_libs" >&5
15970 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15971                 cat >"conftest.$ac_ext" <<_ACEOF
15972 #line 15972 "configure"
15973 #include "confdefs.h"
15974
15975 #include <X11/Intrinsic.h>
15976 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15977
15978 int
15979 main (void)
15980 {
15981
15982 $cf_test((XtAppContext) 0)
15983   ;
15984   return 0;
15985 }
15986 _ACEOF
15987 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15988 if { (eval echo "$as_me:15988: \"$ac_link\"") >&5
15989   (eval $ac_link) 2>&5
15990   ac_status=$?
15991   echo "$as_me:15991: \$? = $ac_status" >&5
15992   (exit "$ac_status"); } &&
15993          { ac_try='test -s "conftest$ac_exeext"'
15994   { (eval echo "$as_me:15994: \"$ac_try\"") >&5
15995   (eval $ac_try) 2>&5
15996   ac_status=$?
15997   echo "$as_me:15997: \$? = $ac_status" >&5
15998   (exit "$ac_status"); }; }; then
15999   cf_result=yes
16000 else
16001   echo "$as_me: failed program was:" >&5
16002 cat "conftest.$ac_ext" >&5
16003 cf_result=no
16004 fi
16005 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16006                 echo "$as_me:16006: result: $cf_result" >&5
16007 echo "${ECHO_T}$cf_result" >&6
16008
16009 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
16010 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
16011 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
16012
16013                 if test "$cf_result" = yes ; then
16014                         cf_x_athena_lib="$cf_libs"
16015                         break
16016                 fi
16017         done # cf_libs
16018                 test -n "$cf_x_athena_lib" && break
16019         done # cf_lib
16020 done
16021
16022 if test -z "$cf_x_athena_lib" ; then
16023         { { echo "$as_me:16023: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
16024 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
16025    { (exit 1); exit 1; }; }
16026 fi
16027
16028 cf_add_libs="$LIBS"
16029 # reverse order
16030 cf_add_0lib=
16031 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16032 # filter duplicates
16033 for cf_add_1lib in $cf_add_0lib; do
16034         for cf_add_2lib in $cf_add_libs; do
16035                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16036                         cf_add_1lib=
16037                         break
16038                 fi
16039         done
16040         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16041 done
16042 LIBS="$cf_add_libs"
16043
16044 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16045
16046 cat >>confdefs.h <<EOF
16047 #define $cf_x_athena_LIBS 1
16048 EOF
16049
16050 fi
16051
16052 if test -n "$ac_tool_prefix"; then
16053   for ac_prog in xcurses-config
16054   do
16055     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
16056 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
16057 echo "$as_me:16057: checking for $ac_word" >&5
16058 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16059 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
16060   echo $ECHO_N "(cached) $ECHO_C" >&6
16061 else
16062   if test -n "$XCURSES_CONFIG"; then
16063   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
16064 else
16065   ac_save_IFS=$IFS; IFS=$ac_path_separator
16066 ac_dummy="$PATH"
16067 for ac_dir in $ac_dummy; do
16068   IFS=$ac_save_IFS
16069   test -z "$ac_dir" && ac_dir=.
16070   $as_executable_p "$ac_dir/$ac_word" || continue
16071 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
16072 echo "$as_me:16072: found $ac_dir/$ac_word" >&5
16073 break
16074 done
16075
16076 fi
16077 fi
16078 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
16079 if test -n "$XCURSES_CONFIG"; then
16080   echo "$as_me:16080: result: $XCURSES_CONFIG" >&5
16081 echo "${ECHO_T}$XCURSES_CONFIG" >&6
16082 else
16083   echo "$as_me:16083: result: no" >&5
16084 echo "${ECHO_T}no" >&6
16085 fi
16086
16087     test -n "$XCURSES_CONFIG" && break
16088   done
16089 fi
16090 if test -z "$XCURSES_CONFIG"; then
16091   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
16092   for ac_prog in xcurses-config
16093 do
16094   # Extract the first word of "$ac_prog", so it can be a program name with args.
16095 set dummy $ac_prog; ac_word=$2
16096 echo "$as_me:16096: checking for $ac_word" >&5
16097 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16098 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
16099   echo $ECHO_N "(cached) $ECHO_C" >&6
16100 else
16101   if test -n "$ac_ct_XCURSES_CONFIG"; then
16102   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
16103 else
16104   ac_save_IFS=$IFS; IFS=$ac_path_separator
16105 ac_dummy="$PATH"
16106 for ac_dir in $ac_dummy; do
16107   IFS=$ac_save_IFS
16108   test -z "$ac_dir" && ac_dir=.
16109   $as_executable_p "$ac_dir/$ac_word" || continue
16110 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
16111 echo "$as_me:16111: found $ac_dir/$ac_word" >&5
16112 break
16113 done
16114
16115 fi
16116 fi
16117 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
16118 if test -n "$ac_ct_XCURSES_CONFIG"; then
16119   echo "$as_me:16119: result: $ac_ct_XCURSES_CONFIG" >&5
16120 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
16121 else
16122   echo "$as_me:16122: result: no" >&5
16123 echo "${ECHO_T}no" >&6
16124 fi
16125
16126   test -n "$ac_ct_XCURSES_CONFIG" && break
16127 done
16128 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
16129
16130   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
16131 fi
16132
16133 if test "$XCURSES_CONFIG" != none ; then
16134
16135 cf_fix_cppflags=no
16136 cf_new_cflags=
16137 cf_new_cppflags=
16138 cf_new_extra_cppflags=
16139
16140 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
16141 do
16142 case "$cf_fix_cppflags" in
16143 (no)
16144         case "$cf_add_cflags" in
16145         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16146                 case "$cf_add_cflags" in
16147                 (-D*)
16148                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16149
16150                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16151                                 && test -z "${cf_tst_cflags}" \
16152                                 && cf_fix_cppflags=yes
16153
16154                         if test "$cf_fix_cppflags" = yes ; then
16155
16156         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16157         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16158
16159                                 continue
16160                         elif test "${cf_tst_cflags}" = "\"'" ; then
16161
16162         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16163         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16164
16165                                 continue
16166                         fi
16167                         ;;
16168                 esac
16169                 case "$CPPFLAGS" in
16170                 (*$cf_add_cflags)
16171                         ;;
16172                 (*)
16173                         case "$cf_add_cflags" in
16174                         (-D*)
16175                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16176
16177 CPPFLAGS=`echo "$CPPFLAGS" | \
16178         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16179                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16180
16181                                 ;;
16182                         esac
16183
16184         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16185         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16186
16187                         ;;
16188                 esac
16189                 ;;
16190         (*)
16191
16192         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16193         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16194
16195                 ;;
16196         esac
16197         ;;
16198 (yes)
16199
16200         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16201         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16202
16203         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16204
16205         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16206                 && test -z "${cf_tst_cflags}" \
16207                 && cf_fix_cppflags=no
16208         ;;
16209 esac
16210 done
16211
16212 if test -n "$cf_new_cflags" ; then
16213
16214         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16215         CFLAGS="${CFLAGS}$cf_new_cflags"
16216
16217 fi
16218
16219 if test -n "$cf_new_cppflags" ; then
16220
16221         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16222         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16223
16224 fi
16225
16226 if test -n "$cf_new_extra_cppflags" ; then
16227
16228         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16229         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16230
16231 fi
16232
16233 cf_add_libs="$LIBS"
16234 # reverse order
16235 cf_add_0lib=
16236 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16237 # filter duplicates
16238 for cf_add_1lib in $cf_add_0lib; do
16239         for cf_add_2lib in $cf_add_libs; do
16240                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16241                         cf_add_1lib=
16242                         break
16243                 fi
16244         done
16245         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16246 done
16247 LIBS="$cf_add_libs"
16248
16249 cf_cv_lib_XCurses=yes
16250
16251 else
16252
16253 LDFLAGS="$LDFLAGS $X_LIBS"
16254
16255 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
16256
16257 echo "${as_me:-configure}:16257: testing checking additions to CFLAGS ..." 1>&5
16258
16259 cf_check_cflags="$CFLAGS"
16260 cf_check_cppflags="$CPPFLAGS"
16261
16262 cf_fix_cppflags=no
16263 cf_new_cflags=
16264 cf_new_cppflags=
16265 cf_new_extra_cppflags=
16266
16267 for cf_add_cflags in $X_CFLAGS
16268 do
16269 case "$cf_fix_cppflags" in
16270 (no)
16271         case "$cf_add_cflags" in
16272         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16273                 case "$cf_add_cflags" in
16274                 (-D*)
16275                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16276
16277                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16278                                 && test -z "${cf_tst_cflags}" \
16279                                 && cf_fix_cppflags=yes
16280
16281                         if test "$cf_fix_cppflags" = yes ; then
16282
16283         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16284         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16285
16286                                 continue
16287                         elif test "${cf_tst_cflags}" = "\"'" ; then
16288
16289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16291
16292                                 continue
16293                         fi
16294                         ;;
16295                 esac
16296                 case "$CPPFLAGS" in
16297                 (*$cf_add_cflags)
16298                         ;;
16299                 (*)
16300                         case "$cf_add_cflags" in
16301                         (-D*)
16302                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16303
16304 CPPFLAGS=`echo "$CPPFLAGS" | \
16305         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16306                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16307
16308                                 ;;
16309                         esac
16310
16311         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16312         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16313
16314                         ;;
16315                 esac
16316                 ;;
16317         (*)
16318
16319         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16320         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16321
16322                 ;;
16323         esac
16324         ;;
16325 (yes)
16326
16327         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16328         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16329
16330         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16331
16332         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16333                 && test -z "${cf_tst_cflags}" \
16334                 && cf_fix_cppflags=no
16335         ;;
16336 esac
16337 done
16338
16339 if test -n "$cf_new_cflags" ; then
16340         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
16341
16342 echo "${as_me:-configure}:16342: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
16343
16344         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16345         CFLAGS="${CFLAGS}$cf_new_cflags"
16346
16347 fi
16348
16349 if test -n "$cf_new_cppflags" ; then
16350         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
16351
16352 echo "${as_me:-configure}:16352: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
16353
16354         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16355         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16356
16357 fi
16358
16359 if test -n "$cf_new_extra_cppflags" ; then
16360         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
16361
16362 echo "${as_me:-configure}:16362: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
16363
16364         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16365         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16366
16367 fi
16368
16369 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
16370 cat >"conftest.$ac_ext" <<_ACEOF
16371 #line 16371 "configure"
16372 #include "confdefs.h"
16373 #include <stdio.h>
16374 int
16375 main (void)
16376 {
16377 printf("Hello world");
16378   ;
16379   return 0;
16380 }
16381 _ACEOF
16382 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16383 if { (eval echo "$as_me:16383: \"$ac_link\"") >&5
16384   (eval $ac_link) 2>&5
16385   ac_status=$?
16386   echo "$as_me:16386: \$? = $ac_status" >&5
16387   (exit "$ac_status"); } &&
16388          { ac_try='test -s "conftest$ac_exeext"'
16389   { (eval echo "$as_me:16389: \"$ac_try\"") >&5
16390   (eval $ac_try) 2>&5
16391   ac_status=$?
16392   echo "$as_me:16392: \$? = $ac_status" >&5
16393   (exit "$ac_status"); }; }; then
16394   :
16395 else
16396   echo "$as_me: failed program was:" >&5
16397 cat "conftest.$ac_ext" >&5
16398 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
16399
16400 echo "${as_me:-configure}:16400: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
16401
16402          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16403                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
16404
16405 echo "${as_me:-configure}:16405: testing but keeping change to \$CPPFLAGS ..." 1>&5
16406
16407          fi
16408          CFLAGS="$cf_check_cflags"
16409 fi
16410 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16411 fi
16412
16413 echo "$as_me:16413: checking for XOpenDisplay in -lX11" >&5
16414 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16415 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16416   echo $ECHO_N "(cached) $ECHO_C" >&6
16417 else
16418   ac_check_lib_save_LIBS=$LIBS
16419 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
16420 cat >"conftest.$ac_ext" <<_ACEOF
16421 #line 16421 "configure"
16422 #include "confdefs.h"
16423
16424 /* Override any gcc2 internal prototype to avoid an error.  */
16425 #ifdef __cplusplus
16426 extern "C"
16427 #endif
16428 /* We use char because int might match the return type of a gcc2
16429    builtin and then its argument prototype would still apply.  */
16430 char XOpenDisplay ();
16431 int
16432 main (void)
16433 {
16434 XOpenDisplay ();
16435   ;
16436   return 0;
16437 }
16438 _ACEOF
16439 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16440 if { (eval echo "$as_me:16440: \"$ac_link\"") >&5
16441   (eval $ac_link) 2>&5
16442   ac_status=$?
16443   echo "$as_me:16443: \$? = $ac_status" >&5
16444   (exit "$ac_status"); } &&
16445          { ac_try='test -s "conftest$ac_exeext"'
16446   { (eval echo "$as_me:16446: \"$ac_try\"") >&5
16447   (eval $ac_try) 2>&5
16448   ac_status=$?
16449   echo "$as_me:16449: \$? = $ac_status" >&5
16450   (exit "$ac_status"); }; }; then
16451   ac_cv_lib_X11_XOpenDisplay=yes
16452 else
16453   echo "$as_me: failed program was:" >&5
16454 cat "conftest.$ac_ext" >&5
16455 ac_cv_lib_X11_XOpenDisplay=no
16456 fi
16457 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16458 LIBS=$ac_check_lib_save_LIBS
16459 fi
16460 echo "$as_me:16460: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16461 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16462 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16463
16464 cf_add_libs="$LIBS"
16465 # reverse order
16466 cf_add_0lib=
16467 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16468 # filter duplicates
16469 for cf_add_1lib in $cf_add_0lib; do
16470         for cf_add_2lib in $cf_add_libs; do
16471                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16472                         cf_add_1lib=
16473                         break
16474                 fi
16475         done
16476         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16477 done
16478 LIBS="$cf_add_libs"
16479
16480 fi
16481
16482 echo "$as_me:16482: checking for XCurses library" >&5
16483 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16484 if test "${cf_cv_lib_XCurses+set}" = set; then
16485   echo $ECHO_N "(cached) $ECHO_C" >&6
16486 else
16487
16488 cf_add_libs="$LIBS"
16489 # reverse order
16490 cf_add_0lib=
16491 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16492 # filter duplicates
16493 for cf_add_1lib in $cf_add_0lib; do
16494         for cf_add_2lib in $cf_add_libs; do
16495                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16496                         cf_add_1lib=
16497                         break
16498                 fi
16499         done
16500         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16501 done
16502 LIBS="$cf_add_libs"
16503
16504 cat >"conftest.$ac_ext" <<_ACEOF
16505 #line 16505 "configure"
16506 #include "confdefs.h"
16507
16508 #include <xcurses.h>
16509 char *XCursesProgramName = "test";
16510
16511 int
16512 main (void)
16513 {
16514 XCursesExit();
16515   ;
16516   return 0;
16517 }
16518 _ACEOF
16519 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16520 if { (eval echo "$as_me:16520: \"$ac_link\"") >&5
16521   (eval $ac_link) 2>&5
16522   ac_status=$?
16523   echo "$as_me:16523: \$? = $ac_status" >&5
16524   (exit "$ac_status"); } &&
16525          { ac_try='test -s "conftest$ac_exeext"'
16526   { (eval echo "$as_me:16526: \"$ac_try\"") >&5
16527   (eval $ac_try) 2>&5
16528   ac_status=$?
16529   echo "$as_me:16529: \$? = $ac_status" >&5
16530   (exit "$ac_status"); }; }; then
16531   cf_cv_lib_XCurses=yes
16532 else
16533   echo "$as_me: failed program was:" >&5
16534 cat "conftest.$ac_ext" >&5
16535 cf_cv_lib_XCurses=no
16536 fi
16537 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16538
16539 fi
16540 echo "$as_me:16540: result: $cf_cv_lib_XCurses" >&5
16541 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16542
16543 fi
16544
16545 if test "$cf_cv_lib_XCurses" = yes ; then
16546
16547 cat >>confdefs.h <<\EOF
16548 #define UNIX 1
16549 EOF
16550
16551 cat >>confdefs.h <<\EOF
16552 #define XCURSES 1
16553 EOF
16554
16555         echo "$as_me:16555: checking for xcurses.h" >&5
16556 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16557 if test "${ac_cv_header_xcurses_h+set}" = set; then
16558   echo $ECHO_N "(cached) $ECHO_C" >&6
16559 else
16560   cat >"conftest.$ac_ext" <<_ACEOF
16561 #line 16561 "configure"
16562 #include "confdefs.h"
16563 #include <xcurses.h>
16564 _ACEOF
16565 if { (eval echo "$as_me:16565: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16566   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16567   ac_status=$?
16568   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16569   rm -f conftest.er1
16570   cat conftest.err >&5
16571   echo "$as_me:16571: \$? = $ac_status" >&5
16572   (exit "$ac_status"); } >/dev/null; then
16573   if test -s conftest.err; then
16574     ac_cpp_err=$ac_c_preproc_warn_flag
16575   else
16576     ac_cpp_err=
16577   fi
16578 else
16579   ac_cpp_err=yes
16580 fi
16581 if test -z "$ac_cpp_err"; then
16582   ac_cv_header_xcurses_h=yes
16583 else
16584   echo "$as_me: failed program was:" >&5
16585   cat "conftest.$ac_ext" >&5
16586   ac_cv_header_xcurses_h=no
16587 fi
16588 rm -f conftest.err "conftest.$ac_ext"
16589 fi
16590 echo "$as_me:16590: result: $ac_cv_header_xcurses_h" >&5
16591 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16592 if test "$ac_cv_header_xcurses_h" = yes; then
16593
16594 cat >>confdefs.h <<\EOF
16595 #define HAVE_XCURSES 1
16596 EOF
16597
16598 fi
16599
16600 else
16601         { { echo "$as_me:16601: error: Cannot link with XCurses" >&5
16602 echo "$as_me: error: Cannot link with XCurses" >&2;}
16603    { (exit 1); exit 1; }; }
16604 fi
16605
16606         ;;
16607 (*)
16608         { { echo "$as_me:16608: error: unexpected screen-value: $cf_cv_screen" >&5
16609 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16610    { (exit 1); exit 1; }; }
16611         ;;
16612 esac
16613
16614 : ${cf_nculib_root:=$cf_cv_screen}
16615 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16616 echo "$as_me:16616: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16617 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16618 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16619   echo $ECHO_N "(cached) $ECHO_C" >&6
16620 else
16621   ac_check_lib_save_LIBS=$LIBS
16622 LIBS="-l$cf_nculib_root  $LIBS"
16623 cat >"conftest.$ac_ext" <<_ACEOF
16624 #line 16624 "configure"
16625 #include "confdefs.h"
16626
16627 /* Override any gcc2 internal prototype to avoid an error.  */
16628 #ifdef __cplusplus
16629 extern "C"
16630 #endif
16631 /* We use char because int might match the return type of a gcc2
16632    builtin and then its argument prototype would still apply.  */
16633 char _nc_init_pthreads ();
16634 int
16635 main (void)
16636 {
16637 _nc_init_pthreads ();
16638   ;
16639   return 0;
16640 }
16641 _ACEOF
16642 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16643 if { (eval echo "$as_me:16643: \"$ac_link\"") >&5
16644   (eval $ac_link) 2>&5
16645   ac_status=$?
16646   echo "$as_me:16646: \$? = $ac_status" >&5
16647   (exit "$ac_status"); } &&
16648          { ac_try='test -s "conftest$ac_exeext"'
16649   { (eval echo "$as_me:16649: \"$ac_try\"") >&5
16650   (eval $ac_try) 2>&5
16651   ac_status=$?
16652   echo "$as_me:16652: \$? = $ac_status" >&5
16653   (exit "$ac_status"); }; }; then
16654   eval "$as_ac_Lib=yes"
16655 else
16656   echo "$as_me: failed program was:" >&5
16657 cat "conftest.$ac_ext" >&5
16658 eval "$as_ac_Lib=no"
16659 fi
16660 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16661 LIBS=$ac_check_lib_save_LIBS
16662 fi
16663 echo "$as_me:16663: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16664 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16665 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16666   cf_cv_ncurses_pthreads=yes
16667 else
16668   cf_cv_ncurses_pthreads=no
16669 fi
16670
16671 if test "$cf_cv_ncurses_pthreads" = yes
16672 then
16673
16674 cf_add_libs="$LIBS"
16675 # reverse order
16676 cf_add_0lib=
16677 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16678 # filter duplicates
16679 for cf_add_1lib in $cf_add_0lib; do
16680         for cf_add_2lib in $cf_add_libs; do
16681                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16682                         cf_add_1lib=
16683                         break
16684                 fi
16685         done
16686         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16687 done
16688 LIBS="$cf_add_libs"
16689
16690 fi
16691
16692 case $cf_cv_screen in
16693 (ncurses*)
16694         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16695         ;;
16696 esac
16697
16698 echo "$as_me:16698: checking for X11 rgb file" >&5
16699 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16700
16701 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16702 if test "${with_x11_rgb+set}" = set; then
16703   withval="$with_x11_rgb"
16704   RGB_PATH=$withval
16705 else
16706   RGB_PATH=auto
16707 fi;
16708
16709 if test "x$RGB_PATH" = xauto
16710 then
16711         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16712         for cf_path in \
16713                 /opt/local/share/X11/rgb.txt \
16714                 /opt/X11/share/X11/rgb.txt \
16715                 /usr/share/X11/rgb.txt \
16716                 /usr/X11/share/X11/rgb.txt \
16717                 /usr/X11/lib/X11/rgb.txt \
16718                 /usr/lib/X11/rgb.txt \
16719                 /etc/X11/rgb.txt \
16720                 /usr/pkg/lib/X11/rgb.txt \
16721                 /usr/X11R7/lib/X11/rgb.txt \
16722                 /usr/X11R6/lib/X11/rgb.txt \
16723                 /usr/X11R5/lib/X11/rgb.txt \
16724                 /usr/X11R4/lib/X11/rgb.txt \
16725                 /usr/local/lib/X11/rgb.txt \
16726                 /usr/local/share/X11/rgb.txt \
16727                 /usr/lib64/X11/rgb.txt
16728         do
16729                 if test -f "$cf_path" ; then
16730                         RGB_PATH="$cf_path"
16731                         break
16732                 fi
16733         done
16734 else
16735         cf_path=$RGB_PATH
16736
16737 if test "x$prefix" != xNONE; then
16738         cf_path_syntax="$prefix"
16739 else
16740         cf_path_syntax="$ac_default_prefix"
16741 fi
16742
16743 case ".$cf_path" in
16744 (.\$\(*\)*|.\'*\'*)
16745         ;;
16746 (..|./*|.\\*)
16747         ;;
16748 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16749         ;;
16750 (.\$\{*prefix\}*|.\$\{*dir\}*)
16751         eval cf_path="$cf_path"
16752         case ".$cf_path" in
16753         (.NONE/*)
16754                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16755                 ;;
16756         esac
16757         ;;
16758 (.no|.NONE/*)
16759         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16760         ;;
16761 (*)
16762         { { echo "$as_me:16762: error: expected a pathname, not \"$cf_path\"" >&5
16763 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16764    { (exit 1); exit 1; }; }
16765         ;;
16766 esac
16767
16768 fi
16769
16770 echo "$as_me:16770: result: $RGB_PATH" >&5
16771 echo "${ECHO_T}$RGB_PATH" >&6
16772
16773 cat >>confdefs.h <<EOF
16774 #define RGB_PATH "$cf_path"
16775 EOF
16776
16777 no_x11_rgb=
16778 if test "$RGB_PATH" = no
16779 then
16780         no_x11_rgb="#"
16781 fi
16782
16783 cf_curses_headers=
16784
16785 case $cf_cv_screen in
16786 (pdcurses)
16787         cf_default_panel=no
16788         cf_default_form=no
16789         cf_default_menu=no
16790         cf_default_tinfo=no
16791         ;;
16792 (xcurses|bsdcurses)
16793         cf_default_panel=no
16794         cf_default_form=no
16795         cf_default_menu=no
16796         cf_default_tinfo=yes
16797         ;;
16798 (*)
16799         cf_default_panel=yes
16800         cf_default_form=yes
16801         cf_default_menu=yes
16802         cf_default_tinfo=yes
16803         case $cf_cv_screen in
16804         (ncurses*)
16805                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16806                 ;;
16807         esac
16808         ;;
16809 esac
16810
16811 echo "$as_me:16811: checking for desired basename for form library" >&5
16812 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16813
16814 # Check whether --with-form-libname or --without-form-libname was given.
16815 if test "${with_form_libname+set}" = set; then
16816   withval="$with_form_libname"
16817   with_lib_basename=$withval
16818 else
16819   with_lib_basename=form
16820 fi;
16821 FORM_NAME="$with_lib_basename"
16822
16823 case "x$FORM_NAME" in
16824 (x|xno|xnone|xyes)
16825         FORM_NAME=form
16826         ;;
16827 (*)
16828         ;;
16829 esac
16830
16831 echo "$as_me:16831: result: $FORM_NAME" >&5
16832 echo "${ECHO_T}$FORM_NAME" >&6
16833
16834 echo "$as_me:16834: checking for desired basename for menu library" >&5
16835 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16836
16837 # Check whether --with-menu-libname or --without-menu-libname was given.
16838 if test "${with_menu_libname+set}" = set; then
16839   withval="$with_menu_libname"
16840   with_lib_basename=$withval
16841 else
16842   with_lib_basename=menu
16843 fi;
16844 MENU_NAME="$with_lib_basename"
16845
16846 case "x$MENU_NAME" in
16847 (x|xno|xnone|xyes)
16848         MENU_NAME=menu
16849         ;;
16850 (*)
16851         ;;
16852 esac
16853
16854 echo "$as_me:16854: result: $MENU_NAME" >&5
16855 echo "${ECHO_T}$MENU_NAME" >&6
16856
16857 echo "$as_me:16857: checking for desired basename for panel library" >&5
16858 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16859
16860 # Check whether --with-panel-libname or --without-panel-libname was given.
16861 if test "${with_panel_libname+set}" = set; then
16862   withval="$with_panel_libname"
16863   with_lib_basename=$withval
16864 else
16865   with_lib_basename=panel
16866 fi;
16867 PANEL_NAME="$with_lib_basename"
16868
16869 case "x$PANEL_NAME" in
16870 (x|xno|xnone|xyes)
16871         PANEL_NAME=panel
16872         ;;
16873 (*)
16874         ;;
16875 esac
16876
16877 echo "$as_me:16877: result: $PANEL_NAME" >&5
16878 echo "${ECHO_T}$PANEL_NAME" >&6
16879
16880 echo "$as_me:16880: checking if you want to check for panel functions" >&5
16881 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16882
16883 # Check whether --enable-panel or --disable-panel was given.
16884 if test "${enable_panel+set}" = set; then
16885   enableval="$enable_panel"
16886   test "$enableval" != no && enableval=yes
16887         if test "$enableval" != "yes" ; then
16888     cf_enable_panel=no
16889         else
16890                 cf_enable_panel=$cf_default_panel
16891         fi
16892 else
16893   enableval=yes
16894         cf_enable_panel=$cf_default_panel
16895
16896 fi;
16897 echo "$as_me:16897: result: $cf_enable_panel" >&5
16898 echo "${ECHO_T}$cf_enable_panel" >&6
16899 if test $cf_enable_panel = yes
16900 then
16901
16902 cf_have_curses_lib=no
16903
16904 : ${NCURSES_CONFIG_PKG:=none}
16905 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16906         :
16907 elif test "x${PKG_CONFIG:=none}" != xnone; then
16908         echo "$as_me:16908: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16909 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16910         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16911                 echo "$as_me:16911: result: yes" >&5
16912 echo "${ECHO_T}yes" >&6
16913
16914                 echo "$as_me:16914: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16915 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16916
16917                 cf_save_CFLAGS="$CFLAGS"
16918                 cf_save_CPPFLAGS="$CPPFLAGS"
16919                 cf_save_LIBS="$LIBS"
16920
16921 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16922 do
16923         case "x$cf_add_cflags" in
16924         (x-[DU]*)
16925
16926 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
16927 while true
16928 do
16929         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'`
16930         test "$CFLAGS" != "$cf_old_cflag" || break
16931
16932         CFLAGS="$cf_old_cflag"
16933 done
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$CPPFLAGS" | 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 "$CPPFLAGS" != "$cf_old_cflag" || break
16940
16941         CPPFLAGS="$cf_old_cflag"
16942 done
16943
16944                 ;;
16945         esac
16946
16947 cf_fix_cppflags=no
16948 cf_new_cflags=
16949 cf_new_cppflags=
16950 cf_new_extra_cppflags=
16951
16952 for cf_add_cflags in $cf_add_cflags
16953 do
16954 case "$cf_fix_cppflags" in
16955 (no)
16956         case "$cf_add_cflags" in
16957         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16958                 case "$cf_add_cflags" in
16959                 (-D*)
16960                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16961
16962                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16963                                 && test -z "${cf_tst_cflags}" \
16964                                 && cf_fix_cppflags=yes
16965
16966                         if test "$cf_fix_cppflags" = yes ; then
16967
16968         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16969         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16970
16971                                 continue
16972                         elif test "${cf_tst_cflags}" = "\"'" ; then
16973
16974         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16975         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16976
16977                                 continue
16978                         fi
16979                         ;;
16980                 esac
16981                 case "$CPPFLAGS" in
16982                 (*$cf_add_cflags)
16983                         ;;
16984                 (*)
16985                         case "$cf_add_cflags" in
16986                         (-D*)
16987                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16988
16989 CPPFLAGS=`echo "$CPPFLAGS" | \
16990         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16991                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16992
16993                                 ;;
16994                         esac
16995
16996         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16997         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16998
16999                         ;;
17000                 esac
17001                 ;;
17002         (*)
17003
17004         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17005         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17006
17007                 ;;
17008         esac
17009         ;;
17010 (yes)
17011
17012         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17013         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17014
17015         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17016
17017         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17018                 && test -z "${cf_tst_cflags}" \
17019                 && cf_fix_cppflags=no
17020         ;;
17021 esac
17022 done
17023
17024 if test -n "$cf_new_cflags" ; then
17025
17026         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17027         CFLAGS="${CFLAGS}$cf_new_cflags"
17028
17029 fi
17030
17031 if test -n "$cf_new_cppflags" ; then
17032
17033         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17034         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17035
17036 fi
17037
17038 if test -n "$cf_new_extra_cppflags" ; then
17039
17040         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17041         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17042
17043 fi
17044
17045 done
17046
17047 cf_add_libs="$LIBS"
17048 # reverse order
17049 cf_add_0lib=
17050 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17051 # filter duplicates
17052 for cf_add_1lib in $cf_add_0lib; do
17053         for cf_add_2lib in $cf_add_libs; do
17054                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17055                         cf_add_1lib=
17056                         break
17057                 fi
17058         done
17059         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17060 done
17061 LIBS="$cf_add_libs"
17062
17063                 cat >"conftest.$ac_ext" <<_ACEOF
17064 #line 17064 "configure"
17065 #include "confdefs.h"
17066 #include <$PANEL_NAME.h>
17067 int
17068 main (void)
17069 {
17070 (void) new_panel ( 0 );
17071   ;
17072   return 0;
17073 }
17074 _ACEOF
17075 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17076 if { (eval echo "$as_me:17076: \"$ac_link\"") >&5
17077   (eval $ac_link) 2>&5
17078   ac_status=$?
17079   echo "$as_me:17079: \$? = $ac_status" >&5
17080   (exit "$ac_status"); } &&
17081          { ac_try='test -s "conftest$ac_exeext"'
17082   { (eval echo "$as_me:17082: \"$ac_try\"") >&5
17083   (eval $ac_try) 2>&5
17084   ac_status=$?
17085   echo "$as_me:17085: \$? = $ac_status" >&5
17086   (exit "$ac_status"); }; }; then
17087   if test "$cross_compiling" = yes; then
17088   cf_have_curses_lib=maybe
17089 else
17090   cat >"conftest.$ac_ext" <<_ACEOF
17091 #line 17091 "configure"
17092 #include "confdefs.h"
17093 #include <$PANEL_NAME.h>
17094                                 int main(void)
17095                                 { (void) new_panel ( 0 ); return 0; }
17096 _ACEOF
17097 rm -f "conftest$ac_exeext"
17098 if { (eval echo "$as_me:17098: \"$ac_link\"") >&5
17099   (eval $ac_link) 2>&5
17100   ac_status=$?
17101   echo "$as_me:17101: \$? = $ac_status" >&5
17102   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17103   { (eval echo "$as_me:17103: \"$ac_try\"") >&5
17104   (eval $ac_try) 2>&5
17105   ac_status=$?
17106   echo "$as_me:17106: \$? = $ac_status" >&5
17107   (exit "$ac_status"); }; }; then
17108   cf_have_curses_lib=yes
17109 else
17110   echo "$as_me: program exited with status $ac_status" >&5
17111 echo "$as_me: failed program was:" >&5
17112 cat "conftest.$ac_ext" >&5
17113 cf_have_curses_lib=no
17114 fi
17115 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17116 fi
17117 else
17118   echo "$as_me: failed program was:" >&5
17119 cat "conftest.$ac_ext" >&5
17120 cf_have_curses_lib=no
17121 fi
17122 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17123                 echo "$as_me:17123: result: $cf_have_curses_lib" >&5
17124 echo "${ECHO_T}$cf_have_curses_lib" >&6
17125                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17126                 if test "$cf_have_curses_lib" = "yes"
17127                 then
17128
17129 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17130
17131                         cat >>confdefs.h <<EOF
17132 #define $cf_upper 1
17133 EOF
17134
17135                 else
17136                         CFLAGS="$cf_save_CFLAGS"
17137                         CPPFLAGS="$cf_save_CPPFLAGS"
17138                         LIBS="$cf_save_LIBS"
17139                 fi
17140         fi
17141 fi
17142 if test "$cf_have_curses_lib" = no; then
17143         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
17144 echo "$as_me:17144: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
17145 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17146 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17147   echo $ECHO_N "(cached) $ECHO_C" >&6
17148 else
17149   ac_check_lib_save_LIBS=$LIBS
17150 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
17151 cat >"conftest.$ac_ext" <<_ACEOF
17152 #line 17152 "configure"
17153 #include "confdefs.h"
17154
17155 /* Override any gcc2 internal prototype to avoid an error.  */
17156 #ifdef __cplusplus
17157 extern "C"
17158 #endif
17159 /* We use char because int might match the return type of a gcc2
17160    builtin and then its argument prototype would still apply.  */
17161 char new_panel ();
17162 int
17163 main (void)
17164 {
17165 new_panel ();
17166   ;
17167   return 0;
17168 }
17169 _ACEOF
17170 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17171 if { (eval echo "$as_me:17171: \"$ac_link\"") >&5
17172   (eval $ac_link) 2>&5
17173   ac_status=$?
17174   echo "$as_me:17174: \$? = $ac_status" >&5
17175   (exit "$ac_status"); } &&
17176          { ac_try='test -s "conftest$ac_exeext"'
17177   { (eval echo "$as_me:17177: \"$ac_try\"") >&5
17178   (eval $ac_try) 2>&5
17179   ac_status=$?
17180   echo "$as_me:17180: \$? = $ac_status" >&5
17181   (exit "$ac_status"); }; }; then
17182   eval "$as_ac_Lib=yes"
17183 else
17184   echo "$as_me: failed program was:" >&5
17185 cat "conftest.$ac_ext" >&5
17186 eval "$as_ac_Lib=no"
17187 fi
17188 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17189 LIBS=$ac_check_lib_save_LIBS
17190 fi
17191 echo "$as_me:17191: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17192 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17193 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17194
17195 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17196
17197 cf_add_libs="$LIBS"
17198 # reverse order
17199 cf_add_0lib=
17200 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17201 # filter duplicates
17202 for cf_add_1lib in $cf_add_0lib; do
17203         for cf_add_2lib in $cf_add_libs; do
17204                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17205                         cf_add_1lib=
17206                         break
17207                 fi
17208         done
17209         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17210 done
17211 LIBS="$cf_add_libs"
17212
17213                 cat >>confdefs.h <<EOF
17214 #define $cf_upper 1
17215 EOF
17216
17217 fi
17218
17219 fi
17220
17221         cf_curses_headers="$cf_curses_headers panel.h"
17222 fi
17223
17224 echo "$as_me:17224: checking if you want to check for menu functions" >&5
17225 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
17226
17227 # Check whether --enable-menu or --disable-menu was given.
17228 if test "${enable_menu+set}" = set; then
17229   enableval="$enable_menu"
17230   test "$enableval" != no && enableval=yes
17231         if test "$enableval" != "yes" ; then
17232     cf_enable_menu=no
17233         else
17234                 cf_enable_menu=$cf_default_menu
17235         fi
17236 else
17237   enableval=yes
17238         cf_enable_menu=$cf_default_menu
17239
17240 fi;
17241 echo "$as_me:17241: result: $cf_enable_menu" >&5
17242 echo "${ECHO_T}$cf_enable_menu" >&6
17243 if test $cf_enable_menu = yes
17244 then
17245         case $cf_cv_screen in
17246         (ncurses*)
17247                 ;;
17248         (curses*)
17249
17250 echo "$as_me:17250: checking for NetBSD menu.h" >&5
17251 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
17252 if test "${cf_cv_netbsd_menu_h+set}" = set; then
17253   echo $ECHO_N "(cached) $ECHO_C" >&6
17254 else
17255
17256 cat >"conftest.$ac_ext" <<_ACEOF
17257 #line 17257 "configure"
17258 #include "confdefs.h"
17259
17260 #include <${cf_cv_ncurses_header:-curses.h}>
17261 #include <menu.h>
17262
17263 int
17264 main (void)
17265 {
17266
17267         MENU *menu;
17268         int y = menu->max_item_width;
17269
17270   ;
17271   return 0;
17272 }
17273 _ACEOF
17274 rm -f "conftest.$ac_objext"
17275 if { (eval echo "$as_me:17275: \"$ac_compile\"") >&5
17276   (eval $ac_compile) 2>&5
17277   ac_status=$?
17278   echo "$as_me:17278: \$? = $ac_status" >&5
17279   (exit "$ac_status"); } &&
17280          { ac_try='test -s "conftest.$ac_objext"'
17281   { (eval echo "$as_me:17281: \"$ac_try\"") >&5
17282   (eval $ac_try) 2>&5
17283   ac_status=$?
17284   echo "$as_me:17284: \$? = $ac_status" >&5
17285   (exit "$ac_status"); }; }; then
17286   cf_cv_netbsd_menu_h=yes
17287
17288 else
17289   echo "$as_me: failed program was:" >&5
17290 cat "conftest.$ac_ext" >&5
17291 cf_cv_netbsd_menu_h=no
17292 fi
17293 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17294
17295 fi
17296 echo "$as_me:17296: result: $cf_cv_netbsd_menu_h" >&5
17297 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
17298
17299 test "$cf_cv_netbsd_menu_h" = yes &&
17300 cat >>confdefs.h <<\EOF
17301 #define HAVE_NETBSD_MENU_H 1
17302 EOF
17303
17304                 ;;
17305         esac
17306
17307 cf_have_curses_lib=no
17308
17309 : ${NCURSES_CONFIG_PKG:=none}
17310 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17311         :
17312 elif test "x${PKG_CONFIG:=none}" != xnone; then
17313         echo "$as_me:17313: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
17314 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17315         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
17316                 echo "$as_me:17316: result: yes" >&5
17317 echo "${ECHO_T}yes" >&6
17318
17319                 echo "$as_me:17319: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
17320 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17321
17322                 cf_save_CFLAGS="$CFLAGS"
17323                 cf_save_CPPFLAGS="$CPPFLAGS"
17324                 cf_save_LIBS="$LIBS"
17325
17326 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
17327 do
17328         case "x$cf_add_cflags" in
17329         (x-[DU]*)
17330
17331 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17332 while true
17333 do
17334         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'`
17335         test "$CFLAGS" != "$cf_old_cflag" || break
17336
17337         CFLAGS="$cf_old_cflag"
17338 done
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$CPPFLAGS" | 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 "$CPPFLAGS" != "$cf_old_cflag" || break
17345
17346         CPPFLAGS="$cf_old_cflag"
17347 done
17348
17349                 ;;
17350         esac
17351
17352 cf_fix_cppflags=no
17353 cf_new_cflags=
17354 cf_new_cppflags=
17355 cf_new_extra_cppflags=
17356
17357 for cf_add_cflags in $cf_add_cflags
17358 do
17359 case "$cf_fix_cppflags" in
17360 (no)
17361         case "$cf_add_cflags" in
17362         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17363                 case "$cf_add_cflags" in
17364                 (-D*)
17365                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17366
17367                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17368                                 && test -z "${cf_tst_cflags}" \
17369                                 && cf_fix_cppflags=yes
17370
17371                         if test "$cf_fix_cppflags" = yes ; then
17372
17373         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17374         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17375
17376                                 continue
17377                         elif test "${cf_tst_cflags}" = "\"'" ; then
17378
17379         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17380         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17381
17382                                 continue
17383                         fi
17384                         ;;
17385                 esac
17386                 case "$CPPFLAGS" in
17387                 (*$cf_add_cflags)
17388                         ;;
17389                 (*)
17390                         case "$cf_add_cflags" in
17391                         (-D*)
17392                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17393
17394 CPPFLAGS=`echo "$CPPFLAGS" | \
17395         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17396                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17397
17398                                 ;;
17399                         esac
17400
17401         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17402         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17403
17404                         ;;
17405                 esac
17406                 ;;
17407         (*)
17408
17409         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17410         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17411
17412                 ;;
17413         esac
17414         ;;
17415 (yes)
17416
17417         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17418         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17419
17420         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17421
17422         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17423                 && test -z "${cf_tst_cflags}" \
17424                 && cf_fix_cppflags=no
17425         ;;
17426 esac
17427 done
17428
17429 if test -n "$cf_new_cflags" ; then
17430
17431         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17432         CFLAGS="${CFLAGS}$cf_new_cflags"
17433
17434 fi
17435
17436 if test -n "$cf_new_cppflags" ; then
17437
17438         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17439         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17440
17441 fi
17442
17443 if test -n "$cf_new_extra_cppflags" ; then
17444
17445         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17446         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17447
17448 fi
17449
17450 done
17451
17452 cf_add_libs="$LIBS"
17453 # reverse order
17454 cf_add_0lib=
17455 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17456 # filter duplicates
17457 for cf_add_1lib in $cf_add_0lib; do
17458         for cf_add_2lib in $cf_add_libs; do
17459                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17460                         cf_add_1lib=
17461                         break
17462                 fi
17463         done
17464         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17465 done
17466 LIBS="$cf_add_libs"
17467
17468                 cat >"conftest.$ac_ext" <<_ACEOF
17469 #line 17469 "configure"
17470 #include "confdefs.h"
17471 #include <$MENU_NAME.h>
17472 int
17473 main (void)
17474 {
17475 (void) menu_driver ( 0,0 );
17476   ;
17477   return 0;
17478 }
17479 _ACEOF
17480 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17481 if { (eval echo "$as_me:17481: \"$ac_link\"") >&5
17482   (eval $ac_link) 2>&5
17483   ac_status=$?
17484   echo "$as_me:17484: \$? = $ac_status" >&5
17485   (exit "$ac_status"); } &&
17486          { ac_try='test -s "conftest$ac_exeext"'
17487   { (eval echo "$as_me:17487: \"$ac_try\"") >&5
17488   (eval $ac_try) 2>&5
17489   ac_status=$?
17490   echo "$as_me:17490: \$? = $ac_status" >&5
17491   (exit "$ac_status"); }; }; then
17492   if test "$cross_compiling" = yes; then
17493   cf_have_curses_lib=maybe
17494 else
17495   cat >"conftest.$ac_ext" <<_ACEOF
17496 #line 17496 "configure"
17497 #include "confdefs.h"
17498 #include <$MENU_NAME.h>
17499                                 int main(void)
17500                                 { (void) menu_driver ( 0,0 ); return 0; }
17501 _ACEOF
17502 rm -f "conftest$ac_exeext"
17503 if { (eval echo "$as_me:17503: \"$ac_link\"") >&5
17504   (eval $ac_link) 2>&5
17505   ac_status=$?
17506   echo "$as_me:17506: \$? = $ac_status" >&5
17507   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17508   { (eval echo "$as_me:17508: \"$ac_try\"") >&5
17509   (eval $ac_try) 2>&5
17510   ac_status=$?
17511   echo "$as_me:17511: \$? = $ac_status" >&5
17512   (exit "$ac_status"); }; }; then
17513   cf_have_curses_lib=yes
17514 else
17515   echo "$as_me: program exited with status $ac_status" >&5
17516 echo "$as_me: failed program was:" >&5
17517 cat "conftest.$ac_ext" >&5
17518 cf_have_curses_lib=no
17519 fi
17520 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17521 fi
17522 else
17523   echo "$as_me: failed program was:" >&5
17524 cat "conftest.$ac_ext" >&5
17525 cf_have_curses_lib=no
17526 fi
17527 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17528                 echo "$as_me:17528: result: $cf_have_curses_lib" >&5
17529 echo "${ECHO_T}$cf_have_curses_lib" >&6
17530                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17531                 if test "$cf_have_curses_lib" = "yes"
17532                 then
17533
17534 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17535
17536                         cat >>confdefs.h <<EOF
17537 #define $cf_upper 1
17538 EOF
17539
17540                 else
17541                         CFLAGS="$cf_save_CFLAGS"
17542                         CPPFLAGS="$cf_save_CPPFLAGS"
17543                         LIBS="$cf_save_LIBS"
17544                 fi
17545         fi
17546 fi
17547 if test "$cf_have_curses_lib" = no; then
17548         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17549 echo "$as_me:17549: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17550 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17551 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17552   echo $ECHO_N "(cached) $ECHO_C" >&6
17553 else
17554   ac_check_lib_save_LIBS=$LIBS
17555 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17556 cat >"conftest.$ac_ext" <<_ACEOF
17557 #line 17557 "configure"
17558 #include "confdefs.h"
17559
17560 /* Override any gcc2 internal prototype to avoid an error.  */
17561 #ifdef __cplusplus
17562 extern "C"
17563 #endif
17564 /* We use char because int might match the return type of a gcc2
17565    builtin and then its argument prototype would still apply.  */
17566 char menu_driver ();
17567 int
17568 main (void)
17569 {
17570 menu_driver ();
17571   ;
17572   return 0;
17573 }
17574 _ACEOF
17575 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17576 if { (eval echo "$as_me:17576: \"$ac_link\"") >&5
17577   (eval $ac_link) 2>&5
17578   ac_status=$?
17579   echo "$as_me:17579: \$? = $ac_status" >&5
17580   (exit "$ac_status"); } &&
17581          { ac_try='test -s "conftest$ac_exeext"'
17582   { (eval echo "$as_me:17582: \"$ac_try\"") >&5
17583   (eval $ac_try) 2>&5
17584   ac_status=$?
17585   echo "$as_me:17585: \$? = $ac_status" >&5
17586   (exit "$ac_status"); }; }; then
17587   eval "$as_ac_Lib=yes"
17588 else
17589   echo "$as_me: failed program was:" >&5
17590 cat "conftest.$ac_ext" >&5
17591 eval "$as_ac_Lib=no"
17592 fi
17593 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17594 LIBS=$ac_check_lib_save_LIBS
17595 fi
17596 echo "$as_me:17596: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17597 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17598 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17599
17600 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17601
17602 cf_add_libs="$LIBS"
17603 # reverse order
17604 cf_add_0lib=
17605 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17606 # filter duplicates
17607 for cf_add_1lib in $cf_add_0lib; do
17608         for cf_add_2lib in $cf_add_libs; do
17609                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17610                         cf_add_1lib=
17611                         break
17612                 fi
17613         done
17614         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17615 done
17616 LIBS="$cf_add_libs"
17617
17618                 cat >>confdefs.h <<EOF
17619 #define $cf_upper 1
17620 EOF
17621
17622 fi
17623
17624 fi
17625
17626         cf_curses_headers="$cf_curses_headers menu.h"
17627 fi
17628
17629 echo "$as_me:17629: checking if you want to check for form functions" >&5
17630 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17631
17632 # Check whether --enable-form or --disable-form was given.
17633 if test "${enable_form+set}" = set; then
17634   enableval="$enable_form"
17635   test "$enableval" != no && enableval=yes
17636         if test "$enableval" != "yes" ; then
17637     cf_enable_form=no
17638         else
17639                 cf_enable_form=$cf_default_form
17640         fi
17641 else
17642   enableval=yes
17643         cf_enable_form=$cf_default_form
17644
17645 fi;
17646 echo "$as_me:17646: result: $cf_enable_form" >&5
17647 echo "${ECHO_T}$cf_enable_form" >&6
17648 if test $cf_enable_form = yes
17649 then
17650         case $cf_cv_screen in
17651         (ncurses*)
17652                 ;;
17653         (curses*)
17654
17655 echo "$as_me:17655: checking for NetBSD form.h" >&5
17656 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17657 if test "${cf_cv_netbsd_form_h+set}" = set; then
17658   echo $ECHO_N "(cached) $ECHO_C" >&6
17659 else
17660
17661 cat >"conftest.$ac_ext" <<_ACEOF
17662 #line 17662 "configure"
17663 #include "confdefs.h"
17664
17665 #include <${cf_cv_ncurses_header:-curses.h}>
17666 #include <form.h>
17667
17668 int
17669 main (void)
17670 {
17671
17672         FORM *form;
17673         int y = current_field(form)->cursor_ypos;
17674         int x = current_field(form)->cursor_xpos;
17675
17676   ;
17677   return 0;
17678 }
17679 _ACEOF
17680 rm -f "conftest.$ac_objext"
17681 if { (eval echo "$as_me:17681: \"$ac_compile\"") >&5
17682   (eval $ac_compile) 2>&5
17683   ac_status=$?
17684   echo "$as_me:17684: \$? = $ac_status" >&5
17685   (exit "$ac_status"); } &&
17686          { ac_try='test -s "conftest.$ac_objext"'
17687   { (eval echo "$as_me:17687: \"$ac_try\"") >&5
17688   (eval $ac_try) 2>&5
17689   ac_status=$?
17690   echo "$as_me:17690: \$? = $ac_status" >&5
17691   (exit "$ac_status"); }; }; then
17692   cf_cv_netbsd_form_h=yes
17693
17694 else
17695   echo "$as_me: failed program was:" >&5
17696 cat "conftest.$ac_ext" >&5
17697 cf_cv_netbsd_form_h=no
17698 fi
17699 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17700
17701 fi
17702 echo "$as_me:17702: result: $cf_cv_netbsd_form_h" >&5
17703 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17704
17705 test "$cf_cv_netbsd_form_h" = yes &&
17706 cat >>confdefs.h <<\EOF
17707 #define HAVE_NETBSD_FORM_H 1
17708 EOF
17709
17710                 ;;
17711         esac
17712
17713 cf_have_curses_lib=no
17714
17715 : ${NCURSES_CONFIG_PKG:=none}
17716 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17717         :
17718 elif test "x${PKG_CONFIG:=none}" != xnone; then
17719         echo "$as_me:17719: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17720 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17721         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17722                 echo "$as_me:17722: result: yes" >&5
17723 echo "${ECHO_T}yes" >&6
17724
17725                 echo "$as_me:17725: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17726 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17727
17728                 cf_save_CFLAGS="$CFLAGS"
17729                 cf_save_CPPFLAGS="$CPPFLAGS"
17730                 cf_save_LIBS="$LIBS"
17731
17732 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17733 do
17734         case "x$cf_add_cflags" in
17735         (x-[DU]*)
17736
17737 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17738 while true
17739 do
17740         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'`
17741         test "$CFLAGS" != "$cf_old_cflag" || break
17742
17743         CFLAGS="$cf_old_cflag"
17744 done
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$CPPFLAGS" | 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 "$CPPFLAGS" != "$cf_old_cflag" || break
17751
17752         CPPFLAGS="$cf_old_cflag"
17753 done
17754
17755                 ;;
17756         esac
17757
17758 cf_fix_cppflags=no
17759 cf_new_cflags=
17760 cf_new_cppflags=
17761 cf_new_extra_cppflags=
17762
17763 for cf_add_cflags in $cf_add_cflags
17764 do
17765 case "$cf_fix_cppflags" in
17766 (no)
17767         case "$cf_add_cflags" in
17768         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17769                 case "$cf_add_cflags" in
17770                 (-D*)
17771                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17772
17773                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17774                                 && test -z "${cf_tst_cflags}" \
17775                                 && cf_fix_cppflags=yes
17776
17777                         if test "$cf_fix_cppflags" = yes ; then
17778
17779         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17780         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17781
17782                                 continue
17783                         elif test "${cf_tst_cflags}" = "\"'" ; then
17784
17785         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17786         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17787
17788                                 continue
17789                         fi
17790                         ;;
17791                 esac
17792                 case "$CPPFLAGS" in
17793                 (*$cf_add_cflags)
17794                         ;;
17795                 (*)
17796                         case "$cf_add_cflags" in
17797                         (-D*)
17798                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17799
17800 CPPFLAGS=`echo "$CPPFLAGS" | \
17801         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17802                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17803
17804                                 ;;
17805                         esac
17806
17807         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17808         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17809
17810                         ;;
17811                 esac
17812                 ;;
17813         (*)
17814
17815         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17816         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17817
17818                 ;;
17819         esac
17820         ;;
17821 (yes)
17822
17823         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17824         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17825
17826         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17827
17828         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17829                 && test -z "${cf_tst_cflags}" \
17830                 && cf_fix_cppflags=no
17831         ;;
17832 esac
17833 done
17834
17835 if test -n "$cf_new_cflags" ; then
17836
17837         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17838         CFLAGS="${CFLAGS}$cf_new_cflags"
17839
17840 fi
17841
17842 if test -n "$cf_new_cppflags" ; then
17843
17844         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17845         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17846
17847 fi
17848
17849 if test -n "$cf_new_extra_cppflags" ; then
17850
17851         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17852         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17853
17854 fi
17855
17856 done
17857
17858 cf_add_libs="$LIBS"
17859 # reverse order
17860 cf_add_0lib=
17861 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17862 # filter duplicates
17863 for cf_add_1lib in $cf_add_0lib; do
17864         for cf_add_2lib in $cf_add_libs; do
17865                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17866                         cf_add_1lib=
17867                         break
17868                 fi
17869         done
17870         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17871 done
17872 LIBS="$cf_add_libs"
17873
17874                 cat >"conftest.$ac_ext" <<_ACEOF
17875 #line 17875 "configure"
17876 #include "confdefs.h"
17877 #include <$FORM_NAME.h>
17878 int
17879 main (void)
17880 {
17881 (void) form_driver ( 0,0 );
17882   ;
17883   return 0;
17884 }
17885 _ACEOF
17886 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17887 if { (eval echo "$as_me:17887: \"$ac_link\"") >&5
17888   (eval $ac_link) 2>&5
17889   ac_status=$?
17890   echo "$as_me:17890: \$? = $ac_status" >&5
17891   (exit "$ac_status"); } &&
17892          { ac_try='test -s "conftest$ac_exeext"'
17893   { (eval echo "$as_me:17893: \"$ac_try\"") >&5
17894   (eval $ac_try) 2>&5
17895   ac_status=$?
17896   echo "$as_me:17896: \$? = $ac_status" >&5
17897   (exit "$ac_status"); }; }; then
17898   if test "$cross_compiling" = yes; then
17899   cf_have_curses_lib=maybe
17900 else
17901   cat >"conftest.$ac_ext" <<_ACEOF
17902 #line 17902 "configure"
17903 #include "confdefs.h"
17904 #include <$FORM_NAME.h>
17905                                 int main(void)
17906                                 { (void) form_driver ( 0,0 ); return 0; }
17907 _ACEOF
17908 rm -f "conftest$ac_exeext"
17909 if { (eval echo "$as_me:17909: \"$ac_link\"") >&5
17910   (eval $ac_link) 2>&5
17911   ac_status=$?
17912   echo "$as_me:17912: \$? = $ac_status" >&5
17913   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17914   { (eval echo "$as_me:17914: \"$ac_try\"") >&5
17915   (eval $ac_try) 2>&5
17916   ac_status=$?
17917   echo "$as_me:17917: \$? = $ac_status" >&5
17918   (exit "$ac_status"); }; }; then
17919   cf_have_curses_lib=yes
17920 else
17921   echo "$as_me: program exited with status $ac_status" >&5
17922 echo "$as_me: failed program was:" >&5
17923 cat "conftest.$ac_ext" >&5
17924 cf_have_curses_lib=no
17925 fi
17926 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17927 fi
17928 else
17929   echo "$as_me: failed program was:" >&5
17930 cat "conftest.$ac_ext" >&5
17931 cf_have_curses_lib=no
17932 fi
17933 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17934                 echo "$as_me:17934: result: $cf_have_curses_lib" >&5
17935 echo "${ECHO_T}$cf_have_curses_lib" >&6
17936                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17937                 if test "$cf_have_curses_lib" = "yes"
17938                 then
17939
17940 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17941
17942                         cat >>confdefs.h <<EOF
17943 #define $cf_upper 1
17944 EOF
17945
17946                 else
17947                         CFLAGS="$cf_save_CFLAGS"
17948                         CPPFLAGS="$cf_save_CPPFLAGS"
17949                         LIBS="$cf_save_LIBS"
17950                 fi
17951         fi
17952 fi
17953 if test "$cf_have_curses_lib" = no; then
17954         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17955 echo "$as_me:17955: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17956 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17957 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17958   echo $ECHO_N "(cached) $ECHO_C" >&6
17959 else
17960   ac_check_lib_save_LIBS=$LIBS
17961 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17962 cat >"conftest.$ac_ext" <<_ACEOF
17963 #line 17963 "configure"
17964 #include "confdefs.h"
17965
17966 /* Override any gcc2 internal prototype to avoid an error.  */
17967 #ifdef __cplusplus
17968 extern "C"
17969 #endif
17970 /* We use char because int might match the return type of a gcc2
17971    builtin and then its argument prototype would still apply.  */
17972 char form_driver ();
17973 int
17974 main (void)
17975 {
17976 form_driver ();
17977   ;
17978   return 0;
17979 }
17980 _ACEOF
17981 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17982 if { (eval echo "$as_me:17982: \"$ac_link\"") >&5
17983   (eval $ac_link) 2>&5
17984   ac_status=$?
17985   echo "$as_me:17985: \$? = $ac_status" >&5
17986   (exit "$ac_status"); } &&
17987          { ac_try='test -s "conftest$ac_exeext"'
17988   { (eval echo "$as_me:17988: \"$ac_try\"") >&5
17989   (eval $ac_try) 2>&5
17990   ac_status=$?
17991   echo "$as_me:17991: \$? = $ac_status" >&5
17992   (exit "$ac_status"); }; }; then
17993   eval "$as_ac_Lib=yes"
17994 else
17995   echo "$as_me: failed program was:" >&5
17996 cat "conftest.$ac_ext" >&5
17997 eval "$as_ac_Lib=no"
17998 fi
17999 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18000 LIBS=$ac_check_lib_save_LIBS
18001 fi
18002 echo "$as_me:18002: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
18003 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
18004 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
18005
18006 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18007
18008 cf_add_libs="$LIBS"
18009 # reverse order
18010 cf_add_0lib=
18011 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18012 # filter duplicates
18013 for cf_add_1lib in $cf_add_0lib; do
18014         for cf_add_2lib in $cf_add_libs; do
18015                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18016                         cf_add_1lib=
18017                         break
18018                 fi
18019         done
18020         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18021 done
18022 LIBS="$cf_add_libs"
18023
18024                 cat >>confdefs.h <<EOF
18025 #define $cf_upper 1
18026 EOF
18027
18028 fi
18029
18030 fi
18031
18032         cf_curses_headers="$cf_curses_headers form.h"
18033 fi
18034
18035 # look for curses-related headers
18036
18037 for ac_header in $cf_curses_headers
18038 do
18039 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18040 echo "$as_me:18040: checking for $ac_header" >&5
18041 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18042 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18043   echo $ECHO_N "(cached) $ECHO_C" >&6
18044 else
18045   cat >"conftest.$ac_ext" <<_ACEOF
18046 #line 18046 "configure"
18047 #include "confdefs.h"
18048 #include <$ac_header>
18049 _ACEOF
18050 if { (eval echo "$as_me:18050: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18051   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18052   ac_status=$?
18053   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18054   rm -f conftest.er1
18055   cat conftest.err >&5
18056   echo "$as_me:18056: \$? = $ac_status" >&5
18057   (exit "$ac_status"); } >/dev/null; then
18058   if test -s conftest.err; then
18059     ac_cpp_err=$ac_c_preproc_warn_flag
18060   else
18061     ac_cpp_err=
18062   fi
18063 else
18064   ac_cpp_err=yes
18065 fi
18066 if test -z "$ac_cpp_err"; then
18067   eval "$as_ac_Header=yes"
18068 else
18069   echo "$as_me: failed program was:" >&5
18070   cat "conftest.$ac_ext" >&5
18071   eval "$as_ac_Header=no"
18072 fi
18073 rm -f conftest.err "conftest.$ac_ext"
18074 fi
18075 echo "$as_me:18075: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18076 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18077 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18078   cat >>confdefs.h <<EOF
18079 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18080 EOF
18081
18082 fi
18083 done
18084
18085 echo "$as_me:18085: checking for ANSI C header files" >&5
18086 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
18087 if test "${ac_cv_header_stdc+set}" = set; then
18088   echo $ECHO_N "(cached) $ECHO_C" >&6
18089 else
18090   cat >"conftest.$ac_ext" <<_ACEOF
18091 #line 18091 "configure"
18092 #include "confdefs.h"
18093 #include <stdlib.h>
18094 #include <stdarg.h>
18095 #include <string.h>
18096 #include <float.h>
18097
18098 _ACEOF
18099 if { (eval echo "$as_me:18099: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18100   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18101   ac_status=$?
18102   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18103   rm -f conftest.er1
18104   cat conftest.err >&5
18105   echo "$as_me:18105: \$? = $ac_status" >&5
18106   (exit "$ac_status"); } >/dev/null; then
18107   if test -s conftest.err; then
18108     ac_cpp_err=$ac_c_preproc_warn_flag
18109   else
18110     ac_cpp_err=
18111   fi
18112 else
18113   ac_cpp_err=yes
18114 fi
18115 if test -z "$ac_cpp_err"; then
18116   ac_cv_header_stdc=yes
18117 else
18118   echo "$as_me: failed program was:" >&5
18119   cat "conftest.$ac_ext" >&5
18120   ac_cv_header_stdc=no
18121 fi
18122 rm -f conftest.err "conftest.$ac_ext"
18123
18124 if test $ac_cv_header_stdc = yes; then
18125   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
18126   cat >"conftest.$ac_ext" <<_ACEOF
18127 #line 18127 "configure"
18128 #include "confdefs.h"
18129 #include <string.h>
18130
18131 _ACEOF
18132 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18133   $EGREP "memchr" >/dev/null 2>&1; then
18134   :
18135 else
18136   ac_cv_header_stdc=no
18137 fi
18138 rm -rf conftest*
18139
18140 fi
18141
18142 if test $ac_cv_header_stdc = yes; then
18143   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
18144   cat >"conftest.$ac_ext" <<_ACEOF
18145 #line 18145 "configure"
18146 #include "confdefs.h"
18147 #include <stdlib.h>
18148
18149 _ACEOF
18150 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18151   $EGREP "free" >/dev/null 2>&1; then
18152   :
18153 else
18154   ac_cv_header_stdc=no
18155 fi
18156 rm -rf conftest*
18157
18158 fi
18159
18160 if test $ac_cv_header_stdc = yes; then
18161   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
18162   if test "$cross_compiling" = yes; then
18163   :
18164 else
18165   cat >"conftest.$ac_ext" <<_ACEOF
18166 #line 18166 "configure"
18167 #include "confdefs.h"
18168 #include <ctype.h>
18169 #if ((' ' & 0x0FF) == 0x020)
18170 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
18171 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
18172 #else
18173 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
18174                      || ('j' <= (c) && (c) <= 'r') \
18175                      || ('s' <= (c) && (c) <= 'z'))
18176 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
18177 #endif
18178
18179 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
18180 int
18181 main (void)
18182 {
18183   int i;
18184   for (i = 0; i < 256; i++)
18185     if (XOR (islower (i), ISLOWER (i))
18186         || toupper (i) != TOUPPER (i))
18187       $ac_main_return(2);
18188   $ac_main_return (0);
18189 }
18190 _ACEOF
18191 rm -f "conftest$ac_exeext"
18192 if { (eval echo "$as_me:18192: \"$ac_link\"") >&5
18193   (eval $ac_link) 2>&5
18194   ac_status=$?
18195   echo "$as_me:18195: \$? = $ac_status" >&5
18196   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
18197   { (eval echo "$as_me:18197: \"$ac_try\"") >&5
18198   (eval $ac_try) 2>&5
18199   ac_status=$?
18200   echo "$as_me:18200: \$? = $ac_status" >&5
18201   (exit "$ac_status"); }; }; then
18202   :
18203 else
18204   echo "$as_me: program exited with status $ac_status" >&5
18205 echo "$as_me: failed program was:" >&5
18206 cat "conftest.$ac_ext" >&5
18207 ac_cv_header_stdc=no
18208 fi
18209 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
18210 fi
18211 fi
18212 fi
18213 echo "$as_me:18213: result: $ac_cv_header_stdc" >&5
18214 echo "${ECHO_T}$ac_cv_header_stdc" >&6
18215 if test $ac_cv_header_stdc = yes; then
18216
18217 cat >>confdefs.h <<\EOF
18218 #define STDC_HEADERS 1
18219 EOF
18220
18221 fi
18222
18223 echo "$as_me:18223: checking whether time.h and sys/time.h may both be included" >&5
18224 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
18225 if test "${ac_cv_header_time+set}" = set; then
18226   echo $ECHO_N "(cached) $ECHO_C" >&6
18227 else
18228   cat >"conftest.$ac_ext" <<_ACEOF
18229 #line 18229 "configure"
18230 #include "confdefs.h"
18231 #include <sys/types.h>
18232 #include <sys/time.h>
18233 #include <time.h>
18234
18235 int
18236 main (void)
18237 {
18238 if ((struct tm *) 0)
18239 return 0;
18240   ;
18241   return 0;
18242 }
18243 _ACEOF
18244 rm -f "conftest.$ac_objext"
18245 if { (eval echo "$as_me:18245: \"$ac_compile\"") >&5
18246   (eval $ac_compile) 2>&5
18247   ac_status=$?
18248   echo "$as_me:18248: \$? = $ac_status" >&5
18249   (exit "$ac_status"); } &&
18250          { ac_try='test -s "conftest.$ac_objext"'
18251   { (eval echo "$as_me:18251: \"$ac_try\"") >&5
18252   (eval $ac_try) 2>&5
18253   ac_status=$?
18254   echo "$as_me:18254: \$? = $ac_status" >&5
18255   (exit "$ac_status"); }; }; then
18256   ac_cv_header_time=yes
18257 else
18258   echo "$as_me: failed program was:" >&5
18259 cat "conftest.$ac_ext" >&5
18260 ac_cv_header_time=no
18261 fi
18262 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18263 fi
18264 echo "$as_me:18264: result: $ac_cv_header_time" >&5
18265 echo "${ECHO_T}$ac_cv_header_time" >&6
18266 if test $ac_cv_header_time = yes; then
18267
18268 cat >>confdefs.h <<\EOF
18269 #define TIME_WITH_SYS_TIME 1
18270 EOF
18271
18272 fi
18273
18274 for ac_header in \
18275 getopt.h \
18276 locale.h \
18277 math.h \
18278 stdarg.h \
18279 stdint.h \
18280 sys/ioctl.h \
18281 sys/select.h \
18282 sys/time.h \
18283 termios.h \
18284 unistd.h \
18285
18286 do
18287 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18288 echo "$as_me:18288: checking for $ac_header" >&5
18289 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18290 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18291   echo $ECHO_N "(cached) $ECHO_C" >&6
18292 else
18293   cat >"conftest.$ac_ext" <<_ACEOF
18294 #line 18294 "configure"
18295 #include "confdefs.h"
18296 #include <$ac_header>
18297 _ACEOF
18298 if { (eval echo "$as_me:18298: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18299   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18300   ac_status=$?
18301   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18302   rm -f conftest.er1
18303   cat conftest.err >&5
18304   echo "$as_me:18304: \$? = $ac_status" >&5
18305   (exit "$ac_status"); } >/dev/null; then
18306   if test -s conftest.err; then
18307     ac_cpp_err=$ac_c_preproc_warn_flag
18308   else
18309     ac_cpp_err=
18310   fi
18311 else
18312   ac_cpp_err=yes
18313 fi
18314 if test -z "$ac_cpp_err"; then
18315   eval "$as_ac_Header=yes"
18316 else
18317   echo "$as_me: failed program was:" >&5
18318   cat "conftest.$ac_ext" >&5
18319   eval "$as_ac_Header=no"
18320 fi
18321 rm -f conftest.err "conftest.$ac_ext"
18322 fi
18323 echo "$as_me:18323: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18324 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18325 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18326   cat >>confdefs.h <<EOF
18327 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18328 EOF
18329
18330 fi
18331 done
18332
18333 for ac_header in unistd.h getopt.h
18334 do
18335 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18336 echo "$as_me:18336: checking for $ac_header" >&5
18337 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18338 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18339   echo $ECHO_N "(cached) $ECHO_C" >&6
18340 else
18341   cat >"conftest.$ac_ext" <<_ACEOF
18342 #line 18342 "configure"
18343 #include "confdefs.h"
18344 #include <$ac_header>
18345 _ACEOF
18346 if { (eval echo "$as_me:18346: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18347   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18348   ac_status=$?
18349   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18350   rm -f conftest.er1
18351   cat conftest.err >&5
18352   echo "$as_me:18352: \$? = $ac_status" >&5
18353   (exit "$ac_status"); } >/dev/null; then
18354   if test -s conftest.err; then
18355     ac_cpp_err=$ac_c_preproc_warn_flag
18356   else
18357     ac_cpp_err=
18358   fi
18359 else
18360   ac_cpp_err=yes
18361 fi
18362 if test -z "$ac_cpp_err"; then
18363   eval "$as_ac_Header=yes"
18364 else
18365   echo "$as_me: failed program was:" >&5
18366   cat "conftest.$ac_ext" >&5
18367   eval "$as_ac_Header=no"
18368 fi
18369 rm -f conftest.err "conftest.$ac_ext"
18370 fi
18371 echo "$as_me:18371: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18372 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18373 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18374   cat >>confdefs.h <<EOF
18375 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18376 EOF
18377
18378 fi
18379 done
18380
18381 echo "$as_me:18381: checking for header declaring getopt variables" >&5
18382 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
18383 if test "${cf_cv_getopt_header+set}" = set; then
18384   echo $ECHO_N "(cached) $ECHO_C" >&6
18385 else
18386
18387 cf_cv_getopt_header=none
18388 for cf_header in stdio.h stdlib.h unistd.h getopt.h
18389 do
18390 cat >"conftest.$ac_ext" <<_ACEOF
18391 #line 18391 "configure"
18392 #include "confdefs.h"
18393
18394 #include <$cf_header>
18395 int
18396 main (void)
18397 {
18398 int x = optind; char *y = optarg; (void)x; (void)y
18399   ;
18400   return 0;
18401 }
18402 _ACEOF
18403 rm -f "conftest.$ac_objext"
18404 if { (eval echo "$as_me:18404: \"$ac_compile\"") >&5
18405   (eval $ac_compile) 2>&5
18406   ac_status=$?
18407   echo "$as_me:18407: \$? = $ac_status" >&5
18408   (exit "$ac_status"); } &&
18409          { ac_try='test -s "conftest.$ac_objext"'
18410   { (eval echo "$as_me:18410: \"$ac_try\"") >&5
18411   (eval $ac_try) 2>&5
18412   ac_status=$?
18413   echo "$as_me:18413: \$? = $ac_status" >&5
18414   (exit "$ac_status"); }; }; then
18415   cf_cv_getopt_header=$cf_header
18416  break
18417 else
18418   echo "$as_me: failed program was:" >&5
18419 cat "conftest.$ac_ext" >&5
18420 fi
18421 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18422 done
18423
18424 fi
18425 echo "$as_me:18425: result: $cf_cv_getopt_header" >&5
18426 echo "${ECHO_T}$cf_cv_getopt_header" >&6
18427 if test "$cf_cv_getopt_header" != none ; then
18428
18429 cat >>confdefs.h <<\EOF
18430 #define HAVE_GETOPT_HEADER 1
18431 EOF
18432
18433 fi
18434 if test "$cf_cv_getopt_header" = getopt.h ; then
18435
18436 cat >>confdefs.h <<\EOF
18437 #define NEED_GETOPT_H 1
18438 EOF
18439
18440 fi
18441
18442 for ac_func in \
18443 cfmakeraw \
18444 getopt \
18445 gettimeofday \
18446 snprintf \
18447 strdup \
18448 strstr \
18449 tsearch \
18450
18451 do
18452 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18453 echo "$as_me:18453: checking for $ac_func" >&5
18454 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18455 if eval "test \"\${$as_ac_var+set}\" = set"; then
18456   echo $ECHO_N "(cached) $ECHO_C" >&6
18457 else
18458   cat >"conftest.$ac_ext" <<_ACEOF
18459 #line 18459 "configure"
18460 #include "confdefs.h"
18461 #define $ac_func autoconf_temporary
18462 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18463 #undef $ac_func
18464
18465 #ifdef __cplusplus
18466 extern "C"
18467 #endif
18468
18469 /* We use char because int might match the return type of a gcc2
18470    builtin and then its argument prototype would still apply.  */
18471 char $ac_func (void);
18472
18473 int
18474 main (void)
18475 {
18476
18477 /* The GNU C library defines stubs for functions which it implements
18478     to always fail with ENOSYS.  Some functions are actually named
18479     something starting with __ and the normal name is an alias.  */
18480 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18481 #error found stub for $ac_func
18482 #endif
18483
18484         return $ac_func ();
18485   ;
18486   return 0;
18487 }
18488 _ACEOF
18489 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18490 if { (eval echo "$as_me:18490: \"$ac_link\"") >&5
18491   (eval $ac_link) 2>&5
18492   ac_status=$?
18493   echo "$as_me:18493: \$? = $ac_status" >&5
18494   (exit "$ac_status"); } &&
18495          { ac_try='test -s "conftest$ac_exeext"'
18496   { (eval echo "$as_me:18496: \"$ac_try\"") >&5
18497   (eval $ac_try) 2>&5
18498   ac_status=$?
18499   echo "$as_me:18499: \$? = $ac_status" >&5
18500   (exit "$ac_status"); }; }; then
18501   eval "$as_ac_var=yes"
18502 else
18503   echo "$as_me: failed program was:" >&5
18504 cat "conftest.$ac_ext" >&5
18505 eval "$as_ac_var=no"
18506 fi
18507 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18508 fi
18509 echo "$as_me:18509: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18510 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18511 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18512   cat >>confdefs.h <<EOF
18513 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18514 EOF
18515
18516 fi
18517 done
18518
18519 # use a compile-check to work with ncurses*-config and subdirectory includes
18520 echo "$as_me:18520: checking if we can use termcap.h" >&5
18521 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18522 if test "${cf_cv_have_termcap_h+set}" = set; then
18523   echo $ECHO_N "(cached) $ECHO_C" >&6
18524 else
18525
18526         cat >"conftest.$ac_ext" <<_ACEOF
18527 #line 18527 "configure"
18528 #include "confdefs.h"
18529
18530 #include <curses.h>
18531 #ifdef NCURSES_VERSION
18532 #undef NCURSES_VERSION
18533 #endif
18534 #include <termcap.h>
18535 #ifndef NCURSES_VERSION
18536 #error wrong header
18537 #endif
18538
18539 int
18540 main (void)
18541 {
18542 return 0;
18543   ;
18544   return 0;
18545 }
18546 _ACEOF
18547 rm -f "conftest.$ac_objext"
18548 if { (eval echo "$as_me:18548: \"$ac_compile\"") >&5
18549   (eval $ac_compile) 2>&5
18550   ac_status=$?
18551   echo "$as_me:18551: \$? = $ac_status" >&5
18552   (exit "$ac_status"); } &&
18553          { ac_try='test -s "conftest.$ac_objext"'
18554   { (eval echo "$as_me:18554: \"$ac_try\"") >&5
18555   (eval $ac_try) 2>&5
18556   ac_status=$?
18557   echo "$as_me:18557: \$? = $ac_status" >&5
18558   (exit "$ac_status"); }; }; then
18559   cf_cv_have_termcap_h=yes
18560 else
18561   echo "$as_me: failed program was:" >&5
18562 cat "conftest.$ac_ext" >&5
18563 cf_cv_have_termcap_h=no
18564 fi
18565 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18566 fi
18567 echo "$as_me:18567: result: $cf_cv_have_termcap_h" >&5
18568 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18569 if test "x$cf_cv_have_termcap_h" = xyes
18570 then
18571
18572 cat >>confdefs.h <<\EOF
18573 #define HAVE_TERMCAP_H 1
18574 EOF
18575
18576 else
18577 echo "$as_me:18577: checking if we can use ncurses/termcap.h" >&5
18578 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18579 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18580   echo $ECHO_N "(cached) $ECHO_C" >&6
18581 else
18582
18583         cat >"conftest.$ac_ext" <<_ACEOF
18584 #line 18584 "configure"
18585 #include "confdefs.h"
18586
18587 #include <ncurses/curses.h>
18588 #ifdef NCURSES_VERSION
18589 #undef NCURSES_VERSION
18590 #endif
18591 #include <ncurses/termcap.h>
18592 #ifndef NCURSES_VERSION
18593 #error wrong header
18594 #endif
18595
18596 int
18597 main (void)
18598 {
18599 return 0;
18600   ;
18601   return 0;
18602 }
18603 _ACEOF
18604 rm -f "conftest.$ac_objext"
18605 if { (eval echo "$as_me:18605: \"$ac_compile\"") >&5
18606   (eval $ac_compile) 2>&5
18607   ac_status=$?
18608   echo "$as_me:18608: \$? = $ac_status" >&5
18609   (exit "$ac_status"); } &&
18610          { ac_try='test -s "conftest.$ac_objext"'
18611   { (eval echo "$as_me:18611: \"$ac_try\"") >&5
18612   (eval $ac_try) 2>&5
18613   ac_status=$?
18614   echo "$as_me:18614: \$? = $ac_status" >&5
18615   (exit "$ac_status"); }; }; then
18616   cf_cv_have_ncurses_termcap_h=yes
18617 else
18618   echo "$as_me: failed program was:" >&5
18619 cat "conftest.$ac_ext" >&5
18620 cf_cv_have_ncurses_termcap_h=no
18621 fi
18622 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18623 fi
18624 echo "$as_me:18624: result: $cf_cv_have_ncurses_termcap_h" >&5
18625 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18626 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18627 cat >>confdefs.h <<\EOF
18628 #define HAVE_NCURSES_TERMCAP_H 1
18629 EOF
18630
18631 fi
18632
18633 if test "x$ac_cv_func_getopt" = xno; then
18634         { { echo "$as_me:18634: error: getopt is required for building programs" >&5
18635 echo "$as_me: error: getopt is required for building programs" >&2;}
18636    { (exit 1); exit 1; }; }
18637 fi
18638
18639 if test "$cf_enable_widec" = yes; then
18640
18641 for ac_func in \
18642 mblen \
18643 mbrlen \
18644 mbrtowc \
18645 mbsrtowcs \
18646 mbstowcs \
18647 mbtowc \
18648 wcsrtombs \
18649 wcstombs \
18650
18651 do
18652 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18653 echo "$as_me:18653: checking for $ac_func" >&5
18654 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18655 if eval "test \"\${$as_ac_var+set}\" = set"; then
18656   echo $ECHO_N "(cached) $ECHO_C" >&6
18657 else
18658   cat >"conftest.$ac_ext" <<_ACEOF
18659 #line 18659 "configure"
18660 #include "confdefs.h"
18661 #define $ac_func autoconf_temporary
18662 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18663 #undef $ac_func
18664
18665 #ifdef __cplusplus
18666 extern "C"
18667 #endif
18668
18669 /* We use char because int might match the return type of a gcc2
18670    builtin and then its argument prototype would still apply.  */
18671 char $ac_func (void);
18672
18673 int
18674 main (void)
18675 {
18676
18677 /* The GNU C library defines stubs for functions which it implements
18678     to always fail with ENOSYS.  Some functions are actually named
18679     something starting with __ and the normal name is an alias.  */
18680 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18681 #error found stub for $ac_func
18682 #endif
18683
18684         return $ac_func ();
18685   ;
18686   return 0;
18687 }
18688 _ACEOF
18689 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18690 if { (eval echo "$as_me:18690: \"$ac_link\"") >&5
18691   (eval $ac_link) 2>&5
18692   ac_status=$?
18693   echo "$as_me:18693: \$? = $ac_status" >&5
18694   (exit "$ac_status"); } &&
18695          { ac_try='test -s "conftest$ac_exeext"'
18696   { (eval echo "$as_me:18696: \"$ac_try\"") >&5
18697   (eval $ac_try) 2>&5
18698   ac_status=$?
18699   echo "$as_me:18699: \$? = $ac_status" >&5
18700   (exit "$ac_status"); }; }; then
18701   eval "$as_ac_var=yes"
18702 else
18703   echo "$as_me: failed program was:" >&5
18704 cat "conftest.$ac_ext" >&5
18705 eval "$as_ac_var=no"
18706 fi
18707 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18708 fi
18709 echo "$as_me:18709: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18710 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18711 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18712   cat >>confdefs.h <<EOF
18713 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18714 EOF
18715
18716 fi
18717 done
18718
18719 fi
18720
18721 echo "$as_me:18721: checking definition to turn on extended curses functions" >&5
18722 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18723 if test "${cf_cv_need_xopen_extension+set}" = set; then
18724   echo $ECHO_N "(cached) $ECHO_C" >&6
18725 else
18726
18727 cf_cv_need_xopen_extension=unknown
18728 cat >"conftest.$ac_ext" <<_ACEOF
18729 #line 18729 "configure"
18730 #include "confdefs.h"
18731
18732 #include <stdlib.h>
18733 #include <${cf_cv_ncurses_header:-curses.h}>
18734 int
18735 main (void)
18736 {
18737
18738 #if defined(NCURSES_VERSION_PATCH)
18739 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18740         make an error
18741 #endif
18742 #endif
18743 #ifdef NCURSES_WIDECHAR
18744 make an error   /* prefer to fall-through on the second checks */
18745 #endif
18746         cchar_t check;
18747         int check2 = curs_set((int)sizeof(check));
18748         long x = winnstr(stdscr, "", 0);
18749         int x1, y1;
18750         (void)check2;
18751         getbegyx(stdscr, y1, x1);
18752         (void)x;
18753         (void)y1;
18754         (void)x1;
18755
18756   ;
18757   return 0;
18758 }
18759 _ACEOF
18760 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18761 if { (eval echo "$as_me:18761: \"$ac_link\"") >&5
18762   (eval $ac_link) 2>&5
18763   ac_status=$?
18764   echo "$as_me:18764: \$? = $ac_status" >&5
18765   (exit "$ac_status"); } &&
18766          { ac_try='test -s "conftest$ac_exeext"'
18767   { (eval echo "$as_me:18767: \"$ac_try\"") >&5
18768   (eval $ac_try) 2>&5
18769   ac_status=$?
18770   echo "$as_me:18770: \$? = $ac_status" >&5
18771   (exit "$ac_status"); }; }; then
18772   cf_cv_need_xopen_extension=none
18773 else
18774   echo "$as_me: failed program was:" >&5
18775 cat "conftest.$ac_ext" >&5
18776
18777         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18778         do
18779                 cat >"conftest.$ac_ext" <<_ACEOF
18780 #line 18780 "configure"
18781 #include "confdefs.h"
18782
18783 #define $cf_try_xopen_extension 1
18784 #include <stdlib.h>
18785 #include <${cf_cv_ncurses_header:-curses.h}>
18786 int
18787 main (void)
18788 {
18789
18790                 cchar_t check;
18791                 int check2 = curs_set((int)sizeof(check));
18792                 long x = winnstr(stdscr, "", 0);
18793                 int x1, y1;
18794                 getbegyx(stdscr, y1, x1);
18795                 (void)check2;
18796                 (void)x;
18797                 (void)y1;
18798                 (void)x1;
18799
18800   ;
18801   return 0;
18802 }
18803 _ACEOF
18804 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18805 if { (eval echo "$as_me:18805: \"$ac_link\"") >&5
18806   (eval $ac_link) 2>&5
18807   ac_status=$?
18808   echo "$as_me:18808: \$? = $ac_status" >&5
18809   (exit "$ac_status"); } &&
18810          { ac_try='test -s "conftest$ac_exeext"'
18811   { (eval echo "$as_me:18811: \"$ac_try\"") >&5
18812   (eval $ac_try) 2>&5
18813   ac_status=$?
18814   echo "$as_me:18814: \$? = $ac_status" >&5
18815   (exit "$ac_status"); }; }; then
18816   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18817 else
18818   echo "$as_me: failed program was:" >&5
18819 cat "conftest.$ac_ext" >&5
18820 fi
18821 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18822         done
18823
18824 fi
18825 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18826
18827 fi
18828 echo "$as_me:18828: result: $cf_cv_need_xopen_extension" >&5
18829 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18830
18831 case "$cf_cv_need_xopen_extension" in
18832 (*_*)
18833
18834         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18835         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18836
18837         ;;
18838 esac
18839
18840 echo "$as_me:18840: checking for term.h" >&5
18841 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18842 if test "${cf_cv_term_header+set}" = set; then
18843   echo $ECHO_N "(cached) $ECHO_C" >&6
18844 else
18845
18846 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18847 # for <term.h> if we do not find the variant.
18848
18849 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18850
18851 case "${cf_cv_ncurses_header:-curses.h}" in
18852 (*/*)
18853         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18854         cf_header_list="$cf_header_item $cf_header_list"
18855         ;;
18856 esac
18857
18858 for cf_header in $cf_header_list
18859 do
18860         cat >"conftest.$ac_ext" <<_ACEOF
18861 #line 18861 "configure"
18862 #include "confdefs.h"
18863
18864 #include <${cf_cv_ncurses_header:-curses.h}>
18865 #include <${cf_header}>
18866 int
18867 main (void)
18868 {
18869 WINDOW *x; (void)x
18870   ;
18871   return 0;
18872 }
18873 _ACEOF
18874 rm -f "conftest.$ac_objext"
18875 if { (eval echo "$as_me:18875: \"$ac_compile\"") >&5
18876   (eval $ac_compile) 2>&5
18877   ac_status=$?
18878   echo "$as_me:18878: \$? = $ac_status" >&5
18879   (exit "$ac_status"); } &&
18880          { ac_try='test -s "conftest.$ac_objext"'
18881   { (eval echo "$as_me:18881: \"$ac_try\"") >&5
18882   (eval $ac_try) 2>&5
18883   ac_status=$?
18884   echo "$as_me:18884: \$? = $ac_status" >&5
18885   (exit "$ac_status"); }; }; then
18886   cf_cv_term_header=$cf_header
18887          break
18888 else
18889   echo "$as_me: failed program was:" >&5
18890 cat "conftest.$ac_ext" >&5
18891 cf_cv_term_header=no
18892 fi
18893 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18894 done
18895
18896 case "$cf_cv_term_header" in
18897 (no)
18898         # If curses is ncurses, some packagers still mess it up by trying to make
18899         # us use GNU termcap.  This handles the most common case.
18900         for cf_header in ncurses/term.h ncursesw/term.h
18901         do
18902                 cat >"conftest.$ac_ext" <<_ACEOF
18903 #line 18903 "configure"
18904 #include "confdefs.h"
18905
18906 #include <${cf_cv_ncurses_header:-curses.h}>
18907 #ifdef NCURSES_VERSION
18908 #include <${cf_header}>
18909 #else
18910 make an error
18911 #endif
18912 int
18913 main (void)
18914 {
18915 WINDOW *x; (void)x
18916   ;
18917   return 0;
18918 }
18919 _ACEOF
18920 rm -f "conftest.$ac_objext"
18921 if { (eval echo "$as_me:18921: \"$ac_compile\"") >&5
18922   (eval $ac_compile) 2>&5
18923   ac_status=$?
18924   echo "$as_me:18924: \$? = $ac_status" >&5
18925   (exit "$ac_status"); } &&
18926          { ac_try='test -s "conftest.$ac_objext"'
18927   { (eval echo "$as_me:18927: \"$ac_try\"") >&5
18928   (eval $ac_try) 2>&5
18929   ac_status=$?
18930   echo "$as_me:18930: \$? = $ac_status" >&5
18931   (exit "$ac_status"); }; }; then
18932   cf_cv_term_header=$cf_header
18933                          break
18934 else
18935   echo "$as_me: failed program was:" >&5
18936 cat "conftest.$ac_ext" >&5
18937 cf_cv_term_header=no
18938 fi
18939 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18940         done
18941         ;;
18942 esac
18943
18944 fi
18945 echo "$as_me:18945: result: $cf_cv_term_header" >&5
18946 echo "${ECHO_T}$cf_cv_term_header" >&6
18947
18948 case "$cf_cv_term_header" in
18949 (term.h)
18950
18951 cat >>confdefs.h <<\EOF
18952 #define HAVE_TERM_H 1
18953 EOF
18954
18955         ;;
18956 (ncurses/term.h)
18957
18958 cat >>confdefs.h <<\EOF
18959 #define HAVE_NCURSES_TERM_H 1
18960 EOF
18961
18962         ;;
18963 (ncursesw/term.h)
18964
18965 cat >>confdefs.h <<\EOF
18966 #define HAVE_NCURSESW_TERM_H 1
18967 EOF
18968
18969         ;;
18970 esac
18971
18972 echo "$as_me:18972: checking for unctrl.h" >&5
18973 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18974 if test "${cf_cv_unctrl_header+set}" = set; then
18975   echo $ECHO_N "(cached) $ECHO_C" >&6
18976 else
18977
18978 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18979 # for <unctrl.h> if we do not find the variant.
18980
18981 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18982
18983 case "${cf_cv_ncurses_header:-curses.h}" in
18984 (*/*)
18985         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18986         cf_header_list="$cf_header_item $cf_header_list"
18987         ;;
18988 esac
18989
18990 for cf_header in $cf_header_list
18991 do
18992         cat >"conftest.$ac_ext" <<_ACEOF
18993 #line 18993 "configure"
18994 #include "confdefs.h"
18995
18996 #include <${cf_cv_ncurses_header:-curses.h}>
18997 #include <${cf_header}>
18998 int
18999 main (void)
19000 {
19001 WINDOW *x; (void)x
19002   ;
19003   return 0;
19004 }
19005 _ACEOF
19006 rm -f "conftest.$ac_objext"
19007 if { (eval echo "$as_me:19007: \"$ac_compile\"") >&5
19008   (eval $ac_compile) 2>&5
19009   ac_status=$?
19010   echo "$as_me:19010: \$? = $ac_status" >&5
19011   (exit "$ac_status"); } &&
19012          { ac_try='test -s "conftest.$ac_objext"'
19013   { (eval echo "$as_me:19013: \"$ac_try\"") >&5
19014   (eval $ac_try) 2>&5
19015   ac_status=$?
19016   echo "$as_me:19016: \$? = $ac_status" >&5
19017   (exit "$ac_status"); }; }; then
19018   cf_cv_unctrl_header=$cf_header
19019          break
19020 else
19021   echo "$as_me: failed program was:" >&5
19022 cat "conftest.$ac_ext" >&5
19023 cf_cv_unctrl_header=no
19024 fi
19025 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19026 done
19027
19028 fi
19029 echo "$as_me:19029: result: $cf_cv_unctrl_header" >&5
19030 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
19031
19032 case "$cf_cv_unctrl_header" in
19033 (no)
19034         { echo "$as_me:19034: WARNING: unctrl.h header not found" >&5
19035 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
19036         ;;
19037 esac
19038
19039 case "$cf_cv_unctrl_header" in
19040 (unctrl.h)
19041
19042 cat >>confdefs.h <<\EOF
19043 #define HAVE_UNCTRL_H 1
19044 EOF
19045
19046         ;;
19047 (ncurses/unctrl.h)
19048
19049 cat >>confdefs.h <<\EOF
19050 #define HAVE_NCURSES_UNCTRL_H 1
19051 EOF
19052
19053         ;;
19054 (ncursesw/unctrl.h)
19055
19056 cat >>confdefs.h <<\EOF
19057 #define HAVE_NCURSESW_UNCTRL_H 1
19058 EOF
19059
19060         ;;
19061 esac
19062
19063 for cf_func in \
19064 alloc_pair \
19065 assume_default_colors \
19066 chgat \
19067 color_content \
19068 color_set \
19069 copywin \
19070 curses_trace \
19071 delscreen \
19072 dupwin \
19073 exit_curses \
19074 exit_terminfo \
19075 filter \
19076 getbegx \
19077 getcurx \
19078 getmaxx \
19079 getnstr \
19080 getparx \
19081 getwin \
19082 halfdelay \
19083 init_extended_color \
19084 mvderwin \
19085 mvvline \
19086 mvwin \
19087 mvwvline \
19088 napms \
19089 newpad \
19090 putwin \
19091 reset_color_pairs \
19092 resize_term \
19093 resizeterm \
19094 restartterm \
19095 ripoffline \
19096 scr_dump \
19097 setupterm \
19098 slk_color \
19099 slk_init \
19100 termattrs \
19101 termname \
19102 tgetent \
19103 tigetnum \
19104 tigetstr \
19105 tputs_sp \
19106 typeahead \
19107 unget_wch \
19108 use_default_colors \
19109 use_env \
19110 use_extended_names \
19111 use_screen \
19112 use_window \
19113 vid_puts \
19114 vidputs \
19115 vsscanf \
19116 vw_printw \
19117 wchgat \
19118 winsdelln \
19119 winsstr \
19120 wresize \
19121 wsyncdown \
19122 _tracef \
19123
19124 do
19125
19126 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19127
19128         echo "$as_me:19128: checking for ${cf_func}" >&5
19129 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19130
19131 echo "${as_me:-configure}:19131: testing ${cf_func} ..." 1>&5
19132
19133         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19134   echo $ECHO_N "(cached) $ECHO_C" >&6
19135 else
19136
19137                 eval cf_result='$ac_cv_func_'$cf_func
19138                 if test ".$cf_result" != ".no"; then
19139                         cat >"conftest.$ac_ext" <<_ACEOF
19140 #line 19140 "configure"
19141 #include "confdefs.h"
19142
19143 #ifdef HAVE_XCURSES
19144 #include <xcurses.h>
19145 char * XCursesProgramName = "test";
19146 #else
19147 #include <${cf_cv_ncurses_header:-curses.h}>
19148 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19149 #include <ncursesw/term.h>
19150 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19151 #include <ncurses/term.h>
19152 #elif defined(HAVE_TERM_H)
19153 #include <term.h>
19154 #endif
19155 #endif
19156
19157 int
19158 main (void)
19159 {
19160
19161 #ifndef ${cf_func}
19162 long foo = (long)(&${cf_func});
19163 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19164 if (foo + 1234L > 5678L)
19165         ${cf_cv_main_return:-return}(foo != 0);
19166 #endif
19167
19168   ;
19169   return 0;
19170 }
19171 _ACEOF
19172 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19173 if { (eval echo "$as_me:19173: \"$ac_link\"") >&5
19174   (eval $ac_link) 2>&5
19175   ac_status=$?
19176   echo "$as_me:19176: \$? = $ac_status" >&5
19177   (exit "$ac_status"); } &&
19178          { ac_try='test -s "conftest$ac_exeext"'
19179   { (eval echo "$as_me:19179: \"$ac_try\"") >&5
19180   (eval $ac_try) 2>&5
19181   ac_status=$?
19182   echo "$as_me:19182: \$? = $ac_status" >&5
19183   (exit "$ac_status"); }; }; then
19184   cf_result=yes
19185 else
19186   echo "$as_me: failed program was:" >&5
19187 cat "conftest.$ac_ext" >&5
19188 cf_result=no
19189 fi
19190 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19191                 fi
19192                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19193
19194 fi
19195
19196         # use the computed/retrieved cache-value:
19197         eval 'cf_result=$cf_cv_func_'$cf_func
19198         echo "$as_me:19198: result: $cf_result" >&5
19199 echo "${ECHO_T}$cf_result" >&6
19200         if test "$cf_result" != no; then
19201                 cat >>confdefs.h <<EOF
19202 #define HAVE_${cf_tr_func} 1
19203 EOF
19204
19205         fi
19206 done
19207
19208 for cf_func in tputs
19209 do
19210
19211 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19212
19213         echo "$as_me:19213: checking for ${cf_func}" >&5
19214 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19215
19216 echo "${as_me:-configure}:19216: testing ${cf_func} ..." 1>&5
19217
19218         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19219   echo $ECHO_N "(cached) $ECHO_C" >&6
19220 else
19221
19222                 eval cf_result='$ac_cv_func_'$cf_func
19223                 if test ".$cf_result" != ".no"; then
19224                         cat >"conftest.$ac_ext" <<_ACEOF
19225 #line 19225 "configure"
19226 #include "confdefs.h"
19227
19228 #ifdef HAVE_XCURSES
19229 #include <xcurses.h>
19230 char * XCursesProgramName = "test";
19231 #else
19232 #include <${cf_cv_ncurses_header:-curses.h}>
19233 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19234 #include <ncursesw/term.h>
19235 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19236 #include <ncurses/term.h>
19237 #elif defined(HAVE_TERM_H)
19238 #include <term.h>
19239 #endif
19240 #endif
19241
19242 int
19243 main (void)
19244 {
19245
19246 #ifndef ${cf_func}
19247 long foo = (long)(&${cf_func});
19248 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19249 if (foo + 1234L > 5678L)
19250         ${cf_cv_main_return:-return}(foo != 0);
19251 #endif
19252
19253   ;
19254   return 0;
19255 }
19256 _ACEOF
19257 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19258 if { (eval echo "$as_me:19258: \"$ac_link\"") >&5
19259   (eval $ac_link) 2>&5
19260   ac_status=$?
19261   echo "$as_me:19261: \$? = $ac_status" >&5
19262   (exit "$ac_status"); } &&
19263          { ac_try='test -s "conftest$ac_exeext"'
19264   { (eval echo "$as_me:19264: \"$ac_try\"") >&5
19265   (eval $ac_try) 2>&5
19266   ac_status=$?
19267   echo "$as_me:19267: \$? = $ac_status" >&5
19268   (exit "$ac_status"); }; }; then
19269   cf_result=yes
19270 else
19271   echo "$as_me: failed program was:" >&5
19272 cat "conftest.$ac_ext" >&5
19273 cf_result=no
19274 fi
19275 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19276                 fi
19277                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19278
19279 fi
19280
19281         # use the computed/retrieved cache-value:
19282         eval 'cf_result=$cf_cv_func_'$cf_func
19283         echo "$as_me:19283: result: $cf_result" >&5
19284 echo "${ECHO_T}$cf_result" >&6
19285         if test "$cf_result" != no; then
19286                 cat >>confdefs.h <<EOF
19287 #define HAVE_${cf_tr_func} 1
19288 EOF
19289
19290         fi
19291 done
19292
19293 if test "x$cf_cv_func_tputs" = xyes
19294 then
19295         cf_done=no
19296         for cf_arg in int char
19297         do
19298                 for cf_ret in int void
19299                 do
19300                         if test "$cf_ret" = void
19301                         then
19302                                 cf_return="/* nothing */"
19303                         else
19304                                 cf_return="return value"
19305                         fi
19306                         cat >"conftest.$ac_ext" <<_ACEOF
19307 #line 19307 "configure"
19308 #include "confdefs.h"
19309
19310 #include <${cf_cv_ncurses_header:-curses.h}>
19311 #include <$cf_cv_term_header>
19312
19313 static $cf_ret outc($cf_arg value) { $cf_return; }
19314
19315 int
19316 main (void)
19317 {
19318
19319         tputs("hello", 0, outc);
19320         ${cf_cv_main_return:-return}(0);
19321
19322   ;
19323   return 0;
19324 }
19325 _ACEOF
19326 rm -f "conftest.$ac_objext"
19327 if { (eval echo "$as_me:19327: \"$ac_compile\"") >&5
19328   (eval $ac_compile) 2>&5
19329   ac_status=$?
19330   echo "$as_me:19330: \$? = $ac_status" >&5
19331   (exit "$ac_status"); } &&
19332          { ac_try='test -s "conftest.$ac_objext"'
19333   { (eval echo "$as_me:19333: \"$ac_try\"") >&5
19334   (eval $ac_try) 2>&5
19335   ac_status=$?
19336   echo "$as_me:19336: \$? = $ac_status" >&5
19337   (exit "$ac_status"); }; }; then
19338
19339                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
19340
19341 echo "${as_me:-configure}:19341: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
19342
19343                 cat >>confdefs.h <<EOF
19344 #define TPUTS_ARG               $cf_arg
19345 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
19346 #define TPUTS_RETURN(value)     $cf_return
19347 EOF
19348                 cf_done=yes
19349                 break
19350
19351 else
19352   echo "$as_me: failed program was:" >&5
19353 cat "conftest.$ac_ext" >&5
19354 fi
19355 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19356                 done
19357                 test "$cf_done" = yes && break
19358         done
19359 fi
19360
19361 echo "$as_me:19361: checking for ncurses extended functions" >&5
19362 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
19363 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
19364   echo $ECHO_N "(cached) $ECHO_C" >&6
19365 else
19366
19367 cat >"conftest.$ac_ext" <<_ACEOF
19368 #line 19368 "configure"
19369 #include "confdefs.h"
19370
19371 #include <${cf_cv_ncurses_header:-curses.h}>
19372 int
19373 main (void)
19374 {
19375
19376 int x = NCURSES_EXT_FUNCS
19377
19378   ;
19379   return 0;
19380 }
19381 _ACEOF
19382 rm -f "conftest.$ac_objext"
19383 if { (eval echo "$as_me:19383: \"$ac_compile\"") >&5
19384   (eval $ac_compile) 2>&5
19385   ac_status=$?
19386   echo "$as_me:19386: \$? = $ac_status" >&5
19387   (exit "$ac_status"); } &&
19388          { ac_try='test -s "conftest.$ac_objext"'
19389   { (eval echo "$as_me:19389: \"$ac_try\"") >&5
19390   (eval $ac_try) 2>&5
19391   ac_status=$?
19392   echo "$as_me:19392: \$? = $ac_status" >&5
19393   (exit "$ac_status"); }; }; then
19394   cf_cv_ncurses_ext_funcs=defined
19395 else
19396   echo "$as_me: failed program was:" >&5
19397 cat "conftest.$ac_ext" >&5
19398
19399 cat >"conftest.$ac_ext" <<_ACEOF
19400 #line 19400 "configure"
19401 #include "confdefs.h"
19402
19403 #include <${cf_cv_ncurses_header:-curses.h}>
19404 int
19405 main (void)
19406 {
19407
19408         (void) assume_default_colors (0, 0);
19409         (void) curses_version ();
19410         (void) define_key (0, 0);
19411         (void) is_term_resized (0, 0);
19412         (void) key_defined (0);
19413         (void) keybound (0, 0);
19414         (void) keyok (0, 0);
19415         (void) resize_term (0, 0);
19416         (void) resizeterm (0, 0);
19417         (void) use_default_colors ();
19418         (void) use_extended_names (0);
19419         (void) wresize (0, 0, 0);
19420   ;
19421   return 0;
19422 }
19423 _ACEOF
19424 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19425 if { (eval echo "$as_me:19425: \"$ac_link\"") >&5
19426   (eval $ac_link) 2>&5
19427   ac_status=$?
19428   echo "$as_me:19428: \$? = $ac_status" >&5
19429   (exit "$ac_status"); } &&
19430          { ac_try='test -s "conftest$ac_exeext"'
19431   { (eval echo "$as_me:19431: \"$ac_try\"") >&5
19432   (eval $ac_try) 2>&5
19433   ac_status=$?
19434   echo "$as_me:19434: \$? = $ac_status" >&5
19435   (exit "$ac_status"); }; }; then
19436   cf_cv_ncurses_ext_funcs=yes
19437 else
19438   echo "$as_me: failed program was:" >&5
19439 cat "conftest.$ac_ext" >&5
19440 cf_cv_ncurses_ext_funcs=no
19441 fi
19442 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19443
19444 fi
19445 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19446
19447 fi
19448 echo "$as_me:19448: result: $cf_cv_ncurses_ext_funcs" >&5
19449 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19450 test "$cf_cv_ncurses_ext_funcs" = yes &&
19451 cat >>confdefs.h <<\EOF
19452 #define NCURSES_EXT_FUNCS 1
19453 EOF
19454
19455 if test "$cf_enable_widec" = yes
19456 then
19457         # workaround for systems with ncurses before 20111029, due to change of
19458         # feature test macro from _XPG5 to _XOPEN_SOURCE
19459         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19460         then
19461                 cf_define_xpg5=no
19462                 echo "$as_me:19462: checking if _XPG5 should be defined to enable wide-characters" >&5
19463 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19464
19465                 cat >"conftest.$ac_ext" <<_ACEOF
19466 #line 19466 "configure"
19467 #include "confdefs.h"
19468
19469 #include <${cf_cv_ncurses_header:-curses.h}>
19470 int
19471 main (void)
19472 {
19473 int x = _XPG5
19474   ;
19475   return 0;
19476 }
19477 _ACEOF
19478 rm -f "conftest.$ac_objext"
19479 if { (eval echo "$as_me:19479: \"$ac_compile\"") >&5
19480   (eval $ac_compile) 2>&5
19481   ac_status=$?
19482   echo "$as_me:19482: \$? = $ac_status" >&5
19483   (exit "$ac_status"); } &&
19484          { ac_try='test -s "conftest.$ac_objext"'
19485   { (eval echo "$as_me:19485: \"$ac_try\"") >&5
19486   (eval $ac_try) 2>&5
19487   ac_status=$?
19488   echo "$as_me:19488: \$? = $ac_status" >&5
19489   (exit "$ac_status"); }; }; then
19490   :
19491 else
19492   echo "$as_me: failed program was:" >&5
19493 cat "conftest.$ac_ext" >&5
19494 cf_save_cppflags="$CPPFLAGS"
19495                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19496                          cat >"conftest.$ac_ext" <<_ACEOF
19497 #line 19497 "configure"
19498 #include "confdefs.h"
19499
19500 #include <${cf_cv_ncurses_header:-curses.h}>
19501 int
19502 main (void)
19503 {
19504 int x = _XPG5
19505   ;
19506   return 0;
19507 }
19508 _ACEOF
19509 rm -f "conftest.$ac_objext"
19510 if { (eval echo "$as_me:19510: \"$ac_compile\"") >&5
19511   (eval $ac_compile) 2>&5
19512   ac_status=$?
19513   echo "$as_me:19513: \$? = $ac_status" >&5
19514   (exit "$ac_status"); } &&
19515          { ac_try='test -s "conftest.$ac_objext"'
19516   { (eval echo "$as_me:19516: \"$ac_try\"") >&5
19517   (eval $ac_try) 2>&5
19518   ac_status=$?
19519   echo "$as_me:19519: \$? = $ac_status" >&5
19520   (exit "$ac_status"); }; }; then
19521   cf_define_xpg5=yes
19522 else
19523   echo "$as_me: failed program was:" >&5
19524 cat "conftest.$ac_ext" >&5
19525 fi
19526 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19527                          CPPFLAGS="$cf_save_cppflags"
19528 fi
19529 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19530                 echo "$as_me:19530: result: $cf_define_xpg5" >&5
19531 echo "${ECHO_T}$cf_define_xpg5" >&6
19532
19533                 if test "$cf_define_xpg5" = yes
19534                 then
19535                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19536                 fi
19537         fi
19538
19539         echo "$as_me:19539: checking for wide-character functions" >&5
19540 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19541 if test "${cf_cv_widechar_funcs+set}" = set; then
19542   echo $ECHO_N "(cached) $ECHO_C" >&6
19543 else
19544
19545         cat >"conftest.$ac_ext" <<_ACEOF
19546 #line 19546 "configure"
19547 #include "confdefs.h"
19548
19549 #include <${cf_cv_ncurses_header:-curses.h}>
19550 int
19551 main (void)
19552 {
19553
19554                 static wchar_t src_wchar[2];
19555                 static cchar_t dst_cchar;
19556                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19557
19558   ;
19559   return 0;
19560 }
19561 _ACEOF
19562 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19563 if { (eval echo "$as_me:19563: \"$ac_link\"") >&5
19564   (eval $ac_link) 2>&5
19565   ac_status=$?
19566   echo "$as_me:19566: \$? = $ac_status" >&5
19567   (exit "$ac_status"); } &&
19568          { ac_try='test -s "conftest$ac_exeext"'
19569   { (eval echo "$as_me:19569: \"$ac_try\"") >&5
19570   (eval $ac_try) 2>&5
19571   ac_status=$?
19572   echo "$as_me:19572: \$? = $ac_status" >&5
19573   (exit "$ac_status"); }; }; then
19574   cf_cv_widechar_funcs=yes
19575 else
19576   echo "$as_me: failed program was:" >&5
19577 cat "conftest.$ac_ext" >&5
19578 cf_cv_widechar_funcs=no
19579 fi
19580 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19581
19582 fi
19583 echo "$as_me:19583: result: $cf_cv_widechar_funcs" >&5
19584 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19585         if test "$cf_cv_widechar_funcs" != no ; then
19586
19587 cat >>confdefs.h <<\EOF
19588 #define USE_WIDEC_SUPPORT 1
19589 EOF
19590
19591         else
19592                 cat >>confdefs.h <<\EOF
19593 #define USE_WIDEC_SUPPORT 0
19594 EOF
19595
19596         fi
19597 else
19598         cat >>confdefs.h <<\EOF
19599 #define USE_WIDEC_SUPPORT 0
19600 EOF
19601
19602 fi
19603
19604 echo "$as_me:19604: checking if $cf_cv_screen library uses pthreads" >&5
19605 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19606 if test "${cf_cv_use_pthreads+set}" = set; then
19607   echo $ECHO_N "(cached) $ECHO_C" >&6
19608 else
19609
19610 cat >"conftest.$ac_ext" <<_ACEOF
19611 #line 19611 "configure"
19612 #include "confdefs.h"
19613
19614 #include <${cf_cv_ncurses_header:-curses.h}>
19615 extern void _nc_init_pthreads(void);
19616
19617 int
19618 main (void)
19619 {
19620
19621         initscr();
19622         _nc_init_pthreads();
19623
19624   ;
19625   return 0;
19626 }
19627 _ACEOF
19628 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19629 if { (eval echo "$as_me:19629: \"$ac_link\"") >&5
19630   (eval $ac_link) 2>&5
19631   ac_status=$?
19632   echo "$as_me:19632: \$? = $ac_status" >&5
19633   (exit "$ac_status"); } &&
19634          { ac_try='test -s "conftest$ac_exeext"'
19635   { (eval echo "$as_me:19635: \"$ac_try\"") >&5
19636   (eval $ac_try) 2>&5
19637   ac_status=$?
19638   echo "$as_me:19638: \$? = $ac_status" >&5
19639   (exit "$ac_status"); }; }; then
19640   cf_cv_use_pthreads=yes
19641 else
19642   echo "$as_me: failed program was:" >&5
19643 cat "conftest.$ac_ext" >&5
19644 cf_cv_use_pthreads=no
19645 fi
19646 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19647
19648 fi
19649 echo "$as_me:19649: result: $cf_cv_use_pthreads" >&5
19650 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19651 test $cf_cv_use_pthreads = yes &&
19652 cat >>confdefs.h <<\EOF
19653 #define USE_PTHREADS 1
19654 EOF
19655
19656 echo "$as_me:19656: checking if sys/time.h works with sys/select.h" >&5
19657 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19658 if test "${cf_cv_sys_time_select+set}" = set; then
19659   echo $ECHO_N "(cached) $ECHO_C" >&6
19660 else
19661
19662 cat >"conftest.$ac_ext" <<_ACEOF
19663 #line 19663 "configure"
19664 #include "confdefs.h"
19665
19666 #include <sys/types.h>
19667 #ifdef HAVE_SYS_TIME_H
19668 #include <sys/time.h>
19669 #endif
19670 #ifdef HAVE_SYS_SELECT_H
19671 #include <sys/select.h>
19672 #endif
19673
19674 int
19675 main (void)
19676 {
19677
19678   ;
19679   return 0;
19680 }
19681 _ACEOF
19682 rm -f "conftest.$ac_objext"
19683 if { (eval echo "$as_me:19683: \"$ac_compile\"") >&5
19684   (eval $ac_compile) 2>&5
19685   ac_status=$?
19686   echo "$as_me:19686: \$? = $ac_status" >&5
19687   (exit "$ac_status"); } &&
19688          { ac_try='test -s "conftest.$ac_objext"'
19689   { (eval echo "$as_me:19689: \"$ac_try\"") >&5
19690   (eval $ac_try) 2>&5
19691   ac_status=$?
19692   echo "$as_me:19692: \$? = $ac_status" >&5
19693   (exit "$ac_status"); }; }; then
19694   cf_cv_sys_time_select=yes
19695 else
19696   echo "$as_me: failed program was:" >&5
19697 cat "conftest.$ac_ext" >&5
19698 cf_cv_sys_time_select=no
19699 fi
19700 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19701
19702 fi
19703
19704 echo "$as_me:19704: result: $cf_cv_sys_time_select" >&5
19705 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19706 test "$cf_cv_sys_time_select" = yes &&
19707 cat >>confdefs.h <<\EOF
19708 #define HAVE_SYS_TIME_SELECT 1
19709 EOF
19710
19711 # special check for test/ditto.c
19712
19713 echo "$as_me:19713: checking for openpty in -lutil" >&5
19714 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19715 if test "${ac_cv_lib_util_openpty+set}" = set; then
19716   echo $ECHO_N "(cached) $ECHO_C" >&6
19717 else
19718   ac_check_lib_save_LIBS=$LIBS
19719 LIBS="-lutil  $LIBS"
19720 cat >"conftest.$ac_ext" <<_ACEOF
19721 #line 19721 "configure"
19722 #include "confdefs.h"
19723
19724 /* Override any gcc2 internal prototype to avoid an error.  */
19725 #ifdef __cplusplus
19726 extern "C"
19727 #endif
19728 /* We use char because int might match the return type of a gcc2
19729    builtin and then its argument prototype would still apply.  */
19730 char openpty ();
19731 int
19732 main (void)
19733 {
19734 openpty ();
19735   ;
19736   return 0;
19737 }
19738 _ACEOF
19739 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19740 if { (eval echo "$as_me:19740: \"$ac_link\"") >&5
19741   (eval $ac_link) 2>&5
19742   ac_status=$?
19743   echo "$as_me:19743: \$? = $ac_status" >&5
19744   (exit "$ac_status"); } &&
19745          { ac_try='test -s "conftest$ac_exeext"'
19746   { (eval echo "$as_me:19746: \"$ac_try\"") >&5
19747   (eval $ac_try) 2>&5
19748   ac_status=$?
19749   echo "$as_me:19749: \$? = $ac_status" >&5
19750   (exit "$ac_status"); }; }; then
19751   ac_cv_lib_util_openpty=yes
19752 else
19753   echo "$as_me: failed program was:" >&5
19754 cat "conftest.$ac_ext" >&5
19755 ac_cv_lib_util_openpty=no
19756 fi
19757 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19758 LIBS=$ac_check_lib_save_LIBS
19759 fi
19760 echo "$as_me:19760: result: $ac_cv_lib_util_openpty" >&5
19761 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19762 if test "$ac_cv_lib_util_openpty" = yes; then
19763   cf_cv_lib_util=yes
19764 else
19765   cf_cv_lib_util=no
19766 fi
19767
19768 echo "$as_me:19768: checking for openpty header" >&5
19769 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19770 if test "${cf_cv_func_openpty+set}" = set; then
19771   echo $ECHO_N "(cached) $ECHO_C" >&6
19772 else
19773
19774         cf_save_LIBS="$LIBS"
19775         test "$cf_cv_lib_util" = yes && {
19776 cf_add_libs="$LIBS"
19777 # reverse order
19778 cf_add_0lib=
19779 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19780 # filter duplicates
19781 for cf_add_1lib in $cf_add_0lib; do
19782         for cf_add_2lib in $cf_add_libs; do
19783                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19784                         cf_add_1lib=
19785                         break
19786                 fi
19787         done
19788         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19789 done
19790 LIBS="$cf_add_libs"
19791  }
19792         for cf_header in pty.h libutil.h util.h
19793         do
19794         cat >"conftest.$ac_ext" <<_ACEOF
19795 #line 19795 "configure"
19796 #include "confdefs.h"
19797
19798 #include <$cf_header>
19799
19800 int
19801 main (void)
19802 {
19803
19804         int x = openpty((int *)0, (int *)0, (char *)0,
19805                                    (struct termios *)0, (struct winsize *)0);
19806
19807   ;
19808   return 0;
19809 }
19810 _ACEOF
19811 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19812 if { (eval echo "$as_me:19812: \"$ac_link\"") >&5
19813   (eval $ac_link) 2>&5
19814   ac_status=$?
19815   echo "$as_me:19815: \$? = $ac_status" >&5
19816   (exit "$ac_status"); } &&
19817          { ac_try='test -s "conftest$ac_exeext"'
19818   { (eval echo "$as_me:19818: \"$ac_try\"") >&5
19819   (eval $ac_try) 2>&5
19820   ac_status=$?
19821   echo "$as_me:19821: \$? = $ac_status" >&5
19822   (exit "$ac_status"); }; }; then
19823
19824                 cf_cv_func_openpty=$cf_header
19825                 break
19826
19827 else
19828   echo "$as_me: failed program was:" >&5
19829 cat "conftest.$ac_ext" >&5
19830
19831                 cf_cv_func_openpty=no
19832
19833 fi
19834 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19835         done
19836         LIBS="$cf_save_LIBS"
19837
19838 fi
19839 echo "$as_me:19839: result: $cf_cv_func_openpty" >&5
19840 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19841
19842 if test "$cf_cv_func_openpty" != no ; then
19843
19844 cat >>confdefs.h <<EOF
19845 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19846 EOF
19847
19848 cat >>confdefs.h <<\EOF
19849 #define USE_XTERM_PTY 1
19850 EOF
19851
19852         if test "x$cf_cv_lib_util" = xyes ; then
19853
19854 cf_add_libs="$TEST_LIBS"
19855 # reverse order
19856 cf_add_0lib=
19857 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19858 # filter duplicates
19859 for cf_add_1lib in $cf_add_0lib; do
19860         for cf_add_2lib in $cf_add_libs; do
19861                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19862                         cf_add_1lib=
19863                         break
19864                 fi
19865         done
19866         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19867 done
19868 TEST_LIBS="$cf_add_libs"
19869
19870         fi
19871 fi
19872
19873 echo "$as_me:19873: checking for function curses_version" >&5
19874 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19875 if test "${cf_cv_func_curses_version+set}" = set; then
19876   echo $ECHO_N "(cached) $ECHO_C" >&6
19877 else
19878
19879 if test "$cross_compiling" = yes; then
19880   cf_cv_func_curses_version=unknown
19881 else
19882   cat >"conftest.$ac_ext" <<_ACEOF
19883 #line 19883 "configure"
19884 #include "confdefs.h"
19885
19886 #include <${cf_cv_ncurses_header:-curses.h}>
19887 int main(void)
19888 {
19889         char temp[1024];
19890         sprintf(temp, "%s\\n", curses_version());
19891         ${cf_cv_main_return:-return}(0);
19892 }
19893
19894 _ACEOF
19895 rm -f "conftest$ac_exeext"
19896 if { (eval echo "$as_me:19896: \"$ac_link\"") >&5
19897   (eval $ac_link) 2>&5
19898   ac_status=$?
19899   echo "$as_me:19899: \$? = $ac_status" >&5
19900   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19901   { (eval echo "$as_me:19901: \"$ac_try\"") >&5
19902   (eval $ac_try) 2>&5
19903   ac_status=$?
19904   echo "$as_me:19904: \$? = $ac_status" >&5
19905   (exit "$ac_status"); }; }; then
19906   cf_cv_func_curses_version=yes
19907
19908 else
19909   echo "$as_me: program exited with status $ac_status" >&5
19910 echo "$as_me: failed program was:" >&5
19911 cat "conftest.$ac_ext" >&5
19912 cf_cv_func_curses_version=no
19913
19914 fi
19915 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19916 fi
19917 rm -f core
19918 fi
19919 echo "$as_me:19919: result: $cf_cv_func_curses_version" >&5
19920 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19921 test "$cf_cv_func_curses_version" = yes &&
19922 cat >>confdefs.h <<\EOF
19923 #define HAVE_CURSES_VERSION 1
19924 EOF
19925
19926 echo "$as_me:19926: checking for alternate character set array" >&5
19927 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19928 if test "${cf_cv_curses_acs_map+set}" = set; then
19929   echo $ECHO_N "(cached) $ECHO_C" >&6
19930 else
19931
19932 cf_cv_curses_acs_map=unknown
19933 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19934 do
19935 cat >"conftest.$ac_ext" <<_ACEOF
19936 #line 19936 "configure"
19937 #include "confdefs.h"
19938
19939 #include <${cf_cv_ncurses_header:-curses.h}>
19940
19941 int
19942 main (void)
19943 {
19944
19945 ${name}['k'] = ACS_PLUS
19946
19947   ;
19948   return 0;
19949 }
19950 _ACEOF
19951 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19952 if { (eval echo "$as_me:19952: \"$ac_link\"") >&5
19953   (eval $ac_link) 2>&5
19954   ac_status=$?
19955   echo "$as_me:19955: \$? = $ac_status" >&5
19956   (exit "$ac_status"); } &&
19957          { ac_try='test -s "conftest$ac_exeext"'
19958   { (eval echo "$as_me:19958: \"$ac_try\"") >&5
19959   (eval $ac_try) 2>&5
19960   ac_status=$?
19961   echo "$as_me:19961: \$? = $ac_status" >&5
19962   (exit "$ac_status"); }; }; then
19963   cf_cv_curses_acs_map=$name; break
19964 else
19965   echo "$as_me: failed program was:" >&5
19966 cat "conftest.$ac_ext" >&5
19967 fi
19968 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19969 done
19970
19971 fi
19972 echo "$as_me:19972: result: $cf_cv_curses_acs_map" >&5
19973 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19974
19975 test "$cf_cv_curses_acs_map" != unknown &&
19976 cat >>confdefs.h <<EOF
19977 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19978 EOF
19979
19980 if test "$cf_enable_widec" = yes; then
19981
19982 echo "$as_me:19982: checking for wide alternate character set array" >&5
19983 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19984 if test "${cf_cv_curses_wacs_map+set}" = set; then
19985   echo $ECHO_N "(cached) $ECHO_C" >&6
19986 else
19987
19988         cf_cv_curses_wacs_map=unknown
19989         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19990         do
19991         cat >"conftest.$ac_ext" <<_ACEOF
19992 #line 19992 "configure"
19993 #include "confdefs.h"
19994
19995 #ifndef _XOPEN_SOURCE_EXTENDED
19996 #define _XOPEN_SOURCE_EXTENDED
19997 #endif
19998 #include <${cf_cv_ncurses_header:-curses.h}>
19999 int
20000 main (void)
20001 {
20002 void *foo = &(${name}['k']); (void)foo
20003   ;
20004   return 0;
20005 }
20006 _ACEOF
20007 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20008 if { (eval echo "$as_me:20008: \"$ac_link\"") >&5
20009   (eval $ac_link) 2>&5
20010   ac_status=$?
20011   echo "$as_me:20011: \$? = $ac_status" >&5
20012   (exit "$ac_status"); } &&
20013          { ac_try='test -s "conftest$ac_exeext"'
20014   { (eval echo "$as_me:20014: \"$ac_try\"") >&5
20015   (eval $ac_try) 2>&5
20016   ac_status=$?
20017   echo "$as_me:20017: \$? = $ac_status" >&5
20018   (exit "$ac_status"); }; }; then
20019   cf_cv_curses_wacs_map=$name
20020          break
20021 else
20022   echo "$as_me: failed program was:" >&5
20023 cat "conftest.$ac_ext" >&5
20024 fi
20025 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20026         done
20027 fi
20028 echo "$as_me:20028: result: $cf_cv_curses_wacs_map" >&5
20029 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
20030
20031 test "$cf_cv_curses_wacs_map" != unknown &&
20032 cat >>confdefs.h <<EOF
20033 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
20034 EOF
20035
20036 echo "$as_me:20036: checking for wide alternate character constants" >&5
20037 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
20038 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
20039   echo $ECHO_N "(cached) $ECHO_C" >&6
20040 else
20041
20042 cf_cv_curses_wacs_symbols=no
20043 if test "$cf_cv_curses_wacs_map" != unknown
20044 then
20045         cat >"conftest.$ac_ext" <<_ACEOF
20046 #line 20046 "configure"
20047 #include "confdefs.h"
20048
20049 #ifndef _XOPEN_SOURCE_EXTENDED
20050 #define _XOPEN_SOURCE_EXTENDED
20051 #endif
20052 #include <${cf_cv_ncurses_header:-curses.h}>
20053 int
20054 main (void)
20055 {
20056 cchar_t *foo = WACS_PLUS;
20057          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
20058   ;
20059   return 0;
20060 }
20061 _ACEOF
20062 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20063 if { (eval echo "$as_me:20063: \"$ac_link\"") >&5
20064   (eval $ac_link) 2>&5
20065   ac_status=$?
20066   echo "$as_me:20066: \$? = $ac_status" >&5
20067   (exit "$ac_status"); } &&
20068          { ac_try='test -s "conftest$ac_exeext"'
20069   { (eval echo "$as_me:20069: \"$ac_try\"") >&5
20070   (eval $ac_try) 2>&5
20071   ac_status=$?
20072   echo "$as_me:20072: \$? = $ac_status" >&5
20073   (exit "$ac_status"); }; }; then
20074   cf_cv_curses_wacs_symbols=yes
20075 else
20076   echo "$as_me: failed program was:" >&5
20077 cat "conftest.$ac_ext" >&5
20078 fi
20079 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20080 else
20081         cat >"conftest.$ac_ext" <<_ACEOF
20082 #line 20082 "configure"
20083 #include "confdefs.h"
20084
20085 #ifndef _XOPEN_SOURCE_EXTENDED
20086 #define _XOPEN_SOURCE_EXTENDED
20087 #endif
20088 #include <${cf_cv_ncurses_header:-curses.h}>
20089 int
20090 main (void)
20091 {
20092 cchar_t *foo = WACS_PLUS; (void)foo
20093   ;
20094   return 0;
20095 }
20096 _ACEOF
20097 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20098 if { (eval echo "$as_me:20098: \"$ac_link\"") >&5
20099   (eval $ac_link) 2>&5
20100   ac_status=$?
20101   echo "$as_me:20101: \$? = $ac_status" >&5
20102   (exit "$ac_status"); } &&
20103          { ac_try='test -s "conftest$ac_exeext"'
20104   { (eval echo "$as_me:20104: \"$ac_try\"") >&5
20105   (eval $ac_try) 2>&5
20106   ac_status=$?
20107   echo "$as_me:20107: \$? = $ac_status" >&5
20108   (exit "$ac_status"); }; }; then
20109   cf_cv_curses_wacs_symbols=yes
20110 else
20111   echo "$as_me: failed program was:" >&5
20112 cat "conftest.$ac_ext" >&5
20113 fi
20114 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20115 fi
20116
20117 fi
20118 echo "$as_me:20118: result: $cf_cv_curses_wacs_symbols" >&5
20119 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
20120
20121 test "$cf_cv_curses_wacs_symbols" != no &&
20122 cat >>confdefs.h <<\EOF
20123 #define CURSES_WACS_SYMBOLS 1
20124 EOF
20125
20126 fi
20127
20128 echo "$as_me:20128: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20129 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20130 cat >"conftest.$ac_ext" <<_ACEOF
20131 #line 20131 "configure"
20132 #include "confdefs.h"
20133
20134 #ifndef _XOPEN_SOURCE_EXTENDED
20135 #define _XOPEN_SOURCE_EXTENDED
20136 #endif
20137 #include <${cf_cv_ncurses_header:-curses.h}>
20138 int
20139 main (void)
20140 {
20141
20142 attr_t foo
20143
20144   ;
20145   return 0;
20146 }
20147 _ACEOF
20148 rm -f "conftest.$ac_objext"
20149 if { (eval echo "$as_me:20149: \"$ac_compile\"") >&5
20150   (eval $ac_compile) 2>&5
20151   ac_status=$?
20152   echo "$as_me:20152: \$? = $ac_status" >&5
20153   (exit "$ac_status"); } &&
20154          { ac_try='test -s "conftest.$ac_objext"'
20155   { (eval echo "$as_me:20155: \"$ac_try\"") >&5
20156   (eval $ac_try) 2>&5
20157   ac_status=$?
20158   echo "$as_me:20158: \$? = $ac_status" >&5
20159   (exit "$ac_status"); }; }; then
20160   cf_result=yes
20161 else
20162   echo "$as_me: failed program was:" >&5
20163 cat "conftest.$ac_ext" >&5
20164 cf_result=no
20165 fi
20166 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20167 echo "$as_me:20167: result: $cf_result" >&5
20168 echo "${ECHO_T}$cf_result" >&6
20169 if test "$cf_result" = yes ; then
20170
20171 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20172
20173 cat >>confdefs.h <<EOF
20174 #define $cf_result 1
20175 EOF
20176
20177 else
20178
20179 cat >>confdefs.h <<EOF
20180 #define attr_t long
20181 EOF
20182
20183 fi
20184
20185 if test "$cf_enable_widec" = yes; then
20186
20187 # This is needed on Tru64 5.0 to declare mbstate_t
20188 echo "$as_me:20188: checking if we must include wchar.h to declare mbstate_t" >&5
20189 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
20190 if test "${cf_cv_mbstate_t+set}" = set; then
20191   echo $ECHO_N "(cached) $ECHO_C" >&6
20192 else
20193
20194 cat >"conftest.$ac_ext" <<_ACEOF
20195 #line 20195 "configure"
20196 #include "confdefs.h"
20197
20198 #include <stdlib.h>
20199 #include <stdarg.h>
20200 #include <stdio.h>
20201 #ifdef HAVE_LIBUTF8_H
20202 #include <libutf8.h>
20203 #endif
20204 int
20205 main (void)
20206 {
20207 mbstate_t state
20208   ;
20209   return 0;
20210 }
20211 _ACEOF
20212 rm -f "conftest.$ac_objext"
20213 if { (eval echo "$as_me:20213: \"$ac_compile\"") >&5
20214   (eval $ac_compile) 2>&5
20215   ac_status=$?
20216   echo "$as_me:20216: \$? = $ac_status" >&5
20217   (exit "$ac_status"); } &&
20218          { ac_try='test -s "conftest.$ac_objext"'
20219   { (eval echo "$as_me:20219: \"$ac_try\"") >&5
20220   (eval $ac_try) 2>&5
20221   ac_status=$?
20222   echo "$as_me:20222: \$? = $ac_status" >&5
20223   (exit "$ac_status"); }; }; then
20224   cf_cv_mbstate_t=no
20225 else
20226   echo "$as_me: failed program was:" >&5
20227 cat "conftest.$ac_ext" >&5
20228 cat >"conftest.$ac_ext" <<_ACEOF
20229 #line 20229 "configure"
20230 #include "confdefs.h"
20231
20232 #include <stdlib.h>
20233 #include <stdarg.h>
20234 #include <stdio.h>
20235 #include <wchar.h>
20236 #ifdef HAVE_LIBUTF8_H
20237 #include <libutf8.h>
20238 #endif
20239 int
20240 main (void)
20241 {
20242 mbstate_t value
20243   ;
20244   return 0;
20245 }
20246 _ACEOF
20247 rm -f "conftest.$ac_objext"
20248 if { (eval echo "$as_me:20248: \"$ac_compile\"") >&5
20249   (eval $ac_compile) 2>&5
20250   ac_status=$?
20251   echo "$as_me:20251: \$? = $ac_status" >&5
20252   (exit "$ac_status"); } &&
20253          { ac_try='test -s "conftest.$ac_objext"'
20254   { (eval echo "$as_me:20254: \"$ac_try\"") >&5
20255   (eval $ac_try) 2>&5
20256   ac_status=$?
20257   echo "$as_me:20257: \$? = $ac_status" >&5
20258   (exit "$ac_status"); }; }; then
20259   cf_cv_mbstate_t=yes
20260 else
20261   echo "$as_me: failed program was:" >&5
20262 cat "conftest.$ac_ext" >&5
20263 cf_cv_mbstate_t=unknown
20264 fi
20265 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20266 fi
20267 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20268 fi
20269 echo "$as_me:20269: result: $cf_cv_mbstate_t" >&5
20270 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
20271
20272 if test "$cf_cv_mbstate_t" = yes ; then
20273
20274 cat >>confdefs.h <<\EOF
20275 #define NEED_WCHAR_H 1
20276 EOF
20277
20278         NEED_WCHAR_H=1
20279 fi
20280
20281 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
20282 if test "$cf_cv_mbstate_t" = unknown ; then
20283         NCURSES_MBSTATE_T=1
20284 fi
20285
20286 # if we find mbstate_t in either place, use substitution to provide a fallback.
20287 if test "$cf_cv_mbstate_t" != unknown ; then
20288         NCURSES_OK_MBSTATE_T=1
20289 fi
20290
20291 # This is needed on Tru64 5.0 to declare wchar_t
20292 echo "$as_me:20292: checking if we must include wchar.h to declare wchar_t" >&5
20293 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
20294 if test "${cf_cv_wchar_t+set}" = set; then
20295   echo $ECHO_N "(cached) $ECHO_C" >&6
20296 else
20297
20298 cat >"conftest.$ac_ext" <<_ACEOF
20299 #line 20299 "configure"
20300 #include "confdefs.h"
20301
20302 #include <stdlib.h>
20303 #include <stdarg.h>
20304 #include <stdio.h>
20305 #ifdef HAVE_LIBUTF8_H
20306 #include <libutf8.h>
20307 #endif
20308 int
20309 main (void)
20310 {
20311 wchar_t state
20312   ;
20313   return 0;
20314 }
20315 _ACEOF
20316 rm -f "conftest.$ac_objext"
20317 if { (eval echo "$as_me:20317: \"$ac_compile\"") >&5
20318   (eval $ac_compile) 2>&5
20319   ac_status=$?
20320   echo "$as_me:20320: \$? = $ac_status" >&5
20321   (exit "$ac_status"); } &&
20322          { ac_try='test -s "conftest.$ac_objext"'
20323   { (eval echo "$as_me:20323: \"$ac_try\"") >&5
20324   (eval $ac_try) 2>&5
20325   ac_status=$?
20326   echo "$as_me:20326: \$? = $ac_status" >&5
20327   (exit "$ac_status"); }; }; then
20328   cf_cv_wchar_t=no
20329 else
20330   echo "$as_me: failed program was:" >&5
20331 cat "conftest.$ac_ext" >&5
20332 cat >"conftest.$ac_ext" <<_ACEOF
20333 #line 20333 "configure"
20334 #include "confdefs.h"
20335
20336 #include <stdlib.h>
20337 #include <stdarg.h>
20338 #include <stdio.h>
20339 #include <wchar.h>
20340 #ifdef HAVE_LIBUTF8_H
20341 #include <libutf8.h>
20342 #endif
20343 int
20344 main (void)
20345 {
20346 wchar_t value
20347   ;
20348   return 0;
20349 }
20350 _ACEOF
20351 rm -f "conftest.$ac_objext"
20352 if { (eval echo "$as_me:20352: \"$ac_compile\"") >&5
20353   (eval $ac_compile) 2>&5
20354   ac_status=$?
20355   echo "$as_me:20355: \$? = $ac_status" >&5
20356   (exit "$ac_status"); } &&
20357          { ac_try='test -s "conftest.$ac_objext"'
20358   { (eval echo "$as_me:20358: \"$ac_try\"") >&5
20359   (eval $ac_try) 2>&5
20360   ac_status=$?
20361   echo "$as_me:20361: \$? = $ac_status" >&5
20362   (exit "$ac_status"); }; }; then
20363   cf_cv_wchar_t=yes
20364 else
20365   echo "$as_me: failed program was:" >&5
20366 cat "conftest.$ac_ext" >&5
20367 cf_cv_wchar_t=unknown
20368 fi
20369 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20370 fi
20371 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20372 fi
20373 echo "$as_me:20373: result: $cf_cv_wchar_t" >&5
20374 echo "${ECHO_T}$cf_cv_wchar_t" >&6
20375
20376 if test "$cf_cv_wchar_t" = yes ; then
20377
20378 cat >>confdefs.h <<\EOF
20379 #define NEED_WCHAR_H 1
20380 EOF
20381
20382         NEED_WCHAR_H=1
20383 fi
20384
20385 # if we do not find wchar_t in either place, use substitution to provide a fallback.
20386 if test "$cf_cv_wchar_t" = unknown ; then
20387         NCURSES_WCHAR_T=1
20388 fi
20389
20390 # if we find wchar_t in either place, use substitution to provide a fallback.
20391 if test "$cf_cv_wchar_t" != unknown ; then
20392         NCURSES_OK_WCHAR_T=1
20393 fi
20394
20395 # This is needed on Tru64 5.0 to declare wint_t
20396 echo "$as_me:20396: checking if we must include wchar.h to declare wint_t" >&5
20397 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
20398 if test "${cf_cv_wint_t+set}" = set; then
20399   echo $ECHO_N "(cached) $ECHO_C" >&6
20400 else
20401
20402 cat >"conftest.$ac_ext" <<_ACEOF
20403 #line 20403 "configure"
20404 #include "confdefs.h"
20405
20406 #include <stdlib.h>
20407 #include <stdarg.h>
20408 #include <stdio.h>
20409 #ifdef HAVE_LIBUTF8_H
20410 #include <libutf8.h>
20411 #endif
20412 int
20413 main (void)
20414 {
20415 wint_t state
20416   ;
20417   return 0;
20418 }
20419 _ACEOF
20420 rm -f "conftest.$ac_objext"
20421 if { (eval echo "$as_me:20421: \"$ac_compile\"") >&5
20422   (eval $ac_compile) 2>&5
20423   ac_status=$?
20424   echo "$as_me:20424: \$? = $ac_status" >&5
20425   (exit "$ac_status"); } &&
20426          { ac_try='test -s "conftest.$ac_objext"'
20427   { (eval echo "$as_me:20427: \"$ac_try\"") >&5
20428   (eval $ac_try) 2>&5
20429   ac_status=$?
20430   echo "$as_me:20430: \$? = $ac_status" >&5
20431   (exit "$ac_status"); }; }; then
20432   cf_cv_wint_t=no
20433 else
20434   echo "$as_me: failed program was:" >&5
20435 cat "conftest.$ac_ext" >&5
20436 cat >"conftest.$ac_ext" <<_ACEOF
20437 #line 20437 "configure"
20438 #include "confdefs.h"
20439
20440 #include <stdlib.h>
20441 #include <stdarg.h>
20442 #include <stdio.h>
20443 #include <wchar.h>
20444 #ifdef HAVE_LIBUTF8_H
20445 #include <libutf8.h>
20446 #endif
20447 int
20448 main (void)
20449 {
20450 wint_t value
20451   ;
20452   return 0;
20453 }
20454 _ACEOF
20455 rm -f "conftest.$ac_objext"
20456 if { (eval echo "$as_me:20456: \"$ac_compile\"") >&5
20457   (eval $ac_compile) 2>&5
20458   ac_status=$?
20459   echo "$as_me:20459: \$? = $ac_status" >&5
20460   (exit "$ac_status"); } &&
20461          { ac_try='test -s "conftest.$ac_objext"'
20462   { (eval echo "$as_me:20462: \"$ac_try\"") >&5
20463   (eval $ac_try) 2>&5
20464   ac_status=$?
20465   echo "$as_me:20465: \$? = $ac_status" >&5
20466   (exit "$ac_status"); }; }; then
20467   cf_cv_wint_t=yes
20468 else
20469   echo "$as_me: failed program was:" >&5
20470 cat "conftest.$ac_ext" >&5
20471 cf_cv_wint_t=unknown
20472 fi
20473 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20474 fi
20475 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20476 fi
20477 echo "$as_me:20477: result: $cf_cv_wint_t" >&5
20478 echo "${ECHO_T}$cf_cv_wint_t" >&6
20479
20480 if test "$cf_cv_wint_t" = yes ; then
20481
20482 cat >>confdefs.h <<\EOF
20483 #define NEED_WCHAR_H 1
20484 EOF
20485
20486         NEED_WCHAR_H=1
20487 fi
20488
20489 # if we do not find wint_t in either place, use substitution to provide a fallback.
20490 if test "$cf_cv_wint_t" = unknown ; then
20491         NCURSES_WINT_T=1
20492 fi
20493
20494 # if we find wint_t in either place, use substitution to provide a fallback.
20495 if test "$cf_cv_wint_t" != unknown ; then
20496         NCURSES_OK_WINT_T=1
20497 fi
20498
20499         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20500
20501 echo "$as_me:20501: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20502 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20503 cat >"conftest.$ac_ext" <<_ACEOF
20504 #line 20504 "configure"
20505 #include "confdefs.h"
20506
20507 #ifndef _XOPEN_SOURCE_EXTENDED
20508 #define _XOPEN_SOURCE_EXTENDED
20509 #endif
20510 #include <${cf_cv_ncurses_header:-curses.h}>
20511 int
20512 main (void)
20513 {
20514
20515 mbstate_t foo
20516
20517   ;
20518   return 0;
20519 }
20520 _ACEOF
20521 rm -f "conftest.$ac_objext"
20522 if { (eval echo "$as_me:20522: \"$ac_compile\"") >&5
20523   (eval $ac_compile) 2>&5
20524   ac_status=$?
20525   echo "$as_me:20525: \$? = $ac_status" >&5
20526   (exit "$ac_status"); } &&
20527          { ac_try='test -s "conftest.$ac_objext"'
20528   { (eval echo "$as_me:20528: \"$ac_try\"") >&5
20529   (eval $ac_try) 2>&5
20530   ac_status=$?
20531   echo "$as_me:20531: \$? = $ac_status" >&5
20532   (exit "$ac_status"); }; }; then
20533   cf_result=yes
20534 else
20535   echo "$as_me: failed program was:" >&5
20536 cat "conftest.$ac_ext" >&5
20537 cf_result=no
20538 fi
20539 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20540 echo "$as_me:20540: result: $cf_result" >&5
20541 echo "${ECHO_T}$cf_result" >&6
20542 if test "$cf_result" = yes ; then
20543
20544 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20545
20546 cat >>confdefs.h <<EOF
20547 #define $cf_result 1
20548 EOF
20549
20550 else
20551
20552 cat >>confdefs.h <<EOF
20553 #define mbstate_t long
20554 EOF
20555
20556 fi
20557
20558         fi
20559
20560         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20561
20562 echo "$as_me:20562: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20563 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20564 cat >"conftest.$ac_ext" <<_ACEOF
20565 #line 20565 "configure"
20566 #include "confdefs.h"
20567
20568 #ifndef _XOPEN_SOURCE_EXTENDED
20569 #define _XOPEN_SOURCE_EXTENDED
20570 #endif
20571 #include <${cf_cv_ncurses_header:-curses.h}>
20572 int
20573 main (void)
20574 {
20575
20576 wchar_t foo
20577
20578   ;
20579   return 0;
20580 }
20581 _ACEOF
20582 rm -f "conftest.$ac_objext"
20583 if { (eval echo "$as_me:20583: \"$ac_compile\"") >&5
20584   (eval $ac_compile) 2>&5
20585   ac_status=$?
20586   echo "$as_me:20586: \$? = $ac_status" >&5
20587   (exit "$ac_status"); } &&
20588          { ac_try='test -s "conftest.$ac_objext"'
20589   { (eval echo "$as_me:20589: \"$ac_try\"") >&5
20590   (eval $ac_try) 2>&5
20591   ac_status=$?
20592   echo "$as_me:20592: \$? = $ac_status" >&5
20593   (exit "$ac_status"); }; }; then
20594   cf_result=yes
20595 else
20596   echo "$as_me: failed program was:" >&5
20597 cat "conftest.$ac_ext" >&5
20598 cf_result=no
20599 fi
20600 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20601 echo "$as_me:20601: result: $cf_result" >&5
20602 echo "${ECHO_T}$cf_result" >&6
20603 if test "$cf_result" = yes ; then
20604
20605 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20606
20607 cat >>confdefs.h <<EOF
20608 #define $cf_result 1
20609 EOF
20610
20611 else
20612
20613 cat >>confdefs.h <<EOF
20614 #define wchar_t long
20615 EOF
20616
20617 fi
20618
20619         fi
20620
20621         if test "$NCURSES_OK_WINT_T" = 0 ; then
20622
20623 echo "$as_me:20623: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20624 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20625 cat >"conftest.$ac_ext" <<_ACEOF
20626 #line 20626 "configure"
20627 #include "confdefs.h"
20628
20629 #ifndef _XOPEN_SOURCE_EXTENDED
20630 #define _XOPEN_SOURCE_EXTENDED
20631 #endif
20632 #include <${cf_cv_ncurses_header:-curses.h}>
20633 int
20634 main (void)
20635 {
20636
20637 wint_t foo
20638
20639   ;
20640   return 0;
20641 }
20642 _ACEOF
20643 rm -f "conftest.$ac_objext"
20644 if { (eval echo "$as_me:20644: \"$ac_compile\"") >&5
20645   (eval $ac_compile) 2>&5
20646   ac_status=$?
20647   echo "$as_me:20647: \$? = $ac_status" >&5
20648   (exit "$ac_status"); } &&
20649          { ac_try='test -s "conftest.$ac_objext"'
20650   { (eval echo "$as_me:20650: \"$ac_try\"") >&5
20651   (eval $ac_try) 2>&5
20652   ac_status=$?
20653   echo "$as_me:20653: \$? = $ac_status" >&5
20654   (exit "$ac_status"); }; }; then
20655   cf_result=yes
20656 else
20657   echo "$as_me: failed program was:" >&5
20658 cat "conftest.$ac_ext" >&5
20659 cf_result=no
20660 fi
20661 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20662 echo "$as_me:20662: result: $cf_result" >&5
20663 echo "${ECHO_T}$cf_result" >&6
20664 if test "$cf_result" = yes ; then
20665
20666 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20667
20668 cat >>confdefs.h <<EOF
20669 #define $cf_result 1
20670 EOF
20671
20672 else
20673
20674 cat >>confdefs.h <<EOF
20675 #define wint_t long
20676 EOF
20677
20678 fi
20679
20680         fi
20681 fi
20682
20683 for cf_data in \
20684 TABSIZE \
20685 curscr \
20686 ospeed \
20687 boolnames \
20688 boolfnames \
20689 ttytype
20690 do
20691 echo "$as_me:20691: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20692 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20693
20694 cat >"conftest.$ac_ext" <<_ACEOF
20695 #line 20695 "configure"
20696 #include "confdefs.h"
20697
20698 #ifdef HAVE_XCURSES
20699 #include <xcurses.h>
20700 char * XCursesProgramName = "test";
20701 #else
20702 #include <${cf_cv_ncurses_header:-curses.h}>
20703 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20704 #include <ncursesw/term.h>
20705 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20706 #include <ncurses/term.h>
20707 #elif defined(HAVE_TERM_H)
20708 #include <term.h>
20709 #endif
20710 #endif
20711
20712 int
20713 main (void)
20714 {
20715
20716 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20717         const void *foo = (const void *)($cf_data);
20718 #else
20719         const void *foo = &($cf_data);
20720 #endif
20721         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20722
20723   ;
20724   return 0;
20725 }
20726 _ACEOF
20727 rm -f "conftest.$ac_objext"
20728 if { (eval echo "$as_me:20728: \"$ac_compile\"") >&5
20729   (eval $ac_compile) 2>&5
20730   ac_status=$?
20731   echo "$as_me:20731: \$? = $ac_status" >&5
20732   (exit "$ac_status"); } &&
20733          { ac_try='test -s "conftest.$ac_objext"'
20734   { (eval echo "$as_me:20734: \"$ac_try\"") >&5
20735   (eval $ac_try) 2>&5
20736   ac_status=$?
20737   echo "$as_me:20737: \$? = $ac_status" >&5
20738   (exit "$ac_status"); }; }; then
20739   cf_result=yes
20740
20741 else
20742   echo "$as_me: failed program was:" >&5
20743 cat "conftest.$ac_ext" >&5
20744 cf_result=no
20745 fi
20746 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20747 echo "$as_me:20747: result: $cf_result" >&5
20748 echo "${ECHO_T}$cf_result" >&6
20749
20750 if test "$cf_result" = yes ; then
20751
20752 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20753
20754         cat >>confdefs.h <<EOF
20755 #define $cf_result 1
20756 EOF
20757
20758 else
20759         echo "$as_me:20759: checking for data $cf_data in library" >&5
20760 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20761         # BSD linkers insist on making weak linkage, but resolve at runtime.
20762         if test "$cross_compiling" = yes; then
20763
20764         # cross-compiling
20765         cat >"conftest.$ac_ext" <<_ACEOF
20766 #line 20766 "configure"
20767 #include "confdefs.h"
20768
20769 #ifdef HAVE_XCURSES
20770 #include <xcurses.h>
20771 char * XCursesProgramName = "test";
20772 #else
20773 #include <${cf_cv_ncurses_header:-curses.h}>
20774 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20775 #include <ncursesw/term.h>
20776 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20777 #include <ncurses/term.h>
20778 #elif defined(HAVE_TERM_H)
20779 #include <term.h>
20780 #endif
20781 #endif
20782
20783 extern char $cf_data;
20784 int
20785 main (void)
20786 {
20787
20788         do {
20789
20790 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20791         const void *foo = (const void *)($cf_data);
20792 #else
20793         const void *foo = &($cf_data);
20794 #endif
20795         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20796
20797                 ${cf_cv_main_return:-return}(foo == 0);
20798         } while (0)
20799
20800   ;
20801   return 0;
20802 }
20803 _ACEOF
20804 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20805 if { (eval echo "$as_me:20805: \"$ac_link\"") >&5
20806   (eval $ac_link) 2>&5
20807   ac_status=$?
20808   echo "$as_me:20808: \$? = $ac_status" >&5
20809   (exit "$ac_status"); } &&
20810          { ac_try='test -s "conftest$ac_exeext"'
20811   { (eval echo "$as_me:20811: \"$ac_try\"") >&5
20812   (eval $ac_try) 2>&5
20813   ac_status=$?
20814   echo "$as_me:20814: \$? = $ac_status" >&5
20815   (exit "$ac_status"); }; }; then
20816   cf_result=yes
20817 else
20818   echo "$as_me: failed program was:" >&5
20819 cat "conftest.$ac_ext" >&5
20820 cf_result=no
20821 fi
20822 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20823
20824 else
20825   cat >"conftest.$ac_ext" <<_ACEOF
20826 #line 20826 "configure"
20827 #include "confdefs.h"
20828
20829 #ifdef HAVE_XCURSES
20830 #include <xcurses.h>
20831 char * XCursesProgramName = "test";
20832 #else
20833 #include <${cf_cv_ncurses_header:-curses.h}>
20834 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20835 #include <ncursesw/term.h>
20836 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20837 #include <ncurses/term.h>
20838 #elif defined(HAVE_TERM_H)
20839 #include <term.h>
20840 #endif
20841 #endif
20842
20843 extern char $cf_data;
20844 int main(void)
20845 {
20846
20847 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20848         const void *foo = (const void *)($cf_data);
20849 #else
20850         const void *foo = &($cf_data);
20851 #endif
20852         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20853
20854         ${cf_cv_main_return:-return}(foo == 0);
20855 }
20856 _ACEOF
20857 rm -f "conftest$ac_exeext"
20858 if { (eval echo "$as_me:20858: \"$ac_link\"") >&5
20859   (eval $ac_link) 2>&5
20860   ac_status=$?
20861   echo "$as_me:20861: \$? = $ac_status" >&5
20862   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20863   { (eval echo "$as_me:20863: \"$ac_try\"") >&5
20864   (eval $ac_try) 2>&5
20865   ac_status=$?
20866   echo "$as_me:20866: \$? = $ac_status" >&5
20867   (exit "$ac_status"); }; }; then
20868   cf_result=yes
20869
20870 else
20871   echo "$as_me: program exited with status $ac_status" >&5
20872 echo "$as_me: failed program was:" >&5
20873 cat "conftest.$ac_ext" >&5
20874 cf_result=no
20875 fi
20876 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20877 fi
20878         echo "$as_me:20878: result: $cf_result" >&5
20879 echo "${ECHO_T}$cf_result" >&6
20880         if test "$cf_result" = yes ; then
20881
20882 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20883
20884                 cat >>confdefs.h <<EOF
20885 #define $cf_result 1
20886 EOF
20887
20888                 # do not exit loop here, since we prefer system's declarations
20889         fi
20890 fi
20891 done
20892
20893 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20894 then
20895         echo "$as_me:20895: checking for X" >&5
20896 echo $ECHO_N "checking for X... $ECHO_C" >&6
20897
20898 # Check whether --with-x or --without-x was given.
20899 if test "${with_x+set}" = set; then
20900   withval="$with_x"
20901
20902 fi;
20903 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20904 if test "x$with_x" = xno; then
20905   # The user explicitly disabled X.
20906   have_x=disabled
20907 else
20908   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20909     # Both variables are already set.
20910     have_x=yes
20911   else
20912     if test "${ac_cv_have_x+set}" = set; then
20913   echo $ECHO_N "(cached) $ECHO_C" >&6
20914 else
20915   # One or both of the vars are not set, and there is no cached value.
20916 ac_x_includes=no ac_x_libraries=no
20917 rm -fr conftest.dir
20918 if mkdir conftest.dir; then
20919   cd conftest.dir
20920   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20921   cat >Imakefile <<'EOF'
20922 acfindx:
20923         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20924 EOF
20925   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20926     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20927     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20928     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20929     for ac_extension in a so sl dylib dll; do
20930       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20931          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20932         ac_im_usrlibdir=$ac_im_libdir; break
20933       fi
20934     done
20935     # Screen out bogus values from the imake configuration.  They are
20936     # bogus both because they are the default anyway, and because
20937     # using them would break gcc on systems where it needs fixed includes.
20938     case $ac_im_incroot in
20939         /usr/include) ;;
20940         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20941     esac
20942     case $ac_im_usrlibdir in
20943         /usr/lib | /lib) ;;
20944         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20945     esac
20946   fi
20947   cd ..
20948   rm -fr conftest.dir
20949 fi
20950
20951 # Standard set of common directories for X headers.
20952 # Check X11 before X11Rn because it is often a symlink to the current release.
20953 ac_x_header_dirs='
20954 /usr/X11/include
20955 /usr/X11R7/include
20956 /usr/X11R6/include
20957 /usr/X11R5/include
20958 /usr/X11R4/include
20959
20960 /opt/local/include
20961 /opt/X11/include
20962
20963 /usr/include/X11
20964 /usr/include/X11R7
20965 /usr/include/X11R6
20966 /usr/include/X11R5
20967 /usr/include/X11R4
20968
20969 /usr/local/X11/include
20970 /usr/local/X11R7/include
20971 /usr/local/X11R6/include
20972 /usr/local/X11R5/include
20973 /usr/local/X11R4/include
20974
20975 /usr/local/include/X11
20976 /usr/local/include/X11R7
20977 /usr/local/include/X11R6
20978 /usr/local/include/X11R5
20979 /usr/local/include/X11R4
20980
20981 /usr/X386/include
20982 /usr/x386/include
20983 /usr/XFree86/include/X11
20984
20985 /usr/include
20986 /usr/local/include
20987 /usr/unsupported/include
20988 /usr/athena/include
20989 /usr/local/x11r5/include
20990 /usr/lpp/Xamples/include
20991
20992 /usr/openwin/include
20993 /usr/openwin/share/include'
20994
20995 if test "$ac_x_includes" = no; then
20996   # Guess where to find include files, by looking for Intrinsic.h.
20997   # First, try using that file with no special directory specified.
20998   cat >"conftest.$ac_ext" <<_ACEOF
20999 #line 20999 "configure"
21000 #include "confdefs.h"
21001 #include <X11/Intrinsic.h>
21002 _ACEOF
21003 if { (eval echo "$as_me:21003: \"$ac_cpp "conftest.$ac_ext"\"") >&5
21004   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
21005   ac_status=$?
21006   $EGREP -v '^ *\+' conftest.er1 >conftest.err
21007   rm -f conftest.er1
21008   cat conftest.err >&5
21009   echo "$as_me:21009: \$? = $ac_status" >&5
21010   (exit "$ac_status"); } >/dev/null; then
21011   if test -s conftest.err; then
21012     ac_cpp_err=$ac_c_preproc_warn_flag
21013   else
21014     ac_cpp_err=
21015   fi
21016 else
21017   ac_cpp_err=yes
21018 fi
21019 if test -z "$ac_cpp_err"; then
21020   # We can compile using X headers with no special include directory.
21021 ac_x_includes=
21022 else
21023   echo "$as_me: failed program was:" >&5
21024   cat "conftest.$ac_ext" >&5
21025   for ac_dir in $ac_x_header_dirs; do
21026   if test -r "$ac_dir/X11/Intrinsic.h"; then
21027     ac_x_includes=$ac_dir
21028     break
21029   fi
21030 done
21031 fi
21032 rm -f conftest.err "conftest.$ac_ext"
21033 fi # $ac_x_includes = no
21034
21035 if test "$ac_x_libraries" = no; then
21036   # Check for the libraries.
21037   # See if we find them without any special options.
21038   # Don't add to $LIBS permanently.
21039   ac_save_LIBS=$LIBS
21040   LIBS="-lXt $LIBS"
21041   cat >"conftest.$ac_ext" <<_ACEOF
21042 #line 21042 "configure"
21043 #include "confdefs.h"
21044 #include <X11/Intrinsic.h>
21045 int
21046 main (void)
21047 {
21048 XtMalloc (0)
21049   ;
21050   return 0;
21051 }
21052 _ACEOF
21053 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21054 if { (eval echo "$as_me:21054: \"$ac_link\"") >&5
21055   (eval $ac_link) 2>&5
21056   ac_status=$?
21057   echo "$as_me:21057: \$? = $ac_status" >&5
21058   (exit "$ac_status"); } &&
21059          { ac_try='test -s "conftest$ac_exeext"'
21060   { (eval echo "$as_me:21060: \"$ac_try\"") >&5
21061   (eval $ac_try) 2>&5
21062   ac_status=$?
21063   echo "$as_me:21063: \$? = $ac_status" >&5
21064   (exit "$ac_status"); }; }; then
21065   LIBS=$ac_save_LIBS
21066 # We can link X programs with no special library path.
21067 ac_x_libraries=
21068 else
21069   echo "$as_me: failed program was:" >&5
21070 cat "conftest.$ac_ext" >&5
21071 LIBS=$ac_save_LIBS
21072 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
21073 do
21074   # Don't even attempt the hair of trying to link an X program!
21075   for ac_extension in a so sl dylib dll; do
21076     if test -r "$ac_dir/libXt.$ac_extension"; then
21077       ac_x_libraries=$ac_dir
21078       break 2
21079     fi
21080   done
21081 done
21082 fi
21083 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21084 fi # $ac_x_libraries = no
21085
21086 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
21087   # Didn't find X anywhere.  Cache the known absence of X.
21088   ac_cv_have_x="have_x=no"
21089 else
21090   # Record where we found X for the cache.
21091   ac_cv_have_x="have_x=yes \
21092                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
21093 fi
21094 fi
21095
21096   fi
21097   eval "$ac_cv_have_x"
21098 fi # $with_x != no
21099
21100 if test "$have_x" != yes; then
21101   echo "$as_me:21101: result: $have_x" >&5
21102 echo "${ECHO_T}$have_x" >&6
21103   no_x=yes
21104 else
21105   # If each of the values was on the command line, it overrides each guess.
21106   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
21107   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
21108   # Update the cache value to reflect the command line values.
21109   ac_cv_have_x="have_x=yes \
21110                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
21111   echo "$as_me:21111: result: libraries $x_libraries, headers $x_includes" >&5
21112 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
21113 fi
21114
21115         if test "$no_x" = yes; then
21116   # Not all programs may use this symbol, but it does not hurt to define it.
21117
21118 cat >>confdefs.h <<\EOF
21119 #define X_DISPLAY_MISSING 1
21120 EOF
21121
21122   X_CFLAGS=
21123   X_PRE_LIBS=
21124   X_LIBS=
21125   X_EXTRA_LIBS=
21126 else
21127   if test -n "$x_includes"; then
21128     X_CFLAGS="$X_CFLAGS -I$x_includes"
21129   fi
21130
21131   # It would also be nice to do this for all -L options, not just this one.
21132   if test -n "$x_libraries"; then
21133     X_LIBS="$X_LIBS -L$x_libraries"
21134     # For Solaris; some versions of Sun CC require a space after -R and
21135     # others require no space.  Words are not sufficient . . . .
21136     case `(uname -sr) 2>/dev/null` in
21137     "SunOS 5"*)
21138       echo "$as_me:21138: checking whether -R must be followed by a space" >&5
21139 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
21140       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
21141       cat >"conftest.$ac_ext" <<_ACEOF
21142 #line 21142 "configure"
21143 #include "confdefs.h"
21144
21145 int
21146 main (void)
21147 {
21148
21149   ;
21150   return 0;
21151 }
21152 _ACEOF
21153 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21154 if { (eval echo "$as_me:21154: \"$ac_link\"") >&5
21155   (eval $ac_link) 2>&5
21156   ac_status=$?
21157   echo "$as_me:21157: \$? = $ac_status" >&5
21158   (exit "$ac_status"); } &&
21159          { ac_try='test -s "conftest$ac_exeext"'
21160   { (eval echo "$as_me:21160: \"$ac_try\"") >&5
21161   (eval $ac_try) 2>&5
21162   ac_status=$?
21163   echo "$as_me:21163: \$? = $ac_status" >&5
21164   (exit "$ac_status"); }; }; then
21165   ac_R_nospace=yes
21166 else
21167   echo "$as_me: failed program was:" >&5
21168 cat "conftest.$ac_ext" >&5
21169 ac_R_nospace=no
21170 fi
21171 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21172       if test $ac_R_nospace = yes; then
21173         echo "$as_me:21173: result: no" >&5
21174 echo "${ECHO_T}no" >&6
21175         X_LIBS="$X_LIBS -R$x_libraries"
21176       else
21177         LIBS="$ac_xsave_LIBS -R $x_libraries"
21178         cat >"conftest.$ac_ext" <<_ACEOF
21179 #line 21179 "configure"
21180 #include "confdefs.h"
21181
21182 int
21183 main (void)
21184 {
21185
21186   ;
21187   return 0;
21188 }
21189 _ACEOF
21190 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21191 if { (eval echo "$as_me:21191: \"$ac_link\"") >&5
21192   (eval $ac_link) 2>&5
21193   ac_status=$?
21194   echo "$as_me:21194: \$? = $ac_status" >&5
21195   (exit "$ac_status"); } &&
21196          { ac_try='test -s "conftest$ac_exeext"'
21197   { (eval echo "$as_me:21197: \"$ac_try\"") >&5
21198   (eval $ac_try) 2>&5
21199   ac_status=$?
21200   echo "$as_me:21200: \$? = $ac_status" >&5
21201   (exit "$ac_status"); }; }; then
21202   ac_R_space=yes
21203 else
21204   echo "$as_me: failed program was:" >&5
21205 cat "conftest.$ac_ext" >&5
21206 ac_R_space=no
21207 fi
21208 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21209         if test $ac_R_space = yes; then
21210           echo "$as_me:21210: result: yes" >&5
21211 echo "${ECHO_T}yes" >&6
21212           X_LIBS="$X_LIBS -R $x_libraries"
21213         else
21214           echo "$as_me:21214: result: neither works" >&5
21215 echo "${ECHO_T}neither works" >&6
21216         fi
21217       fi
21218       LIBS=$ac_xsave_LIBS
21219     esac
21220   fi
21221
21222   # Check for system-dependent libraries X programs must link with.
21223   # Do this before checking for the system-independent R6 libraries
21224   # (-lICE), since we may need -lsocket or whatever for X linking.
21225
21226   if test "$ISC" = yes; then
21227     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
21228   else
21229     # Martyn Johnson says this is needed for Ultrix, if the X
21230     # libraries were built with DECnet support.  And Karl Berry says
21231     # the Alpha needs dnet_stub (dnet does not exist).
21232     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
21233     cat >"conftest.$ac_ext" <<_ACEOF
21234 #line 21234 "configure"
21235 #include "confdefs.h"
21236
21237 /* Override any gcc2 internal prototype to avoid an error.  */
21238 #ifdef __cplusplus
21239 extern "C"
21240 #endif
21241 /* We use char because int might match the return type of a gcc2
21242    builtin and then its argument prototype would still apply.  */
21243 char XOpenDisplay ();
21244 int
21245 main (void)
21246 {
21247 XOpenDisplay ();
21248   ;
21249   return 0;
21250 }
21251 _ACEOF
21252 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21253 if { (eval echo "$as_me:21253: \"$ac_link\"") >&5
21254   (eval $ac_link) 2>&5
21255   ac_status=$?
21256   echo "$as_me:21256: \$? = $ac_status" >&5
21257   (exit "$ac_status"); } &&
21258          { ac_try='test -s "conftest$ac_exeext"'
21259   { (eval echo "$as_me:21259: \"$ac_try\"") >&5
21260   (eval $ac_try) 2>&5
21261   ac_status=$?
21262   echo "$as_me:21262: \$? = $ac_status" >&5
21263   (exit "$ac_status"); }; }; then
21264   :
21265 else
21266   echo "$as_me: failed program was:" >&5
21267 cat "conftest.$ac_ext" >&5
21268 echo "$as_me:21268: checking for dnet_ntoa in -ldnet" >&5
21269 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
21270 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
21271   echo $ECHO_N "(cached) $ECHO_C" >&6
21272 else
21273   ac_check_lib_save_LIBS=$LIBS
21274 LIBS="-ldnet  $LIBS"
21275 cat >"conftest.$ac_ext" <<_ACEOF
21276 #line 21276 "configure"
21277 #include "confdefs.h"
21278
21279 /* Override any gcc2 internal prototype to avoid an error.  */
21280 #ifdef __cplusplus
21281 extern "C"
21282 #endif
21283 /* We use char because int might match the return type of a gcc2
21284    builtin and then its argument prototype would still apply.  */
21285 char dnet_ntoa ();
21286 int
21287 main (void)
21288 {
21289 dnet_ntoa ();
21290   ;
21291   return 0;
21292 }
21293 _ACEOF
21294 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21295 if { (eval echo "$as_me:21295: \"$ac_link\"") >&5
21296   (eval $ac_link) 2>&5
21297   ac_status=$?
21298   echo "$as_me:21298: \$? = $ac_status" >&5
21299   (exit "$ac_status"); } &&
21300          { ac_try='test -s "conftest$ac_exeext"'
21301   { (eval echo "$as_me:21301: \"$ac_try\"") >&5
21302   (eval $ac_try) 2>&5
21303   ac_status=$?
21304   echo "$as_me:21304: \$? = $ac_status" >&5
21305   (exit "$ac_status"); }; }; then
21306   ac_cv_lib_dnet_dnet_ntoa=yes
21307 else
21308   echo "$as_me: failed program was:" >&5
21309 cat "conftest.$ac_ext" >&5
21310 ac_cv_lib_dnet_dnet_ntoa=no
21311 fi
21312 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21313 LIBS=$ac_check_lib_save_LIBS
21314 fi
21315 echo "$as_me:21315: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
21316 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
21317 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
21318   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
21319 fi
21320
21321     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
21322       echo "$as_me:21322: checking for dnet_ntoa in -ldnet_stub" >&5
21323 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
21324 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
21325   echo $ECHO_N "(cached) $ECHO_C" >&6
21326 else
21327   ac_check_lib_save_LIBS=$LIBS
21328 LIBS="-ldnet_stub  $LIBS"
21329 cat >"conftest.$ac_ext" <<_ACEOF
21330 #line 21330 "configure"
21331 #include "confdefs.h"
21332
21333 /* Override any gcc2 internal prototype to avoid an error.  */
21334 #ifdef __cplusplus
21335 extern "C"
21336 #endif
21337 /* We use char because int might match the return type of a gcc2
21338    builtin and then its argument prototype would still apply.  */
21339 char dnet_ntoa ();
21340 int
21341 main (void)
21342 {
21343 dnet_ntoa ();
21344   ;
21345   return 0;
21346 }
21347 _ACEOF
21348 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21349 if { (eval echo "$as_me:21349: \"$ac_link\"") >&5
21350   (eval $ac_link) 2>&5
21351   ac_status=$?
21352   echo "$as_me:21352: \$? = $ac_status" >&5
21353   (exit "$ac_status"); } &&
21354          { ac_try='test -s "conftest$ac_exeext"'
21355   { (eval echo "$as_me:21355: \"$ac_try\"") >&5
21356   (eval $ac_try) 2>&5
21357   ac_status=$?
21358   echo "$as_me:21358: \$? = $ac_status" >&5
21359   (exit "$ac_status"); }; }; then
21360   ac_cv_lib_dnet_stub_dnet_ntoa=yes
21361 else
21362   echo "$as_me: failed program was:" >&5
21363 cat "conftest.$ac_ext" >&5
21364 ac_cv_lib_dnet_stub_dnet_ntoa=no
21365 fi
21366 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21367 LIBS=$ac_check_lib_save_LIBS
21368 fi
21369 echo "$as_me:21369: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
21370 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
21371 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
21372   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
21373 fi
21374
21375     fi
21376 fi
21377 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21378     LIBS="$ac_xsave_LIBS"
21379
21380     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
21381     # to get the SysV transport functions.
21382     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
21383     # needs -lnsl.
21384     # The nsl library prevents programs from opening the X display
21385     # on Irix 5.2, according to T.E. Dickey.
21386     # The functions gethostbyname, getservbyname, and inet_addr are
21387     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
21388     echo "$as_me:21388: checking for gethostbyname" >&5
21389 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
21390 if test "${ac_cv_func_gethostbyname+set}" = set; then
21391   echo $ECHO_N "(cached) $ECHO_C" >&6
21392 else
21393   cat >"conftest.$ac_ext" <<_ACEOF
21394 #line 21394 "configure"
21395 #include "confdefs.h"
21396 #define gethostbyname autoconf_temporary
21397 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21398 #undef gethostbyname
21399
21400 #ifdef __cplusplus
21401 extern "C"
21402 #endif
21403
21404 /* We use char because int might match the return type of a gcc2
21405    builtin and then its argument prototype would still apply.  */
21406 char gethostbyname (void);
21407
21408 int
21409 main (void)
21410 {
21411
21412 /* The GNU C library defines stubs for functions which it implements
21413     to always fail with ENOSYS.  Some functions are actually named
21414     something starting with __ and the normal name is an alias.  */
21415 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21416 #error found stub for gethostbyname
21417 #endif
21418
21419         return gethostbyname ();
21420   ;
21421   return 0;
21422 }
21423 _ACEOF
21424 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21425 if { (eval echo "$as_me:21425: \"$ac_link\"") >&5
21426   (eval $ac_link) 2>&5
21427   ac_status=$?
21428   echo "$as_me:21428: \$? = $ac_status" >&5
21429   (exit "$ac_status"); } &&
21430          { ac_try='test -s "conftest$ac_exeext"'
21431   { (eval echo "$as_me:21431: \"$ac_try\"") >&5
21432   (eval $ac_try) 2>&5
21433   ac_status=$?
21434   echo "$as_me:21434: \$? = $ac_status" >&5
21435   (exit "$ac_status"); }; }; then
21436   ac_cv_func_gethostbyname=yes
21437 else
21438   echo "$as_me: failed program was:" >&5
21439 cat "conftest.$ac_ext" >&5
21440 ac_cv_func_gethostbyname=no
21441 fi
21442 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21443 fi
21444 echo "$as_me:21444: result: $ac_cv_func_gethostbyname" >&5
21445 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21446
21447     if test $ac_cv_func_gethostbyname = no; then
21448       echo "$as_me:21448: checking for gethostbyname in -lnsl" >&5
21449 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21450 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21451   echo $ECHO_N "(cached) $ECHO_C" >&6
21452 else
21453   ac_check_lib_save_LIBS=$LIBS
21454 LIBS="-lnsl  $LIBS"
21455 cat >"conftest.$ac_ext" <<_ACEOF
21456 #line 21456 "configure"
21457 #include "confdefs.h"
21458
21459 /* Override any gcc2 internal prototype to avoid an error.  */
21460 #ifdef __cplusplus
21461 extern "C"
21462 #endif
21463 /* We use char because int might match the return type of a gcc2
21464    builtin and then its argument prototype would still apply.  */
21465 char gethostbyname ();
21466 int
21467 main (void)
21468 {
21469 gethostbyname ();
21470   ;
21471   return 0;
21472 }
21473 _ACEOF
21474 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21475 if { (eval echo "$as_me:21475: \"$ac_link\"") >&5
21476   (eval $ac_link) 2>&5
21477   ac_status=$?
21478   echo "$as_me:21478: \$? = $ac_status" >&5
21479   (exit "$ac_status"); } &&
21480          { ac_try='test -s "conftest$ac_exeext"'
21481   { (eval echo "$as_me:21481: \"$ac_try\"") >&5
21482   (eval $ac_try) 2>&5
21483   ac_status=$?
21484   echo "$as_me:21484: \$? = $ac_status" >&5
21485   (exit "$ac_status"); }; }; then
21486   ac_cv_lib_nsl_gethostbyname=yes
21487 else
21488   echo "$as_me: failed program was:" >&5
21489 cat "conftest.$ac_ext" >&5
21490 ac_cv_lib_nsl_gethostbyname=no
21491 fi
21492 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21493 LIBS=$ac_check_lib_save_LIBS
21494 fi
21495 echo "$as_me:21495: result: $ac_cv_lib_nsl_gethostbyname" >&5
21496 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21497 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21498   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21499 fi
21500
21501       if test $ac_cv_lib_nsl_gethostbyname = no; then
21502         echo "$as_me:21502: checking for gethostbyname in -lbsd" >&5
21503 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21504 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21505   echo $ECHO_N "(cached) $ECHO_C" >&6
21506 else
21507   ac_check_lib_save_LIBS=$LIBS
21508 LIBS="-lbsd  $LIBS"
21509 cat >"conftest.$ac_ext" <<_ACEOF
21510 #line 21510 "configure"
21511 #include "confdefs.h"
21512
21513 /* Override any gcc2 internal prototype to avoid an error.  */
21514 #ifdef __cplusplus
21515 extern "C"
21516 #endif
21517 /* We use char because int might match the return type of a gcc2
21518    builtin and then its argument prototype would still apply.  */
21519 char gethostbyname ();
21520 int
21521 main (void)
21522 {
21523 gethostbyname ();
21524   ;
21525   return 0;
21526 }
21527 _ACEOF
21528 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21529 if { (eval echo "$as_me:21529: \"$ac_link\"") >&5
21530   (eval $ac_link) 2>&5
21531   ac_status=$?
21532   echo "$as_me:21532: \$? = $ac_status" >&5
21533   (exit "$ac_status"); } &&
21534          { ac_try='test -s "conftest$ac_exeext"'
21535   { (eval echo "$as_me:21535: \"$ac_try\"") >&5
21536   (eval $ac_try) 2>&5
21537   ac_status=$?
21538   echo "$as_me:21538: \$? = $ac_status" >&5
21539   (exit "$ac_status"); }; }; then
21540   ac_cv_lib_bsd_gethostbyname=yes
21541 else
21542   echo "$as_me: failed program was:" >&5
21543 cat "conftest.$ac_ext" >&5
21544 ac_cv_lib_bsd_gethostbyname=no
21545 fi
21546 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21547 LIBS=$ac_check_lib_save_LIBS
21548 fi
21549 echo "$as_me:21549: result: $ac_cv_lib_bsd_gethostbyname" >&5
21550 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21551 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21552   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21553 fi
21554
21555       fi
21556     fi
21557
21558     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21559     # socket/setsockopt and other routines are undefined under SCO ODT
21560     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21561     # on later versions), says Simon Leinen: it contains gethostby*
21562     # variants that don't use the nameserver (or something).  -lsocket
21563     # must be given before -lnsl if both are needed.  We assume that
21564     # if connect needs -lnsl, so does gethostbyname.
21565     echo "$as_me:21565: checking for connect" >&5
21566 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21567 if test "${ac_cv_func_connect+set}" = set; then
21568   echo $ECHO_N "(cached) $ECHO_C" >&6
21569 else
21570   cat >"conftest.$ac_ext" <<_ACEOF
21571 #line 21571 "configure"
21572 #include "confdefs.h"
21573 #define connect autoconf_temporary
21574 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21575 #undef connect
21576
21577 #ifdef __cplusplus
21578 extern "C"
21579 #endif
21580
21581 /* We use char because int might match the return type of a gcc2
21582    builtin and then its argument prototype would still apply.  */
21583 char connect (void);
21584
21585 int
21586 main (void)
21587 {
21588
21589 /* The GNU C library defines stubs for functions which it implements
21590     to always fail with ENOSYS.  Some functions are actually named
21591     something starting with __ and the normal name is an alias.  */
21592 #if defined (__stub_connect) || defined (__stub___connect)
21593 #error found stub for connect
21594 #endif
21595
21596         return connect ();
21597   ;
21598   return 0;
21599 }
21600 _ACEOF
21601 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21602 if { (eval echo "$as_me:21602: \"$ac_link\"") >&5
21603   (eval $ac_link) 2>&5
21604   ac_status=$?
21605   echo "$as_me:21605: \$? = $ac_status" >&5
21606   (exit "$ac_status"); } &&
21607          { ac_try='test -s "conftest$ac_exeext"'
21608   { (eval echo "$as_me:21608: \"$ac_try\"") >&5
21609   (eval $ac_try) 2>&5
21610   ac_status=$?
21611   echo "$as_me:21611: \$? = $ac_status" >&5
21612   (exit "$ac_status"); }; }; then
21613   ac_cv_func_connect=yes
21614 else
21615   echo "$as_me: failed program was:" >&5
21616 cat "conftest.$ac_ext" >&5
21617 ac_cv_func_connect=no
21618 fi
21619 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21620 fi
21621 echo "$as_me:21621: result: $ac_cv_func_connect" >&5
21622 echo "${ECHO_T}$ac_cv_func_connect" >&6
21623
21624     if test $ac_cv_func_connect = no; then
21625       echo "$as_me:21625: checking for connect in -lsocket" >&5
21626 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21627 if test "${ac_cv_lib_socket_connect+set}" = set; then
21628   echo $ECHO_N "(cached) $ECHO_C" >&6
21629 else
21630   ac_check_lib_save_LIBS=$LIBS
21631 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21632 cat >"conftest.$ac_ext" <<_ACEOF
21633 #line 21633 "configure"
21634 #include "confdefs.h"
21635
21636 /* Override any gcc2 internal prototype to avoid an error.  */
21637 #ifdef __cplusplus
21638 extern "C"
21639 #endif
21640 /* We use char because int might match the return type of a gcc2
21641    builtin and then its argument prototype would still apply.  */
21642 char connect ();
21643 int
21644 main (void)
21645 {
21646 connect ();
21647   ;
21648   return 0;
21649 }
21650 _ACEOF
21651 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21652 if { (eval echo "$as_me:21652: \"$ac_link\"") >&5
21653   (eval $ac_link) 2>&5
21654   ac_status=$?
21655   echo "$as_me:21655: \$? = $ac_status" >&5
21656   (exit "$ac_status"); } &&
21657          { ac_try='test -s "conftest$ac_exeext"'
21658   { (eval echo "$as_me:21658: \"$ac_try\"") >&5
21659   (eval $ac_try) 2>&5
21660   ac_status=$?
21661   echo "$as_me:21661: \$? = $ac_status" >&5
21662   (exit "$ac_status"); }; }; then
21663   ac_cv_lib_socket_connect=yes
21664 else
21665   echo "$as_me: failed program was:" >&5
21666 cat "conftest.$ac_ext" >&5
21667 ac_cv_lib_socket_connect=no
21668 fi
21669 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21670 LIBS=$ac_check_lib_save_LIBS
21671 fi
21672 echo "$as_me:21672: result: $ac_cv_lib_socket_connect" >&5
21673 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21674 if test "$ac_cv_lib_socket_connect" = yes; then
21675   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21676 fi
21677
21678     fi
21679
21680     # Guillermo Gomez says -lposix is necessary on A/UX.
21681     echo "$as_me:21681: checking for remove" >&5
21682 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21683 if test "${ac_cv_func_remove+set}" = set; then
21684   echo $ECHO_N "(cached) $ECHO_C" >&6
21685 else
21686   cat >"conftest.$ac_ext" <<_ACEOF
21687 #line 21687 "configure"
21688 #include "confdefs.h"
21689 #define remove autoconf_temporary
21690 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21691 #undef remove
21692
21693 #ifdef __cplusplus
21694 extern "C"
21695 #endif
21696
21697 /* We use char because int might match the return type of a gcc2
21698    builtin and then its argument prototype would still apply.  */
21699 char remove (void);
21700
21701 int
21702 main (void)
21703 {
21704
21705 /* The GNU C library defines stubs for functions which it implements
21706     to always fail with ENOSYS.  Some functions are actually named
21707     something starting with __ and the normal name is an alias.  */
21708 #if defined (__stub_remove) || defined (__stub___remove)
21709 #error found stub for remove
21710 #endif
21711
21712         return remove ();
21713   ;
21714   return 0;
21715 }
21716 _ACEOF
21717 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21718 if { (eval echo "$as_me:21718: \"$ac_link\"") >&5
21719   (eval $ac_link) 2>&5
21720   ac_status=$?
21721   echo "$as_me:21721: \$? = $ac_status" >&5
21722   (exit "$ac_status"); } &&
21723          { ac_try='test -s "conftest$ac_exeext"'
21724   { (eval echo "$as_me:21724: \"$ac_try\"") >&5
21725   (eval $ac_try) 2>&5
21726   ac_status=$?
21727   echo "$as_me:21727: \$? = $ac_status" >&5
21728   (exit "$ac_status"); }; }; then
21729   ac_cv_func_remove=yes
21730 else
21731   echo "$as_me: failed program was:" >&5
21732 cat "conftest.$ac_ext" >&5
21733 ac_cv_func_remove=no
21734 fi
21735 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21736 fi
21737 echo "$as_me:21737: result: $ac_cv_func_remove" >&5
21738 echo "${ECHO_T}$ac_cv_func_remove" >&6
21739
21740     if test $ac_cv_func_remove = no; then
21741       echo "$as_me:21741: checking for remove in -lposix" >&5
21742 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21743 if test "${ac_cv_lib_posix_remove+set}" = set; then
21744   echo $ECHO_N "(cached) $ECHO_C" >&6
21745 else
21746   ac_check_lib_save_LIBS=$LIBS
21747 LIBS="-lposix  $LIBS"
21748 cat >"conftest.$ac_ext" <<_ACEOF
21749 #line 21749 "configure"
21750 #include "confdefs.h"
21751
21752 /* Override any gcc2 internal prototype to avoid an error.  */
21753 #ifdef __cplusplus
21754 extern "C"
21755 #endif
21756 /* We use char because int might match the return type of a gcc2
21757    builtin and then its argument prototype would still apply.  */
21758 char remove ();
21759 int
21760 main (void)
21761 {
21762 remove ();
21763   ;
21764   return 0;
21765 }
21766 _ACEOF
21767 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21768 if { (eval echo "$as_me:21768: \"$ac_link\"") >&5
21769   (eval $ac_link) 2>&5
21770   ac_status=$?
21771   echo "$as_me:21771: \$? = $ac_status" >&5
21772   (exit "$ac_status"); } &&
21773          { ac_try='test -s "conftest$ac_exeext"'
21774   { (eval echo "$as_me:21774: \"$ac_try\"") >&5
21775   (eval $ac_try) 2>&5
21776   ac_status=$?
21777   echo "$as_me:21777: \$? = $ac_status" >&5
21778   (exit "$ac_status"); }; }; then
21779   ac_cv_lib_posix_remove=yes
21780 else
21781   echo "$as_me: failed program was:" >&5
21782 cat "conftest.$ac_ext" >&5
21783 ac_cv_lib_posix_remove=no
21784 fi
21785 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21786 LIBS=$ac_check_lib_save_LIBS
21787 fi
21788 echo "$as_me:21788: result: $ac_cv_lib_posix_remove" >&5
21789 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21790 if test "$ac_cv_lib_posix_remove" = yes; then
21791   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21792 fi
21793
21794     fi
21795
21796     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21797     echo "$as_me:21797: checking for shmat" >&5
21798 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21799 if test "${ac_cv_func_shmat+set}" = set; then
21800   echo $ECHO_N "(cached) $ECHO_C" >&6
21801 else
21802   cat >"conftest.$ac_ext" <<_ACEOF
21803 #line 21803 "configure"
21804 #include "confdefs.h"
21805 #define shmat autoconf_temporary
21806 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21807 #undef shmat
21808
21809 #ifdef __cplusplus
21810 extern "C"
21811 #endif
21812
21813 /* We use char because int might match the return type of a gcc2
21814    builtin and then its argument prototype would still apply.  */
21815 char shmat (void);
21816
21817 int
21818 main (void)
21819 {
21820
21821 /* The GNU C library defines stubs for functions which it implements
21822     to always fail with ENOSYS.  Some functions are actually named
21823     something starting with __ and the normal name is an alias.  */
21824 #if defined (__stub_shmat) || defined (__stub___shmat)
21825 #error found stub for shmat
21826 #endif
21827
21828         return shmat ();
21829   ;
21830   return 0;
21831 }
21832 _ACEOF
21833 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21834 if { (eval echo "$as_me:21834: \"$ac_link\"") >&5
21835   (eval $ac_link) 2>&5
21836   ac_status=$?
21837   echo "$as_me:21837: \$? = $ac_status" >&5
21838   (exit "$ac_status"); } &&
21839          { ac_try='test -s "conftest$ac_exeext"'
21840   { (eval echo "$as_me:21840: \"$ac_try\"") >&5
21841   (eval $ac_try) 2>&5
21842   ac_status=$?
21843   echo "$as_me:21843: \$? = $ac_status" >&5
21844   (exit "$ac_status"); }; }; then
21845   ac_cv_func_shmat=yes
21846 else
21847   echo "$as_me: failed program was:" >&5
21848 cat "conftest.$ac_ext" >&5
21849 ac_cv_func_shmat=no
21850 fi
21851 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21852 fi
21853 echo "$as_me:21853: result: $ac_cv_func_shmat" >&5
21854 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21855
21856     if test $ac_cv_func_shmat = no; then
21857       echo "$as_me:21857: checking for shmat in -lipc" >&5
21858 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21859 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21860   echo $ECHO_N "(cached) $ECHO_C" >&6
21861 else
21862   ac_check_lib_save_LIBS=$LIBS
21863 LIBS="-lipc  $LIBS"
21864 cat >"conftest.$ac_ext" <<_ACEOF
21865 #line 21865 "configure"
21866 #include "confdefs.h"
21867
21868 /* Override any gcc2 internal prototype to avoid an error.  */
21869 #ifdef __cplusplus
21870 extern "C"
21871 #endif
21872 /* We use char because int might match the return type of a gcc2
21873    builtin and then its argument prototype would still apply.  */
21874 char shmat ();
21875 int
21876 main (void)
21877 {
21878 shmat ();
21879   ;
21880   return 0;
21881 }
21882 _ACEOF
21883 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21884 if { (eval echo "$as_me:21884: \"$ac_link\"") >&5
21885   (eval $ac_link) 2>&5
21886   ac_status=$?
21887   echo "$as_me:21887: \$? = $ac_status" >&5
21888   (exit "$ac_status"); } &&
21889          { ac_try='test -s "conftest$ac_exeext"'
21890   { (eval echo "$as_me:21890: \"$ac_try\"") >&5
21891   (eval $ac_try) 2>&5
21892   ac_status=$?
21893   echo "$as_me:21893: \$? = $ac_status" >&5
21894   (exit "$ac_status"); }; }; then
21895   ac_cv_lib_ipc_shmat=yes
21896 else
21897   echo "$as_me: failed program was:" >&5
21898 cat "conftest.$ac_ext" >&5
21899 ac_cv_lib_ipc_shmat=no
21900 fi
21901 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21902 LIBS=$ac_check_lib_save_LIBS
21903 fi
21904 echo "$as_me:21904: result: $ac_cv_lib_ipc_shmat" >&5
21905 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21906 if test "$ac_cv_lib_ipc_shmat" = yes; then
21907   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21908 fi
21909
21910     fi
21911   fi
21912
21913   # Check for libraries that X11R6 Xt/Xaw programs need.
21914   ac_save_LDFLAGS=$LDFLAGS
21915   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21916   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21917   # check for ICE first), but we must link in the order -lSM -lICE or
21918   # we get undefined symbols.  So assume we have SM if we have ICE.
21919   # These have to be linked with before -lX11, unlike the other
21920   # libraries we check for below, so use a different variable.
21921   # John Interrante, Karl Berry
21922   echo "$as_me:21922: checking for IceConnectionNumber in -lICE" >&5
21923 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21924 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21925   echo $ECHO_N "(cached) $ECHO_C" >&6
21926 else
21927   ac_check_lib_save_LIBS=$LIBS
21928 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21929 cat >"conftest.$ac_ext" <<_ACEOF
21930 #line 21930 "configure"
21931 #include "confdefs.h"
21932
21933 /* Override any gcc2 internal prototype to avoid an error.  */
21934 #ifdef __cplusplus
21935 extern "C"
21936 #endif
21937 /* We use char because int might match the return type of a gcc2
21938    builtin and then its argument prototype would still apply.  */
21939 char IceConnectionNumber ();
21940 int
21941 main (void)
21942 {
21943 IceConnectionNumber ();
21944   ;
21945   return 0;
21946 }
21947 _ACEOF
21948 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21949 if { (eval echo "$as_me:21949: \"$ac_link\"") >&5
21950   (eval $ac_link) 2>&5
21951   ac_status=$?
21952   echo "$as_me:21952: \$? = $ac_status" >&5
21953   (exit "$ac_status"); } &&
21954          { ac_try='test -s "conftest$ac_exeext"'
21955   { (eval echo "$as_me:21955: \"$ac_try\"") >&5
21956   (eval $ac_try) 2>&5
21957   ac_status=$?
21958   echo "$as_me:21958: \$? = $ac_status" >&5
21959   (exit "$ac_status"); }; }; then
21960   ac_cv_lib_ICE_IceConnectionNumber=yes
21961 else
21962   echo "$as_me: failed program was:" >&5
21963 cat "conftest.$ac_ext" >&5
21964 ac_cv_lib_ICE_IceConnectionNumber=no
21965 fi
21966 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21967 LIBS=$ac_check_lib_save_LIBS
21968 fi
21969 echo "$as_me:21969: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21970 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21971 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21972   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21973 fi
21974
21975   LDFLAGS=$ac_save_LDFLAGS
21976
21977 fi
21978
21979 fi
21980
21981 if test "$GCC" = yes || test "$GXX" = yes
21982 then
21983
21984 if test "$GCC" = yes || test "$GXX" = yes
21985 then
21986         case $CFLAGS in
21987         (*-Werror=*)
21988                 cf_temp_flags=
21989                 for cf_temp_scan in $CFLAGS
21990                 do
21991                         case "x$cf_temp_scan" in
21992                         (x-Werror=format*)
21993
21994         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21995         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21996
21997                                 ;;
21998                         (x-Werror=*)
21999
22000         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22001         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22002
22003                                 ;;
22004                         (*)
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                         esac
22011                 done
22012                 if test "x$CFLAGS" != "x$cf_temp_flags"
22013                 then
22014                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
22015
22016 echo "${as_me:-configure}:22016: testing repairing CFLAGS: $CFLAGS ..." 1>&5
22017
22018                         CFLAGS="$cf_temp_flags"
22019                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
22020
22021 echo "${as_me:-configure}:22021: testing ... fixed $CFLAGS ..." 1>&5
22022
22023                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22024
22025 echo "${as_me:-configure}:22025: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22026
22027                 fi
22028                 ;;
22029         esac
22030 fi
22031
22032 if test "$GCC" = yes || test "$GXX" = yes
22033 then
22034         case $CPPFLAGS in
22035         (*-Werror=*)
22036                 cf_temp_flags=
22037                 for cf_temp_scan in $CPPFLAGS
22038                 do
22039                         case "x$cf_temp_scan" in
22040                         (x-Werror=format*)
22041
22042         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22043         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22044
22045                                 ;;
22046                         (x-Werror=*)
22047
22048         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22049         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22050
22051                                 ;;
22052                         (*)
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                         esac
22059                 done
22060                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
22061                 then
22062                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
22063
22064 echo "${as_me:-configure}:22064: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
22065
22066                         CPPFLAGS="$cf_temp_flags"
22067                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
22068
22069 echo "${as_me:-configure}:22069: testing ... fixed $CPPFLAGS ..." 1>&5
22070
22071                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22072
22073 echo "${as_me:-configure}:22073: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22074
22075                 fi
22076                 ;;
22077         esac
22078 fi
22079
22080 if test "$GCC" = yes || test "$GXX" = yes
22081 then
22082         case $LDFLAGS in
22083         (*-Werror=*)
22084                 cf_temp_flags=
22085                 for cf_temp_scan in $LDFLAGS
22086                 do
22087                         case "x$cf_temp_scan" in
22088                         (x-Werror=format*)
22089
22090         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22091         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22092
22093                                 ;;
22094                         (x-Werror=*)
22095
22096         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22097         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22098
22099                                 ;;
22100                         (*)
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                         esac
22107                 done
22108                 if test "x$LDFLAGS" != "x$cf_temp_flags"
22109                 then
22110                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
22111
22112 echo "${as_me:-configure}:22112: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
22113
22114                         LDFLAGS="$cf_temp_flags"
22115                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
22116
22117 echo "${as_me:-configure}:22117: testing ... fixed $LDFLAGS ..." 1>&5
22118
22119                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22120
22121 echo "${as_me:-configure}:22121: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22122
22123                 fi
22124                 ;;
22125         esac
22126 fi
22127
22128 echo "$as_me:22128: checking if you want to turn on gcc warnings" >&5
22129 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
22130
22131 # Check whether --enable-warnings or --disable-warnings was given.
22132 if test "${enable_warnings+set}" = set; then
22133   enableval="$enable_warnings"
22134   test "$enableval" != yes && enableval=no
22135         if test "$enableval" != "no" ; then
22136     enable_warnings=yes
22137         else
22138                 enable_warnings=no
22139         fi
22140 else
22141   enableval=no
22142         enable_warnings=no
22143
22144 fi;
22145 echo "$as_me:22145: result: $enable_warnings" >&5
22146 echo "${ECHO_T}$enable_warnings" >&6
22147 if test "$enable_warnings" = "yes"
22148 then
22149
22150 if test "$GCC" = yes || test "$GXX" = yes
22151 then
22152 cat > conftest.i <<EOF
22153 #ifndef GCC_PRINTF
22154 #define GCC_PRINTF 0
22155 #endif
22156 #ifndef GCC_SCANF
22157 #define GCC_SCANF 0
22158 #endif
22159 #ifndef GCC_NORETURN
22160 #define GCC_NORETURN /* nothing */
22161 #endif
22162 #ifndef GCC_UNUSED
22163 #define GCC_UNUSED /* nothing */
22164 #endif
22165 EOF
22166 if test "$GCC" = yes
22167 then
22168         { echo "$as_me:22168: checking for $CC __attribute__ directives..." >&5
22169 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
22170 cat > "conftest.$ac_ext" <<EOF
22171 #line 22171 "${as_me:-configure}"
22172 #include "confdefs.h"
22173 #include "conftest.h"
22174 #include "conftest.i"
22175 #if     GCC_PRINTF
22176 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
22177 #else
22178 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
22179 #endif
22180 #if     GCC_SCANF
22181 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
22182 #else
22183 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
22184 #endif
22185 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
22186 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
22187 extern GCC_NORETURN void foo(void);
22188 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
22189 EOF
22190         cf_printf_attribute=no
22191         cf_scanf_attribute=no
22192         for cf_attribute in scanf printf unused noreturn
22193         do
22194
22195 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
22196
22197                 cf_directive="__attribute__(($cf_attribute))"
22198                 echo "checking for $CC $cf_directive" 1>&5
22199
22200                 case "$cf_attribute" in
22201                 (printf)
22202                         cf_printf_attribute=yes
22203                         cat >conftest.h <<EOF
22204 #define GCC_$cf_ATTRIBUTE 1
22205 EOF
22206                         ;;
22207                 (scanf)
22208                         cf_scanf_attribute=yes
22209                         cat >conftest.h <<EOF
22210 #define GCC_$cf_ATTRIBUTE 1
22211 EOF
22212                         ;;
22213                 (*)
22214                         cat >conftest.h <<EOF
22215 #define GCC_$cf_ATTRIBUTE $cf_directive
22216 EOF
22217                         ;;
22218                 esac
22219
22220                 if { (eval echo "$as_me:22220: \"$ac_compile\"") >&5
22221   (eval $ac_compile) 2>&5
22222   ac_status=$?
22223   echo "$as_me:22223: \$? = $ac_status" >&5
22224   (exit "$ac_status"); }; then
22225                         test -n "$verbose" && echo "$as_me:22225: result: ... $cf_attribute" >&5
22226 echo "${ECHO_T}... $cf_attribute" >&6
22227                         cat conftest.h >>confdefs.h
22228                         case "$cf_attribute" in
22229                         (noreturn)
22230
22231 cat >>confdefs.h <<EOF
22232 #define GCC_NORETURN $cf_directive
22233 EOF
22234
22235                                 ;;
22236                         (printf)
22237                                 cf_value='/* nothing */'
22238                                 if test "$cf_printf_attribute" != no ; then
22239                                         cf_value='__attribute__((format(printf,fmt,var)))'
22240
22241 cat >>confdefs.h <<\EOF
22242 #define GCC_PRINTF 1
22243 EOF
22244
22245                                 fi
22246
22247 cat >>confdefs.h <<EOF
22248 #define GCC_PRINTFLIKE(fmt,var) $cf_value
22249 EOF
22250
22251                                 ;;
22252                         (scanf)
22253                                 cf_value='/* nothing */'
22254                                 if test "$cf_scanf_attribute" != no ; then
22255                                         cf_value='__attribute__((format(scanf,fmt,var)))'
22256
22257 cat >>confdefs.h <<\EOF
22258 #define GCC_SCANF 1
22259 EOF
22260
22261                                 fi
22262
22263 cat >>confdefs.h <<EOF
22264 #define GCC_SCANFLIKE(fmt,var) $cf_value
22265 EOF
22266
22267                                 ;;
22268                         (unused)
22269
22270 cat >>confdefs.h <<EOF
22271 #define GCC_UNUSED $cf_directive
22272 EOF
22273
22274                                 ;;
22275                         esac
22276                 fi
22277         done
22278 else
22279         ${FGREP-fgrep} define conftest.i >>confdefs.h
22280 fi
22281 rm -rf ./conftest*
22282 fi
22283
22284 if test "x$have_x" = xyes; then
22285
22286 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
22287 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
22288 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
22289 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
22290 for cf_X_CFLAGS in $X_CFLAGS
22291 do
22292         case "x$cf_X_CFLAGS" in
22293         x-[IUD]*)
22294                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
22295                 ;;
22296         *)
22297                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
22298                 ;;
22299         esac
22300 done
22301
22302 cat >"conftest.$ac_ext" <<_ACEOF
22303 #line 22303 "configure"
22304 #include "confdefs.h"
22305
22306 #include <stdlib.h>
22307 #include <X11/Intrinsic.h>
22308
22309 int
22310 main (void)
22311 {
22312 String foo = malloc(1); free((void*)foo)
22313   ;
22314   return 0;
22315 }
22316 _ACEOF
22317 rm -f "conftest.$ac_objext"
22318 if { (eval echo "$as_me:22318: \"$ac_compile\"") >&5
22319   (eval $ac_compile) 2>&5
22320   ac_status=$?
22321   echo "$as_me:22321: \$? = $ac_status" >&5
22322   (exit "$ac_status"); } &&
22323          { ac_try='test -s "conftest.$ac_objext"'
22324   { (eval echo "$as_me:22324: \"$ac_try\"") >&5
22325   (eval $ac_try) 2>&5
22326   ac_status=$?
22327   echo "$as_me:22327: \$? = $ac_status" >&5
22328   (exit "$ac_status"); }; }; then
22329
22330 echo "$as_me:22330: checking for X11/Xt const-feature" >&5
22331 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
22332 if test "${cf_cv_const_x_string+set}" = set; then
22333   echo $ECHO_N "(cached) $ECHO_C" >&6
22334 else
22335
22336         cat >"conftest.$ac_ext" <<_ACEOF
22337 #line 22337 "configure"
22338 #include "confdefs.h"
22339
22340 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
22341 #undef  XTSTRINGDEFINES /* X11R5 and later */
22342 #include <stdlib.h>
22343 #include <X11/Intrinsic.h>
22344
22345 int
22346 main (void)
22347 {
22348 String foo = malloc(1); *foo = 0
22349   ;
22350   return 0;
22351 }
22352 _ACEOF
22353 rm -f "conftest.$ac_objext"
22354 if { (eval echo "$as_me:22354: \"$ac_compile\"") >&5
22355   (eval $ac_compile) 2>&5
22356   ac_status=$?
22357   echo "$as_me:22357: \$? = $ac_status" >&5
22358   (exit "$ac_status"); } &&
22359          { ac_try='test -s "conftest.$ac_objext"'
22360   { (eval echo "$as_me:22360: \"$ac_try\"") >&5
22361   (eval $ac_try) 2>&5
22362   ac_status=$?
22363   echo "$as_me:22363: \$? = $ac_status" >&5
22364   (exit "$ac_status"); }; }; then
22365
22366                         cf_cv_const_x_string=no
22367
22368 else
22369   echo "$as_me: failed program was:" >&5
22370 cat "conftest.$ac_ext" >&5
22371
22372                         cf_cv_const_x_string=yes
22373
22374 fi
22375 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22376
22377 fi
22378 echo "$as_me:22378: result: $cf_cv_const_x_string" >&5
22379 echo "${ECHO_T}$cf_cv_const_x_string" >&6
22380
22381 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
22382 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
22383 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
22384
22385 case "$cf_cv_const_x_string" in
22386 (no)
22387
22388         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22389         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
22390
22391         ;;
22392 (*)
22393
22394         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22395         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
22396
22397         ;;
22398 esac
22399
22400 else
22401   echo "$as_me: failed program was:" >&5
22402 cat "conftest.$ac_ext" >&5
22403 fi
22404 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22405  fi
22406 cat > "conftest.$ac_ext" <<EOF
22407 #line 22407 "${as_me:-configure}"
22408 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
22409 EOF
22410 if test "$INTEL_COMPILER" = yes
22411 then
22412 # The "-wdXXX" options suppress warnings:
22413 # remark #1419: external declaration in primary source file
22414 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
22415 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
22416 # remark #193: zero used for undefined preprocessing identifier
22417 # remark #593: variable "curs_sb_left_arrow" was set but never used
22418 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
22419 # remark #869: parameter "tw" was never referenced
22420 # remark #981: operands are evaluated in unspecified order
22421 # warning #279: controlling expression is constant
22422
22423         { echo "$as_me:22423: checking for $CC warning options..." >&5
22424 echo "$as_me: checking for $CC warning options..." >&6;}
22425         cf_save_CFLAGS="$CFLAGS"
22426         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
22427         for cf_opt in \
22428                 wd1419 \
22429                 wd1683 \
22430                 wd1684 \
22431                 wd193 \
22432                 wd593 \
22433                 wd279 \
22434                 wd810 \
22435                 wd869 \
22436                 wd981
22437         do
22438                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22439                 if { (eval echo "$as_me:22439: \"$ac_compile\"") >&5
22440   (eval $ac_compile) 2>&5
22441   ac_status=$?
22442   echo "$as_me:22442: \$? = $ac_status" >&5
22443   (exit "$ac_status"); }; then
22444                         test -n "$verbose" && echo "$as_me:22444: result: ... -$cf_opt" >&5
22445 echo "${ECHO_T}... -$cf_opt" >&6
22446                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22447                 fi
22448         done
22449         CFLAGS="$cf_save_CFLAGS"
22450 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
22451 then
22452         { echo "$as_me:22452: checking for $CC warning options..." >&5
22453 echo "$as_me: checking for $CC warning options..." >&6;}
22454         cf_save_CFLAGS="$CFLAGS"
22455         cf_warn_CONST=""
22456         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22457         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22458         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22459         for cf_opt in W Wall \
22460                 Wbad-function-cast \
22461                 Wcast-align \
22462                 Wcast-qual \
22463                 Wdeclaration-after-statement \
22464                 Wextra \
22465                 Winline \
22466                 Wmissing-declarations \
22467                 Wmissing-prototypes \
22468                 Wnested-externs \
22469                 Wpointer-arith \
22470                 Wshadow \
22471                 Wstrict-prototypes \
22472                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
22473         do
22474                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22475                 if { (eval echo "$as_me:22475: \"$ac_compile\"") >&5
22476   (eval $ac_compile) 2>&5
22477   ac_status=$?
22478   echo "$as_me:22478: \$? = $ac_status" >&5
22479   (exit "$ac_status"); }; then
22480                         test -n "$verbose" && echo "$as_me:22480: result: ... -$cf_opt" >&5
22481 echo "${ECHO_T}... -$cf_opt" >&6
22482                         case "$cf_opt" in
22483                         (Winline)
22484                                 case "$GCC_VERSION" in
22485                                 ([34].*)
22486                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22487
22488 echo "${as_me:-configure}:22488: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22489
22490                                         continue;;
22491                                 esac
22492                                 ;;
22493                         (Wpointer-arith)
22494                                 case "$GCC_VERSION" in
22495                                 ([12].*)
22496                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22497
22498 echo "${as_me:-configure}:22498: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22499
22500                                         continue;;
22501                                 esac
22502                                 ;;
22503                         esac
22504                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22505                 fi
22506         done
22507         CFLAGS="$cf_save_CFLAGS"
22508 fi
22509 rm -rf ./conftest*
22510
22511 fi
22512
22513 fi
22514
22515 echo "$as_me:22515: checking if you want to use dmalloc for testing" >&5
22516 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22517
22518 # Check whether --with-dmalloc or --without-dmalloc was given.
22519 if test "${with_dmalloc+set}" = set; then
22520   withval="$with_dmalloc"
22521   case "x$withval" in
22522         (x|xno) ;;
22523         (*)
22524                 : "${with_cflags:=-g}"
22525                 : "${enable_leaks:=no}"
22526                 with_dmalloc=yes
22527
22528 cat >>confdefs.h <<EOF
22529 #define USE_DMALLOC 1
22530 EOF
22531
22532                 ;;
22533         esac
22534 else
22535   with_dmalloc=
22536 fi;
22537 echo "$as_me:22537: result: ${with_dmalloc:-no}" >&5
22538 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22539
22540 case ".$with_cflags" in
22541 (.*-g*)
22542         case .$CFLAGS in
22543         (.*-g*)
22544                 ;;
22545         (*)
22546
22547 cf_fix_cppflags=no
22548 cf_new_cflags=
22549 cf_new_cppflags=
22550 cf_new_extra_cppflags=
22551
22552 for cf_add_cflags in -g
22553 do
22554 case "$cf_fix_cppflags" in
22555 (no)
22556         case "$cf_add_cflags" in
22557         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22558                 case "$cf_add_cflags" in
22559                 (-D*)
22560                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22561
22562                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22563                                 && test -z "${cf_tst_cflags}" \
22564                                 && cf_fix_cppflags=yes
22565
22566                         if test "$cf_fix_cppflags" = yes ; then
22567
22568         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22569         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22570
22571                                 continue
22572                         elif test "${cf_tst_cflags}" = "\"'" ; then
22573
22574         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22575         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22576
22577                                 continue
22578                         fi
22579                         ;;
22580                 esac
22581                 case "$CPPFLAGS" in
22582                 (*$cf_add_cflags)
22583                         ;;
22584                 (*)
22585                         case "$cf_add_cflags" in
22586                         (-D*)
22587                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22588
22589 CPPFLAGS=`echo "$CPPFLAGS" | \
22590         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22591                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22592
22593                                 ;;
22594                         esac
22595
22596         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22597         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22598
22599                         ;;
22600                 esac
22601                 ;;
22602         (*)
22603
22604         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22605         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22606
22607                 ;;
22608         esac
22609         ;;
22610 (yes)
22611
22612         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22613         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22614
22615         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22616
22617         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22618                 && test -z "${cf_tst_cflags}" \
22619                 && cf_fix_cppflags=no
22620         ;;
22621 esac
22622 done
22623
22624 if test -n "$cf_new_cflags" ; then
22625
22626         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22627         CFLAGS="${CFLAGS}$cf_new_cflags"
22628
22629 fi
22630
22631 if test -n "$cf_new_cppflags" ; then
22632
22633         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22634         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22635
22636 fi
22637
22638 if test -n "$cf_new_extra_cppflags" ; then
22639
22640         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22641         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22642
22643 fi
22644
22645                 ;;
22646         esac
22647         ;;
22648 esac
22649
22650 if test "$with_dmalloc" = yes ; then
22651         echo "$as_me:22651: checking for dmalloc.h" >&5
22652 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22653 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22654   echo $ECHO_N "(cached) $ECHO_C" >&6
22655 else
22656   cat >"conftest.$ac_ext" <<_ACEOF
22657 #line 22657 "configure"
22658 #include "confdefs.h"
22659 #include <dmalloc.h>
22660 _ACEOF
22661 if { (eval echo "$as_me:22661: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22662   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22663   ac_status=$?
22664   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22665   rm -f conftest.er1
22666   cat conftest.err >&5
22667   echo "$as_me:22667: \$? = $ac_status" >&5
22668   (exit "$ac_status"); } >/dev/null; then
22669   if test -s conftest.err; then
22670     ac_cpp_err=$ac_c_preproc_warn_flag
22671   else
22672     ac_cpp_err=
22673   fi
22674 else
22675   ac_cpp_err=yes
22676 fi
22677 if test -z "$ac_cpp_err"; then
22678   ac_cv_header_dmalloc_h=yes
22679 else
22680   echo "$as_me: failed program was:" >&5
22681   cat "conftest.$ac_ext" >&5
22682   ac_cv_header_dmalloc_h=no
22683 fi
22684 rm -f conftest.err "conftest.$ac_ext"
22685 fi
22686 echo "$as_me:22686: result: $ac_cv_header_dmalloc_h" >&5
22687 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22688 if test "$ac_cv_header_dmalloc_h" = yes; then
22689
22690 echo "$as_me:22690: checking for dmalloc_debug in -ldmalloc" >&5
22691 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22692 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22693   echo $ECHO_N "(cached) $ECHO_C" >&6
22694 else
22695   ac_check_lib_save_LIBS=$LIBS
22696 LIBS="-ldmalloc  $LIBS"
22697 cat >"conftest.$ac_ext" <<_ACEOF
22698 #line 22698 "configure"
22699 #include "confdefs.h"
22700
22701 /* Override any gcc2 internal prototype to avoid an error.  */
22702 #ifdef __cplusplus
22703 extern "C"
22704 #endif
22705 /* We use char because int might match the return type of a gcc2
22706    builtin and then its argument prototype would still apply.  */
22707 char dmalloc_debug ();
22708 int
22709 main (void)
22710 {
22711 dmalloc_debug ();
22712   ;
22713   return 0;
22714 }
22715 _ACEOF
22716 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22717 if { (eval echo "$as_me:22717: \"$ac_link\"") >&5
22718   (eval $ac_link) 2>&5
22719   ac_status=$?
22720   echo "$as_me:22720: \$? = $ac_status" >&5
22721   (exit "$ac_status"); } &&
22722          { ac_try='test -s "conftest$ac_exeext"'
22723   { (eval echo "$as_me:22723: \"$ac_try\"") >&5
22724   (eval $ac_try) 2>&5
22725   ac_status=$?
22726   echo "$as_me:22726: \$? = $ac_status" >&5
22727   (exit "$ac_status"); }; }; then
22728   ac_cv_lib_dmalloc_dmalloc_debug=yes
22729 else
22730   echo "$as_me: failed program was:" >&5
22731 cat "conftest.$ac_ext" >&5
22732 ac_cv_lib_dmalloc_dmalloc_debug=no
22733 fi
22734 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22735 LIBS=$ac_check_lib_save_LIBS
22736 fi
22737 echo "$as_me:22737: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22738 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22739 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22740   cat >>confdefs.h <<EOF
22741 #define HAVE_LIBDMALLOC 1
22742 EOF
22743
22744   LIBS="-ldmalloc $LIBS"
22745
22746 fi
22747
22748 fi
22749
22750 fi
22751
22752 echo "$as_me:22752: checking if you want to use dbmalloc for testing" >&5
22753 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22754
22755 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22756 if test "${with_dbmalloc+set}" = set; then
22757   withval="$with_dbmalloc"
22758   case "x$withval" in
22759         (x|xno) ;;
22760         (*)
22761                 : "${with_cflags:=-g}"
22762                 : "${enable_leaks:=no}"
22763                 with_dbmalloc=yes
22764
22765 cat >>confdefs.h <<EOF
22766 #define USE_DBMALLOC 1
22767 EOF
22768
22769                 ;;
22770         esac
22771 else
22772   with_dbmalloc=
22773 fi;
22774 echo "$as_me:22774: result: ${with_dbmalloc:-no}" >&5
22775 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22776
22777 case ".$with_cflags" in
22778 (.*-g*)
22779         case .$CFLAGS in
22780         (.*-g*)
22781                 ;;
22782         (*)
22783
22784 cf_fix_cppflags=no
22785 cf_new_cflags=
22786 cf_new_cppflags=
22787 cf_new_extra_cppflags=
22788
22789 for cf_add_cflags in -g
22790 do
22791 case "$cf_fix_cppflags" in
22792 (no)
22793         case "$cf_add_cflags" in
22794         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22795                 case "$cf_add_cflags" in
22796                 (-D*)
22797                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22798
22799                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22800                                 && test -z "${cf_tst_cflags}" \
22801                                 && cf_fix_cppflags=yes
22802
22803                         if test "$cf_fix_cppflags" = yes ; then
22804
22805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22807
22808                                 continue
22809                         elif test "${cf_tst_cflags}" = "\"'" ; then
22810
22811         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22812         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22813
22814                                 continue
22815                         fi
22816                         ;;
22817                 esac
22818                 case "$CPPFLAGS" in
22819                 (*$cf_add_cflags)
22820                         ;;
22821                 (*)
22822                         case "$cf_add_cflags" in
22823                         (-D*)
22824                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22825
22826 CPPFLAGS=`echo "$CPPFLAGS" | \
22827         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22828                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22829
22830                                 ;;
22831                         esac
22832
22833         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22834         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22835
22836                         ;;
22837                 esac
22838                 ;;
22839         (*)
22840
22841         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22842         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22843
22844                 ;;
22845         esac
22846         ;;
22847 (yes)
22848
22849         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22850         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22851
22852         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22853
22854         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22855                 && test -z "${cf_tst_cflags}" \
22856                 && cf_fix_cppflags=no
22857         ;;
22858 esac
22859 done
22860
22861 if test -n "$cf_new_cflags" ; then
22862
22863         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22864         CFLAGS="${CFLAGS}$cf_new_cflags"
22865
22866 fi
22867
22868 if test -n "$cf_new_cppflags" ; then
22869
22870         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22871         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22872
22873 fi
22874
22875 if test -n "$cf_new_extra_cppflags" ; then
22876
22877         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22878         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22879
22880 fi
22881
22882                 ;;
22883         esac
22884         ;;
22885 esac
22886
22887 if test "$with_dbmalloc" = yes ; then
22888         echo "$as_me:22888: checking for dbmalloc.h" >&5
22889 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22890 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22891   echo $ECHO_N "(cached) $ECHO_C" >&6
22892 else
22893   cat >"conftest.$ac_ext" <<_ACEOF
22894 #line 22894 "configure"
22895 #include "confdefs.h"
22896 #include <dbmalloc.h>
22897 _ACEOF
22898 if { (eval echo "$as_me:22898: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22899   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22900   ac_status=$?
22901   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22902   rm -f conftest.er1
22903   cat conftest.err >&5
22904   echo "$as_me:22904: \$? = $ac_status" >&5
22905   (exit "$ac_status"); } >/dev/null; then
22906   if test -s conftest.err; then
22907     ac_cpp_err=$ac_c_preproc_warn_flag
22908   else
22909     ac_cpp_err=
22910   fi
22911 else
22912   ac_cpp_err=yes
22913 fi
22914 if test -z "$ac_cpp_err"; then
22915   ac_cv_header_dbmalloc_h=yes
22916 else
22917   echo "$as_me: failed program was:" >&5
22918   cat "conftest.$ac_ext" >&5
22919   ac_cv_header_dbmalloc_h=no
22920 fi
22921 rm -f conftest.err "conftest.$ac_ext"
22922 fi
22923 echo "$as_me:22923: result: $ac_cv_header_dbmalloc_h" >&5
22924 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22925 if test "$ac_cv_header_dbmalloc_h" = yes; then
22926
22927 echo "$as_me:22927: checking for debug_malloc in -ldbmalloc" >&5
22928 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22929 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22930   echo $ECHO_N "(cached) $ECHO_C" >&6
22931 else
22932   ac_check_lib_save_LIBS=$LIBS
22933 LIBS="-ldbmalloc  $LIBS"
22934 cat >"conftest.$ac_ext" <<_ACEOF
22935 #line 22935 "configure"
22936 #include "confdefs.h"
22937
22938 /* Override any gcc2 internal prototype to avoid an error.  */
22939 #ifdef __cplusplus
22940 extern "C"
22941 #endif
22942 /* We use char because int might match the return type of a gcc2
22943    builtin and then its argument prototype would still apply.  */
22944 char debug_malloc ();
22945 int
22946 main (void)
22947 {
22948 debug_malloc ();
22949   ;
22950   return 0;
22951 }
22952 _ACEOF
22953 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22954 if { (eval echo "$as_me:22954: \"$ac_link\"") >&5
22955   (eval $ac_link) 2>&5
22956   ac_status=$?
22957   echo "$as_me:22957: \$? = $ac_status" >&5
22958   (exit "$ac_status"); } &&
22959          { ac_try='test -s "conftest$ac_exeext"'
22960   { (eval echo "$as_me:22960: \"$ac_try\"") >&5
22961   (eval $ac_try) 2>&5
22962   ac_status=$?
22963   echo "$as_me:22963: \$? = $ac_status" >&5
22964   (exit "$ac_status"); }; }; then
22965   ac_cv_lib_dbmalloc_debug_malloc=yes
22966 else
22967   echo "$as_me: failed program was:" >&5
22968 cat "conftest.$ac_ext" >&5
22969 ac_cv_lib_dbmalloc_debug_malloc=no
22970 fi
22971 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22972 LIBS=$ac_check_lib_save_LIBS
22973 fi
22974 echo "$as_me:22974: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22975 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22976 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22977   cat >>confdefs.h <<EOF
22978 #define HAVE_LIBDBMALLOC 1
22979 EOF
22980
22981   LIBS="-ldbmalloc $LIBS"
22982
22983 fi
22984
22985 fi
22986
22987 fi
22988
22989 echo "$as_me:22989: checking if you want to use valgrind for testing" >&5
22990 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22991
22992 # Check whether --with-valgrind or --without-valgrind was given.
22993 if test "${with_valgrind+set}" = set; then
22994   withval="$with_valgrind"
22995   case "x$withval" in
22996         (x|xno) ;;
22997         (*)
22998                 : "${with_cflags:=-g}"
22999                 : "${enable_leaks:=no}"
23000                 with_valgrind=yes
23001
23002 cat >>confdefs.h <<EOF
23003 #define USE_VALGRIND 1
23004 EOF
23005
23006                 ;;
23007         esac
23008 else
23009   with_valgrind=
23010 fi;
23011 echo "$as_me:23011: result: ${with_valgrind:-no}" >&5
23012 echo "${ECHO_T}${with_valgrind:-no}" >&6
23013
23014 case ".$with_cflags" in
23015 (.*-g*)
23016         case .$CFLAGS in
23017         (.*-g*)
23018                 ;;
23019         (*)
23020
23021 cf_fix_cppflags=no
23022 cf_new_cflags=
23023 cf_new_cppflags=
23024 cf_new_extra_cppflags=
23025
23026 for cf_add_cflags in -g
23027 do
23028 case "$cf_fix_cppflags" in
23029 (no)
23030         case "$cf_add_cflags" in
23031         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
23032                 case "$cf_add_cflags" in
23033                 (-D*)
23034                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
23035
23036                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23037                                 && test -z "${cf_tst_cflags}" \
23038                                 && cf_fix_cppflags=yes
23039
23040                         if test "$cf_fix_cppflags" = yes ; then
23041
23042         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23043         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23044
23045                                 continue
23046                         elif test "${cf_tst_cflags}" = "\"'" ; then
23047
23048         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23049         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23050
23051                                 continue
23052                         fi
23053                         ;;
23054                 esac
23055                 case "$CPPFLAGS" in
23056                 (*$cf_add_cflags)
23057                         ;;
23058                 (*)
23059                         case "$cf_add_cflags" in
23060                         (-D*)
23061                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
23062
23063 CPPFLAGS=`echo "$CPPFLAGS" | \
23064         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
23065                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
23066
23067                                 ;;
23068                         esac
23069
23070         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
23071         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
23072
23073                         ;;
23074                 esac
23075                 ;;
23076         (*)
23077
23078         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
23079         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
23080
23081                 ;;
23082         esac
23083         ;;
23084 (yes)
23085
23086         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23087         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23088
23089         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
23090
23091         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23092                 && test -z "${cf_tst_cflags}" \
23093                 && cf_fix_cppflags=no
23094         ;;
23095 esac
23096 done
23097
23098 if test -n "$cf_new_cflags" ; then
23099
23100         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
23101         CFLAGS="${CFLAGS}$cf_new_cflags"
23102
23103 fi
23104
23105 if test -n "$cf_new_cppflags" ; then
23106
23107         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23108         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23109
23110 fi
23111
23112 if test -n "$cf_new_extra_cppflags" ; then
23113
23114         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23115         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23116
23117 fi
23118
23119                 ;;
23120         esac
23121         ;;
23122 esac
23123
23124 echo "$as_me:23124: checking if you want to perform memory-leak testing" >&5
23125 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
23126
23127 # Check whether --enable-leaks or --disable-leaks was given.
23128 if test "${enable_leaks+set}" = set; then
23129   enableval="$enable_leaks"
23130   enable_leaks=$enableval
23131 else
23132   enable_leaks=yes
23133 fi;
23134 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
23135 echo "$as_me:23135: result: $with_no_leaks" >&5
23136 echo "${ECHO_T}$with_no_leaks" >&6
23137
23138 if test "$enable_leaks" = no ; then
23139
23140 cat >>confdefs.h <<\EOF
23141 #define NO_LEAKS 1
23142 EOF
23143
23144 cat >>confdefs.h <<\EOF
23145 #define YY_NO_LEAKS 1
23146 EOF
23147
23148 fi
23149
23150 LD_RPATH_OPT=
23151 if test "x$cf_cv_enable_rpath" != xno
23152 then
23153         echo "$as_me:23153: checking for an rpath option" >&5
23154 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
23155         case "$cf_cv_system_name" in
23156         (irix*)
23157                 if test "$GCC" = yes; then
23158                         LD_RPATH_OPT="-Wl,-rpath,"
23159                 else
23160                         LD_RPATH_OPT="-rpath "
23161                 fi
23162                 ;;
23163         (linux*|gnu*|k*bsd*-gnu|freebsd*)
23164                 LD_RPATH_OPT="-Wl,-rpath,"
23165                 ;;
23166         (openbsd[2-9].*|mirbsd*)
23167                 LD_RPATH_OPT="-Wl,-rpath,"
23168                 ;;
23169         (dragonfly*)
23170                 LD_RPATH_OPT="-rpath "
23171                 ;;
23172         (netbsd*)
23173                 LD_RPATH_OPT="-Wl,-rpath,"
23174                 ;;
23175         (osf*|mls+*)
23176                 LD_RPATH_OPT="-rpath "
23177                 ;;
23178         (solaris2*)
23179                 LD_RPATH_OPT="-R"
23180                 ;;
23181         (*)
23182                 ;;
23183         esac
23184         echo "$as_me:23184: result: $LD_RPATH_OPT" >&5
23185 echo "${ECHO_T}$LD_RPATH_OPT" >&6
23186
23187         case "x$LD_RPATH_OPT" in
23188         (x-R*)
23189                 echo "$as_me:23189: checking if we need a space after rpath option" >&5
23190 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
23191                 cf_save_LIBS="$LIBS"
23192
23193 cf_add_libs="$LIBS"
23194 # reverse order
23195 cf_add_0lib=
23196 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
23197 # filter duplicates
23198 for cf_add_1lib in $cf_add_0lib; do
23199         for cf_add_2lib in $cf_add_libs; do
23200                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
23201                         cf_add_1lib=
23202                         break
23203                 fi
23204         done
23205         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
23206 done
23207 LIBS="$cf_add_libs"
23208
23209                 cat >"conftest.$ac_ext" <<_ACEOF
23210 #line 23210 "configure"
23211 #include "confdefs.h"
23212
23213 int
23214 main (void)
23215 {
23216
23217   ;
23218   return 0;
23219 }
23220 _ACEOF
23221 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23222 if { (eval echo "$as_me:23222: \"$ac_link\"") >&5
23223   (eval $ac_link) 2>&5
23224   ac_status=$?
23225   echo "$as_me:23225: \$? = $ac_status" >&5
23226   (exit "$ac_status"); } &&
23227          { ac_try='test -s "conftest$ac_exeext"'
23228   { (eval echo "$as_me:23228: \"$ac_try\"") >&5
23229   (eval $ac_try) 2>&5
23230   ac_status=$?
23231   echo "$as_me:23231: \$? = $ac_status" >&5
23232   (exit "$ac_status"); }; }; then
23233   cf_rpath_space=no
23234 else
23235   echo "$as_me: failed program was:" >&5
23236 cat "conftest.$ac_ext" >&5
23237 cf_rpath_space=yes
23238 fi
23239 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23240                 LIBS="$cf_save_LIBS"
23241                 echo "$as_me:23241: result: $cf_rpath_space" >&5
23242 echo "${ECHO_T}$cf_rpath_space" >&6
23243                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
23244                 ;;
23245         esac
23246 fi
23247
23248 echo "$as_me:23248: checking if rpath-hack should be disabled" >&5
23249 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
23250
23251 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
23252 if test "${enable_rpath_hack+set}" = set; then
23253   enableval="$enable_rpath_hack"
23254   test "$enableval" != no && enableval=yes
23255         if test "$enableval" != "yes" ; then
23256     enable_rpath_hack=no
23257         else
23258                 enable_rpath_hack=yes
23259         fi
23260 else
23261   enableval=yes
23262         enable_rpath_hack=yes
23263
23264 fi;
23265 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
23266 echo "$as_me:23266: result: $cf_disable_rpath_hack" >&5
23267 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
23268
23269 if test "$enable_rpath_hack" = yes ; then
23270
23271 echo "$as_me:23271: checking for updated LDFLAGS" >&5
23272 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
23273 if test -n "$LD_RPATH_OPT" ; then
23274         echo "$as_me:23274: result: maybe" >&5
23275 echo "${ECHO_T}maybe" >&6
23276
23277         for ac_prog in ldd
23278 do
23279   # Extract the first word of "$ac_prog", so it can be a program name with args.
23280 set dummy $ac_prog; ac_word=$2
23281 echo "$as_me:23281: checking for $ac_word" >&5
23282 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
23283 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
23284   echo $ECHO_N "(cached) $ECHO_C" >&6
23285 else
23286   if test -n "$cf_ldd_prog"; then
23287   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
23288 else
23289   ac_save_IFS=$IFS; IFS=$ac_path_separator
23290 ac_dummy="$PATH"
23291 for ac_dir in $ac_dummy; do
23292   IFS=$ac_save_IFS
23293   test -z "$ac_dir" && ac_dir=.
23294   $as_executable_p "$ac_dir/$ac_word" || continue
23295 ac_cv_prog_cf_ldd_prog="$ac_prog"
23296 echo "$as_me:23296: found $ac_dir/$ac_word" >&5
23297 break
23298 done
23299
23300 fi
23301 fi
23302 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
23303 if test -n "$cf_ldd_prog"; then
23304   echo "$as_me:23304: result: $cf_ldd_prog" >&5
23305 echo "${ECHO_T}$cf_ldd_prog" >&6
23306 else
23307   echo "$as_me:23307: result: no" >&5
23308 echo "${ECHO_T}no" >&6
23309 fi
23310
23311   test -n "$cf_ldd_prog" && break
23312 done
23313 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
23314
23315         cf_rpath_list="/usr/lib /lib"
23316         if test "$cf_ldd_prog" != no
23317         then
23318                 cf_rpath_oops=
23319
23320 cat >"conftest.$ac_ext" <<_ACEOF
23321 #line 23321 "configure"
23322 #include "confdefs.h"
23323 #include <stdio.h>
23324 int
23325 main (void)
23326 {
23327 printf("Hello");
23328   ;
23329   return 0;
23330 }
23331 _ACEOF
23332 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23333 if { (eval echo "$as_me:23333: \"$ac_link\"") >&5
23334   (eval $ac_link) 2>&5
23335   ac_status=$?
23336   echo "$as_me:23336: \$? = $ac_status" >&5
23337   (exit "$ac_status"); } &&
23338          { ac_try='test -s "conftest$ac_exeext"'
23339   { (eval echo "$as_me:23339: \"$ac_try\"") >&5
23340   (eval $ac_try) 2>&5
23341   ac_status=$?
23342   echo "$as_me:23342: \$? = $ac_status" >&5
23343   (exit "$ac_status"); }; }; then
23344   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
23345                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
23346 else
23347   echo "$as_me: failed program was:" >&5
23348 cat "conftest.$ac_ext" >&5
23349 fi
23350 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23351
23352                 # If we passed the link-test, but get a "not found" on a given library,
23353                 # this could be due to inept reconfiguration of gcc to make it only
23354                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
23355                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
23356                 # /usr/local libraries.
23357                 if test -n "$cf_rpath_oops"
23358                 then
23359                         for cf_rpath_src in $cf_rpath_oops
23360                         do
23361                                 for cf_rpath_dir in \
23362                                         /usr/local \
23363                                         /usr/pkg \
23364                                         /opt/sfw
23365                                 do
23366                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
23367                                         then
23368                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
23369
23370 echo "${as_me:-configure}:23370: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
23371
23372                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
23373                                                 break
23374                                         fi
23375                                 done
23376                         done
23377                 fi
23378         fi
23379
23380         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23381
23382 echo "${as_me:-configure}:23382: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23383
23384 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
23385
23386 echo "${as_me:-configure}:23386: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
23387
23388 cf_rpath_dst=
23389 for cf_rpath_src in $LDFLAGS
23390 do
23391         case "$cf_rpath_src" in
23392         (-L*)
23393
23394                 # check if this refers to a directory which we will ignore
23395                 cf_rpath_skip=no
23396                 if test -n "$cf_rpath_list"
23397                 then
23398                         for cf_rpath_item in $cf_rpath_list
23399                         do
23400                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23401                                 then
23402                                         cf_rpath_skip=yes
23403                                         break
23404                                 fi
23405                         done
23406                 fi
23407
23408                 if test "$cf_rpath_skip" = no
23409                 then
23410                         # transform the option
23411                         if test "$LD_RPATH_OPT" = "-R " ; then
23412                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23413                         else
23414                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23415                         fi
23416
23417                         # if we have not already added this, add it now
23418                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23419                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23420                         then
23421                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23422
23423 echo "${as_me:-configure}:23423: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23424
23425                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23426                         fi
23427                 fi
23428                 ;;
23429         esac
23430         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23431 done
23432 LDFLAGS=$cf_rpath_dst
23433
23434 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
23435
23436 echo "${as_me:-configure}:23436: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
23437
23438 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
23439
23440 echo "${as_me:-configure}:23440: testing ...checking LIBS $LIBS ..." 1>&5
23441
23442 cf_rpath_dst=
23443 for cf_rpath_src in $LIBS
23444 do
23445         case "$cf_rpath_src" in
23446         (-L*)
23447
23448                 # check if this refers to a directory which we will ignore
23449                 cf_rpath_skip=no
23450                 if test -n "$cf_rpath_list"
23451                 then
23452                         for cf_rpath_item in $cf_rpath_list
23453                         do
23454                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23455                                 then
23456                                         cf_rpath_skip=yes
23457                                         break
23458                                 fi
23459                         done
23460                 fi
23461
23462                 if test "$cf_rpath_skip" = no
23463                 then
23464                         # transform the option
23465                         if test "$LD_RPATH_OPT" = "-R " ; then
23466                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23467                         else
23468                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23469                         fi
23470
23471                         # if we have not already added this, add it now
23472                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23473                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23474                         then
23475                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23476
23477 echo "${as_me:-configure}:23477: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23478
23479                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23480                         fi
23481                 fi
23482                 ;;
23483         esac
23484         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23485 done
23486 LIBS=$cf_rpath_dst
23487
23488 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
23489
23490 echo "${as_me:-configure}:23490: testing ...checked LIBS $LIBS ..." 1>&5
23491
23492         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23493
23494 echo "${as_me:-configure}:23494: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23495
23496 else
23497         echo "$as_me:23497: result: no" >&5
23498 echo "${ECHO_T}no" >&6
23499 fi
23500
23501 fi
23502
23503 TEST_ARGS="$LIBS"
23504 LIBS=
23505
23506 ac_config_files="$ac_config_files Makefile"
23507 ac_config_commands="$ac_config_commands default"
23508 cat >confcache <<\_ACEOF
23509 # This file is a shell script that caches the results of configure
23510 # tests run on this system so they can be shared between configure
23511 # scripts and configure runs, see configure's option --config-cache.
23512 # It is not useful on other systems.  If it contains results you don't
23513 # want to keep, you may remove or edit it.
23514 #
23515 # config.status only pays attention to the cache file if you give it
23516 # the --recheck option to rerun configure.
23517 #
23518 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23519 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23520 # following values.
23521
23522 _ACEOF
23523
23524 # The following way of writing the cache mishandles newlines in values,
23525 # but we know of no workaround that is simple, portable, and efficient.
23526 # So, don't put newlines in cache variables' values.
23527 # Ultrix sh set writes to stderr and can't be redirected directly,
23528 # and sets the high bit in the cache file unless we assign to the vars.
23529 {
23530   (set) 2>&1 |
23531     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23532     *ac_space=\ *)
23533       # `set' does not quote correctly, so add quotes (double-quote
23534       # substitution turns \\\\ into \\, and sed turns \\ into \).
23535       sed -n \
23536         "s/'/'\\\\''/g;
23537           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23538       ;;
23539     *)
23540       # `set' quotes correctly as required by POSIX, so do not add quotes.
23541       sed -n \
23542         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23543       ;;
23544     esac;
23545 } |
23546   sed '
23547      t clear
23548      : clear
23549      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23550      t end
23551      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23552      : end' >>confcache
23553 if cmp -s $cache_file confcache; then :; else
23554   if test -w $cache_file; then
23555     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23556     cat confcache >$cache_file
23557   else
23558     echo "not updating unwritable cache $cache_file"
23559   fi
23560 fi
23561 rm -f confcache
23562
23563 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23564 # Let make expand exec_prefix.
23565 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23566
23567 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23568 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23569 # trailing colons and then remove the whole line if VPATH becomes empty
23570 # (actually we leave an empty line to preserve line numbers).
23571 if test "x$srcdir" = x.; then
23572   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23573 s/:*\$(srcdir):*/:/;
23574 s/:*\${srcdir}:*/:/;
23575 s/:*@srcdir@:*/:/;
23576 s/^\([^=]*=[    ]*\):*/\1/;
23577 s/:*$//;
23578 s/^[^=]*=[      ]*$//;
23579 }'
23580 fi
23581
23582 DEFS=-DHAVE_CONFIG_H
23583
23584 : "${CONFIG_STATUS=./config.status}"
23585 ac_clean_files_save=$ac_clean_files
23586 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23587 { echo "$as_me:23587: creating $CONFIG_STATUS" >&5
23588 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23589 cat >"$CONFIG_STATUS" <<_ACEOF
23590 #! $SHELL
23591 # Generated automatically by configure.
23592 # Run this file to recreate the current configuration.
23593 # Compiler output produced by configure, useful for debugging
23594 # configure, is in config.log if it exists.
23595
23596 debug=false
23597 SHELL=\${CONFIG_SHELL-$SHELL}
23598 ac_cs_invocation="\$0 \$@"
23599
23600 CLICOLOR_FORCE= GREP_OPTIONS=
23601 unset CLICOLOR_FORCE GREP_OPTIONS
23602 _ACEOF
23603
23604 cat >>"$CONFIG_STATUS" <<\_ACEOF
23605 # Be Bourne compatible
23606 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23607   emulate sh
23608   NULLCMD=:
23609 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23610   set -o posix
23611 fi
23612
23613 # Name of the executable.
23614 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23615
23616 if expr a : '\(a\)' >/dev/null 2>&1; then
23617   as_expr=expr
23618 else
23619   as_expr=false
23620 fi
23621
23622 rm -f conf$$ conf$$.exe conf$$.file
23623 echo >conf$$.file
23624 if ln -s conf$$.file conf$$ 2>/dev/null; then
23625   # We could just check for DJGPP; but this test a) works b) is more generic
23626   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23627   if test -f conf$$.exe; then
23628     # Don't use ln at all; we don't have any links
23629     as_ln_s='cp -p'
23630   else
23631     as_ln_s='ln -s'
23632   fi
23633 elif ln conf$$.file conf$$ 2>/dev/null; then
23634   as_ln_s=ln
23635 else
23636   as_ln_s='cp -p'
23637 fi
23638 rm -f conf$$ conf$$.exe conf$$.file
23639
23640 as_executable_p="test -f"
23641
23642 # Support unset when possible.
23643 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23644   as_unset="unset"
23645 else
23646   as_unset="false"
23647 fi
23648
23649 # NLS nuisances.
23650 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23651 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23652 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23653 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23654 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23655 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23656 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23657 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23658
23659 # IFS
23660 # We need space, tab and new line, in precisely that order.
23661 as_nl='
23662 '
23663 IFS="   $as_nl"
23664
23665 # CDPATH.
23666 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23667
23668 exec 6>&1
23669
23670 _ACEOF
23671
23672 # Files that config.status was made for.
23673 if test -n "$ac_config_files"; then
23674   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23675 fi
23676
23677 if test -n "$ac_config_headers"; then
23678   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23679 fi
23680
23681 if test -n "$ac_config_links"; then
23682   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23683 fi
23684
23685 if test -n "$ac_config_commands"; then
23686   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23687 fi
23688
23689 cat >>"$CONFIG_STATUS" <<\EOF
23690
23691 ac_cs_usage="\
23692 \`$as_me' instantiates files from templates according to the
23693 current configuration.
23694
23695 Usage: $0 [OPTIONS] [FILE]...
23696
23697   -h, --help       print this help, then exit
23698   -V, --version    print version number, then exit
23699   -d, --debug      don't remove temporary files
23700       --recheck    update $as_me by reconfiguring in the same conditions
23701   --file=FILE[:TEMPLATE]
23702                    instantiate the configuration file FILE
23703   --header=FILE[:TEMPLATE]
23704                    instantiate the configuration header FILE
23705
23706 Configuration files:
23707 $config_files
23708
23709 Configuration headers:
23710 $config_headers
23711
23712 Configuration commands:
23713 $config_commands
23714
23715 Report bugs to <dickey@invisible-island.net>."
23716 EOF
23717
23718 cat >>"$CONFIG_STATUS" <<EOF
23719 ac_cs_version="\\
23720 config.status
23721 configured by $0, generated by GNU Autoconf 2.52.20210509,
23722   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23723
23724 Copyright 2003-2020,2021        Thomas E. Dickey
23725 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23726 Free Software Foundation, Inc.
23727 This config.status script is free software; the Free Software Foundation
23728 gives unlimited permission to copy, distribute and modify it."
23729 srcdir="$srcdir"
23730 INSTALL="$INSTALL"
23731 EOF
23732
23733 cat >>"$CONFIG_STATUS" <<\EOF
23734 # If no file are specified by the user, then we need to provide default
23735 # value.  By we need to know if files were specified by the user.
23736 ac_need_defaults=:
23737 while test $# != 0
23738 do
23739   case $1 in
23740   --*=*)
23741     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23742     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23743     shift
23744     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23745     shift
23746     ;;
23747   -*);;
23748   *) # This is not an option, so the user has probably given explicit
23749      # arguments.
23750      ac_need_defaults=false;;
23751   esac
23752
23753   case $1 in
23754   # Handling of the options.
23755 EOF
23756 cat >>"$CONFIG_STATUS" <<EOF
23757   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23758     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23759     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23760 EOF
23761 cat >>"$CONFIG_STATUS" <<\EOF
23762   --version | --vers* | -V )
23763     echo "$ac_cs_version"; exit 0 ;;
23764   --he | --h)
23765     # Conflict between --help and --header
23766     { { echo "$as_me:23766: error: ambiguous option: $1
23767 Try \`$0 --help' for more information." >&5
23768 echo "$as_me: error: ambiguous option: $1
23769 Try \`$0 --help' for more information." >&2;}
23770    { (exit 1); exit 1; }; };;
23771   --help | --hel | -h )
23772     echo "$ac_cs_usage"; exit 0 ;;
23773   --debug | --d* | -d )
23774     debug=: ;;
23775   --file | --fil | --fi | --f )
23776     shift
23777     CONFIG_FILES="$CONFIG_FILES $1"
23778     ac_need_defaults=false;;
23779   --header | --heade | --head | --hea )
23780     shift
23781     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23782     ac_need_defaults=false;;
23783
23784   # This is an error.
23785   -*) { { echo "$as_me:23785: error: unrecognized option: $1
23786 Try \`$0 --help' for more information." >&5
23787 echo "$as_me: error: unrecognized option: $1
23788 Try \`$0 --help' for more information." >&2;}
23789    { (exit 1); exit 1; }; } ;;
23790
23791   *) ac_config_targets="$ac_config_targets $1" ;;
23792
23793   esac
23794   shift
23795 done
23796
23797 exec 5>>config.log
23798 cat >&5 << _ACEOF
23799
23800 ## ----------------------- ##
23801 ## Running config.status.  ##
23802 ## ----------------------- ##
23803
23804 This file was extended by $as_me 2.52.20210509, executed with
23805   CONFIG_FILES    = $CONFIG_FILES
23806   CONFIG_HEADERS  = $CONFIG_HEADERS
23807   CONFIG_LINKS    = $CONFIG_LINKS
23808   CONFIG_COMMANDS = $CONFIG_COMMANDS
23809   > "$ac_cs_invocation"
23810 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23811
23812 _ACEOF
23813 EOF
23814
23815 cat >>"$CONFIG_STATUS" <<EOF
23816 #
23817 # INIT-COMMANDS section.
23818 #
23819
23820 AWK="$AWK"
23821 ECHO_CC="$ECHO_CC"
23822 ECHO_LD="$ECHO_LD"
23823 SHOW_CC="$SHOW_LD"
23824
23825 EOF
23826
23827 cat >>"$CONFIG_STATUS" <<\EOF
23828 for ac_config_target in $ac_config_targets
23829 do
23830   case "$ac_config_target" in
23831   # Handling of arguments.
23832   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23833   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23834   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23835   *) { { echo "$as_me:23835: error: invalid argument: $ac_config_target" >&5
23836 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23837    { (exit 1); exit 1; }; };;
23838   esac
23839 done
23840
23841 # If the user did not use the arguments to specify the items to instantiate,
23842 # then the envvar interface is used.  Set only those that are not.
23843 # We use the long form for the default assignment because of an extremely
23844 # bizarre bug on SunOS 4.1.3.
23845 if "$ac_need_defaults"; then
23846   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23847   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23848   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23849 fi
23850
23851 # Create a temporary directory, and hook for its removal unless debugging.
23852 $debug ||
23853 {
23854   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23855   trap '{ (exit 1); exit 1; }' 1 2 13 15
23856 }
23857
23858 # Create a (secure) tmp directory for tmp files.
23859 : ${TMPDIR=/tmp}
23860 {
23861   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23862   test -n "$tmp" && test -d "$tmp"
23863 }  ||
23864 {
23865   tmp=$TMPDIR/cs$$-$RANDOM
23866   (umask 077 && mkdir $tmp)
23867 } ||
23868 {
23869    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23870    { (exit 1); exit 1; }
23871 }
23872
23873 EOF
23874
23875 cat >>"$CONFIG_STATUS" <<EOF
23876
23877 #
23878 # CONFIG_FILES section.
23879 #
23880
23881 # No need to generate the scripts if there are no CONFIG_FILES.
23882 # This happens for instance when ./config.status config.h
23883 if test -n "\$CONFIG_FILES"; then
23884   # Protect against being on the right side of a sed subst in config.status.
23885   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23886    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23887 s,@SHELL@,$SHELL,;t t
23888 s,@exec_prefix@,$exec_prefix,;t t
23889 s,@prefix@,$prefix,;t t
23890 s,@program_transform_name@,$program_transform_name,;t t
23891 s,@bindir@,$bindir,;t t
23892 s,@sbindir@,$sbindir,;t t
23893 s,@libexecdir@,$libexecdir,;t t
23894 s,@datarootdir@,$datarootdir,;t t
23895 s,@datadir@,$datadir,;t t
23896 s,@sysconfdir@,$sysconfdir,;t t
23897 s,@sharedstatedir@,$sharedstatedir,;t t
23898 s,@localstatedir@,$localstatedir,;t t
23899 s,@runstatedir@,$runstatedir,;t t
23900 s,@libdir@,$libdir,;t t
23901 s,@includedir@,$includedir,;t t
23902 s,@oldincludedir@,$oldincludedir,;t t
23903 s,@infodir@,$infodir,;t t
23904 s,@mandir@,$mandir,;t t
23905 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23906 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23907 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23908 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23909 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23910 s,@build_alias@,$build_alias,;t t
23911 s,@host_alias@,$host_alias,;t t
23912 s,@target_alias@,$target_alias,;t t
23913 s,@ECHO_C@,$ECHO_C,;t t
23914 s,@ECHO_N@,$ECHO_N,;t t
23915 s,@ECHO_T@,$ECHO_T,;t t
23916 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23917 s,@DEFS@,$DEFS,;t t
23918 s,@LIBS@,$LIBS,;t t
23919 s,@build@,$build,;t t
23920 s,@build_cpu@,$build_cpu,;t t
23921 s,@build_vendor@,$build_vendor,;t t
23922 s,@build_os@,$build_os,;t t
23923 s,@host@,$host,;t t
23924 s,@host_cpu@,$host_cpu,;t t
23925 s,@host_vendor@,$host_vendor,;t t
23926 s,@host_os@,$host_os,;t t
23927 s,@SET_MAKE@,$SET_MAKE,;t t
23928 s,@CC@,$CC,;t t
23929 s,@CFLAGS@,$CFLAGS,;t t
23930 s,@LDFLAGS@,$LDFLAGS,;t t
23931 s,@CPPFLAGS@,$CPPFLAGS,;t t
23932 s,@ac_ct_CC@,$ac_ct_CC,;t t
23933 s,@EXEEXT@,$EXEEXT,;t t
23934 s,@OBJEXT@,$OBJEXT,;t t
23935 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23936 s,@CPP@,$CPP,;t t
23937 s,@GREP@,$GREP,;t t
23938 s,@EGREP@,$EGREP,;t t
23939 s,@AWK@,$AWK,;t t
23940 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23941 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23942 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23943 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23944 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23945 s,@LINT@,$LINT,;t t
23946 s,@LINT_OPTS@,$LINT_OPTS,;t t
23947 s,@LINT_LIBS@,$LINT_LIBS,;t t
23948 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
23949 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
23950 s,@CTAGS@,$CTAGS,;t t
23951 s,@ETAGS@,$ETAGS,;t t
23952 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23953 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23954 s,@MATH_LIB@,$MATH_LIB,;t t
23955 s,@top_builddir@,$top_builddir,;t t
23956 s,@CC_G_OPT@,$CC_G_OPT,;t t
23957 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23958 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23959 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23960 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23961 s,@LD@,$LD,;t t
23962 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23963 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23964 s,@LD_MODEL@,$LD_MODEL,;t t
23965 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23966 s,@LIBTOOL@,$LIBTOOL,;t t
23967 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23968 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23969 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23970 s,@LIB_LINK@,$LIB_LINK,;t t
23971 s,@LINK_TESTS@,$LINK_TESTS,;t t
23972 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23973 s,@PACKAGE@,$PACKAGE,;t t
23974 s,@PTHREAD@,$PTHREAD,;t t
23975 s,@TEST_ARGS@,$TEST_ARGS,;t t
23976 s,@TEST_DEPS@,$TEST_DEPS,;t t
23977 s,@TEST_LIBS@,$TEST_LIBS,;t t
23978 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23979 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23980 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23981 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23982 s,@includesubdir@,$includesubdir,;t t
23983 s,@FGREP@,$FGREP,;t t
23984 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23985 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
23986 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23987 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23988 s,@ECHO_LT@,$ECHO_LT,;t t
23989 s,@ECHO_LD@,$ECHO_LD,;t t
23990 s,@RULE_CC@,$RULE_CC,;t t
23991 s,@SHOW_CC@,$SHOW_CC,;t t
23992 s,@ECHO_CC@,$ECHO_CC,;t t
23993 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23994 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23995 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23996 s,@X_CFLAGS@,$X_CFLAGS,;t t
23997 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23998 s,@X_LIBS@,$X_LIBS,;t t
23999 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
24000 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
24001 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
24002 s,@RGB_PATH@,$RGB_PATH,;t t
24003 s,@no_x11_rgb@,$no_x11_rgb,;t t
24004 s,@FORM_NAME@,$FORM_NAME,;t t
24005 s,@MENU_NAME@,$MENU_NAME,;t t
24006 s,@PANEL_NAME@,$PANEL_NAME,;t t
24007 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
24008 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
24009 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
24010 CEOF
24011
24012 EOF
24013
24014   cat >>"$CONFIG_STATUS" <<\EOF
24015   # Split the substitutions into bite-sized pieces for seds with
24016   # small command number limits, like on Digital OSF/1 and HP-UX.
24017   ac_max_sed_lines=48
24018   ac_sed_frag=1 # Number of current file.
24019   ac_beg=1 # First line for current file.
24020   ac_end=$ac_max_sed_lines # Line after last line for current file.
24021   ac_more_lines=:
24022   ac_sed_cmds=
24023   while "$ac_more_lines"; do
24024     if test "$ac_beg" -gt 1; then
24025       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
24026     else
24027       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
24028     fi
24029     if test ! -s $tmp/subs.frag; then
24030       ac_more_lines=false
24031     else
24032       # The purpose of the label and of the branching condition is to
24033       # speed up the sed processing (if there are no `@' at all, there
24034       # is no need to browse any of the substitutions).
24035       # These are the two extra sed commands mentioned above.
24036       (echo ':t
24037   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
24038       # It is possible to make a multiline substitution using escaped newlines.
24039       # Ensure that we do not split the substitution between script fragments.
24040       ac_BEG=$ac_end
24041       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
24042       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
24043       if test -s $tmp/subs.next; then
24044         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
24045         if test ! -s $tmp/subs.edit; then
24046           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
24047           if test ! -s $tmp/subs.edit; then
24048             if test "$ac_beg" -gt 1; then
24049               ac_end=`expr "$ac_end" - 1`
24050               continue
24051             fi
24052           fi
24053         fi
24054       fi
24055
24056       if test -z "$ac_sed_cmds"; then
24057         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
24058       else
24059         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
24060       fi
24061       ac_sed_frag=`expr "$ac_sed_frag" + 1`
24062       ac_beg=$ac_end
24063       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
24064     fi
24065   done
24066   if test -z "$ac_sed_cmds"; then
24067     ac_sed_cmds=cat
24068   fi
24069 fi # test -n "$CONFIG_FILES"
24070
24071 EOF
24072 cat >>"$CONFIG_STATUS" <<\EOF
24073 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
24074   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24075   case "$ac_file" in
24076   - | *:- | *:-:* ) # input from stdin
24077         cat >$tmp/stdin
24078         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24079         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24080   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24081         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24082   * )   ac_file_in=$ac_file.in ;;
24083   esac
24084
24085   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
24086   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24087          X"$ac_file" : 'X\(//\)[^/]' \| \
24088          X"$ac_file" : 'X\(//\)$' \| \
24089          X"$ac_file" : 'X\(/\)' \| \
24090          .     : '\(.\)' 2>/dev/null ||
24091 echo X"$ac_file" |
24092     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24093           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24094           /^X\(\/\/\)$/{ s//\1/; q; }
24095           /^X\(\/\).*/{ s//\1/; q; }
24096           s/.*/./; q'`
24097   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24098     { case "$ac_dir" in
24099   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24100   *)                      as_incr_dir=.;;
24101 esac
24102 as_dummy="$ac_dir"
24103 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24104   case $as_mkdir_dir in
24105     # Skip DOS drivespec
24106     ?:) as_incr_dir=$as_mkdir_dir ;;
24107     *)
24108       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24109       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24110     ;;
24111   esac
24112 done; }
24113
24114     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
24115     # A "../" for each directory in $ac_dir_suffix.
24116     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
24117   else
24118     ac_dir_suffix= ac_dots=
24119   fi
24120
24121   case "$srcdir" in
24122   .)  ac_srcdir=.
24123       if test -z "$ac_dots"; then
24124          ac_top_srcdir=.
24125       else
24126          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
24127       fi ;;
24128   [\\/]* | ?:[\\/]* )
24129       ac_srcdir="$srcdir$ac_dir_suffix";
24130       ac_top_srcdir="$srcdir" ;;
24131   *) # Relative path.
24132     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
24133     ac_top_srcdir="$ac_dots$srcdir" ;;
24134   esac
24135
24136   case $INSTALL in
24137   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
24138   *) ac_INSTALL=$ac_dots$INSTALL ;;
24139   esac
24140
24141   if test x"$ac_file" != x-; then
24142     { echo "$as_me:24142: creating $ac_file" >&5
24143 echo "$as_me: creating $ac_file" >&6;}
24144     rm -f "$ac_file"
24145   fi
24146   # Let's still pretend it is `configure' which instantiates (i.e., don't
24147   # use $as_me), people would be surprised to read:
24148   #    /* config.h.  Generated automatically by config.status.  */
24149   configure_input="Generated automatically from `echo $ac_file_in |
24150                                                  sed 's,.*/,,'` by configure."
24151
24152   # First look for the input files in the build tree, otherwise in the
24153   # src tree.
24154   ac_file_inputs=`IFS=:
24155     for f in $ac_file_in; do
24156       case $f in
24157       -) echo $tmp/stdin ;;
24158       [\\/$]*)
24159          # Absolute (can't be DOS-style, as IFS=:)
24160          test -f "$f" || { { echo "$as_me:24160: error: cannot find input file: $f" >&5
24161 echo "$as_me: error: cannot find input file: $f" >&2;}
24162    { (exit 1); exit 1; }; }
24163          echo $f;;
24164       *) # Relative
24165          if test -f "$f"; then
24166            # Build tree
24167            echo $f
24168          elif test -f "$srcdir/$f"; then
24169            # Source tree
24170            echo "$srcdir/$f"
24171          else
24172            # /dev/null tree
24173            { { echo "$as_me:24173: error: cannot find input file: $f" >&5
24174 echo "$as_me: error: cannot find input file: $f" >&2;}
24175    { (exit 1); exit 1; }; }
24176          fi;;
24177       esac
24178     done` || { (exit 1); exit 1; }
24179 EOF
24180 cat >>"$CONFIG_STATUS" <<\EOF
24181   ac_warn_datarootdir=no
24182   if test x"$ac_file" != x-; then
24183     for ac_item in $ac_file_inputs
24184     do
24185       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
24186       if test -n "$ac_seen"; then
24187         ac_used=`grep '@datarootdir@' "$ac_item"`
24188         if test -z "$ac_used"; then
24189           { echo "$as_me:24189: WARNING: datarootdir was used implicitly but not set:
24190 $ac_seen" >&5
24191 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
24192 $ac_seen" >&2;}
24193           ac_warn_datarootdir=yes
24194         fi
24195       fi
24196       ac_seen=`grep '${datarootdir}' "$ac_item"`
24197       if test -n "$ac_seen"; then
24198         { echo "$as_me:24198: WARNING: datarootdir was used explicitly but not set:
24199 $ac_seen" >&5
24200 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
24201 $ac_seen" >&2;}
24202         ac_warn_datarootdir=yes
24203       fi
24204     done
24205   fi
24206
24207 if test "x$ac_warn_datarootdir" = xyes; then
24208   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
24209 fi
24210
24211 EOF
24212 cat >>"$CONFIG_STATUS" <<EOF
24213   sed "$ac_vpsub
24214 $extrasub
24215 EOF
24216 cat >>"$CONFIG_STATUS" <<\EOF
24217 :t
24218 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
24219 s,@configure_input@,$configure_input,;t t
24220 s,@srcdir@,$ac_srcdir,;t t
24221 s,@top_srcdir@,$ac_top_srcdir,;t t
24222 s,@INSTALL@,$ac_INSTALL,;t t
24223 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
24224   rm -f $tmp/stdin
24225   if test x"$ac_file" != x-; then
24226     cp "$tmp/out" "$ac_file"
24227
24228     for ac_name in prefix exec_prefix datarootdir
24229     do
24230         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
24231         if test -n "$ac_seen"; then
24232             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
24233             if test -z "$ac_init"; then
24234               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
24235               { echo "$as_me:24235: WARNING: Variable $ac_name is used but was not set:
24236 $ac_seen" >&5
24237 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
24238 $ac_seen" >&2;}
24239             fi
24240         fi
24241     done
24242     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
24243     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
24244     if test -s $tmp/out; then
24245       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
24246       { echo "$as_me:24246: WARNING: Some variables may not be substituted:
24247 $ac_seen" >&5
24248 echo "$as_me: WARNING: Some variables may not be substituted:
24249 $ac_seen" >&2;}
24250     fi
24251   else
24252     cat $tmp/out
24253   fi
24254   rm -f $tmp/out
24255
24256 done
24257 EOF
24258 cat >>"$CONFIG_STATUS" <<\EOF
24259
24260 #
24261 # CONFIG_HEADER section.
24262 #
24263
24264 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24265 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24266 #
24267 # ac_d sets the value in "#define NAME VALUE" lines.
24268 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24269 ac_dB='[        ].*$,\1#\2'
24270 ac_dC=' '
24271 ac_dD=',;t'
24272 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24273 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24274 ac_iB='\([      ]\),\1#\2define\3'
24275 ac_iC=' '
24276 ac_iD='\4,;t'
24277 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24278 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24279 ac_uB='$,\1#\2define\3'
24280 ac_uC=' '
24281 ac_uD=',;t'
24282
24283 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
24284   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24285   case "$ac_file" in
24286   - | *:- | *:-:* ) # input from stdin
24287         cat >$tmp/stdin
24288         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24289         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24290   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24291         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24292   * )   ac_file_in=$ac_file.in ;;
24293   esac
24294
24295   test x"$ac_file" != x- && { echo "$as_me:24295: creating $ac_file" >&5
24296 echo "$as_me: creating $ac_file" >&6;}
24297
24298   # First look for the input files in the build tree, otherwise in the
24299   # src tree.
24300   ac_file_inputs=`IFS=:
24301     for f in $ac_file_in; do
24302       case $f in
24303       -) echo $tmp/stdin ;;
24304       [\\/$]*)
24305          # Absolute (can't be DOS-style, as IFS=:)
24306          test -f "$f" || { { echo "$as_me:24306: error: cannot find input file: $f" >&5
24307 echo "$as_me: error: cannot find input file: $f" >&2;}
24308    { (exit 1); exit 1; }; }
24309          echo $f;;
24310       *) # Relative
24311          if test -f "$f"; then
24312            # Build tree
24313            echo $f
24314          elif test -f "$srcdir/$f"; then
24315            # Source tree
24316            echo "$srcdir/$f"
24317          else
24318            # /dev/null tree
24319            { { echo "$as_me:24319: error: cannot find input file: $f" >&5
24320 echo "$as_me: error: cannot find input file: $f" >&2;}
24321    { (exit 1); exit 1; }; }
24322          fi;;
24323       esac
24324     done` || { (exit 1); exit 1; }
24325   # Remove the trailing spaces.
24326   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
24327
24328 EOF
24329
24330 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
24331 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
24332 # be either 'cat' or 'sort'.
24333 cat confdefs.h | uniq >conftest.vals
24334
24335 # Break up conftest.vals because some shells have a limit on
24336 # the size of here documents, and old seds have small limits too.
24337
24338 rm -f conftest.tail
24339 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
24340 while grep . conftest.vals >/dev/null
24341 do
24342   # Write chunks of a limited-size here document to conftest.frag.
24343   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
24344   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
24345   echo 'CEOF' >> "$CONFIG_STATUS"
24346   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
24347   rm -f conftest.vals
24348   mv conftest.tail conftest.vals
24349 done
24350 rm -f conftest.vals
24351
24352 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
24353 # marker @DEFS@.
24354 echo '  cat >> conftest.edit <<CEOF
24355 /@DEFS@/r conftest.frag
24356 /@DEFS@/d
24357 CEOF
24358 sed -f conftest.edit $tmp/in > $tmp/out
24359 rm -f $tmp/in
24360 mv $tmp/out $tmp/in
24361 rm -f conftest.edit conftest.frag
24362 ' >> "$CONFIG_STATUS"
24363
24364 cat >>"$CONFIG_STATUS" <<\EOF
24365   # Let's still pretend it is `configure' which instantiates (i.e., don't
24366   # use $as_me), people would be surprised to read:
24367   #    /* config.h.  Generated automatically by config.status.  */
24368   if test x"$ac_file" = x-; then
24369     echo "/* Generated automatically by configure.  */" >$tmp/config.h
24370   else
24371     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
24372   fi
24373   cat $tmp/in >>$tmp/config.h
24374   rm -f $tmp/in
24375   if test x"$ac_file" != x-; then
24376     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
24377       { echo "$as_me:24377: $ac_file is unchanged" >&5
24378 echo "$as_me: $ac_file is unchanged" >&6;}
24379     else
24380       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24381          X"$ac_file" : 'X\(//\)[^/]' \| \
24382          X"$ac_file" : 'X\(//\)$' \| \
24383          X"$ac_file" : 'X\(/\)' \| \
24384          .     : '\(.\)' 2>/dev/null ||
24385 echo X"$ac_file" |
24386     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24387           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24388           /^X\(\/\/\)$/{ s//\1/; q; }
24389           /^X\(\/\).*/{ s//\1/; q; }
24390           s/.*/./; q'`
24391       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24392         { case "$ac_dir" in
24393   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24394   *)                      as_incr_dir=.;;
24395 esac
24396 as_dummy="$ac_dir"
24397 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24398   case $as_mkdir_dir in
24399     # Skip DOS drivespec
24400     ?:) as_incr_dir=$as_mkdir_dir ;;
24401     *)
24402       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24403       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24404     ;;
24405   esac
24406 done; }
24407
24408       fi
24409       rm -f "$ac_file"
24410       mv "$tmp/config.h" "$ac_file"
24411     fi
24412   else
24413     cat $tmp/config.h
24414     rm -f $tmp/config.h
24415   fi
24416 done
24417 EOF
24418 cat >>"$CONFIG_STATUS" <<\EOF
24419 #
24420 # CONFIG_COMMANDS section.
24421 #
24422 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
24423   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
24424   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
24425
24426   case "$ac_dest" in
24427     default )
24428
24429 for cf_dir in .
24430 do
24431         if test ! -d "$srcdir/$cf_dir" ; then
24432                 continue
24433         elif test -f "$srcdir/$cf_dir/programs" ; then
24434                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
24435         fi
24436 done
24437
24438         cat >>Makefile <<TEST_EOF
24439
24440 # These rules are generated so we do not rely on suffix rules, which do not
24441 # work consistently for different make-programs (the '\$(MODEL)/' confuses
24442 # some, and the '\$x' confuses others).
24443 TEST_EOF
24444
24445 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
24446 for N in $LIST
24447 do
24448         cat >>Makefile <<TEST_EOF
24449
24450 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24451         \$(srcdir)/test.priv.h \\
24452         ncurses_cfg.h
24453         $SHOW_CC
24454         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
24455 TEST_EOF
24456 done
24457
24458 if test -f ../config.guess && test -f ../config.sub
24459 then
24460         cat >>Makefile <<TEST_EOF
24461
24462 # if we used CF_INHERIT for getting these files, we can remove them
24463 distclean::
24464         rm -f config.guess config.sub
24465 TEST_EOF
24466 fi
24467  ;;
24468   esac
24469 done
24470 EOF
24471
24472 cat >>"$CONFIG_STATUS" <<\EOF
24473
24474 { (exit 0); exit 0; }
24475 EOF
24476 chmod +x "$CONFIG_STATUS"
24477 ac_clean_files=$ac_clean_files_save
24478
24479 # configure is writing to config.log, and then calls config.status.
24480 # config.status does its own redirection, appending to config.log.
24481 # Unfortunately, on DOS this fails, as config.log is still kept open
24482 # by configure, so config.status won't be able to write to it; its
24483 # output is simply discarded.  So we exec the FD to /dev/null,
24484 # effectively closing config.log, so it can be properly (re)opened and
24485 # appended to by config.status.  When coming back to configure, we
24486 # need to make the FD available again.
24487 if test "$no_create" != yes; then
24488   ac_cs_success=:
24489   exec 5>/dev/null
24490   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
24491   exec 5>>config.log
24492   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24493   # would make configure fail if this is the last instruction.
24494   "$ac_cs_success" || { (exit 1); exit 1; }
24495 fi
24496