]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20171118
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20170501.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
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 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Features:
650   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
651   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
652
653 Optional Packages:
654   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
655   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
656
657   --enable-string-hacks   work around bogus compiler/loader warnings
658 General Options:
659   --with-pkg-config{=path} enable/disable use of pkg-config
660   --disable-echo          do not display "compiling" commands
661 Curses Version-dependent Options:
662   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
663   --disable-widec         disable checks for wide-character functions
664   --with-curses-dir=DIR   directory in which (n)curses is installed
665   --with-screen=XXX       use specified curses-libraries
666   --with-ncursesw         use wide ncurses-libraries
667   --with-ncurses          use ncurses-libraries
668   --with-pdcurses         compile/link with pdcurses X11 library
669   --with-curses-colr      compile/link with HPUX 10.x color-curses
670   --with-curses-5lib      compile/link with SunOS 5lib curses
671   --with-Xaw3d            link with Xaw 3d library
672   --with-Xaw3dxft         link with Xaw 3d xft library
673   --with-neXtaw           link with neXT Athena library
674   --with-XawPlus          link with Athena-Plus library
675   --with-x                use the X Window System
676   --disable-panel         disable checks for panel functions
677   --disable-menu          disable checks for menu functions
678   --disable-form          disable checks for form functions
679 Testing/development Options:
680   --enable-warnings       test: turn on gcc compiler warnings
681   --with-dmalloc          test: use Gray Watson's dmalloc library
682   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
683   --with-valgrind         test: use valgrind
684   --disable-leaks         test: free permanent memory, analyze leaks
685   --disable-rpath-hack    don't add rpath options for additional libraries
686
687 Some influential environment variables:
688   CC          C compiler command
689   CFLAGS      C compiler flags
690   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
691               nonstandard directory <lib dir>
692   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
693               headers in a nonstandard directory <include dir>
694   CPP         C preprocessor
695
696 Use these variables to override the choices made by `configure' or to help
697 it to find libraries and programs with nonstandard names/locations.
698
699 EOF
700 fi
701
702 if test "$ac_init_help" = "recursive"; then
703   # If there are subdirs, report their specific --help.
704   ac_popdir=`pwd`
705   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
706     cd $ac_subdir
707     # A "../" for each directory in /$ac_subdir.
708     ac_dots=`echo $ac_subdir |
709              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
710
711     case $srcdir in
712     .) # No --srcdir option.  We are building in place.
713       ac_sub_srcdir=$srcdir ;;
714     [\\/]* | ?:[\\/]* ) # Absolute path.
715       ac_sub_srcdir=$srcdir/$ac_subdir ;;
716     *) # Relative path.
717       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
718     esac
719
720     # Check for guested configure; otherwise get Cygnus style configure.
721     if test -f $ac_sub_srcdir/configure.gnu; then
722       echo
723       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
724     elif test -f $ac_sub_srcdir/configure; then
725       echo
726       $SHELL $ac_sub_srcdir/configure  --help=recursive
727     elif test -f $ac_sub_srcdir/configure.ac ||
728            test -f $ac_sub_srcdir/configure.in; then
729       echo
730       $ac_configure --help
731     else
732       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
733     fi
734     cd $ac_popdir
735   done
736 fi
737
738 test -n "$ac_init_help" && exit 0
739 if $ac_init_version; then
740   cat <<\EOF
741
742 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
743 Free Software Foundation, Inc.
744 This configure script is free software; the Free Software Foundation
745 gives unlimited permission to copy, distribute and modify it.
746 EOF
747   exit 0
748 fi
749 exec 5>config.log
750 cat >&5 <<EOF
751 This file contains any messages produced by compilers while
752 running configure, to aid debugging if configure makes a mistake.
753
754 It was created by $as_me, which was
755 generated by GNU Autoconf 2.52.20170501.  Invocation command line was
756
757   $ $0 $@
758
759 EOF
760 {
761 cat <<_ASUNAME
762 ## ---------- ##
763 ## Platform.  ##
764 ## ---------- ##
765
766 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
767 uname -m = `(uname -m) 2>/dev/null || echo unknown`
768 uname -r = `(uname -r) 2>/dev/null || echo unknown`
769 uname -s = `(uname -s) 2>/dev/null || echo unknown`
770 uname -v = `(uname -v) 2>/dev/null || echo unknown`
771
772 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
773 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
774
775 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
776 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
777 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
778 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
779 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
780 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
781 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
782
783 PATH = $PATH
784
785 _ASUNAME
786 } >&5
787
788 cat >&5 <<EOF
789 ## ------------ ##
790 ## Core tests.  ##
791 ## ------------ ##
792
793 EOF
794
795 # Keep a trace of the command line.
796 # Strip out --no-create and --no-recursion so they do not pile up.
797 # Also quote any args containing shell meta-characters.
798 ac_configure_args=
799 ac_sep=
800 for ac_arg
801 do
802   case $ac_arg in
803   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
804   | --no-cr | --no-c) ;;
805   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
806   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
807   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
808     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
809     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
810     ac_sep=" " ;;
811   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
812      ac_sep=" " ;;
813   esac
814   # Get rid of the leading space.
815 done
816
817 # When interrupted or exit'd, cleanup temporary files, and complete
818 # config.log.  We remove comments because anyway the quotes in there
819 # would cause problems or look ugly.
820 trap 'exit_status=$?
821   # Save into config.log some information that might help in debugging.
822   echo >&5
823   echo "## ----------------- ##" >&5
824   echo "## Cache variables.  ##" >&5
825   echo "## ----------------- ##" >&5
826   echo >&5
827   # The following way of writing the cache mishandles newlines in values,
828 {
829   (set) 2>&1 |
830     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
831     *ac_space=\ *)
832       sed -n \
833         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
834           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
835       ;;
836     *)
837       sed -n \
838         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
839       ;;
840     esac;
841 } >&5
842   sed "/^$/d" confdefs.h >conftest.log
843   if test -s conftest.log; then
844     echo >&5
845     echo "## ------------ ##" >&5
846     echo "## confdefs.h.  ##" >&5
847     echo "## ------------ ##" >&5
848     echo >&5
849     cat conftest.log >&5
850   fi
851   (echo; echo) >&5
852   test "$ac_signal" != 0 &&
853     echo "$as_me: caught signal $ac_signal" >&5
854   echo "$as_me: exit $exit_status" >&5
855   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
856     exit $exit_status
857      ' 0
858 for ac_signal in 1 2 13 15; do
859   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
860 done
861 ac_signal=0
862
863 # confdefs.h avoids OS command line length limits that DEFS can exceed.
864 rm -rf conftest* confdefs.h
865 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
866 echo >confdefs.h
867
868 # Let the site file select an alternate cache file if it wants to.
869 # Prefer explicitly selected file to automatically selected ones.
870 if test -z "$CONFIG_SITE"; then
871   if test "x$prefix" != xNONE; then
872     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
873   else
874     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
875   fi
876 fi
877 for ac_site_file in $CONFIG_SITE; do
878   if test -r "$ac_site_file"; then
879     { echo "$as_me:879: loading site script $ac_site_file" >&5
880 echo "$as_me: loading site script $ac_site_file" >&6;}
881     cat "$ac_site_file" >&5
882     . "$ac_site_file"
883   fi
884 done
885
886 if test -r "$cache_file"; then
887   # Some versions of bash will fail to source /dev/null (special
888   # files actually), so we avoid doing that.
889   if test -f "$cache_file"; then
890     { echo "$as_me:890: loading cache $cache_file" >&5
891 echo "$as_me: loading cache $cache_file" >&6;}
892     case $cache_file in
893       [\\/]* | ?:[\\/]* ) . $cache_file;;
894       *)                      . ./$cache_file;;
895     esac
896   fi
897 else
898   { echo "$as_me:898: creating cache $cache_file" >&5
899 echo "$as_me: creating cache $cache_file" >&6;}
900   >$cache_file
901 fi
902
903 # Check that the precious variables saved in the cache have kept the same
904 # value.
905 ac_cache_corrupted=false
906 for ac_var in `(set) 2>&1 |
907                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
908   eval ac_old_set=\$ac_cv_env_${ac_var}_set
909   eval ac_new_set=\$ac_env_${ac_var}_set
910   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
911   eval ac_new_val="\$ac_env_${ac_var}_value"
912   case $ac_old_set,$ac_new_set in
913     set,)
914       { echo "$as_me:914: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
915 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
916       ac_cache_corrupted=: ;;
917     ,set)
918       { echo "$as_me:918: error: \`$ac_var' was not set in the previous run" >&5
919 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
920       ac_cache_corrupted=: ;;
921     ,);;
922     *)
923       if test "x$ac_old_val" != "x$ac_new_val"; then
924         { echo "$as_me:924: error: \`$ac_var' has changed since the previous run:" >&5
925 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
926         { echo "$as_me:926:   former value:  $ac_old_val" >&5
927 echo "$as_me:   former value:  $ac_old_val" >&2;}
928         { echo "$as_me:928:   current value: $ac_new_val" >&5
929 echo "$as_me:   current value: $ac_new_val" >&2;}
930         ac_cache_corrupted=:
931       fi;;
932   esac
933   # Pass precious variables to config.status.  It doesn't matter if
934   # we pass some twice (in addition to the command line arguments).
935   if test "$ac_new_set" = set; then
936     case $ac_new_val in
937     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
938       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
939       ac_configure_args="$ac_configure_args '$ac_arg'"
940       ;;
941     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
942        ;;
943     esac
944   fi
945 done
946 if $ac_cache_corrupted; then
947   { echo "$as_me:947: error: changes in the environment can compromise the build" >&5
948 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
949   { { echo "$as_me:949: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
950 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
951    { (exit 1); exit 1; }; }
952 fi
953
954 ac_ext=c
955 ac_cpp='$CPP $CPPFLAGS'
956 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
957 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
958 ac_compiler_gnu=$ac_cv_c_compiler_gnu
959 ac_main_return=return
960
961 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
962   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
963                    ECHO_T='     ' ;;
964   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
965   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
966 esac
967 echo "#! $SHELL" >conftest.sh
968 echo  "exit 0"   >>conftest.sh
969 chmod +x conftest.sh
970 if { (echo "$as_me:970: PATH=\".;.\"; conftest.sh") >&5
971   (PATH=".;."; conftest.sh) 2>&5
972   ac_status=$?
973   echo "$as_me:973: \$? = $ac_status" >&5
974   (exit $ac_status); }; then
975   ac_path_separator=';'
976 else
977   ac_path_separator=:
978 fi
979 PATH_SEPARATOR="$ac_path_separator"
980 rm -f conftest.sh
981
982 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
983
984 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
985
986 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
987
988 ac_aux_dir=
989 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
990   if test -f $ac_dir/install-sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install-sh -c"
993     break
994   elif test -f $ac_dir/install.sh; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/install.sh -c"
997     break
998   elif test -f $ac_dir/shtool; then
999     ac_aux_dir=$ac_dir
1000     ac_install_sh="$ac_aux_dir/shtool install -c"
1001     break
1002   fi
1003 done
1004 if test -z "$ac_aux_dir"; then
1005   { { echo "$as_me:1005: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1006 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1007    { (exit 1); exit 1; }; }
1008 fi
1009 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1010 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1011 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1012
1013 # Make sure we can run config.sub.
1014 $ac_config_sub sun4 >/dev/null 2>&1 ||
1015   { { echo "$as_me:1015: error: cannot run $ac_config_sub" >&5
1016 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1017    { (exit 1); exit 1; }; }
1018
1019 echo "$as_me:1019: checking build system type" >&5
1020 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1021 if test "${ac_cv_build+set}" = set; then
1022   echo $ECHO_N "(cached) $ECHO_C" >&6
1023 else
1024   ac_cv_build_alias=$build_alias
1025 test -z "$ac_cv_build_alias" &&
1026   ac_cv_build_alias=`$ac_config_guess`
1027 test -z "$ac_cv_build_alias" &&
1028   { { echo "$as_me:1028: error: cannot guess build type; you must specify one" >&5
1029 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1030    { (exit 1); exit 1; }; }
1031 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1032   { { echo "$as_me:1032: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1033 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1034    { (exit 1); exit 1; }; }
1035
1036 fi
1037 echo "$as_me:1037: result: $ac_cv_build" >&5
1038 echo "${ECHO_T}$ac_cv_build" >&6
1039 build=$ac_cv_build
1040 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1041 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1042 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1043
1044 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1045         echo "$as_me:1045: checking host system type" >&5
1046 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1047 if test "${ac_cv_host+set}" = set; then
1048   echo $ECHO_N "(cached) $ECHO_C" >&6
1049 else
1050   ac_cv_host_alias=$host_alias
1051 test -z "$ac_cv_host_alias" &&
1052   ac_cv_host_alias=$ac_cv_build_alias
1053 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1054   { { echo "$as_me:1054: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1055 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1056    { (exit 1); exit 1; }; }
1057
1058 fi
1059 echo "$as_me:1059: result: $ac_cv_host" >&5
1060 echo "${ECHO_T}$ac_cv_host" >&6
1061 host=$ac_cv_host
1062 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1063 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1064 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1065
1066         system_name="$host_os"
1067 else
1068         system_name="`(uname -s -r) 2>/dev/null`"
1069         if test -z "$system_name" ; then
1070                 system_name="`(hostname) 2>/dev/null`"
1071         fi
1072 fi
1073 test -n "$system_name" &&
1074 cat >>confdefs.h <<EOF
1075 #define SYSTEM_NAME "$system_name"
1076 EOF
1077
1078 if test "${cf_cv_system_name+set}" = set; then
1079   echo $ECHO_N "(cached) $ECHO_C" >&6
1080 else
1081   cf_cv_system_name="$system_name"
1082 fi
1083
1084 test -z "$system_name" && system_name="$cf_cv_system_name"
1085 test -n "$cf_cv_system_name" && echo "$as_me:1085: result: Configuring for $cf_cv_system_name" >&5
1086 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1087
1088 if test ".$system_name" != ".$cf_cv_system_name" ; then
1089         echo "$as_me:1089: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1090 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1091         { { echo "$as_me:1091: error: \"Please remove config.cache and try again.\"" >&5
1092 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1093    { (exit 1); exit 1; }; }
1094 fi
1095
1096 test "$program_prefix" != NONE &&
1097   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1098 # Use a double $ so make ignores it.
1099 test "$program_suffix" != NONE &&
1100   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1101 # Double any \ or $.  echo might interpret backslashes.
1102 # By default was `s,x,x', remove it if useless.
1103 cat <<\_ACEOF >conftest.sed
1104 s/[\\$]/&&/g;s/;s,x,x,$//
1105 _ACEOF
1106 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1107 rm conftest.sed
1108
1109 echo "$as_me:1109: checking whether ${MAKE-make} sets \${MAKE}" >&5
1110 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1111 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1112 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1113   echo $ECHO_N "(cached) $ECHO_C" >&6
1114 else
1115   cat >conftest.make <<\EOF
1116 all:
1117         @echo 'ac_maketemp="${MAKE}"'
1118 EOF
1119 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1120 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1121 if test -n "$ac_maketemp"; then
1122   eval ac_cv_prog_make_${ac_make}_set=yes
1123 else
1124   eval ac_cv_prog_make_${ac_make}_set=no
1125 fi
1126 rm -f conftest.make
1127 fi
1128 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1129   echo "$as_me:1129: result: yes" >&5
1130 echo "${ECHO_T}yes" >&6
1131   SET_MAKE=
1132 else
1133   echo "$as_me:1133: result: no" >&5
1134 echo "${ECHO_T}no" >&6
1135   SET_MAKE="MAKE=${MAKE-make}"
1136 fi
1137
1138 ac_ext=c
1139 ac_cpp='$CPP $CPPFLAGS'
1140 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1141 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1142 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1143 ac_main_return=return
1144 if test -n "$ac_tool_prefix"; then
1145   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1146 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1147 echo "$as_me:1147: checking for $ac_word" >&5
1148 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1149 if test "${ac_cv_prog_CC+set}" = set; then
1150   echo $ECHO_N "(cached) $ECHO_C" >&6
1151 else
1152   if test -n "$CC"; then
1153   ac_cv_prog_CC="$CC" # Let the user override the test.
1154 else
1155   ac_save_IFS=$IFS; IFS=$ac_path_separator
1156 ac_dummy="$PATH"
1157 for ac_dir in $ac_dummy; do
1158   IFS=$ac_save_IFS
1159   test -z "$ac_dir" && ac_dir=.
1160   $as_executable_p "$ac_dir/$ac_word" || continue
1161 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1162 echo "$as_me:1162: found $ac_dir/$ac_word" >&5
1163 break
1164 done
1165
1166 fi
1167 fi
1168 CC=$ac_cv_prog_CC
1169 if test -n "$CC"; then
1170   echo "$as_me:1170: result: $CC" >&5
1171 echo "${ECHO_T}$CC" >&6
1172 else
1173   echo "$as_me:1173: result: no" >&5
1174 echo "${ECHO_T}no" >&6
1175 fi
1176
1177 fi
1178 if test -z "$ac_cv_prog_CC"; then
1179   ac_ct_CC=$CC
1180   # Extract the first word of "gcc", so it can be a program name with args.
1181 set dummy gcc; ac_word=$2
1182 echo "$as_me:1182: checking for $ac_word" >&5
1183 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1184 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1185   echo $ECHO_N "(cached) $ECHO_C" >&6
1186 else
1187   if test -n "$ac_ct_CC"; then
1188   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1189 else
1190   ac_save_IFS=$IFS; IFS=$ac_path_separator
1191 ac_dummy="$PATH"
1192 for ac_dir in $ac_dummy; do
1193   IFS=$ac_save_IFS
1194   test -z "$ac_dir" && ac_dir=.
1195   $as_executable_p "$ac_dir/$ac_word" || continue
1196 ac_cv_prog_ac_ct_CC="gcc"
1197 echo "$as_me:1197: found $ac_dir/$ac_word" >&5
1198 break
1199 done
1200
1201 fi
1202 fi
1203 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1204 if test -n "$ac_ct_CC"; then
1205   echo "$as_me:1205: result: $ac_ct_CC" >&5
1206 echo "${ECHO_T}$ac_ct_CC" >&6
1207 else
1208   echo "$as_me:1208: result: no" >&5
1209 echo "${ECHO_T}no" >&6
1210 fi
1211
1212   CC=$ac_ct_CC
1213 else
1214   CC="$ac_cv_prog_CC"
1215 fi
1216
1217 if test -z "$CC"; then
1218   if test -n "$ac_tool_prefix"; then
1219   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1220 set dummy ${ac_tool_prefix}cc; ac_word=$2
1221 echo "$as_me:1221: checking for $ac_word" >&5
1222 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1223 if test "${ac_cv_prog_CC+set}" = set; then
1224   echo $ECHO_N "(cached) $ECHO_C" >&6
1225 else
1226   if test -n "$CC"; then
1227   ac_cv_prog_CC="$CC" # Let the user override the test.
1228 else
1229   ac_save_IFS=$IFS; IFS=$ac_path_separator
1230 ac_dummy="$PATH"
1231 for ac_dir in $ac_dummy; do
1232   IFS=$ac_save_IFS
1233   test -z "$ac_dir" && ac_dir=.
1234   $as_executable_p "$ac_dir/$ac_word" || continue
1235 ac_cv_prog_CC="${ac_tool_prefix}cc"
1236 echo "$as_me:1236: found $ac_dir/$ac_word" >&5
1237 break
1238 done
1239
1240 fi
1241 fi
1242 CC=$ac_cv_prog_CC
1243 if test -n "$CC"; then
1244   echo "$as_me:1244: result: $CC" >&5
1245 echo "${ECHO_T}$CC" >&6
1246 else
1247   echo "$as_me:1247: result: no" >&5
1248 echo "${ECHO_T}no" >&6
1249 fi
1250
1251 fi
1252 if test -z "$ac_cv_prog_CC"; then
1253   ac_ct_CC=$CC
1254   # Extract the first word of "cc", so it can be a program name with args.
1255 set dummy cc; ac_word=$2
1256 echo "$as_me:1256: checking for $ac_word" >&5
1257 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1258 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1259   echo $ECHO_N "(cached) $ECHO_C" >&6
1260 else
1261   if test -n "$ac_ct_CC"; then
1262   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1263 else
1264   ac_save_IFS=$IFS; IFS=$ac_path_separator
1265 ac_dummy="$PATH"
1266 for ac_dir in $ac_dummy; do
1267   IFS=$ac_save_IFS
1268   test -z "$ac_dir" && ac_dir=.
1269   $as_executable_p "$ac_dir/$ac_word" || continue
1270 ac_cv_prog_ac_ct_CC="cc"
1271 echo "$as_me:1271: found $ac_dir/$ac_word" >&5
1272 break
1273 done
1274
1275 fi
1276 fi
1277 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1278 if test -n "$ac_ct_CC"; then
1279   echo "$as_me:1279: result: $ac_ct_CC" >&5
1280 echo "${ECHO_T}$ac_ct_CC" >&6
1281 else
1282   echo "$as_me:1282: result: no" >&5
1283 echo "${ECHO_T}no" >&6
1284 fi
1285
1286   CC=$ac_ct_CC
1287 else
1288   CC="$ac_cv_prog_CC"
1289 fi
1290
1291 fi
1292 if test -z "$CC"; then
1293   # Extract the first word of "cc", so it can be a program name with args.
1294 set dummy cc; ac_word=$2
1295 echo "$as_me:1295: checking for $ac_word" >&5
1296 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1297 if test "${ac_cv_prog_CC+set}" = set; then
1298   echo $ECHO_N "(cached) $ECHO_C" >&6
1299 else
1300   if test -n "$CC"; then
1301   ac_cv_prog_CC="$CC" # Let the user override the test.
1302 else
1303   ac_prog_rejected=no
1304   ac_save_IFS=$IFS; IFS=$ac_path_separator
1305 ac_dummy="$PATH"
1306 for ac_dir in $ac_dummy; do
1307   IFS=$ac_save_IFS
1308   test -z "$ac_dir" && ac_dir=.
1309   $as_executable_p "$ac_dir/$ac_word" || continue
1310 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1311   ac_prog_rejected=yes
1312   continue
1313 fi
1314 ac_cv_prog_CC="cc"
1315 echo "$as_me:1315: found $ac_dir/$ac_word" >&5
1316 break
1317 done
1318
1319 if test $ac_prog_rejected = yes; then
1320   # We found a bogon in the path, so make sure we never use it.
1321   set dummy $ac_cv_prog_CC
1322   shift
1323   if test $# != 0; then
1324     # We chose a different compiler from the bogus one.
1325     # However, it has the same basename, so the bogon will be chosen
1326     # first if we set CC to just the basename; use the full file name.
1327     shift
1328     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1329     shift
1330     ac_cv_prog_CC="$@"
1331   fi
1332 fi
1333 fi
1334 fi
1335 CC=$ac_cv_prog_CC
1336 if test -n "$CC"; then
1337   echo "$as_me:1337: result: $CC" >&5
1338 echo "${ECHO_T}$CC" >&6
1339 else
1340   echo "$as_me:1340: result: no" >&5
1341 echo "${ECHO_T}no" >&6
1342 fi
1343
1344 fi
1345 if test -z "$CC"; then
1346   if test -n "$ac_tool_prefix"; then
1347   for ac_prog in cl
1348   do
1349     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1350 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1351 echo "$as_me:1351: checking for $ac_word" >&5
1352 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1353 if test "${ac_cv_prog_CC+set}" = set; then
1354   echo $ECHO_N "(cached) $ECHO_C" >&6
1355 else
1356   if test -n "$CC"; then
1357   ac_cv_prog_CC="$CC" # Let the user override the test.
1358 else
1359   ac_save_IFS=$IFS; IFS=$ac_path_separator
1360 ac_dummy="$PATH"
1361 for ac_dir in $ac_dummy; do
1362   IFS=$ac_save_IFS
1363   test -z "$ac_dir" && ac_dir=.
1364   $as_executable_p "$ac_dir/$ac_word" || continue
1365 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1366 echo "$as_me:1366: found $ac_dir/$ac_word" >&5
1367 break
1368 done
1369
1370 fi
1371 fi
1372 CC=$ac_cv_prog_CC
1373 if test -n "$CC"; then
1374   echo "$as_me:1374: result: $CC" >&5
1375 echo "${ECHO_T}$CC" >&6
1376 else
1377   echo "$as_me:1377: result: no" >&5
1378 echo "${ECHO_T}no" >&6
1379 fi
1380
1381     test -n "$CC" && break
1382   done
1383 fi
1384 if test -z "$CC"; then
1385   ac_ct_CC=$CC
1386   for ac_prog in cl
1387 do
1388   # Extract the first word of "$ac_prog", so it can be a program name with args.
1389 set dummy $ac_prog; ac_word=$2
1390 echo "$as_me:1390: checking for $ac_word" >&5
1391 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1392 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1393   echo $ECHO_N "(cached) $ECHO_C" >&6
1394 else
1395   if test -n "$ac_ct_CC"; then
1396   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1397 else
1398   ac_save_IFS=$IFS; IFS=$ac_path_separator
1399 ac_dummy="$PATH"
1400 for ac_dir in $ac_dummy; do
1401   IFS=$ac_save_IFS
1402   test -z "$ac_dir" && ac_dir=.
1403   $as_executable_p "$ac_dir/$ac_word" || continue
1404 ac_cv_prog_ac_ct_CC="$ac_prog"
1405 echo "$as_me:1405: found $ac_dir/$ac_word" >&5
1406 break
1407 done
1408
1409 fi
1410 fi
1411 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1412 if test -n "$ac_ct_CC"; then
1413   echo "$as_me:1413: result: $ac_ct_CC" >&5
1414 echo "${ECHO_T}$ac_ct_CC" >&6
1415 else
1416   echo "$as_me:1416: result: no" >&5
1417 echo "${ECHO_T}no" >&6
1418 fi
1419
1420   test -n "$ac_ct_CC" && break
1421 done
1422
1423   CC=$ac_ct_CC
1424 fi
1425
1426 fi
1427
1428 test -z "$CC" && { { echo "$as_me:1428: error: no acceptable cc found in \$PATH" >&5
1429 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1430    { (exit 1); exit 1; }; }
1431
1432 # Provide some information about the compiler.
1433 echo "$as_me:1433:" \
1434      "checking for C compiler version" >&5
1435 ac_compiler=`set X $ac_compile; echo $2`
1436 { (eval echo "$as_me:1436: \"$ac_compiler --version </dev/null >&5\"") >&5
1437   (eval $ac_compiler --version </dev/null >&5) 2>&5
1438   ac_status=$?
1439   echo "$as_me:1439: \$? = $ac_status" >&5
1440   (exit $ac_status); }
1441 { (eval echo "$as_me:1441: \"$ac_compiler -v </dev/null >&5\"") >&5
1442   (eval $ac_compiler -v </dev/null >&5) 2>&5
1443   ac_status=$?
1444   echo "$as_me:1444: \$? = $ac_status" >&5
1445   (exit $ac_status); }
1446 { (eval echo "$as_me:1446: \"$ac_compiler -V </dev/null >&5\"") >&5
1447   (eval $ac_compiler -V </dev/null >&5) 2>&5
1448   ac_status=$?
1449   echo "$as_me:1449: \$? = $ac_status" >&5
1450   (exit $ac_status); }
1451
1452 cat >conftest.$ac_ext <<_ACEOF
1453 #line 1453 "configure"
1454 #include "confdefs.h"
1455
1456 int
1457 main (void)
1458 {
1459
1460   ;
1461   return 0;
1462 }
1463 _ACEOF
1464 ac_clean_files_save=$ac_clean_files
1465 ac_clean_files="$ac_clean_files a.out a.exe"
1466 # Try to create an executable without -o first, disregard a.out.
1467 # It will help us diagnose broken compilers, and finding out an intuition
1468 # of exeext.
1469 echo "$as_me:1469: checking for C compiler default output" >&5
1470 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1471 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1472 if { (eval echo "$as_me:1472: \"$ac_link_default\"") >&5
1473   (eval $ac_link_default) 2>&5
1474   ac_status=$?
1475   echo "$as_me:1475: \$? = $ac_status" >&5
1476   (exit $ac_status); }; then
1477   # Find the output, starting from the most likely.  This scheme is
1478 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1479 # resort.
1480 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1481                 ls a.out conftest 2>/dev/null;
1482                 ls a.* conftest.* 2>/dev/null`; do
1483   case $ac_file in
1484     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1485     a.out ) # We found the default executable, but exeext='' is most
1486             # certainly right.
1487             break;;
1488     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1489           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1490           export ac_cv_exeext
1491           break;;
1492     * ) break;;
1493   esac
1494 done
1495 else
1496   echo "$as_me: failed program was:" >&5
1497 cat conftest.$ac_ext >&5
1498 { { echo "$as_me:1498: error: C compiler cannot create executables" >&5
1499 echo "$as_me: error: C compiler cannot create executables" >&2;}
1500    { (exit 77); exit 77; }; }
1501 fi
1502
1503 ac_exeext=$ac_cv_exeext
1504 echo "$as_me:1504: result: $ac_file" >&5
1505 echo "${ECHO_T}$ac_file" >&6
1506
1507 # Check the compiler produces executables we can run.  If not, either
1508 # the compiler is broken, or we cross compile.
1509 echo "$as_me:1509: checking whether the C compiler works" >&5
1510 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1511 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1512 # If not cross compiling, check that we can run a simple program.
1513 if test "$cross_compiling" != yes; then
1514   if { ac_try='./$ac_file'
1515   { (eval echo "$as_me:1515: \"$ac_try\"") >&5
1516   (eval $ac_try) 2>&5
1517   ac_status=$?
1518   echo "$as_me:1518: \$? = $ac_status" >&5
1519   (exit $ac_status); }; }; then
1520     cross_compiling=no
1521   else
1522     if test "$cross_compiling" = maybe; then
1523         cross_compiling=yes
1524     else
1525         { { echo "$as_me:1525: error: cannot run C compiled programs.
1526 If you meant to cross compile, use \`--host'." >&5
1527 echo "$as_me: error: cannot run C compiled programs.
1528 If you meant to cross compile, use \`--host'." >&2;}
1529    { (exit 1); exit 1; }; }
1530     fi
1531   fi
1532 fi
1533 echo "$as_me:1533: result: yes" >&5
1534 echo "${ECHO_T}yes" >&6
1535
1536 rm -f a.out a.exe conftest$ac_cv_exeext
1537 ac_clean_files=$ac_clean_files_save
1538 # Check the compiler produces executables we can run.  If not, either
1539 # the compiler is broken, or we cross compile.
1540 echo "$as_me:1540: checking whether we are cross compiling" >&5
1541 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1542 echo "$as_me:1542: result: $cross_compiling" >&5
1543 echo "${ECHO_T}$cross_compiling" >&6
1544
1545 echo "$as_me:1545: checking for executable suffix" >&5
1546 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1547 if { (eval echo "$as_me:1547: \"$ac_link\"") >&5
1548   (eval $ac_link) 2>&5
1549   ac_status=$?
1550   echo "$as_me:1550: \$? = $ac_status" >&5
1551   (exit $ac_status); }; then
1552   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1553 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1554 # work properly (i.e., refer to `conftest.exe'), while it won't with
1555 # `rm'.
1556 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1557   case $ac_file in
1558     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1559     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1560           export ac_cv_exeext
1561           break;;
1562     * ) break;;
1563   esac
1564 done
1565 else
1566   { { echo "$as_me:1566: error: cannot compute EXEEXT: cannot compile and link" >&5
1567 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1568    { (exit 1); exit 1; }; }
1569 fi
1570
1571 rm -f conftest$ac_cv_exeext
1572 echo "$as_me:1572: result: $ac_cv_exeext" >&5
1573 echo "${ECHO_T}$ac_cv_exeext" >&6
1574
1575 rm -f conftest.$ac_ext
1576 EXEEXT=$ac_cv_exeext
1577 ac_exeext=$EXEEXT
1578 echo "$as_me:1578: checking for object suffix" >&5
1579 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1580 if test "${ac_cv_objext+set}" = set; then
1581   echo $ECHO_N "(cached) $ECHO_C" >&6
1582 else
1583   cat >conftest.$ac_ext <<_ACEOF
1584 #line 1584 "configure"
1585 #include "confdefs.h"
1586
1587 int
1588 main (void)
1589 {
1590
1591   ;
1592   return 0;
1593 }
1594 _ACEOF
1595 rm -f conftest.o conftest.obj
1596 if { (eval echo "$as_me:1596: \"$ac_compile\"") >&5
1597   (eval $ac_compile) 2>&5
1598   ac_status=$?
1599   echo "$as_me:1599: \$? = $ac_status" >&5
1600   (exit $ac_status); }; then
1601   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1602   case $ac_file in
1603     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1604     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1605        break;;
1606   esac
1607 done
1608 else
1609   echo "$as_me: failed program was:" >&5
1610 cat conftest.$ac_ext >&5
1611 { { echo "$as_me:1611: error: cannot compute OBJEXT: cannot compile" >&5
1612 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1613    { (exit 1); exit 1; }; }
1614 fi
1615
1616 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1617 fi
1618 echo "$as_me:1618: result: $ac_cv_objext" >&5
1619 echo "${ECHO_T}$ac_cv_objext" >&6
1620 OBJEXT=$ac_cv_objext
1621 ac_objext=$OBJEXT
1622 echo "$as_me:1622: checking whether we are using the GNU C compiler" >&5
1623 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1624 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1625   echo $ECHO_N "(cached) $ECHO_C" >&6
1626 else
1627   cat >conftest.$ac_ext <<_ACEOF
1628 #line 1628 "configure"
1629 #include "confdefs.h"
1630
1631 int
1632 main (void)
1633 {
1634 #ifndef __GNUC__
1635        choke me
1636 #endif
1637
1638   ;
1639   return 0;
1640 }
1641 _ACEOF
1642 rm -f conftest.$ac_objext
1643 if { (eval echo "$as_me:1643: \"$ac_compile\"") >&5
1644   (eval $ac_compile) 2>&5
1645   ac_status=$?
1646   echo "$as_me:1646: \$? = $ac_status" >&5
1647   (exit $ac_status); } &&
1648          { ac_try='test -s conftest.$ac_objext'
1649   { (eval echo "$as_me:1649: \"$ac_try\"") >&5
1650   (eval $ac_try) 2>&5
1651   ac_status=$?
1652   echo "$as_me:1652: \$? = $ac_status" >&5
1653   (exit $ac_status); }; }; then
1654   ac_compiler_gnu=yes
1655 else
1656   echo "$as_me: failed program was:" >&5
1657 cat conftest.$ac_ext >&5
1658 ac_compiler_gnu=no
1659 fi
1660 rm -f conftest.$ac_objext conftest.$ac_ext
1661 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1662
1663 fi
1664 echo "$as_me:1664: result: $ac_cv_c_compiler_gnu" >&5
1665 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1666 GCC=`test $ac_compiler_gnu = yes && echo yes`
1667 ac_test_CFLAGS=${CFLAGS+set}
1668 ac_save_CFLAGS=$CFLAGS
1669 CFLAGS="-g"
1670 echo "$as_me:1670: checking whether $CC accepts -g" >&5
1671 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1672 if test "${ac_cv_prog_cc_g+set}" = set; then
1673   echo $ECHO_N "(cached) $ECHO_C" >&6
1674 else
1675   cat >conftest.$ac_ext <<_ACEOF
1676 #line 1676 "configure"
1677 #include "confdefs.h"
1678
1679 int
1680 main (void)
1681 {
1682
1683   ;
1684   return 0;
1685 }
1686 _ACEOF
1687 rm -f conftest.$ac_objext
1688 if { (eval echo "$as_me:1688: \"$ac_compile\"") >&5
1689   (eval $ac_compile) 2>&5
1690   ac_status=$?
1691   echo "$as_me:1691: \$? = $ac_status" >&5
1692   (exit $ac_status); } &&
1693          { ac_try='test -s conftest.$ac_objext'
1694   { (eval echo "$as_me:1694: \"$ac_try\"") >&5
1695   (eval $ac_try) 2>&5
1696   ac_status=$?
1697   echo "$as_me:1697: \$? = $ac_status" >&5
1698   (exit $ac_status); }; }; then
1699   ac_cv_prog_cc_g=yes
1700 else
1701   echo "$as_me: failed program was:" >&5
1702 cat conftest.$ac_ext >&5
1703 ac_cv_prog_cc_g=no
1704 fi
1705 rm -f conftest.$ac_objext conftest.$ac_ext
1706 fi
1707 echo "$as_me:1707: result: $ac_cv_prog_cc_g" >&5
1708 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1709 if test "$ac_test_CFLAGS" = set; then
1710   CFLAGS=$ac_save_CFLAGS
1711 elif test $ac_cv_prog_cc_g = yes; then
1712   if test "$GCC" = yes; then
1713     CFLAGS="-g -O2"
1714   else
1715     CFLAGS="-g"
1716   fi
1717 else
1718   if test "$GCC" = yes; then
1719     CFLAGS="-O2"
1720   else
1721     CFLAGS=
1722   fi
1723 fi
1724 # Some people use a C++ compiler to compile C.  Since we use `exit',
1725 # in C++ we need to declare it.  In case someone uses the same compiler
1726 # for both compiling C and C++ we need to have the C++ compiler decide
1727 # the declaration of exit, since it's the most demanding environment.
1728 cat >conftest.$ac_ext <<_ACEOF
1729 #ifndef __cplusplus
1730   choke me
1731 #endif
1732 _ACEOF
1733 rm -f conftest.$ac_objext
1734 if { (eval echo "$as_me:1734: \"$ac_compile\"") >&5
1735   (eval $ac_compile) 2>&5
1736   ac_status=$?
1737   echo "$as_me:1737: \$? = $ac_status" >&5
1738   (exit $ac_status); } &&
1739          { ac_try='test -s conftest.$ac_objext'
1740   { (eval echo "$as_me:1740: \"$ac_try\"") >&5
1741   (eval $ac_try) 2>&5
1742   ac_status=$?
1743   echo "$as_me:1743: \$? = $ac_status" >&5
1744   (exit $ac_status); }; }; then
1745   for ac_declaration in \
1746    ''\
1747    '#include <stdlib.h>' \
1748    'extern "C" void std::exit (int) throw (); using std::exit;' \
1749    'extern "C" void std::exit (int); using std::exit;' \
1750    'extern "C" void exit (int) throw ();' \
1751    'extern "C" void exit (int);' \
1752    'void exit (int);'
1753 do
1754   cat >conftest.$ac_ext <<_ACEOF
1755 #line 1755 "configure"
1756 #include "confdefs.h"
1757 #include <stdlib.h>
1758 $ac_declaration
1759 int
1760 main (void)
1761 {
1762 exit (42);
1763   ;
1764   return 0;
1765 }
1766 _ACEOF
1767 rm -f conftest.$ac_objext
1768 if { (eval echo "$as_me:1768: \"$ac_compile\"") >&5
1769   (eval $ac_compile) 2>&5
1770   ac_status=$?
1771   echo "$as_me:1771: \$? = $ac_status" >&5
1772   (exit $ac_status); } &&
1773          { ac_try='test -s conftest.$ac_objext'
1774   { (eval echo "$as_me:1774: \"$ac_try\"") >&5
1775   (eval $ac_try) 2>&5
1776   ac_status=$?
1777   echo "$as_me:1777: \$? = $ac_status" >&5
1778   (exit $ac_status); }; }; then
1779   :
1780 else
1781   echo "$as_me: failed program was:" >&5
1782 cat conftest.$ac_ext >&5
1783 continue
1784 fi
1785 rm -f conftest.$ac_objext conftest.$ac_ext
1786   cat >conftest.$ac_ext <<_ACEOF
1787 #line 1787 "configure"
1788 #include "confdefs.h"
1789 $ac_declaration
1790 int
1791 main (void)
1792 {
1793 exit (42);
1794   ;
1795   return 0;
1796 }
1797 _ACEOF
1798 rm -f conftest.$ac_objext
1799 if { (eval echo "$as_me:1799: \"$ac_compile\"") >&5
1800   (eval $ac_compile) 2>&5
1801   ac_status=$?
1802   echo "$as_me:1802: \$? = $ac_status" >&5
1803   (exit $ac_status); } &&
1804          { ac_try='test -s conftest.$ac_objext'
1805   { (eval echo "$as_me:1805: \"$ac_try\"") >&5
1806   (eval $ac_try) 2>&5
1807   ac_status=$?
1808   echo "$as_me:1808: \$? = $ac_status" >&5
1809   (exit $ac_status); }; }; then
1810   break
1811 else
1812   echo "$as_me: failed program was:" >&5
1813 cat conftest.$ac_ext >&5
1814 fi
1815 rm -f conftest.$ac_objext conftest.$ac_ext
1816 done
1817 rm -rf conftest*
1818 if test -n "$ac_declaration"; then
1819   echo '#ifdef __cplusplus' >>confdefs.h
1820   echo $ac_declaration      >>confdefs.h
1821   echo '#endif'             >>confdefs.h
1822 fi
1823
1824 else
1825   echo "$as_me: failed program was:" >&5
1826 cat conftest.$ac_ext >&5
1827 fi
1828 rm -f conftest.$ac_objext conftest.$ac_ext
1829 ac_ext=c
1830 ac_cpp='$CPP $CPPFLAGS'
1831 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1832 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1833 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1834 ac_main_return=return
1835
1836 GCC_VERSION=none
1837 if test "$GCC" = yes ; then
1838         echo "$as_me:1838: checking version of $CC" >&5
1839 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1840         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.].*//'`"
1841         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1842         echo "$as_me:1842: result: $GCC_VERSION" >&5
1843 echo "${ECHO_T}$GCC_VERSION" >&6
1844 fi
1845
1846 echo "$as_me:1846: checking for $CC option to accept ANSI C" >&5
1847 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1848 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1849   echo $ECHO_N "(cached) $ECHO_C" >&6
1850 else
1851   ac_cv_prog_cc_stdc=no
1852 ac_save_CC=$CC
1853 cat >conftest.$ac_ext <<_ACEOF
1854 #line 1854 "configure"
1855 #include "confdefs.h"
1856 #include <stdarg.h>
1857 #include <stdio.h>
1858 #include <sys/types.h>
1859 #include <sys/stat.h>
1860 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1861 struct buf { int x; };
1862 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1863 static char *e (p, i)
1864      char **p;
1865      int i;
1866 {
1867   return p[i];
1868 }
1869 static char *f (char * (*g) (char **, int), char **p, ...)
1870 {
1871   char *s;
1872   va_list v;
1873   va_start (v,p);
1874   s = g (p, va_arg (v,int));
1875   va_end (v);
1876   return s;
1877 }
1878 int test (int i, double x);
1879 struct s1 {int (*f) (int a);};
1880 struct s2 {int (*f) (double a);};
1881 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1882 int argc;
1883 char **argv;
1884 int
1885 main (void)
1886 {
1887 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1888   ;
1889   return 0;
1890 }
1891 _ACEOF
1892 # Don't try gcc -ansi; that turns off useful extensions and
1893 # breaks some systems' header files.
1894 # AIX                   -qlanglvl=ansi
1895 # Ultrix and OSF/1      -std1
1896 # HP-UX 10.20 and later -Ae
1897 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1898 # SVR4                  -Xc -D__EXTENSIONS__
1899 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1900 do
1901   CC="$ac_save_CC $ac_arg"
1902   rm -f conftest.$ac_objext
1903 if { (eval echo "$as_me:1903: \"$ac_compile\"") >&5
1904   (eval $ac_compile) 2>&5
1905   ac_status=$?
1906   echo "$as_me:1906: \$? = $ac_status" >&5
1907   (exit $ac_status); } &&
1908          { ac_try='test -s conftest.$ac_objext'
1909   { (eval echo "$as_me:1909: \"$ac_try\"") >&5
1910   (eval $ac_try) 2>&5
1911   ac_status=$?
1912   echo "$as_me:1912: \$? = $ac_status" >&5
1913   (exit $ac_status); }; }; then
1914   ac_cv_prog_cc_stdc=$ac_arg
1915 break
1916 else
1917   echo "$as_me: failed program was:" >&5
1918 cat conftest.$ac_ext >&5
1919 fi
1920 rm -f conftest.$ac_objext
1921 done
1922 rm -f conftest.$ac_ext conftest.$ac_objext
1923 CC=$ac_save_CC
1924
1925 fi
1926
1927 case "x$ac_cv_prog_cc_stdc" in
1928   x|xno)
1929     echo "$as_me:1929: result: none needed" >&5
1930 echo "${ECHO_T}none needed" >&6 ;;
1931   *)
1932     echo "$as_me:1932: result: $ac_cv_prog_cc_stdc" >&5
1933 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1934     CC="$CC $ac_cv_prog_cc_stdc" ;;
1935 esac
1936
1937 # This should have been defined by AC_PROG_CC
1938 : ${CC:=cc}
1939
1940 echo "$as_me:1940: checking \$CC variable" >&5
1941 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1942 case "$CC" in
1943 (*[\ \  ]-*)
1944         echo "$as_me:1944: result: broken" >&5
1945 echo "${ECHO_T}broken" >&6
1946         { echo "$as_me:1946: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1947 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1948         # humor him...
1949         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1950         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1951         CC="$cf_prog"
1952         for cf_arg in $cf_flags
1953         do
1954                 case "x$cf_arg" in
1955                 (x-[IUDfgOW]*)
1956
1957 cf_fix_cppflags=no
1958 cf_new_cflags=
1959 cf_new_cppflags=
1960 cf_new_extra_cppflags=
1961
1962 for cf_add_cflags in $cf_arg
1963 do
1964 case $cf_fix_cppflags in
1965 (no)
1966         case $cf_add_cflags in
1967         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1968                 case $cf_add_cflags in
1969                 (-D*)
1970                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1971
1972                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1973                                 && test -z "${cf_tst_cflags}" \
1974                                 && cf_fix_cppflags=yes
1975
1976                         if test $cf_fix_cppflags = yes ; then
1977
1978         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1979         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1980
1981                                 continue
1982                         elif test "${cf_tst_cflags}" = "\"'" ; then
1983
1984         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1985         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1986
1987                                 continue
1988                         fi
1989                         ;;
1990                 esac
1991                 case "$CPPFLAGS" in
1992                 (*$cf_add_cflags)
1993                         ;;
1994                 (*)
1995                         case $cf_add_cflags in
1996                         (-D*)
1997                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1998
1999 CPPFLAGS=`echo "$CPPFLAGS" | \
2000         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2001                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2002
2003                                 ;;
2004                         esac
2005
2006         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2007         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2008
2009                         ;;
2010                 esac
2011                 ;;
2012         (*)
2013
2014         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2015         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2016
2017                 ;;
2018         esac
2019         ;;
2020 (yes)
2021
2022         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2023         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2024
2025         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2026
2027         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2028                 && test -z "${cf_tst_cflags}" \
2029                 && cf_fix_cppflags=no
2030         ;;
2031 esac
2032 done
2033
2034 if test -n "$cf_new_cflags" ; then
2035
2036         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2037         CFLAGS="${CFLAGS}$cf_new_cflags"
2038
2039 fi
2040
2041 if test -n "$cf_new_cppflags" ; then
2042
2043         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2044         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2045
2046 fi
2047
2048 if test -n "$cf_new_extra_cppflags" ; then
2049
2050         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2051         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2052
2053 fi
2054
2055                         ;;
2056                 (*)
2057                         CC="$CC $cf_arg"
2058                         ;;
2059                 esac
2060         done
2061         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2062
2063 echo "${as_me:-configure}:2063: testing resulting CC: '$CC' ..." 1>&5
2064
2065         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2066
2067 echo "${as_me:-configure}:2067: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2068
2069         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2070
2071 echo "${as_me:-configure}:2071: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2072
2073         ;;
2074 (*)
2075         echo "$as_me:2075: result: ok" >&5
2076 echo "${ECHO_T}ok" >&6
2077         ;;
2078 esac
2079
2080 echo "$as_me:2080: checking for inline" >&5
2081 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2082 if test "${ac_cv_c_inline+set}" = set; then
2083   echo $ECHO_N "(cached) $ECHO_C" >&6
2084 else
2085   ac_cv_c_inline=no
2086 for ac_kw in inline __inline__ __inline; do
2087   cat >conftest.$ac_ext <<_ACEOF
2088 #line 2088 "configure"
2089 #include "confdefs.h"
2090 #ifndef __cplusplus
2091 static $ac_kw int static_foo () {return 0; }
2092 $ac_kw int foo () {return 0; }
2093 #endif
2094
2095 _ACEOF
2096 rm -f conftest.$ac_objext
2097 if { (eval echo "$as_me:2097: \"$ac_compile\"") >&5
2098   (eval $ac_compile) 2>&5
2099   ac_status=$?
2100   echo "$as_me:2100: \$? = $ac_status" >&5
2101   (exit $ac_status); } &&
2102          { ac_try='test -s conftest.$ac_objext'
2103   { (eval echo "$as_me:2103: \"$ac_try\"") >&5
2104   (eval $ac_try) 2>&5
2105   ac_status=$?
2106   echo "$as_me:2106: \$? = $ac_status" >&5
2107   (exit $ac_status); }; }; then
2108   ac_cv_c_inline=$ac_kw; break
2109 else
2110   echo "$as_me: failed program was:" >&5
2111 cat conftest.$ac_ext >&5
2112 fi
2113 rm -f conftest.$ac_objext conftest.$ac_ext
2114 done
2115
2116 fi
2117 echo "$as_me:2117: result: $ac_cv_c_inline" >&5
2118 echo "${ECHO_T}$ac_cv_c_inline" >&6
2119 case $ac_cv_c_inline in
2120   inline | yes) ;;
2121   no)
2122 cat >>confdefs.h <<\EOF
2123 #define inline
2124 EOF
2125  ;;
2126   *)  cat >>confdefs.h <<EOF
2127 #define inline $ac_cv_c_inline
2128 EOF
2129  ;;
2130 esac
2131
2132 ac_ext=c
2133 ac_cpp='$CPP $CPPFLAGS'
2134 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2135 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2136 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2137 ac_main_return=return
2138 echo "$as_me:2138: checking how to run the C preprocessor" >&5
2139 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2140 # On Suns, sometimes $CPP names a directory.
2141 if test -n "$CPP" && test -d "$CPP"; then
2142   CPP=
2143 fi
2144 if test -z "$CPP"; then
2145   if test "${ac_cv_prog_CPP+set}" = set; then
2146   echo $ECHO_N "(cached) $ECHO_C" >&6
2147 else
2148       # Double quotes because CPP needs to be expanded
2149     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2150     do
2151       ac_preproc_ok=false
2152 for ac_c_preproc_warn_flag in '' yes
2153 do
2154   # Use a header file that comes with gcc, so configuring glibc
2155   # with a fresh cross-compiler works.
2156   # On the NeXT, cc -E runs the code through the compiler's parser,
2157   # not just through cpp. "Syntax error" is here to catch this case.
2158   cat >conftest.$ac_ext <<_ACEOF
2159 #line 2159 "configure"
2160 #include "confdefs.h"
2161 #include <assert.h>
2162                      Syntax error
2163 _ACEOF
2164 if { (eval echo "$as_me:2164: \"$ac_cpp conftest.$ac_ext\"") >&5
2165   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2166   ac_status=$?
2167   egrep -v '^ *\+' conftest.er1 >conftest.err
2168   rm -f conftest.er1
2169   cat conftest.err >&5
2170   echo "$as_me:2170: \$? = $ac_status" >&5
2171   (exit $ac_status); } >/dev/null; then
2172   if test -s conftest.err; then
2173     ac_cpp_err=$ac_c_preproc_warn_flag
2174   else
2175     ac_cpp_err=
2176   fi
2177 else
2178   ac_cpp_err=yes
2179 fi
2180 if test -z "$ac_cpp_err"; then
2181   :
2182 else
2183   echo "$as_me: failed program was:" >&5
2184   cat conftest.$ac_ext >&5
2185   # Broken: fails on valid input.
2186 continue
2187 fi
2188 rm -f conftest.err conftest.$ac_ext
2189
2190   # OK, works on sane cases.  Now check whether non-existent headers
2191   # can be detected and how.
2192   cat >conftest.$ac_ext <<_ACEOF
2193 #line 2193 "configure"
2194 #include "confdefs.h"
2195 #include <ac_nonexistent.h>
2196 _ACEOF
2197 if { (eval echo "$as_me:2197: \"$ac_cpp conftest.$ac_ext\"") >&5
2198   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2199   ac_status=$?
2200   egrep -v '^ *\+' conftest.er1 >conftest.err
2201   rm -f conftest.er1
2202   cat conftest.err >&5
2203   echo "$as_me:2203: \$? = $ac_status" >&5
2204   (exit $ac_status); } >/dev/null; then
2205   if test -s conftest.err; then
2206     ac_cpp_err=$ac_c_preproc_warn_flag
2207   else
2208     ac_cpp_err=
2209   fi
2210 else
2211   ac_cpp_err=yes
2212 fi
2213 if test -z "$ac_cpp_err"; then
2214   # Broken: success on invalid input.
2215 continue
2216 else
2217   echo "$as_me: failed program was:" >&5
2218   cat conftest.$ac_ext >&5
2219   # Passes both tests.
2220 ac_preproc_ok=:
2221 break
2222 fi
2223 rm -f conftest.err conftest.$ac_ext
2224
2225 done
2226 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2227 rm -f conftest.err conftest.$ac_ext
2228 if $ac_preproc_ok; then
2229   break
2230 fi
2231
2232     done
2233     ac_cv_prog_CPP=$CPP
2234
2235 fi
2236   CPP=$ac_cv_prog_CPP
2237 else
2238   ac_cv_prog_CPP=$CPP
2239 fi
2240 echo "$as_me:2240: result: $CPP" >&5
2241 echo "${ECHO_T}$CPP" >&6
2242 ac_preproc_ok=false
2243 for ac_c_preproc_warn_flag in '' yes
2244 do
2245   # Use a header file that comes with gcc, so configuring glibc
2246   # with a fresh cross-compiler works.
2247   # On the NeXT, cc -E runs the code through the compiler's parser,
2248   # not just through cpp. "Syntax error" is here to catch this case.
2249   cat >conftest.$ac_ext <<_ACEOF
2250 #line 2250 "configure"
2251 #include "confdefs.h"
2252 #include <assert.h>
2253                      Syntax error
2254 _ACEOF
2255 if { (eval echo "$as_me:2255: \"$ac_cpp conftest.$ac_ext\"") >&5
2256   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2257   ac_status=$?
2258   egrep -v '^ *\+' conftest.er1 >conftest.err
2259   rm -f conftest.er1
2260   cat conftest.err >&5
2261   echo "$as_me:2261: \$? = $ac_status" >&5
2262   (exit $ac_status); } >/dev/null; then
2263   if test -s conftest.err; then
2264     ac_cpp_err=$ac_c_preproc_warn_flag
2265   else
2266     ac_cpp_err=
2267   fi
2268 else
2269   ac_cpp_err=yes
2270 fi
2271 if test -z "$ac_cpp_err"; then
2272   :
2273 else
2274   echo "$as_me: failed program was:" >&5
2275   cat conftest.$ac_ext >&5
2276   # Broken: fails on valid input.
2277 continue
2278 fi
2279 rm -f conftest.err conftest.$ac_ext
2280
2281   # OK, works on sane cases.  Now check whether non-existent headers
2282   # can be detected and how.
2283   cat >conftest.$ac_ext <<_ACEOF
2284 #line 2284 "configure"
2285 #include "confdefs.h"
2286 #include <ac_nonexistent.h>
2287 _ACEOF
2288 if { (eval echo "$as_me:2288: \"$ac_cpp conftest.$ac_ext\"") >&5
2289   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2290   ac_status=$?
2291   egrep -v '^ *\+' conftest.er1 >conftest.err
2292   rm -f conftest.er1
2293   cat conftest.err >&5
2294   echo "$as_me:2294: \$? = $ac_status" >&5
2295   (exit $ac_status); } >/dev/null; then
2296   if test -s conftest.err; then
2297     ac_cpp_err=$ac_c_preproc_warn_flag
2298   else
2299     ac_cpp_err=
2300   fi
2301 else
2302   ac_cpp_err=yes
2303 fi
2304 if test -z "$ac_cpp_err"; then
2305   # Broken: success on invalid input.
2306 continue
2307 else
2308   echo "$as_me: failed program was:" >&5
2309   cat conftest.$ac_ext >&5
2310   # Passes both tests.
2311 ac_preproc_ok=:
2312 break
2313 fi
2314 rm -f conftest.err conftest.$ac_ext
2315
2316 done
2317 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2318 rm -f conftest.err conftest.$ac_ext
2319 if $ac_preproc_ok; then
2320   :
2321 else
2322   { { echo "$as_me:2322: error: C preprocessor \"$CPP\" fails sanity check" >&5
2323 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2324    { (exit 1); exit 1; }; }
2325 fi
2326
2327 ac_ext=c
2328 ac_cpp='$CPP $CPPFLAGS'
2329 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2330 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2331 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2332 ac_main_return=return
2333
2334 for ac_prog in mawk gawk nawk awk
2335 do
2336   # Extract the first word of "$ac_prog", so it can be a program name with args.
2337 set dummy $ac_prog; ac_word=$2
2338 echo "$as_me:2338: checking for $ac_word" >&5
2339 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2340 if test "${ac_cv_prog_AWK+set}" = set; then
2341   echo $ECHO_N "(cached) $ECHO_C" >&6
2342 else
2343   if test -n "$AWK"; then
2344   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2345 else
2346   ac_save_IFS=$IFS; IFS=$ac_path_separator
2347 ac_dummy="$PATH"
2348 for ac_dir in $ac_dummy; do
2349   IFS=$ac_save_IFS
2350   test -z "$ac_dir" && ac_dir=.
2351   $as_executable_p "$ac_dir/$ac_word" || continue
2352 ac_cv_prog_AWK="$ac_prog"
2353 echo "$as_me:2353: found $ac_dir/$ac_word" >&5
2354 break
2355 done
2356
2357 fi
2358 fi
2359 AWK=$ac_cv_prog_AWK
2360 if test -n "$AWK"; then
2361   echo "$as_me:2361: result: $AWK" >&5
2362 echo "${ECHO_T}$AWK" >&6
2363 else
2364   echo "$as_me:2364: result: no" >&5
2365 echo "${ECHO_T}no" >&6
2366 fi
2367
2368   test -n "$AWK" && break
2369 done
2370
2371 # Find a good install program.  We prefer a C program (faster),
2372 # so one script is as good as another.  But avoid the broken or
2373 # incompatible versions:
2374 # SysV /etc/install, /usr/sbin/install
2375 # SunOS /usr/etc/install
2376 # IRIX /sbin/install
2377 # AIX /bin/install
2378 # AmigaOS /C/install, which installs bootblocks on floppy discs
2379 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2380 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2381 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2382 # ./install, which can be erroneously created by make from ./install.sh.
2383 echo "$as_me:2383: checking for a BSD compatible install" >&5
2384 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2385 if test -z "$INSTALL"; then
2386 if test "${ac_cv_path_install+set}" = set; then
2387   echo $ECHO_N "(cached) $ECHO_C" >&6
2388 else
2389     ac_save_IFS=$IFS; IFS=$ac_path_separator
2390   for ac_dir in $PATH; do
2391     IFS=$ac_save_IFS
2392     # Account for people who put trailing slashes in PATH elements.
2393     case $ac_dir/ in
2394     / | ./ | .// | /cC/* \
2395     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2396     | /usr/ucb/* ) ;;
2397     *)
2398       # OSF1 and SCO ODT 3.0 have their own names for install.
2399       # Don't use installbsd from OSF since it installs stuff as root
2400       # by default.
2401       for ac_prog in ginstall scoinst install; do
2402         if $as_executable_p "$ac_dir/$ac_prog"; then
2403           if test $ac_prog = install &&
2404             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2405             # AIX install.  It has an incompatible calling convention.
2406             :
2407           elif test $ac_prog = install &&
2408             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2409             # program-specific install script used by HP pwplus--don't use.
2410             :
2411           else
2412             ac_cv_path_install="$ac_dir/$ac_prog -c"
2413             break 2
2414           fi
2415         fi
2416       done
2417       ;;
2418     esac
2419   done
2420
2421 fi
2422   if test "${ac_cv_path_install+set}" = set; then
2423     INSTALL=$ac_cv_path_install
2424   else
2425     # As a last resort, use the slow shell script.  We don't cache a
2426     # path for INSTALL within a source directory, because that will
2427     # break other packages using the cache if that directory is
2428     # removed, or if the path is relative.
2429     INSTALL=$ac_install_sh
2430   fi
2431 fi
2432 echo "$as_me:2432: result: $INSTALL" >&5
2433 echo "${ECHO_T}$INSTALL" >&6
2434
2435 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2436 # It thinks the first close brace ends the variable substitution.
2437 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2438
2439 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2440
2441 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2442
2443 case $INSTALL in
2444 (/*)
2445         ;;
2446 (*)
2447         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2448         test -z "$cf_dir" && cf_dir=.
2449         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2450         ;;
2451 esac
2452
2453 for ac_prog in lint cppcheck splint
2454 do
2455   # Extract the first word of "$ac_prog", so it can be a program name with args.
2456 set dummy $ac_prog; ac_word=$2
2457 echo "$as_me:2457: checking for $ac_word" >&5
2458 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2459 if test "${ac_cv_prog_LINT+set}" = set; then
2460   echo $ECHO_N "(cached) $ECHO_C" >&6
2461 else
2462   if test -n "$LINT"; then
2463   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2464 else
2465   ac_save_IFS=$IFS; IFS=$ac_path_separator
2466 ac_dummy="$PATH"
2467 for ac_dir in $ac_dummy; do
2468   IFS=$ac_save_IFS
2469   test -z "$ac_dir" && ac_dir=.
2470   $as_executable_p "$ac_dir/$ac_word" || continue
2471 ac_cv_prog_LINT="$ac_prog"
2472 echo "$as_me:2472: found $ac_dir/$ac_word" >&5
2473 break
2474 done
2475
2476 fi
2477 fi
2478 LINT=$ac_cv_prog_LINT
2479 if test -n "$LINT"; then
2480   echo "$as_me:2480: result: $LINT" >&5
2481 echo "${ECHO_T}$LINT" >&6
2482 else
2483   echo "$as_me:2483: result: no" >&5
2484 echo "${ECHO_T}no" >&6
2485 fi
2486
2487   test -n "$LINT" && break
2488 done
2489
2490 echo "$as_me:2490: checking if filesystem supports mixed-case filenames" >&5
2491 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2492 if test "${cf_cv_mixedcase+set}" = set; then
2493   echo $ECHO_N "(cached) $ECHO_C" >&6
2494 else
2495
2496 if test "$cross_compiling" = yes ; then
2497         case $target_alias in
2498         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2499                 cf_cv_mixedcase=no
2500                 ;;
2501         (*)
2502                 cf_cv_mixedcase=yes
2503                 ;;
2504         esac
2505 else
2506         rm -f conftest CONFTEST
2507         echo test >conftest
2508         if test -f CONFTEST ; then
2509                 cf_cv_mixedcase=no
2510         else
2511                 cf_cv_mixedcase=yes
2512         fi
2513         rm -f conftest CONFTEST
2514 fi
2515
2516 fi
2517 echo "$as_me:2517: result: $cf_cv_mixedcase" >&5
2518 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2519 test "$cf_cv_mixedcase" = yes &&
2520 cat >>confdefs.h <<\EOF
2521 #define MIXEDCASE_FILENAMES 1
2522 EOF
2523
2524 for ac_prog in exctags ctags
2525 do
2526   # Extract the first word of "$ac_prog", so it can be a program name with args.
2527 set dummy $ac_prog; ac_word=$2
2528 echo "$as_me:2528: checking for $ac_word" >&5
2529 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2530 if test "${ac_cv_prog_CTAGS+set}" = set; then
2531   echo $ECHO_N "(cached) $ECHO_C" >&6
2532 else
2533   if test -n "$CTAGS"; then
2534   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2535 else
2536   ac_save_IFS=$IFS; IFS=$ac_path_separator
2537 ac_dummy="$PATH"
2538 for ac_dir in $ac_dummy; do
2539   IFS=$ac_save_IFS
2540   test -z "$ac_dir" && ac_dir=.
2541   $as_executable_p "$ac_dir/$ac_word" || continue
2542 ac_cv_prog_CTAGS="$ac_prog"
2543 echo "$as_me:2543: found $ac_dir/$ac_word" >&5
2544 break
2545 done
2546
2547 fi
2548 fi
2549 CTAGS=$ac_cv_prog_CTAGS
2550 if test -n "$CTAGS"; then
2551   echo "$as_me:2551: result: $CTAGS" >&5
2552 echo "${ECHO_T}$CTAGS" >&6
2553 else
2554   echo "$as_me:2554: result: no" >&5
2555 echo "${ECHO_T}no" >&6
2556 fi
2557
2558   test -n "$CTAGS" && break
2559 done
2560
2561 for ac_prog in exetags etags
2562 do
2563   # Extract the first word of "$ac_prog", so it can be a program name with args.
2564 set dummy $ac_prog; ac_word=$2
2565 echo "$as_me:2565: checking for $ac_word" >&5
2566 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2567 if test "${ac_cv_prog_ETAGS+set}" = set; then
2568   echo $ECHO_N "(cached) $ECHO_C" >&6
2569 else
2570   if test -n "$ETAGS"; then
2571   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2572 else
2573   ac_save_IFS=$IFS; IFS=$ac_path_separator
2574 ac_dummy="$PATH"
2575 for ac_dir in $ac_dummy; do
2576   IFS=$ac_save_IFS
2577   test -z "$ac_dir" && ac_dir=.
2578   $as_executable_p "$ac_dir/$ac_word" || continue
2579 ac_cv_prog_ETAGS="$ac_prog"
2580 echo "$as_me:2580: found $ac_dir/$ac_word" >&5
2581 break
2582 done
2583
2584 fi
2585 fi
2586 ETAGS=$ac_cv_prog_ETAGS
2587 if test -n "$ETAGS"; then
2588   echo "$as_me:2588: result: $ETAGS" >&5
2589 echo "${ECHO_T}$ETAGS" >&6
2590 else
2591   echo "$as_me:2591: result: no" >&5
2592 echo "${ECHO_T}no" >&6
2593 fi
2594
2595   test -n "$ETAGS" && break
2596 done
2597
2598 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2599 set dummy ${CTAGS:-ctags}; ac_word=$2
2600 echo "$as_me:2600: checking for $ac_word" >&5
2601 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2602 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2603   echo $ECHO_N "(cached) $ECHO_C" >&6
2604 else
2605   if test -n "$MAKE_LOWER_TAGS"; then
2606   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2607 else
2608   ac_save_IFS=$IFS; IFS=$ac_path_separator
2609 ac_dummy="$PATH"
2610 for ac_dir in $ac_dummy; do
2611   IFS=$ac_save_IFS
2612   test -z "$ac_dir" && ac_dir=.
2613   $as_executable_p "$ac_dir/$ac_word" || continue
2614 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2615 echo "$as_me:2615: found $ac_dir/$ac_word" >&5
2616 break
2617 done
2618
2619   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2620 fi
2621 fi
2622 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2623 if test -n "$MAKE_LOWER_TAGS"; then
2624   echo "$as_me:2624: result: $MAKE_LOWER_TAGS" >&5
2625 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2626 else
2627   echo "$as_me:2627: result: no" >&5
2628 echo "${ECHO_T}no" >&6
2629 fi
2630
2631 if test "$cf_cv_mixedcase" = yes ; then
2632         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2633 set dummy ${ETAGS:-etags}; ac_word=$2
2634 echo "$as_me:2634: checking for $ac_word" >&5
2635 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2636 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2637   echo $ECHO_N "(cached) $ECHO_C" >&6
2638 else
2639   if test -n "$MAKE_UPPER_TAGS"; then
2640   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2641 else
2642   ac_save_IFS=$IFS; IFS=$ac_path_separator
2643 ac_dummy="$PATH"
2644 for ac_dir in $ac_dummy; do
2645   IFS=$ac_save_IFS
2646   test -z "$ac_dir" && ac_dir=.
2647   $as_executable_p "$ac_dir/$ac_word" || continue
2648 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2649 echo "$as_me:2649: found $ac_dir/$ac_word" >&5
2650 break
2651 done
2652
2653   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2654 fi
2655 fi
2656 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2657 if test -n "$MAKE_UPPER_TAGS"; then
2658   echo "$as_me:2658: result: $MAKE_UPPER_TAGS" >&5
2659 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2660 else
2661   echo "$as_me:2661: result: no" >&5
2662 echo "${ECHO_T}no" >&6
2663 fi
2664
2665 else
2666         MAKE_UPPER_TAGS=no
2667 fi
2668
2669 if test "$MAKE_UPPER_TAGS" = yes ; then
2670         MAKE_UPPER_TAGS=
2671 else
2672         MAKE_UPPER_TAGS="#"
2673 fi
2674
2675 if test "$MAKE_LOWER_TAGS" = yes ; then
2676         MAKE_LOWER_TAGS=
2677 else
2678         MAKE_LOWER_TAGS="#"
2679 fi
2680
2681 echo "$as_me:2681: checking if -lm needed for math functions" >&5
2682 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2683 if test "${cf_cv_need_libm+set}" = set; then
2684   echo $ECHO_N "(cached) $ECHO_C" >&6
2685 else
2686
2687         cat >conftest.$ac_ext <<_ACEOF
2688 #line 2688 "configure"
2689 #include "confdefs.h"
2690
2691         #include <stdio.h>
2692         #include <stdlib.h>
2693         #include <math.h>
2694
2695 int
2696 main (void)
2697 {
2698 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2699   ;
2700   return 0;
2701 }
2702 _ACEOF
2703 rm -f conftest.$ac_objext conftest$ac_exeext
2704 if { (eval echo "$as_me:2704: \"$ac_link\"") >&5
2705   (eval $ac_link) 2>&5
2706   ac_status=$?
2707   echo "$as_me:2707: \$? = $ac_status" >&5
2708   (exit $ac_status); } &&
2709          { ac_try='test -s conftest$ac_exeext'
2710   { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit $ac_status); }; }; then
2715   cf_cv_need_libm=no
2716 else
2717   echo "$as_me: failed program was:" >&5
2718 cat conftest.$ac_ext >&5
2719 cf_cv_need_libm=yes
2720 fi
2721 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2722 fi
2723 echo "$as_me:2723: result: $cf_cv_need_libm" >&5
2724 echo "${ECHO_T}$cf_cv_need_libm" >&6
2725 if test "$cf_cv_need_libm" = yes
2726 then
2727 MATH_LIB=-lm
2728 fi
2729
2730 top_builddir=`pwd`
2731
2732 CC_G_OPT="-g"
2733 CC_SHARED_OPTS=unknown
2734 CPPFLAGS="$CPPFLAGS"
2735 DFT_DEP_SUFFIX=""
2736 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2737 DFT_UPR_MODEL="NORMAL"
2738 LD="ld"
2739 LDFLAGS_SHARED=""
2740 LDFLAGS_STATIC=""
2741 LD_MODEL=""
2742 LD_SHARED_OPTS=""
2743 LIBTOOL=""
2744 LIBTOOL_OPTS=""
2745 LIB_CLEAN=""
2746 LIB_COMPILE=""
2747 LIB_LINK='${CC}'
2748 LINK_TESTS=""
2749 LOCAL_LDFLAGS=""
2750 PACKAGE="ncurses-examples"
2751 PTHREAD="-lm"
2752 TEST_ARGS=""
2753 TEST_DEPS=""
2754 TEST_LIBS=""
2755 TINFO_LDFLAGS=''
2756 TINFO_LIBS='$(LIBS_CURSES)'
2757 cf_cv_abi_version=""
2758 cf_cv_rel_version=""
2759 includesubdir=""
2760
2761 cf_cv_screen=curses
2762 cf_cv_libtype=
2763
2764 if test "$GCC" = yes
2765 then
2766 cat > conftest.i <<EOF
2767 #ifndef GCC_PRINTF
2768 #define GCC_PRINTF 0
2769 #endif
2770 #ifndef GCC_SCANF
2771 #define GCC_SCANF 0
2772 #endif
2773 #ifndef GCC_NORETURN
2774 #define GCC_NORETURN /* nothing */
2775 #endif
2776 #ifndef GCC_UNUSED
2777 #define GCC_UNUSED /* nothing */
2778 #endif
2779 EOF
2780 if test "$GCC" = yes
2781 then
2782         { echo "$as_me:2782: checking for $CC __attribute__ directives..." >&5
2783 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2784 cat > conftest.$ac_ext <<EOF
2785 #line 2785 "${as_me:-configure}"
2786 #include "confdefs.h"
2787 #include "conftest.h"
2788 #include "conftest.i"
2789 #if     GCC_PRINTF
2790 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2791 #else
2792 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2793 #endif
2794 #if     GCC_SCANF
2795 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2796 #else
2797 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2798 #endif
2799 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2800 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2801 extern void foo(void) GCC_NORETURN;
2802 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2803 EOF
2804         cf_printf_attribute=no
2805         cf_scanf_attribute=no
2806         for cf_attribute in scanf printf unused noreturn
2807         do
2808
2809 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2810
2811                 cf_directive="__attribute__(($cf_attribute))"
2812                 echo "checking for $CC $cf_directive" 1>&5
2813
2814                 case $cf_attribute in
2815                 (printf)
2816                         cf_printf_attribute=yes
2817                         cat >conftest.h <<EOF
2818 #define GCC_$cf_ATTRIBUTE 1
2819 EOF
2820                         ;;
2821                 (scanf)
2822                         cf_scanf_attribute=yes
2823                         cat >conftest.h <<EOF
2824 #define GCC_$cf_ATTRIBUTE 1
2825 EOF
2826                         ;;
2827                 (*)
2828                         cat >conftest.h <<EOF
2829 #define GCC_$cf_ATTRIBUTE $cf_directive
2830 EOF
2831                         ;;
2832                 esac
2833
2834                 if { (eval echo "$as_me:2834: \"$ac_compile\"") >&5
2835   (eval $ac_compile) 2>&5
2836   ac_status=$?
2837   echo "$as_me:2837: \$? = $ac_status" >&5
2838   (exit $ac_status); }; then
2839                         test -n "$verbose" && echo "$as_me:2839: result: ... $cf_attribute" >&5
2840 echo "${ECHO_T}... $cf_attribute" >&6
2841                         cat conftest.h >>confdefs.h
2842                         case $cf_attribute in
2843                         (noreturn)
2844
2845 cat >>confdefs.h <<EOF
2846 #define GCC_NORETURN $cf_directive
2847 EOF
2848
2849                                 ;;
2850                         (printf)
2851                                 cf_value='/* nothing */'
2852                                 if test "$cf_printf_attribute" != no ; then
2853                                         cf_value='__attribute__((format(printf,fmt,var)))'
2854
2855 cat >>confdefs.h <<\EOF
2856 #define GCC_PRINTF 1
2857 EOF
2858
2859                                 fi
2860
2861 cat >>confdefs.h <<EOF
2862 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2863 EOF
2864
2865                                 ;;
2866                         (scanf)
2867                                 cf_value='/* nothing */'
2868                                 if test "$cf_scanf_attribute" != no ; then
2869                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2870
2871 cat >>confdefs.h <<\EOF
2872 #define GCC_SCANF 1
2873 EOF
2874
2875                                 fi
2876
2877 cat >>confdefs.h <<EOF
2878 #define GCC_SCANFLIKE(fmt,var) $cf_value
2879 EOF
2880
2881                                 ;;
2882                         (unused)
2883
2884 cat >>confdefs.h <<EOF
2885 #define GCC_UNUSED $cf_directive
2886 EOF
2887
2888                                 ;;
2889                         esac
2890                 fi
2891         done
2892 else
2893         fgrep define conftest.i >>confdefs.h
2894 fi
2895 rm -rf conftest*
2896 fi
2897
2898 echo "$as_me:2898: checking if you want to work around bogus compiler/loader warnings" >&5
2899 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
2900
2901 # Check whether --enable-string-hacks or --disable-string-hacks was given.
2902 if test "${enable_string_hacks+set}" = set; then
2903   enableval="$enable_string_hacks"
2904   with_string_hacks=$enableval
2905 else
2906   with_string_hacks=no
2907 fi;
2908 echo "$as_me:2908: result: $with_string_hacks" >&5
2909 echo "${ECHO_T}$with_string_hacks" >&6
2910
2911 if test "x$with_string_hacks" = "xyes"; then
2912
2913 cat >>confdefs.h <<\EOF
2914 #define USE_STRING_HACKS 1
2915 EOF
2916
2917         { echo "$as_me:2917: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
2918 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
2919         echo "$as_me:2919: checking for strlcat" >&5
2920 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
2921 if test "${ac_cv_func_strlcat+set}" = set; then
2922   echo $ECHO_N "(cached) $ECHO_C" >&6
2923 else
2924   cat >conftest.$ac_ext <<_ACEOF
2925 #line 2925 "configure"
2926 #include "confdefs.h"
2927 /* System header to define __stub macros and hopefully few prototypes,
2928     which can conflict with char strlcat (); below.  */
2929 #include <assert.h>
2930 /* Override any gcc2 internal prototype to avoid an error.  */
2931 #ifdef __cplusplus
2932 extern "C"
2933 #endif
2934 /* We use char because int might match the return type of a gcc2
2935    builtin and then its argument prototype would still apply.  */
2936 char strlcat ();
2937 char (*f) ();
2938
2939 int
2940 main (void)
2941 {
2942 /* The GNU C library defines this for functions which it implements
2943     to always fail with ENOSYS.  Some functions are actually named
2944     something starting with __ and the normal name is an alias.  */
2945 #if defined (__stub_strlcat) || defined (__stub___strlcat)
2946 choke me
2947 #else
2948 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
2949 #endif
2950
2951   ;
2952   return 0;
2953 }
2954 _ACEOF
2955 rm -f conftest.$ac_objext conftest$ac_exeext
2956 if { (eval echo "$as_me:2956: \"$ac_link\"") >&5
2957   (eval $ac_link) 2>&5
2958   ac_status=$?
2959   echo "$as_me:2959: \$? = $ac_status" >&5
2960   (exit $ac_status); } &&
2961          { ac_try='test -s conftest$ac_exeext'
2962   { (eval echo "$as_me:2962: \"$ac_try\"") >&5
2963   (eval $ac_try) 2>&5
2964   ac_status=$?
2965   echo "$as_me:2965: \$? = $ac_status" >&5
2966   (exit $ac_status); }; }; then
2967   ac_cv_func_strlcat=yes
2968 else
2969   echo "$as_me: failed program was:" >&5
2970 cat conftest.$ac_ext >&5
2971 ac_cv_func_strlcat=no
2972 fi
2973 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2974 fi
2975 echo "$as_me:2975: result: $ac_cv_func_strlcat" >&5
2976 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
2977 if test $ac_cv_func_strlcat = yes; then
2978
2979 cat >>confdefs.h <<\EOF
2980 #define HAVE_STRLCAT 1
2981 EOF
2982
2983 else
2984
2985                 echo "$as_me:2985: checking for strlcat in -lbsd" >&5
2986 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
2987 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
2988   echo $ECHO_N "(cached) $ECHO_C" >&6
2989 else
2990   ac_check_lib_save_LIBS=$LIBS
2991 LIBS="-lbsd  $LIBS"
2992 cat >conftest.$ac_ext <<_ACEOF
2993 #line 2993 "configure"
2994 #include "confdefs.h"
2995
2996 /* Override any gcc2 internal prototype to avoid an error.  */
2997 #ifdef __cplusplus
2998 extern "C"
2999 #endif
3000 /* We use char because int might match the return type of a gcc2
3001    builtin and then its argument prototype would still apply.  */
3002 char strlcat ();
3003 int
3004 main (void)
3005 {
3006 strlcat ();
3007   ;
3008   return 0;
3009 }
3010 _ACEOF
3011 rm -f conftest.$ac_objext conftest$ac_exeext
3012 if { (eval echo "$as_me:3012: \"$ac_link\"") >&5
3013   (eval $ac_link) 2>&5
3014   ac_status=$?
3015   echo "$as_me:3015: \$? = $ac_status" >&5
3016   (exit $ac_status); } &&
3017          { ac_try='test -s conftest$ac_exeext'
3018   { (eval echo "$as_me:3018: \"$ac_try\"") >&5
3019   (eval $ac_try) 2>&5
3020   ac_status=$?
3021   echo "$as_me:3021: \$? = $ac_status" >&5
3022   (exit $ac_status); }; }; then
3023   ac_cv_lib_bsd_strlcat=yes
3024 else
3025   echo "$as_me: failed program was:" >&5
3026 cat conftest.$ac_ext >&5
3027 ac_cv_lib_bsd_strlcat=no
3028 fi
3029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3030 LIBS=$ac_check_lib_save_LIBS
3031 fi
3032 echo "$as_me:3032: result: $ac_cv_lib_bsd_strlcat" >&5
3033 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3034 if test $ac_cv_lib_bsd_strlcat = yes; then
3035
3036 cf_add_libs="-lbsd"
3037 # Filter out duplicates - this happens with badly-designed ".pc" files...
3038 for cf_add_1lib in $LIBS
3039 do
3040         for cf_add_2lib in $cf_add_libs
3041         do
3042                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3043                 then
3044                         cf_add_1lib=
3045                         break
3046                 fi
3047         done
3048         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3049 done
3050 LIBS="$cf_add_libs"
3051
3052 for ac_header in bsd/string.h
3053 do
3054 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3055 echo "$as_me:3055: checking for $ac_header" >&5
3056 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3057 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3058   echo $ECHO_N "(cached) $ECHO_C" >&6
3059 else
3060   cat >conftest.$ac_ext <<_ACEOF
3061 #line 3061 "configure"
3062 #include "confdefs.h"
3063 #include <$ac_header>
3064 _ACEOF
3065 if { (eval echo "$as_me:3065: \"$ac_cpp conftest.$ac_ext\"") >&5
3066   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3067   ac_status=$?
3068   egrep -v '^ *\+' conftest.er1 >conftest.err
3069   rm -f conftest.er1
3070   cat conftest.err >&5
3071   echo "$as_me:3071: \$? = $ac_status" >&5
3072   (exit $ac_status); } >/dev/null; then
3073   if test -s conftest.err; then
3074     ac_cpp_err=$ac_c_preproc_warn_flag
3075   else
3076     ac_cpp_err=
3077   fi
3078 else
3079   ac_cpp_err=yes
3080 fi
3081 if test -z "$ac_cpp_err"; then
3082   eval "$as_ac_Header=yes"
3083 else
3084   echo "$as_me: failed program was:" >&5
3085   cat conftest.$ac_ext >&5
3086   eval "$as_ac_Header=no"
3087 fi
3088 rm -f conftest.err conftest.$ac_ext
3089 fi
3090 echo "$as_me:3090: result: `eval echo '${'$as_ac_Header'}'`" >&5
3091 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3092 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3093   cat >>confdefs.h <<EOF
3094 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3095 EOF
3096
3097 fi
3098 done
3099
3100 cat >>confdefs.h <<\EOF
3101 #define HAVE_STRLCAT 1
3102 EOF
3103
3104 fi
3105
3106 fi
3107
3108 for ac_func in strlcpy snprintf
3109 do
3110 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3111 echo "$as_me:3111: checking for $ac_func" >&5
3112 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3113 if eval "test \"\${$as_ac_var+set}\" = set"; then
3114   echo $ECHO_N "(cached) $ECHO_C" >&6
3115 else
3116   cat >conftest.$ac_ext <<_ACEOF
3117 #line 3117 "configure"
3118 #include "confdefs.h"
3119 /* System header to define __stub macros and hopefully few prototypes,
3120     which can conflict with char $ac_func (); below.  */
3121 #include <assert.h>
3122 /* Override any gcc2 internal prototype to avoid an error.  */
3123 #ifdef __cplusplus
3124 extern "C"
3125 #endif
3126 /* We use char because int might match the return type of a gcc2
3127    builtin and then its argument prototype would still apply.  */
3128 char $ac_func ();
3129 char (*f) ();
3130
3131 int
3132 main (void)
3133 {
3134 /* The GNU C library defines this for functions which it implements
3135     to always fail with ENOSYS.  Some functions are actually named
3136     something starting with __ and the normal name is an alias.  */
3137 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3138 choke me
3139 #else
3140 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3141 #endif
3142
3143   ;
3144   return 0;
3145 }
3146 _ACEOF
3147 rm -f conftest.$ac_objext conftest$ac_exeext
3148 if { (eval echo "$as_me:3148: \"$ac_link\"") >&5
3149   (eval $ac_link) 2>&5
3150   ac_status=$?
3151   echo "$as_me:3151: \$? = $ac_status" >&5
3152   (exit $ac_status); } &&
3153          { ac_try='test -s conftest$ac_exeext'
3154   { (eval echo "$as_me:3154: \"$ac_try\"") >&5
3155   (eval $ac_try) 2>&5
3156   ac_status=$?
3157   echo "$as_me:3157: \$? = $ac_status" >&5
3158   (exit $ac_status); }; }; then
3159   eval "$as_ac_var=yes"
3160 else
3161   echo "$as_me: failed program was:" >&5
3162 cat conftest.$ac_ext >&5
3163 eval "$as_ac_var=no"
3164 fi
3165 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3166 fi
3167 echo "$as_me:3167: result: `eval echo '${'$as_ac_var'}'`" >&5
3168 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3169 if test `eval echo '${'$as_ac_var'}'` = yes; then
3170   cat >>confdefs.h <<EOF
3171 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3172 EOF
3173
3174 fi
3175 done
3176
3177 fi
3178
3179 cf_XOPEN_SOURCE=500
3180 cf_POSIX_C_SOURCE=199506L
3181 cf_xopen_source=
3182
3183 case $host_os in
3184 (aix[4-7]*)
3185         cf_xopen_source="-D_ALL_SOURCE"
3186         ;;
3187 (msys)
3188         cf_XOPEN_SOURCE=600
3189         ;;
3190 (darwin[0-8].*)
3191         cf_xopen_source="-D_APPLE_C_SOURCE"
3192         ;;
3193 (darwin*)
3194         cf_xopen_source="-D_DARWIN_C_SOURCE"
3195         cf_XOPEN_SOURCE=
3196         ;;
3197 (freebsd*|dragonfly*)
3198         # 5.x headers associate
3199         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3200         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3201         cf_POSIX_C_SOURCE=200112L
3202         cf_XOPEN_SOURCE=600
3203         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3204         ;;
3205 (hpux11*)
3206         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3207         ;;
3208 (hpux*)
3209         cf_xopen_source="-D_HPUX_SOURCE"
3210         ;;
3211 (irix[56].*)
3212         cf_xopen_source="-D_SGI_SOURCE"
3213         cf_XOPEN_SOURCE=
3214         ;;
3215 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3216
3217 echo "$as_me:3217: checking if we must define _GNU_SOURCE" >&5
3218 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3219 if test "${cf_cv_gnu_source+set}" = set; then
3220   echo $ECHO_N "(cached) $ECHO_C" >&6
3221 else
3222
3223 cat >conftest.$ac_ext <<_ACEOF
3224 #line 3224 "configure"
3225 #include "confdefs.h"
3226 #include <sys/types.h>
3227 int
3228 main (void)
3229 {
3230
3231 #ifndef _XOPEN_SOURCE
3232 make an error
3233 #endif
3234   ;
3235   return 0;
3236 }
3237 _ACEOF
3238 rm -f conftest.$ac_objext
3239 if { (eval echo "$as_me:3239: \"$ac_compile\"") >&5
3240   (eval $ac_compile) 2>&5
3241   ac_status=$?
3242   echo "$as_me:3242: \$? = $ac_status" >&5
3243   (exit $ac_status); } &&
3244          { ac_try='test -s conftest.$ac_objext'
3245   { (eval echo "$as_me:3245: \"$ac_try\"") >&5
3246   (eval $ac_try) 2>&5
3247   ac_status=$?
3248   echo "$as_me:3248: \$? = $ac_status" >&5
3249   (exit $ac_status); }; }; then
3250   cf_cv_gnu_source=no
3251 else
3252   echo "$as_me: failed program was:" >&5
3253 cat conftest.$ac_ext >&5
3254 cf_save="$CPPFLAGS"
3255          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3256          cat >conftest.$ac_ext <<_ACEOF
3257 #line 3257 "configure"
3258 #include "confdefs.h"
3259 #include <sys/types.h>
3260 int
3261 main (void)
3262 {
3263
3264 #ifdef _XOPEN_SOURCE
3265 make an error
3266 #endif
3267   ;
3268   return 0;
3269 }
3270 _ACEOF
3271 rm -f conftest.$ac_objext
3272 if { (eval echo "$as_me:3272: \"$ac_compile\"") >&5
3273   (eval $ac_compile) 2>&5
3274   ac_status=$?
3275   echo "$as_me:3275: \$? = $ac_status" >&5
3276   (exit $ac_status); } &&
3277          { ac_try='test -s conftest.$ac_objext'
3278   { (eval echo "$as_me:3278: \"$ac_try\"") >&5
3279   (eval $ac_try) 2>&5
3280   ac_status=$?
3281   echo "$as_me:3281: \$? = $ac_status" >&5
3282   (exit $ac_status); }; }; then
3283   cf_cv_gnu_source=no
3284 else
3285   echo "$as_me: failed program was:" >&5
3286 cat conftest.$ac_ext >&5
3287 cf_cv_gnu_source=yes
3288 fi
3289 rm -f conftest.$ac_objext conftest.$ac_ext
3290         CPPFLAGS="$cf_save"
3291
3292 fi
3293 rm -f conftest.$ac_objext conftest.$ac_ext
3294
3295 fi
3296 echo "$as_me:3296: result: $cf_cv_gnu_source" >&5
3297 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3298
3299 if test "$cf_cv_gnu_source" = yes
3300 then
3301 echo "$as_me:3301: checking if we should also define _DEFAULT_SOURCE" >&5
3302 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3303 if test "${cf_cv_default_source+set}" = set; then
3304   echo $ECHO_N "(cached) $ECHO_C" >&6
3305 else
3306
3307 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3308         cat >conftest.$ac_ext <<_ACEOF
3309 #line 3309 "configure"
3310 #include "confdefs.h"
3311 #include <sys/types.h>
3312 int
3313 main (void)
3314 {
3315
3316 #ifdef _DEFAULT_SOURCE
3317 make an error
3318 #endif
3319   ;
3320   return 0;
3321 }
3322 _ACEOF
3323 rm -f conftest.$ac_objext
3324 if { (eval echo "$as_me:3324: \"$ac_compile\"") >&5
3325   (eval $ac_compile) 2>&5
3326   ac_status=$?
3327   echo "$as_me:3327: \$? = $ac_status" >&5
3328   (exit $ac_status); } &&
3329          { ac_try='test -s conftest.$ac_objext'
3330   { (eval echo "$as_me:3330: \"$ac_try\"") >&5
3331   (eval $ac_try) 2>&5
3332   ac_status=$?
3333   echo "$as_me:3333: \$? = $ac_status" >&5
3334   (exit $ac_status); }; }; then
3335   cf_cv_default_source=no
3336 else
3337   echo "$as_me: failed program was:" >&5
3338 cat conftest.$ac_ext >&5
3339 cf_cv_default_source=yes
3340 fi
3341 rm -f conftest.$ac_objext conftest.$ac_ext
3342
3343 fi
3344 echo "$as_me:3344: result: $cf_cv_default_source" >&5
3345 echo "${ECHO_T}$cf_cv_default_source" >&6
3346 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3347 fi
3348
3349         ;;
3350 (minix*)
3351         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3352         ;;
3353 (mirbsd*)
3354         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3355         cf_XOPEN_SOURCE=
3356
3357 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3358
3359 cf_save_CFLAGS="$CFLAGS"
3360 cf_save_CPPFLAGS="$CPPFLAGS"
3361
3362 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3363         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3364                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3365
3366 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3367         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3368                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3369
3370 echo "$as_me:3370: checking if we should define _POSIX_C_SOURCE" >&5
3371 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3372 if test "${cf_cv_posix_c_source+set}" = set; then
3373   echo $ECHO_N "(cached) $ECHO_C" >&6
3374 else
3375
3376 echo "${as_me:-configure}:3376: testing if the symbol is already defined go no further ..." 1>&5
3377
3378         cat >conftest.$ac_ext <<_ACEOF
3379 #line 3379 "configure"
3380 #include "confdefs.h"
3381 #include <sys/types.h>
3382 int
3383 main (void)
3384 {
3385
3386 #ifndef _POSIX_C_SOURCE
3387 make an error
3388 #endif
3389   ;
3390   return 0;
3391 }
3392 _ACEOF
3393 rm -f conftest.$ac_objext
3394 if { (eval echo "$as_me:3394: \"$ac_compile\"") >&5
3395   (eval $ac_compile) 2>&5
3396   ac_status=$?
3397   echo "$as_me:3397: \$? = $ac_status" >&5
3398   (exit $ac_status); } &&
3399          { ac_try='test -s conftest.$ac_objext'
3400   { (eval echo "$as_me:3400: \"$ac_try\"") >&5
3401   (eval $ac_try) 2>&5
3402   ac_status=$?
3403   echo "$as_me:3403: \$? = $ac_status" >&5
3404   (exit $ac_status); }; }; then
3405   cf_cv_posix_c_source=no
3406 else
3407   echo "$as_me: failed program was:" >&5
3408 cat conftest.$ac_ext >&5
3409 cf_want_posix_source=no
3410          case .$cf_POSIX_C_SOURCE in
3411          (.[12]??*)
3412                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3413                 ;;
3414          (.2)
3415                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3416                 cf_want_posix_source=yes
3417                 ;;
3418          (.*)
3419                 cf_want_posix_source=yes
3420                 ;;
3421          esac
3422          if test "$cf_want_posix_source" = yes ; then
3423                 cat >conftest.$ac_ext <<_ACEOF
3424 #line 3424 "configure"
3425 #include "confdefs.h"
3426 #include <sys/types.h>
3427 int
3428 main (void)
3429 {
3430
3431 #ifdef _POSIX_SOURCE
3432 make an error
3433 #endif
3434   ;
3435   return 0;
3436 }
3437 _ACEOF
3438 rm -f conftest.$ac_objext
3439 if { (eval echo "$as_me:3439: \"$ac_compile\"") >&5
3440   (eval $ac_compile) 2>&5
3441   ac_status=$?
3442   echo "$as_me:3442: \$? = $ac_status" >&5
3443   (exit $ac_status); } &&
3444          { ac_try='test -s conftest.$ac_objext'
3445   { (eval echo "$as_me:3445: \"$ac_try\"") >&5
3446   (eval $ac_try) 2>&5
3447   ac_status=$?
3448   echo "$as_me:3448: \$? = $ac_status" >&5
3449   (exit $ac_status); }; }; then
3450   :
3451 else
3452   echo "$as_me: failed program was:" >&5
3453 cat conftest.$ac_ext >&5
3454 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3455 fi
3456 rm -f conftest.$ac_objext conftest.$ac_ext
3457          fi
3458
3459 echo "${as_me:-configure}:3459: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3460
3461          CFLAGS="$cf_trim_CFLAGS"
3462          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3463
3464 echo "${as_me:-configure}:3464: testing if the second compile does not leave our definition intact error ..." 1>&5
3465
3466          cat >conftest.$ac_ext <<_ACEOF
3467 #line 3467 "configure"
3468 #include "confdefs.h"
3469 #include <sys/types.h>
3470 int
3471 main (void)
3472 {
3473
3474 #ifndef _POSIX_C_SOURCE
3475 make an error
3476 #endif
3477   ;
3478   return 0;
3479 }
3480 _ACEOF
3481 rm -f conftest.$ac_objext
3482 if { (eval echo "$as_me:3482: \"$ac_compile\"") >&5
3483   (eval $ac_compile) 2>&5
3484   ac_status=$?
3485   echo "$as_me:3485: \$? = $ac_status" >&5
3486   (exit $ac_status); } &&
3487          { ac_try='test -s conftest.$ac_objext'
3488   { (eval echo "$as_me:3488: \"$ac_try\"") >&5
3489   (eval $ac_try) 2>&5
3490   ac_status=$?
3491   echo "$as_me:3491: \$? = $ac_status" >&5
3492   (exit $ac_status); }; }; then
3493   :
3494 else
3495   echo "$as_me: failed program was:" >&5
3496 cat conftest.$ac_ext >&5
3497 cf_cv_posix_c_source=no
3498 fi
3499 rm -f conftest.$ac_objext conftest.$ac_ext
3500          CFLAGS="$cf_save_CFLAGS"
3501          CPPFLAGS="$cf_save_CPPFLAGS"
3502
3503 fi
3504 rm -f conftest.$ac_objext conftest.$ac_ext
3505
3506 fi
3507 echo "$as_me:3507: result: $cf_cv_posix_c_source" >&5
3508 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3509
3510 if test "$cf_cv_posix_c_source" != no ; then
3511         CFLAGS="$cf_trim_CFLAGS"
3512         CPPFLAGS="$cf_trim_CPPFLAGS"
3513
3514 cf_fix_cppflags=no
3515 cf_new_cflags=
3516 cf_new_cppflags=
3517 cf_new_extra_cppflags=
3518
3519 for cf_add_cflags in $cf_cv_posix_c_source
3520 do
3521 case $cf_fix_cppflags in
3522 (no)
3523         case $cf_add_cflags in
3524         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3525                 case $cf_add_cflags in
3526                 (-D*)
3527                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3528
3529                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3530                                 && test -z "${cf_tst_cflags}" \
3531                                 && cf_fix_cppflags=yes
3532
3533                         if test $cf_fix_cppflags = yes ; then
3534
3535         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3536         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3537
3538                                 continue
3539                         elif test "${cf_tst_cflags}" = "\"'" ; then
3540
3541         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3542         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3543
3544                                 continue
3545                         fi
3546                         ;;
3547                 esac
3548                 case "$CPPFLAGS" in
3549                 (*$cf_add_cflags)
3550                         ;;
3551                 (*)
3552                         case $cf_add_cflags in
3553                         (-D*)
3554                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3555
3556 CPPFLAGS=`echo "$CPPFLAGS" | \
3557         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3558                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3559
3560                                 ;;
3561                         esac
3562
3563         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3564         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3565
3566                         ;;
3567                 esac
3568                 ;;
3569         (*)
3570
3571         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3572         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3573
3574                 ;;
3575         esac
3576         ;;
3577 (yes)
3578
3579         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3580         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3581
3582         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3583
3584         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3585                 && test -z "${cf_tst_cflags}" \
3586                 && cf_fix_cppflags=no
3587         ;;
3588 esac
3589 done
3590
3591 if test -n "$cf_new_cflags" ; then
3592
3593         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3594         CFLAGS="${CFLAGS}$cf_new_cflags"
3595
3596 fi
3597
3598 if test -n "$cf_new_cppflags" ; then
3599
3600         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3601         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3602
3603 fi
3604
3605 if test -n "$cf_new_extra_cppflags" ; then
3606
3607         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3608         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3609
3610 fi
3611
3612 fi
3613
3614         ;;
3615 (netbsd*)
3616         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3617         ;;
3618 (openbsd[4-9]*)
3619         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3620         cf_xopen_source="-D_BSD_SOURCE"
3621         cf_XOPEN_SOURCE=600
3622         ;;
3623 (openbsd*)
3624         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3625         ;;
3626 (osf[45]*)
3627         cf_xopen_source="-D_OSF_SOURCE"
3628         ;;
3629 (nto-qnx*)
3630         cf_xopen_source="-D_QNX_SOURCE"
3631         ;;
3632 (sco*)
3633         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3634         ;;
3635 (solaris2.*)
3636         cf_xopen_source="-D__EXTENSIONS__"
3637         cf_cv_xopen_source=broken
3638         ;;
3639 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3640         cf_XOPEN_SOURCE=
3641         cf_POSIX_C_SOURCE=
3642         ;;
3643 (*)
3644
3645 echo "$as_me:3645: checking if we should define _XOPEN_SOURCE" >&5
3646 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3647 if test "${cf_cv_xopen_source+set}" = set; then
3648   echo $ECHO_N "(cached) $ECHO_C" >&6
3649 else
3650
3651         cat >conftest.$ac_ext <<_ACEOF
3652 #line 3652 "configure"
3653 #include "confdefs.h"
3654
3655 #include <stdlib.h>
3656 #include <string.h>
3657 #include <sys/types.h>
3658
3659 int
3660 main (void)
3661 {
3662
3663 #ifndef _XOPEN_SOURCE
3664 make an error
3665 #endif
3666   ;
3667   return 0;
3668 }
3669 _ACEOF
3670 rm -f conftest.$ac_objext
3671 if { (eval echo "$as_me:3671: \"$ac_compile\"") >&5
3672   (eval $ac_compile) 2>&5
3673   ac_status=$?
3674   echo "$as_me:3674: \$? = $ac_status" >&5
3675   (exit $ac_status); } &&
3676          { ac_try='test -s conftest.$ac_objext'
3677   { (eval echo "$as_me:3677: \"$ac_try\"") >&5
3678   (eval $ac_try) 2>&5
3679   ac_status=$?
3680   echo "$as_me:3680: \$? = $ac_status" >&5
3681   (exit $ac_status); }; }; then
3682   cf_cv_xopen_source=no
3683 else
3684   echo "$as_me: failed program was:" >&5
3685 cat conftest.$ac_ext >&5
3686 cf_save="$CPPFLAGS"
3687          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3688          cat >conftest.$ac_ext <<_ACEOF
3689 #line 3689 "configure"
3690 #include "confdefs.h"
3691
3692 #include <stdlib.h>
3693 #include <string.h>
3694 #include <sys/types.h>
3695
3696 int
3697 main (void)
3698 {
3699
3700 #ifdef _XOPEN_SOURCE
3701 make an error
3702 #endif
3703   ;
3704   return 0;
3705 }
3706 _ACEOF
3707 rm -f conftest.$ac_objext
3708 if { (eval echo "$as_me:3708: \"$ac_compile\"") >&5
3709   (eval $ac_compile) 2>&5
3710   ac_status=$?
3711   echo "$as_me:3711: \$? = $ac_status" >&5
3712   (exit $ac_status); } &&
3713          { ac_try='test -s conftest.$ac_objext'
3714   { (eval echo "$as_me:3714: \"$ac_try\"") >&5
3715   (eval $ac_try) 2>&5
3716   ac_status=$?
3717   echo "$as_me:3717: \$? = $ac_status" >&5
3718   (exit $ac_status); }; }; then
3719   cf_cv_xopen_source=no
3720 else
3721   echo "$as_me: failed program was:" >&5
3722 cat conftest.$ac_ext >&5
3723 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3724 fi
3725 rm -f conftest.$ac_objext conftest.$ac_ext
3726         CPPFLAGS="$cf_save"
3727
3728 fi
3729 rm -f conftest.$ac_objext conftest.$ac_ext
3730
3731 fi
3732 echo "$as_me:3732: result: $cf_cv_xopen_source" >&5
3733 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3734
3735 if test "$cf_cv_xopen_source" != no ; then
3736
3737 CFLAGS=`echo "$CFLAGS" | \
3738         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3739                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3740
3741 CPPFLAGS=`echo "$CPPFLAGS" | \
3742         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3743                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3744
3745         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3746
3747 cf_fix_cppflags=no
3748 cf_new_cflags=
3749 cf_new_cppflags=
3750 cf_new_extra_cppflags=
3751
3752 for cf_add_cflags in $cf_temp_xopen_source
3753 do
3754 case $cf_fix_cppflags in
3755 (no)
3756         case $cf_add_cflags in
3757         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3758                 case $cf_add_cflags in
3759                 (-D*)
3760                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3761
3762                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3763                                 && test -z "${cf_tst_cflags}" \
3764                                 && cf_fix_cppflags=yes
3765
3766                         if test $cf_fix_cppflags = yes ; then
3767
3768         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3769         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3770
3771                                 continue
3772                         elif test "${cf_tst_cflags}" = "\"'" ; then
3773
3774         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3775         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3776
3777                                 continue
3778                         fi
3779                         ;;
3780                 esac
3781                 case "$CPPFLAGS" in
3782                 (*$cf_add_cflags)
3783                         ;;
3784                 (*)
3785                         case $cf_add_cflags in
3786                         (-D*)
3787                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3788
3789 CPPFLAGS=`echo "$CPPFLAGS" | \
3790         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3791                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3792
3793                                 ;;
3794                         esac
3795
3796         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3797         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3798
3799                         ;;
3800                 esac
3801                 ;;
3802         (*)
3803
3804         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3805         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3806
3807                 ;;
3808         esac
3809         ;;
3810 (yes)
3811
3812         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3813         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3814
3815         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3816
3817         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3818                 && test -z "${cf_tst_cflags}" \
3819                 && cf_fix_cppflags=no
3820         ;;
3821 esac
3822 done
3823
3824 if test -n "$cf_new_cflags" ; then
3825
3826         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3827         CFLAGS="${CFLAGS}$cf_new_cflags"
3828
3829 fi
3830
3831 if test -n "$cf_new_cppflags" ; then
3832
3833         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3834         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3835
3836 fi
3837
3838 if test -n "$cf_new_extra_cppflags" ; then
3839
3840         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3841         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3842
3843 fi
3844
3845 fi
3846
3847 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3848
3849 cf_save_CFLAGS="$CFLAGS"
3850 cf_save_CPPFLAGS="$CPPFLAGS"
3851
3852 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3853         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3854                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3855
3856 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3857         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3858                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3859
3860 echo "$as_me:3860: checking if we should define _POSIX_C_SOURCE" >&5
3861 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3862 if test "${cf_cv_posix_c_source+set}" = set; then
3863   echo $ECHO_N "(cached) $ECHO_C" >&6
3864 else
3865
3866 echo "${as_me:-configure}:3866: testing if the symbol is already defined go no further ..." 1>&5
3867
3868         cat >conftest.$ac_ext <<_ACEOF
3869 #line 3869 "configure"
3870 #include "confdefs.h"
3871 #include <sys/types.h>
3872 int
3873 main (void)
3874 {
3875
3876 #ifndef _POSIX_C_SOURCE
3877 make an error
3878 #endif
3879   ;
3880   return 0;
3881 }
3882 _ACEOF
3883 rm -f conftest.$ac_objext
3884 if { (eval echo "$as_me:3884: \"$ac_compile\"") >&5
3885   (eval $ac_compile) 2>&5
3886   ac_status=$?
3887   echo "$as_me:3887: \$? = $ac_status" >&5
3888   (exit $ac_status); } &&
3889          { ac_try='test -s conftest.$ac_objext'
3890   { (eval echo "$as_me:3890: \"$ac_try\"") >&5
3891   (eval $ac_try) 2>&5
3892   ac_status=$?
3893   echo "$as_me:3893: \$? = $ac_status" >&5
3894   (exit $ac_status); }; }; then
3895   cf_cv_posix_c_source=no
3896 else
3897   echo "$as_me: failed program was:" >&5
3898 cat conftest.$ac_ext >&5
3899 cf_want_posix_source=no
3900          case .$cf_POSIX_C_SOURCE in
3901          (.[12]??*)
3902                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3903                 ;;
3904          (.2)
3905                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3906                 cf_want_posix_source=yes
3907                 ;;
3908          (.*)
3909                 cf_want_posix_source=yes
3910                 ;;
3911          esac
3912          if test "$cf_want_posix_source" = yes ; then
3913                 cat >conftest.$ac_ext <<_ACEOF
3914 #line 3914 "configure"
3915 #include "confdefs.h"
3916 #include <sys/types.h>
3917 int
3918 main (void)
3919 {
3920
3921 #ifdef _POSIX_SOURCE
3922 make an error
3923 #endif
3924   ;
3925   return 0;
3926 }
3927 _ACEOF
3928 rm -f conftest.$ac_objext
3929 if { (eval echo "$as_me:3929: \"$ac_compile\"") >&5
3930   (eval $ac_compile) 2>&5
3931   ac_status=$?
3932   echo "$as_me:3932: \$? = $ac_status" >&5
3933   (exit $ac_status); } &&
3934          { ac_try='test -s conftest.$ac_objext'
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   :
3941 else
3942   echo "$as_me: failed program was:" >&5
3943 cat conftest.$ac_ext >&5
3944 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3945 fi
3946 rm -f conftest.$ac_objext conftest.$ac_ext
3947          fi
3948
3949 echo "${as_me:-configure}:3949: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3950
3951          CFLAGS="$cf_trim_CFLAGS"
3952          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3953
3954 echo "${as_me:-configure}:3954: testing if the second compile does not leave our definition intact error ..." 1>&5
3955
3956          cat >conftest.$ac_ext <<_ACEOF
3957 #line 3957 "configure"
3958 #include "confdefs.h"
3959 #include <sys/types.h>
3960 int
3961 main (void)
3962 {
3963
3964 #ifndef _POSIX_C_SOURCE
3965 make an error
3966 #endif
3967   ;
3968   return 0;
3969 }
3970 _ACEOF
3971 rm -f conftest.$ac_objext
3972 if { (eval echo "$as_me:3972: \"$ac_compile\"") >&5
3973   (eval $ac_compile) 2>&5
3974   ac_status=$?
3975   echo "$as_me:3975: \$? = $ac_status" >&5
3976   (exit $ac_status); } &&
3977          { ac_try='test -s conftest.$ac_objext'
3978   { (eval echo "$as_me:3978: \"$ac_try\"") >&5
3979   (eval $ac_try) 2>&5
3980   ac_status=$?
3981   echo "$as_me:3981: \$? = $ac_status" >&5
3982   (exit $ac_status); }; }; then
3983   :
3984 else
3985   echo "$as_me: failed program was:" >&5
3986 cat conftest.$ac_ext >&5
3987 cf_cv_posix_c_source=no
3988 fi
3989 rm -f conftest.$ac_objext conftest.$ac_ext
3990          CFLAGS="$cf_save_CFLAGS"
3991          CPPFLAGS="$cf_save_CPPFLAGS"
3992
3993 fi
3994 rm -f conftest.$ac_objext conftest.$ac_ext
3995
3996 fi
3997 echo "$as_me:3997: result: $cf_cv_posix_c_source" >&5
3998 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3999
4000 if test "$cf_cv_posix_c_source" != no ; then
4001         CFLAGS="$cf_trim_CFLAGS"
4002         CPPFLAGS="$cf_trim_CPPFLAGS"
4003
4004 cf_fix_cppflags=no
4005 cf_new_cflags=
4006 cf_new_cppflags=
4007 cf_new_extra_cppflags=
4008
4009 for cf_add_cflags in $cf_cv_posix_c_source
4010 do
4011 case $cf_fix_cppflags in
4012 (no)
4013         case $cf_add_cflags in
4014         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4015                 case $cf_add_cflags in
4016                 (-D*)
4017                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4018
4019                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4020                                 && test -z "${cf_tst_cflags}" \
4021                                 && cf_fix_cppflags=yes
4022
4023                         if test $cf_fix_cppflags = yes ; then
4024
4025         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4026         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4027
4028                                 continue
4029                         elif test "${cf_tst_cflags}" = "\"'" ; then
4030
4031         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4032         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4033
4034                                 continue
4035                         fi
4036                         ;;
4037                 esac
4038                 case "$CPPFLAGS" in
4039                 (*$cf_add_cflags)
4040                         ;;
4041                 (*)
4042                         case $cf_add_cflags in
4043                         (-D*)
4044                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4045
4046 CPPFLAGS=`echo "$CPPFLAGS" | \
4047         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4048                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4049
4050                                 ;;
4051                         esac
4052
4053         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4054         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4055
4056                         ;;
4057                 esac
4058                 ;;
4059         (*)
4060
4061         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4062         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4063
4064                 ;;
4065         esac
4066         ;;
4067 (yes)
4068
4069         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4070         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4071
4072         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4073
4074         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4075                 && test -z "${cf_tst_cflags}" \
4076                 && cf_fix_cppflags=no
4077         ;;
4078 esac
4079 done
4080
4081 if test -n "$cf_new_cflags" ; then
4082
4083         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4084         CFLAGS="${CFLAGS}$cf_new_cflags"
4085
4086 fi
4087
4088 if test -n "$cf_new_cppflags" ; then
4089
4090         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4091         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4092
4093 fi
4094
4095 if test -n "$cf_new_extra_cppflags" ; then
4096
4097         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4098         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4099
4100 fi
4101
4102 fi
4103
4104         ;;
4105 esac
4106
4107 if test -n "$cf_xopen_source" ; then
4108
4109 cf_fix_cppflags=no
4110 cf_new_cflags=
4111 cf_new_cppflags=
4112 cf_new_extra_cppflags=
4113
4114 for cf_add_cflags in $cf_xopen_source
4115 do
4116 case $cf_fix_cppflags in
4117 (no)
4118         case $cf_add_cflags in
4119         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4120                 case $cf_add_cflags in
4121                 (-D*)
4122                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4123
4124                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4125                                 && test -z "${cf_tst_cflags}" \
4126                                 && cf_fix_cppflags=yes
4127
4128                         if test $cf_fix_cppflags = yes ; then
4129
4130         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4131         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4132
4133                                 continue
4134                         elif test "${cf_tst_cflags}" = "\"'" ; then
4135
4136         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4137         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4138
4139                                 continue
4140                         fi
4141                         ;;
4142                 esac
4143                 case "$CPPFLAGS" in
4144                 (*$cf_add_cflags)
4145                         ;;
4146                 (*)
4147                         case $cf_add_cflags in
4148                         (-D*)
4149                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4150
4151 CPPFLAGS=`echo "$CPPFLAGS" | \
4152         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4153                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4154
4155                                 ;;
4156                         esac
4157
4158         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4159         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4160
4161                         ;;
4162                 esac
4163                 ;;
4164         (*)
4165
4166         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4167         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4168
4169                 ;;
4170         esac
4171         ;;
4172 (yes)
4173
4174         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4175         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4176
4177         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4178
4179         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4180                 && test -z "${cf_tst_cflags}" \
4181                 && cf_fix_cppflags=no
4182         ;;
4183 esac
4184 done
4185
4186 if test -n "$cf_new_cflags" ; then
4187         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4188
4189 echo "${as_me:-configure}:4189: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4190
4191         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4192         CFLAGS="${CFLAGS}$cf_new_cflags"
4193
4194 fi
4195
4196 if test -n "$cf_new_cppflags" ; then
4197         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4198
4199 echo "${as_me:-configure}:4199: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4200
4201         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4202         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4203
4204 fi
4205
4206 if test -n "$cf_new_extra_cppflags" ; then
4207         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4208
4209 echo "${as_me:-configure}:4209: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4210
4211         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4212         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4213
4214 fi
4215
4216 fi
4217
4218 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4219         echo "$as_me:4219: checking if _XOPEN_SOURCE really is set" >&5
4220 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4221         cat >conftest.$ac_ext <<_ACEOF
4222 #line 4222 "configure"
4223 #include "confdefs.h"
4224 #include <stdlib.h>
4225 int
4226 main (void)
4227 {
4228
4229 #ifndef _XOPEN_SOURCE
4230 make an error
4231 #endif
4232   ;
4233   return 0;
4234 }
4235 _ACEOF
4236 rm -f conftest.$ac_objext
4237 if { (eval echo "$as_me:4237: \"$ac_compile\"") >&5
4238   (eval $ac_compile) 2>&5
4239   ac_status=$?
4240   echo "$as_me:4240: \$? = $ac_status" >&5
4241   (exit $ac_status); } &&
4242          { ac_try='test -s conftest.$ac_objext'
4243   { (eval echo "$as_me:4243: \"$ac_try\"") >&5
4244   (eval $ac_try) 2>&5
4245   ac_status=$?
4246   echo "$as_me:4246: \$? = $ac_status" >&5
4247   (exit $ac_status); }; }; then
4248   cf_XOPEN_SOURCE_set=yes
4249 else
4250   echo "$as_me: failed program was:" >&5
4251 cat conftest.$ac_ext >&5
4252 cf_XOPEN_SOURCE_set=no
4253 fi
4254 rm -f conftest.$ac_objext conftest.$ac_ext
4255         echo "$as_me:4255: result: $cf_XOPEN_SOURCE_set" >&5
4256 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4257         if test $cf_XOPEN_SOURCE_set = yes
4258         then
4259                 cat >conftest.$ac_ext <<_ACEOF
4260 #line 4260 "configure"
4261 #include "confdefs.h"
4262 #include <stdlib.h>
4263 int
4264 main (void)
4265 {
4266
4267 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4268 make an error
4269 #endif
4270   ;
4271   return 0;
4272 }
4273 _ACEOF
4274 rm -f conftest.$ac_objext
4275 if { (eval echo "$as_me:4275: \"$ac_compile\"") >&5
4276   (eval $ac_compile) 2>&5
4277   ac_status=$?
4278   echo "$as_me:4278: \$? = $ac_status" >&5
4279   (exit $ac_status); } &&
4280          { ac_try='test -s conftest.$ac_objext'
4281   { (eval echo "$as_me:4281: \"$ac_try\"") >&5
4282   (eval $ac_try) 2>&5
4283   ac_status=$?
4284   echo "$as_me:4284: \$? = $ac_status" >&5
4285   (exit $ac_status); }; }; then
4286   cf_XOPEN_SOURCE_set_ok=yes
4287 else
4288   echo "$as_me: failed program was:" >&5
4289 cat conftest.$ac_ext >&5
4290 cf_XOPEN_SOURCE_set_ok=no
4291 fi
4292 rm -f conftest.$ac_objext conftest.$ac_ext
4293                 if test $cf_XOPEN_SOURCE_set_ok = no
4294                 then
4295                         { echo "$as_me:4295: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4296 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4297                 fi
4298         else
4299
4300 echo "$as_me:4300: checking if we should define _XOPEN_SOURCE" >&5
4301 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4302 if test "${cf_cv_xopen_source+set}" = set; then
4303   echo $ECHO_N "(cached) $ECHO_C" >&6
4304 else
4305
4306         cat >conftest.$ac_ext <<_ACEOF
4307 #line 4307 "configure"
4308 #include "confdefs.h"
4309
4310 #include <stdlib.h>
4311 #include <string.h>
4312 #include <sys/types.h>
4313
4314 int
4315 main (void)
4316 {
4317
4318 #ifndef _XOPEN_SOURCE
4319 make an error
4320 #endif
4321   ;
4322   return 0;
4323 }
4324 _ACEOF
4325 rm -f conftest.$ac_objext
4326 if { (eval echo "$as_me:4326: \"$ac_compile\"") >&5
4327   (eval $ac_compile) 2>&5
4328   ac_status=$?
4329   echo "$as_me:4329: \$? = $ac_status" >&5
4330   (exit $ac_status); } &&
4331          { ac_try='test -s conftest.$ac_objext'
4332   { (eval echo "$as_me:4332: \"$ac_try\"") >&5
4333   (eval $ac_try) 2>&5
4334   ac_status=$?
4335   echo "$as_me:4335: \$? = $ac_status" >&5
4336   (exit $ac_status); }; }; then
4337   cf_cv_xopen_source=no
4338 else
4339   echo "$as_me: failed program was:" >&5
4340 cat conftest.$ac_ext >&5
4341 cf_save="$CPPFLAGS"
4342          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4343          cat >conftest.$ac_ext <<_ACEOF
4344 #line 4344 "configure"
4345 #include "confdefs.h"
4346
4347 #include <stdlib.h>
4348 #include <string.h>
4349 #include <sys/types.h>
4350
4351 int
4352 main (void)
4353 {
4354
4355 #ifdef _XOPEN_SOURCE
4356 make an error
4357 #endif
4358   ;
4359   return 0;
4360 }
4361 _ACEOF
4362 rm -f conftest.$ac_objext
4363 if { (eval echo "$as_me:4363: \"$ac_compile\"") >&5
4364   (eval $ac_compile) 2>&5
4365   ac_status=$?
4366   echo "$as_me:4366: \$? = $ac_status" >&5
4367   (exit $ac_status); } &&
4368          { ac_try='test -s conftest.$ac_objext'
4369   { (eval echo "$as_me:4369: \"$ac_try\"") >&5
4370   (eval $ac_try) 2>&5
4371   ac_status=$?
4372   echo "$as_me:4372: \$? = $ac_status" >&5
4373   (exit $ac_status); }; }; then
4374   cf_cv_xopen_source=no
4375 else
4376   echo "$as_me: failed program was:" >&5
4377 cat conftest.$ac_ext >&5
4378 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4379 fi
4380 rm -f conftest.$ac_objext conftest.$ac_ext
4381         CPPFLAGS="$cf_save"
4382
4383 fi
4384 rm -f conftest.$ac_objext conftest.$ac_ext
4385
4386 fi
4387 echo "$as_me:4387: result: $cf_cv_xopen_source" >&5
4388 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4389
4390 if test "$cf_cv_xopen_source" != no ; then
4391
4392 CFLAGS=`echo "$CFLAGS" | \
4393         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4394                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4395
4396 CPPFLAGS=`echo "$CPPFLAGS" | \
4397         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4398                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4399
4400         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4401
4402 cf_fix_cppflags=no
4403 cf_new_cflags=
4404 cf_new_cppflags=
4405 cf_new_extra_cppflags=
4406
4407 for cf_add_cflags in $cf_temp_xopen_source
4408 do
4409 case $cf_fix_cppflags in
4410 (no)
4411         case $cf_add_cflags in
4412         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4413                 case $cf_add_cflags in
4414                 (-D*)
4415                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4416
4417                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4418                                 && test -z "${cf_tst_cflags}" \
4419                                 && cf_fix_cppflags=yes
4420
4421                         if test $cf_fix_cppflags = yes ; then
4422
4423         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4424         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4425
4426                                 continue
4427                         elif test "${cf_tst_cflags}" = "\"'" ; then
4428
4429         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4430         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4431
4432                                 continue
4433                         fi
4434                         ;;
4435                 esac
4436                 case "$CPPFLAGS" in
4437                 (*$cf_add_cflags)
4438                         ;;
4439                 (*)
4440                         case $cf_add_cflags in
4441                         (-D*)
4442                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4443
4444 CPPFLAGS=`echo "$CPPFLAGS" | \
4445         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4446                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4447
4448                                 ;;
4449                         esac
4450
4451         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4452         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4453
4454                         ;;
4455                 esac
4456                 ;;
4457         (*)
4458
4459         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4460         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4461
4462                 ;;
4463         esac
4464         ;;
4465 (yes)
4466
4467         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4468         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4469
4470         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4471
4472         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4473                 && test -z "${cf_tst_cflags}" \
4474                 && cf_fix_cppflags=no
4475         ;;
4476 esac
4477 done
4478
4479 if test -n "$cf_new_cflags" ; then
4480
4481         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4482         CFLAGS="${CFLAGS}$cf_new_cflags"
4483
4484 fi
4485
4486 if test -n "$cf_new_cppflags" ; then
4487
4488         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4489         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4490
4491 fi
4492
4493 if test -n "$cf_new_extra_cppflags" ; then
4494
4495         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4496         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4497
4498 fi
4499
4500 fi
4501
4502         fi
4503 fi
4504
4505 echo "$as_me:4505: checking for signal global datatype" >&5
4506 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4507 if test "${cf_cv_sig_atomic_t+set}" = set; then
4508   echo $ECHO_N "(cached) $ECHO_C" >&6
4509 else
4510
4511         for cf_type in \
4512                 "volatile sig_atomic_t" \
4513                 "sig_atomic_t" \
4514                 "int"
4515         do
4516         cat >conftest.$ac_ext <<_ACEOF
4517 #line 4517 "configure"
4518 #include "confdefs.h"
4519
4520 #include <sys/types.h>
4521 #include <signal.h>
4522 #include <stdio.h>
4523
4524 extern $cf_type x;
4525 $cf_type x;
4526 static void handler(int sig)
4527 {
4528         x = 5;
4529 }
4530 int
4531 main (void)
4532 {
4533 signal(SIGINT, handler);
4534                  x = 1
4535   ;
4536   return 0;
4537 }
4538 _ACEOF
4539 rm -f conftest.$ac_objext
4540 if { (eval echo "$as_me:4540: \"$ac_compile\"") >&5
4541   (eval $ac_compile) 2>&5
4542   ac_status=$?
4543   echo "$as_me:4543: \$? = $ac_status" >&5
4544   (exit $ac_status); } &&
4545          { ac_try='test -s conftest.$ac_objext'
4546   { (eval echo "$as_me:4546: \"$ac_try\"") >&5
4547   (eval $ac_try) 2>&5
4548   ac_status=$?
4549   echo "$as_me:4549: \$? = $ac_status" >&5
4550   (exit $ac_status); }; }; then
4551   cf_cv_sig_atomic_t=$cf_type
4552 else
4553   echo "$as_me: failed program was:" >&5
4554 cat conftest.$ac_ext >&5
4555 cf_cv_sig_atomic_t=no
4556 fi
4557 rm -f conftest.$ac_objext conftest.$ac_ext
4558                 test "$cf_cv_sig_atomic_t" != no && break
4559         done
4560
4561 fi
4562
4563 echo "$as_me:4563: result: $cf_cv_sig_atomic_t" >&5
4564 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4565 test "$cf_cv_sig_atomic_t" != no &&
4566 cat >>confdefs.h <<EOF
4567 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4568 EOF
4569
4570 # Work around breakage on OS X
4571
4572 echo "$as_me:4572: checking if SIGWINCH is defined" >&5
4573 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4574 if test "${cf_cv_define_sigwinch+set}" = set; then
4575   echo $ECHO_N "(cached) $ECHO_C" >&6
4576 else
4577
4578         cat >conftest.$ac_ext <<_ACEOF
4579 #line 4579 "configure"
4580 #include "confdefs.h"
4581
4582 #include <sys/types.h>
4583 #include <sys/signal.h>
4584
4585 int
4586 main (void)
4587 {
4588 int x = SIGWINCH
4589   ;
4590   return 0;
4591 }
4592 _ACEOF
4593 rm -f conftest.$ac_objext
4594 if { (eval echo "$as_me:4594: \"$ac_compile\"") >&5
4595   (eval $ac_compile) 2>&5
4596   ac_status=$?
4597   echo "$as_me:4597: \$? = $ac_status" >&5
4598   (exit $ac_status); } &&
4599          { ac_try='test -s conftest.$ac_objext'
4600   { (eval echo "$as_me:4600: \"$ac_try\"") >&5
4601   (eval $ac_try) 2>&5
4602   ac_status=$?
4603   echo "$as_me:4603: \$? = $ac_status" >&5
4604   (exit $ac_status); }; }; then
4605   cf_cv_define_sigwinch=yes
4606 else
4607   echo "$as_me: failed program was:" >&5
4608 cat conftest.$ac_ext >&5
4609 cat >conftest.$ac_ext <<_ACEOF
4610 #line 4610 "configure"
4611 #include "confdefs.h"
4612
4613 #undef _XOPEN_SOURCE
4614 #undef _POSIX_SOURCE
4615 #undef _POSIX_C_SOURCE
4616 #include <sys/types.h>
4617 #include <sys/signal.h>
4618
4619 int
4620 main (void)
4621 {
4622 int x = SIGWINCH
4623   ;
4624   return 0;
4625 }
4626 _ACEOF
4627 rm -f conftest.$ac_objext
4628 if { (eval echo "$as_me:4628: \"$ac_compile\"") >&5
4629   (eval $ac_compile) 2>&5
4630   ac_status=$?
4631   echo "$as_me:4631: \$? = $ac_status" >&5
4632   (exit $ac_status); } &&
4633          { ac_try='test -s conftest.$ac_objext'
4634   { (eval echo "$as_me:4634: \"$ac_try\"") >&5
4635   (eval $ac_try) 2>&5
4636   ac_status=$?
4637   echo "$as_me:4637: \$? = $ac_status" >&5
4638   (exit $ac_status); }; }; then
4639   cf_cv_define_sigwinch=maybe
4640 else
4641   echo "$as_me: failed program was:" >&5
4642 cat conftest.$ac_ext >&5
4643 cf_cv_define_sigwinch=no
4644 fi
4645 rm -f conftest.$ac_objext conftest.$ac_ext
4646
4647 fi
4648 rm -f conftest.$ac_objext conftest.$ac_ext
4649
4650 fi
4651 echo "$as_me:4651: result: $cf_cv_define_sigwinch" >&5
4652 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4653
4654 if test "$cf_cv_define_sigwinch" = maybe ; then
4655 echo "$as_me:4655: checking for actual SIGWINCH definition" >&5
4656 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4657 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4658   echo $ECHO_N "(cached) $ECHO_C" >&6
4659 else
4660
4661 cf_cv_fixup_sigwinch=unknown
4662 cf_sigwinch=32
4663 while test $cf_sigwinch != 1
4664 do
4665         cat >conftest.$ac_ext <<_ACEOF
4666 #line 4666 "configure"
4667 #include "confdefs.h"
4668
4669 #undef _XOPEN_SOURCE
4670 #undef _POSIX_SOURCE
4671 #undef _POSIX_C_SOURCE
4672 #include <sys/types.h>
4673 #include <sys/signal.h>
4674
4675 int
4676 main (void)
4677 {
4678
4679 #if SIGWINCH != $cf_sigwinch
4680 make an error
4681 #endif
4682 int x = SIGWINCH
4683   ;
4684   return 0;
4685 }
4686 _ACEOF
4687 rm -f conftest.$ac_objext
4688 if { (eval echo "$as_me:4688: \"$ac_compile\"") >&5
4689   (eval $ac_compile) 2>&5
4690   ac_status=$?
4691   echo "$as_me:4691: \$? = $ac_status" >&5
4692   (exit $ac_status); } &&
4693          { ac_try='test -s conftest.$ac_objext'
4694   { (eval echo "$as_me:4694: \"$ac_try\"") >&5
4695   (eval $ac_try) 2>&5
4696   ac_status=$?
4697   echo "$as_me:4697: \$? = $ac_status" >&5
4698   (exit $ac_status); }; }; then
4699   cf_cv_fixup_sigwinch=$cf_sigwinch
4700          break
4701 else
4702   echo "$as_me: failed program was:" >&5
4703 cat conftest.$ac_ext >&5
4704 fi
4705 rm -f conftest.$ac_objext conftest.$ac_ext
4706
4707 cf_sigwinch=`expr $cf_sigwinch - 1`
4708 done
4709
4710 fi
4711 echo "$as_me:4711: result: $cf_cv_fixup_sigwinch" >&5
4712 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4713
4714         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4715                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4716         fi
4717 fi
4718
4719 # Checks for CODESET support.
4720
4721 echo "$as_me:4721: checking for nl_langinfo and CODESET" >&5
4722 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4723 if test "${am_cv_langinfo_codeset+set}" = set; then
4724   echo $ECHO_N "(cached) $ECHO_C" >&6
4725 else
4726   cat >conftest.$ac_ext <<_ACEOF
4727 #line 4727 "configure"
4728 #include "confdefs.h"
4729 #include <langinfo.h>
4730 int
4731 main (void)
4732 {
4733 char* cs = nl_langinfo(CODESET);
4734   ;
4735   return 0;
4736 }
4737 _ACEOF
4738 rm -f conftest.$ac_objext conftest$ac_exeext
4739 if { (eval echo "$as_me:4739: \"$ac_link\"") >&5
4740   (eval $ac_link) 2>&5
4741   ac_status=$?
4742   echo "$as_me:4742: \$? = $ac_status" >&5
4743   (exit $ac_status); } &&
4744          { ac_try='test -s conftest$ac_exeext'
4745   { (eval echo "$as_me:4745: \"$ac_try\"") >&5
4746   (eval $ac_try) 2>&5
4747   ac_status=$?
4748   echo "$as_me:4748: \$? = $ac_status" >&5
4749   (exit $ac_status); }; }; then
4750   am_cv_langinfo_codeset=yes
4751 else
4752   echo "$as_me: failed program was:" >&5
4753 cat conftest.$ac_ext >&5
4754 am_cv_langinfo_codeset=no
4755 fi
4756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4757
4758 fi
4759 echo "$as_me:4759: result: $am_cv_langinfo_codeset" >&5
4760 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4761         if test $am_cv_langinfo_codeset = yes; then
4762
4763 cat >>confdefs.h <<\EOF
4764 #define HAVE_LANGINFO_CODESET 1
4765 EOF
4766
4767         fi
4768
4769 echo "$as_me:4769: checking if you want to use pkg-config" >&5
4770 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4771
4772 # Check whether --with-pkg-config or --without-pkg-config was given.
4773 if test "${with_pkg_config+set}" = set; then
4774   withval="$with_pkg_config"
4775   cf_pkg_config=$withval
4776 else
4777   cf_pkg_config=yes
4778 fi;
4779 echo "$as_me:4779: result: $cf_pkg_config" >&5
4780 echo "${ECHO_T}$cf_pkg_config" >&6
4781
4782 case $cf_pkg_config in
4783 (no)
4784         PKG_CONFIG=none
4785         ;;
4786 (yes)
4787
4788 if test -n "$ac_tool_prefix"; then
4789   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4790 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4791 echo "$as_me:4791: checking for $ac_word" >&5
4792 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4793 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4794   echo $ECHO_N "(cached) $ECHO_C" >&6
4795 else
4796   case $PKG_CONFIG in
4797   [\\/]* | ?:[\\/]*)
4798   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4799   ;;
4800   *)
4801   ac_save_IFS=$IFS; IFS=$ac_path_separator
4802 ac_dummy="$PATH"
4803 for ac_dir in $ac_dummy; do
4804   IFS=$ac_save_IFS
4805   test -z "$ac_dir" && ac_dir=.
4806   if $as_executable_p "$ac_dir/$ac_word"; then
4807    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4808    echo "$as_me:4808: found $ac_dir/$ac_word" >&5
4809    break
4810 fi
4811 done
4812
4813   ;;
4814 esac
4815 fi
4816 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4817
4818 if test -n "$PKG_CONFIG"; then
4819   echo "$as_me:4819: result: $PKG_CONFIG" >&5
4820 echo "${ECHO_T}$PKG_CONFIG" >&6
4821 else
4822   echo "$as_me:4822: result: no" >&5
4823 echo "${ECHO_T}no" >&6
4824 fi
4825
4826 fi
4827 if test -z "$ac_cv_path_PKG_CONFIG"; then
4828   ac_pt_PKG_CONFIG=$PKG_CONFIG
4829   # Extract the first word of "pkg-config", so it can be a program name with args.
4830 set dummy pkg-config; ac_word=$2
4831 echo "$as_me:4831: checking for $ac_word" >&5
4832 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4833 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4834   echo $ECHO_N "(cached) $ECHO_C" >&6
4835 else
4836   case $ac_pt_PKG_CONFIG in
4837   [\\/]* | ?:[\\/]*)
4838   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4839   ;;
4840   *)
4841   ac_save_IFS=$IFS; IFS=$ac_path_separator
4842 ac_dummy="$PATH"
4843 for ac_dir in $ac_dummy; do
4844   IFS=$ac_save_IFS
4845   test -z "$ac_dir" && ac_dir=.
4846   if $as_executable_p "$ac_dir/$ac_word"; then
4847    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4848    echo "$as_me:4848: found $ac_dir/$ac_word" >&5
4849    break
4850 fi
4851 done
4852
4853   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4854   ;;
4855 esac
4856 fi
4857 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4858
4859 if test -n "$ac_pt_PKG_CONFIG"; then
4860   echo "$as_me:4860: result: $ac_pt_PKG_CONFIG" >&5
4861 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4862 else
4863   echo "$as_me:4863: result: no" >&5
4864 echo "${ECHO_T}no" >&6
4865 fi
4866
4867   PKG_CONFIG=$ac_pt_PKG_CONFIG
4868 else
4869   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4870 fi
4871
4872         ;;
4873 (*)
4874         PKG_CONFIG=$withval
4875         ;;
4876 esac
4877
4878 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4879 if test "$PKG_CONFIG" != none ; then
4880
4881 if test "x$prefix" != xNONE; then
4882         cf_path_syntax="$prefix"
4883 else
4884         cf_path_syntax="$ac_default_prefix"
4885 fi
4886
4887 case ".$PKG_CONFIG" in
4888 (.\$\(*\)*|.\'*\'*)
4889         ;;
4890 (..|./*|.\\*)
4891         ;;
4892 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4893         ;;
4894 (.\${*prefix}*|.\${*dir}*)
4895         eval PKG_CONFIG="$PKG_CONFIG"
4896         case ".$PKG_CONFIG" in
4897         (.NONE/*)
4898                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4899                 ;;
4900         esac
4901         ;;
4902 (.no|.NONE/*)
4903         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4904         ;;
4905 (*)
4906         { { echo "$as_me:4906: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4907 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4908    { (exit 1); exit 1; }; }
4909         ;;
4910 esac
4911
4912 elif test "x$cf_pkg_config" != xno ; then
4913         { echo "$as_me:4913: WARNING: pkg-config is not installed" >&5
4914 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4915 fi
4916
4917 echo "$as_me:4917: checking if you want to see long compiling messages" >&5
4918 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4919
4920 # Check whether --enable-echo or --disable-echo was given.
4921 if test "${enable_echo+set}" = set; then
4922   enableval="$enable_echo"
4923   test "$enableval" != no && enableval=yes
4924         if test "$enableval" != "yes" ; then
4925
4926         ECHO_LT='--silent'
4927         ECHO_LD='@echo linking $@;'
4928         RULE_CC='@echo compiling $<'
4929         SHOW_CC='@echo compiling $@'
4930         ECHO_CC='@'
4931
4932         else
4933
4934         ECHO_LT=''
4935         ECHO_LD=''
4936         RULE_CC=''
4937         SHOW_CC=''
4938         ECHO_CC=''
4939
4940         fi
4941 else
4942   enableval=yes
4943
4944         ECHO_LT=''
4945         ECHO_LD=''
4946         RULE_CC=''
4947         SHOW_CC=''
4948         ECHO_CC=''
4949
4950 fi;
4951 echo "$as_me:4951: result: $enableval" >&5
4952 echo "${ECHO_T}$enableval" >&6
4953
4954 echo "$as_me:4954: checking for ncurses wrap-prefix" >&5
4955 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4956
4957 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4958 if test "${with_ncurses_wrap_prefix+set}" = set; then
4959   withval="$with_ncurses_wrap_prefix"
4960   NCURSES_WRAP_PREFIX=$withval
4961 else
4962   NCURSES_WRAP_PREFIX=_nc_
4963 fi;
4964 echo "$as_me:4964: result: $NCURSES_WRAP_PREFIX" >&5
4965 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4966
4967 echo "$as_me:4967: checking if you want to check for wide-character functions" >&5
4968 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4969
4970 # Check whether --enable-widec or --disable-widec was given.
4971 if test "${enable_widec+set}" = set; then
4972   enableval="$enable_widec"
4973   test "$enableval" != no && enableval=yes
4974         if test "$enableval" != "yes" ; then
4975     cf_enable_widec=no
4976         else
4977                 cf_enable_widec=yes
4978         fi
4979 else
4980   enableval=yes
4981         cf_enable_widec=yes
4982
4983 fi;
4984 echo "$as_me:4984: result: $cf_enable_widec" >&5
4985 echo "${ECHO_T}$cf_enable_widec" >&6
4986
4987 echo "$as_me:4987: checking for specific curses-directory" >&5
4988 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4989
4990 # Check whether --with-curses-dir or --without-curses-dir was given.
4991 if test "${with_curses_dir+set}" = set; then
4992   withval="$with_curses_dir"
4993   cf_cv_curses_dir=$withval
4994 else
4995   cf_cv_curses_dir=no
4996 fi;
4997 echo "$as_me:4997: result: $cf_cv_curses_dir" >&5
4998 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4999
5000 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5001 then
5002
5003 if test "x$prefix" != xNONE; then
5004         cf_path_syntax="$prefix"
5005 else
5006         cf_path_syntax="$ac_default_prefix"
5007 fi
5008
5009 case ".$withval" in
5010 (.\$\(*\)*|.\'*\'*)
5011         ;;
5012 (..|./*|.\\*)
5013         ;;
5014 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5015         ;;
5016 (.\${*prefix}*|.\${*dir}*)
5017         eval withval="$withval"
5018         case ".$withval" in
5019         (.NONE/*)
5020                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5021                 ;;
5022         esac
5023         ;;
5024 (.no|.NONE/*)
5025         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5026         ;;
5027 (*)
5028         { { echo "$as_me:5028: error: expected a pathname, not \"$withval\"" >&5
5029 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5030    { (exit 1); exit 1; }; }
5031         ;;
5032 esac
5033
5034         if test -d "$cf_cv_curses_dir"
5035         then
5036
5037 if test -n "$cf_cv_curses_dir/include" ; then
5038   for cf_add_incdir in $cf_cv_curses_dir/include
5039   do
5040         while test $cf_add_incdir != /usr/include
5041         do
5042           if test -d $cf_add_incdir
5043           then
5044                 cf_have_incdir=no
5045                 if test -n "$CFLAGS$CPPFLAGS" ; then
5046                   # a loop is needed to ensure we can add subdirs of existing dirs
5047                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5048                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5049                           cf_have_incdir=yes; break
5050                         fi
5051                   done
5052                 fi
5053
5054                 if test "$cf_have_incdir" = no ; then
5055                   if test "$cf_add_incdir" = /usr/local/include ; then
5056                         if test "$GCC" = yes
5057                         then
5058                           cf_save_CPPFLAGS=$CPPFLAGS
5059                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5060                           cat >conftest.$ac_ext <<_ACEOF
5061 #line 5061 "configure"
5062 #include "confdefs.h"
5063 #include <stdio.h>
5064 int
5065 main (void)
5066 {
5067 printf("Hello")
5068   ;
5069   return 0;
5070 }
5071 _ACEOF
5072 rm -f conftest.$ac_objext
5073 if { (eval echo "$as_me:5073: \"$ac_compile\"") >&5
5074   (eval $ac_compile) 2>&5
5075   ac_status=$?
5076   echo "$as_me:5076: \$? = $ac_status" >&5
5077   (exit $ac_status); } &&
5078          { ac_try='test -s conftest.$ac_objext'
5079   { (eval echo "$as_me:5079: \"$ac_try\"") >&5
5080   (eval $ac_try) 2>&5
5081   ac_status=$?
5082   echo "$as_me:5082: \$? = $ac_status" >&5
5083   (exit $ac_status); }; }; then
5084   :
5085 else
5086   echo "$as_me: failed program was:" >&5
5087 cat conftest.$ac_ext >&5
5088 cf_have_incdir=yes
5089 fi
5090 rm -f conftest.$ac_objext conftest.$ac_ext
5091                           CPPFLAGS=$cf_save_CPPFLAGS
5092                         fi
5093                   fi
5094                 fi
5095
5096                 if test "$cf_have_incdir" = no ; then
5097                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5098
5099 echo "${as_me:-configure}:5099: testing adding $cf_add_incdir to include-path ..." 1>&5
5100
5101                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5102
5103                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5104                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5105                   cf_add_incdir="$cf_top_incdir"
5106                 else
5107                   break
5108                 fi
5109           else
5110                 break
5111           fi
5112         done
5113   done
5114 fi
5115
5116 if test -n "$cf_cv_curses_dir/lib" ; then
5117         for cf_add_libdir in $cf_cv_curses_dir/lib
5118         do
5119                 if test $cf_add_libdir = /usr/lib ; then
5120                         :
5121                 elif test -d $cf_add_libdir
5122                 then
5123                         cf_have_libdir=no
5124                         if test -n "$LDFLAGS$LIBS" ; then
5125                                 # a loop is needed to ensure we can add subdirs of existing dirs
5126                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5127                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5128                                                 cf_have_libdir=yes; break
5129                                         fi
5130                                 done
5131                         fi
5132                         if test "$cf_have_libdir" = no ; then
5133                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5134
5135 echo "${as_me:-configure}:5135: testing adding $cf_add_libdir to library-path ..." 1>&5
5136
5137                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5138                         fi
5139                 fi
5140         done
5141 fi
5142
5143         fi
5144 fi
5145
5146 cf_cv_screen=curses
5147
5148 echo "$as_me:5148: checking for specified curses library type" >&5
5149 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5150
5151 # Check whether --with-screen or --without-screen was given.
5152 if test "${with_screen+set}" = set; then
5153   withval="$with_screen"
5154   cf_cv_screen=$withval
5155 else
5156
5157 # Check whether --with-ncursesw or --without-ncursesw was given.
5158 if test "${with_ncursesw+set}" = set; then
5159   withval="$with_ncursesw"
5160   cf_cv_screen=ncursesw
5161 else
5162
5163 # Check whether --with-ncurses or --without-ncurses was given.
5164 if test "${with_ncurses+set}" = set; then
5165   withval="$with_ncurses"
5166   cf_cv_screen=ncurses
5167 else
5168
5169 # Check whether --with-pdcurses or --without-pdcurses was given.
5170 if test "${with_pdcurses+set}" = set; then
5171   withval="$with_pdcurses"
5172   cf_cv_screen=pdcurses
5173 else
5174
5175 # Check whether --with-curses-colr or --without-curses-colr was given.
5176 if test "${with_curses_colr+set}" = set; then
5177   withval="$with_curses_colr"
5178   cf_cv_screen=curses_colr
5179 else
5180
5181 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5182 if test "${with_curses_5lib+set}" = set; then
5183   withval="$with_curses_5lib"
5184   cf_cv_screen=curses_5lib
5185 fi;
5186 fi;
5187 fi;
5188 fi;
5189 fi;
5190 fi;
5191
5192 echo "$as_me:5192: result: $cf_cv_screen" >&5
5193 echo "${ECHO_T}$cf_cv_screen" >&6
5194
5195 case $cf_cv_screen in
5196 (curses|curses_*)
5197
5198 echo "$as_me:5198: checking for extra include directories" >&5
5199 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5200 if test "${cf_cv_curses_incdir+set}" = set; then
5201   echo $ECHO_N "(cached) $ECHO_C" >&6
5202 else
5203
5204 cf_cv_curses_incdir=no
5205 case $host_os in
5206 (hpux10.*)
5207         if test "x$cf_cv_screen" = "xcurses_colr"
5208         then
5209                 test -d /usr/include/curses_colr && \
5210                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5211         fi
5212         ;;
5213 (sunos3*|sunos4*)
5214         if test "x$cf_cv_screen" = "xcurses_5lib"
5215         then
5216                 test -d /usr/5lib && \
5217                 test -d /usr/5include && \
5218                 cf_cv_curses_incdir="-I/usr/5include"
5219         fi
5220         ;;
5221 esac
5222
5223 fi
5224 echo "$as_me:5224: result: $cf_cv_curses_incdir" >&5
5225 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5226 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5227
5228 echo "$as_me:5228: checking if we have identified curses headers" >&5
5229 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5230 if test "${cf_cv_ncurses_header+set}" = set; then
5231   echo $ECHO_N "(cached) $ECHO_C" >&6
5232 else
5233
5234 cf_cv_ncurses_header=none
5235 for cf_header in \
5236         ncurses.h  \
5237         curses.h  ncurses/ncurses.h ncurses/curses.h
5238 do
5239 cat >conftest.$ac_ext <<_ACEOF
5240 #line 5240 "configure"
5241 #include "confdefs.h"
5242 #include <${cf_header}>
5243 int
5244 main (void)
5245 {
5246 initscr(); tgoto("?", 0,0)
5247   ;
5248   return 0;
5249 }
5250 _ACEOF
5251 rm -f conftest.$ac_objext
5252 if { (eval echo "$as_me:5252: \"$ac_compile\"") >&5
5253   (eval $ac_compile) 2>&5
5254   ac_status=$?
5255   echo "$as_me:5255: \$? = $ac_status" >&5
5256   (exit $ac_status); } &&
5257          { ac_try='test -s conftest.$ac_objext'
5258   { (eval echo "$as_me:5258: \"$ac_try\"") >&5
5259   (eval $ac_try) 2>&5
5260   ac_status=$?
5261   echo "$as_me:5261: \$? = $ac_status" >&5
5262   (exit $ac_status); }; }; then
5263   cf_cv_ncurses_header=$cf_header; break
5264 else
5265   echo "$as_me: failed program was:" >&5
5266 cat conftest.$ac_ext >&5
5267 fi
5268 rm -f conftest.$ac_objext conftest.$ac_ext
5269 done
5270
5271 fi
5272 echo "$as_me:5272: result: $cf_cv_ncurses_header" >&5
5273 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5274
5275 if test "$cf_cv_ncurses_header" = none ; then
5276         { { echo "$as_me:5276: error: No curses header-files found" >&5
5277 echo "$as_me: error: No curses header-files found" >&2;}
5278    { (exit 1); exit 1; }; }
5279 fi
5280
5281 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5282
5283 for ac_header in $cf_cv_ncurses_header
5284 do
5285 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5286 echo "$as_me:5286: checking for $ac_header" >&5
5287 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5288 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5289   echo $ECHO_N "(cached) $ECHO_C" >&6
5290 else
5291   cat >conftest.$ac_ext <<_ACEOF
5292 #line 5292 "configure"
5293 #include "confdefs.h"
5294 #include <$ac_header>
5295 _ACEOF
5296 if { (eval echo "$as_me:5296: \"$ac_cpp conftest.$ac_ext\"") >&5
5297   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5298   ac_status=$?
5299   egrep -v '^ *\+' conftest.er1 >conftest.err
5300   rm -f conftest.er1
5301   cat conftest.err >&5
5302   echo "$as_me:5302: \$? = $ac_status" >&5
5303   (exit $ac_status); } >/dev/null; then
5304   if test -s conftest.err; then
5305     ac_cpp_err=$ac_c_preproc_warn_flag
5306   else
5307     ac_cpp_err=
5308   fi
5309 else
5310   ac_cpp_err=yes
5311 fi
5312 if test -z "$ac_cpp_err"; then
5313   eval "$as_ac_Header=yes"
5314 else
5315   echo "$as_me: failed program was:" >&5
5316   cat conftest.$ac_ext >&5
5317   eval "$as_ac_Header=no"
5318 fi
5319 rm -f conftest.err conftest.$ac_ext
5320 fi
5321 echo "$as_me:5321: result: `eval echo '${'$as_ac_Header'}'`" >&5
5322 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5323 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5324   cat >>confdefs.h <<EOF
5325 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5326 EOF
5327
5328 fi
5329 done
5330
5331 echo "$as_me:5331: checking for terminfo header" >&5
5332 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5333 if test "${cf_cv_term_header+set}" = set; then
5334   echo $ECHO_N "(cached) $ECHO_C" >&6
5335 else
5336
5337 case ${cf_cv_ncurses_header} in
5338 (*/ncurses.h|*/ncursesw.h)
5339         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5340         ;;
5341 (*)
5342         cf_term_header=term.h
5343         ;;
5344 esac
5345
5346 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5347 do
5348 cat >conftest.$ac_ext <<_ACEOF
5349 #line 5349 "configure"
5350 #include "confdefs.h"
5351 #include <stdio.h>
5352 #include <${cf_cv_ncurses_header:-curses.h}>
5353 #include <$cf_test>
5354
5355 int
5356 main (void)
5357 {
5358 int x = auto_left_margin
5359   ;
5360   return 0;
5361 }
5362 _ACEOF
5363 rm -f conftest.$ac_objext
5364 if { (eval echo "$as_me:5364: \"$ac_compile\"") >&5
5365   (eval $ac_compile) 2>&5
5366   ac_status=$?
5367   echo "$as_me:5367: \$? = $ac_status" >&5
5368   (exit $ac_status); } &&
5369          { ac_try='test -s conftest.$ac_objext'
5370   { (eval echo "$as_me:5370: \"$ac_try\"") >&5
5371   (eval $ac_try) 2>&5
5372   ac_status=$?
5373   echo "$as_me:5373: \$? = $ac_status" >&5
5374   (exit $ac_status); }; }; then
5375
5376         cf_cv_term_header="$cf_test"
5377 else
5378   echo "$as_me: failed program was:" >&5
5379 cat conftest.$ac_ext >&5
5380
5381         cf_cv_term_header=unknown
5382
5383 fi
5384 rm -f conftest.$ac_objext conftest.$ac_ext
5385         test "$cf_cv_term_header" != unknown && break
5386 done
5387
5388 fi
5389 echo "$as_me:5389: result: $cf_cv_term_header" >&5
5390 echo "${ECHO_T}$cf_cv_term_header" >&6
5391
5392 # Set definitions to allow ifdef'ing to accommodate subdirectories
5393
5394 case $cf_cv_term_header in
5395 (*term.h)
5396
5397 cat >>confdefs.h <<\EOF
5398 #define HAVE_TERM_H 1
5399 EOF
5400
5401         ;;
5402 esac
5403
5404 case $cf_cv_term_header in
5405 (ncurses/term.h)
5406
5407 cat >>confdefs.h <<\EOF
5408 #define HAVE_NCURSES_TERM_H 1
5409 EOF
5410
5411         ;;
5412 (ncursesw/term.h)
5413
5414 cat >>confdefs.h <<\EOF
5415 #define HAVE_NCURSESW_TERM_H 1
5416 EOF
5417
5418         ;;
5419 esac
5420
5421 echo "$as_me:5421: checking for ncurses version" >&5
5422 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5423 if test "${cf_cv_ncurses_version+set}" = set; then
5424   echo $ECHO_N "(cached) $ECHO_C" >&6
5425 else
5426
5427         cf_cv_ncurses_version=no
5428         cf_tempfile=out$$
5429         rm -f $cf_tempfile
5430         if test "$cross_compiling" = yes; then
5431
5432         # This will not work if the preprocessor splits the line after the
5433         # Autoconf token.  The 'unproto' program does that.
5434         cat > conftest.$ac_ext <<EOF
5435 #include <${cf_cv_ncurses_header:-curses.h}>
5436 #undef Autoconf
5437 #ifdef NCURSES_VERSION
5438 Autoconf NCURSES_VERSION
5439 #else
5440 #ifdef __NCURSES_H
5441 Autoconf "old"
5442 #endif
5443 ;
5444 #endif
5445 EOF
5446         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5447         { (eval echo "$as_me:5447: \"$cf_try\"") >&5
5448   (eval $cf_try) 2>&5
5449   ac_status=$?
5450   echo "$as_me:5450: \$? = $ac_status" >&5
5451   (exit $ac_status); }
5452         if test -f conftest.out ; then
5453                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5454                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5455                 rm -f conftest.out
5456         fi
5457
5458 else
5459   cat >conftest.$ac_ext <<_ACEOF
5460 #line 5460 "configure"
5461 #include "confdefs.h"
5462
5463 #include <${cf_cv_ncurses_header:-curses.h}>
5464 #include <stdio.h>
5465 int main(void)
5466 {
5467         FILE *fp = fopen("$cf_tempfile", "w");
5468 #ifdef NCURSES_VERSION
5469 # ifdef NCURSES_VERSION_PATCH
5470         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5471 # else
5472         fprintf(fp, "%s\n", NCURSES_VERSION);
5473 # endif
5474 #else
5475 # ifdef __NCURSES_H
5476         fprintf(fp, "old\n");
5477 # else
5478         make an error
5479 # endif
5480 #endif
5481         ${cf_cv_main_return:-return}(0);
5482 }
5483 _ACEOF
5484 rm -f conftest$ac_exeext
5485 if { (eval echo "$as_me:5485: \"$ac_link\"") >&5
5486   (eval $ac_link) 2>&5
5487   ac_status=$?
5488   echo "$as_me:5488: \$? = $ac_status" >&5
5489   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5490   { (eval echo "$as_me:5490: \"$ac_try\"") >&5
5491   (eval $ac_try) 2>&5
5492   ac_status=$?
5493   echo "$as_me:5493: \$? = $ac_status" >&5
5494   (exit $ac_status); }; }; then
5495
5496         cf_cv_ncurses_version=`cat $cf_tempfile`
5497 else
5498   echo "$as_me: program exited with status $ac_status" >&5
5499 echo "$as_me: failed program was:" >&5
5500 cat conftest.$ac_ext >&5
5501 fi
5502 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5503 fi
5504         rm -f $cf_tempfile
5505
5506 fi
5507 echo "$as_me:5507: result: $cf_cv_ncurses_version" >&5
5508 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5509 test "$cf_cv_ncurses_version" = no ||
5510 cat >>confdefs.h <<\EOF
5511 #define NCURSES 1
5512 EOF
5513
5514 echo "$as_me:5514: checking if we have identified curses libraries" >&5
5515 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5516 cat >conftest.$ac_ext <<_ACEOF
5517 #line 5517 "configure"
5518 #include "confdefs.h"
5519 #include <${cf_cv_ncurses_header:-curses.h}>
5520 int
5521 main (void)
5522 {
5523 initscr(); tgoto("?", 0,0)
5524   ;
5525   return 0;
5526 }
5527 _ACEOF
5528 rm -f conftest.$ac_objext conftest$ac_exeext
5529 if { (eval echo "$as_me:5529: \"$ac_link\"") >&5
5530   (eval $ac_link) 2>&5
5531   ac_status=$?
5532   echo "$as_me:5532: \$? = $ac_status" >&5
5533   (exit $ac_status); } &&
5534          { ac_try='test -s conftest$ac_exeext'
5535   { (eval echo "$as_me:5535: \"$ac_try\"") >&5
5536   (eval $ac_try) 2>&5
5537   ac_status=$?
5538   echo "$as_me:5538: \$? = $ac_status" >&5
5539   (exit $ac_status); }; }; then
5540   cf_result=yes
5541 else
5542   echo "$as_me: failed program was:" >&5
5543 cat conftest.$ac_ext >&5
5544 cf_result=no
5545 fi
5546 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5547 echo "$as_me:5547: result: $cf_result" >&5
5548 echo "${ECHO_T}$cf_result" >&6
5549
5550 if test "$cf_result" = no ; then
5551 case $host_os in
5552 (freebsd*)
5553         echo "$as_me:5553: checking for tgoto in -lmytinfo" >&5
5554 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5555 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5556   echo $ECHO_N "(cached) $ECHO_C" >&6
5557 else
5558   ac_check_lib_save_LIBS=$LIBS
5559 LIBS="-lmytinfo  $LIBS"
5560 cat >conftest.$ac_ext <<_ACEOF
5561 #line 5561 "configure"
5562 #include "confdefs.h"
5563
5564 /* Override any gcc2 internal prototype to avoid an error.  */
5565 #ifdef __cplusplus
5566 extern "C"
5567 #endif
5568 /* We use char because int might match the return type of a gcc2
5569    builtin and then its argument prototype would still apply.  */
5570 char tgoto ();
5571 int
5572 main (void)
5573 {
5574 tgoto ();
5575   ;
5576   return 0;
5577 }
5578 _ACEOF
5579 rm -f conftest.$ac_objext conftest$ac_exeext
5580 if { (eval echo "$as_me:5580: \"$ac_link\"") >&5
5581   (eval $ac_link) 2>&5
5582   ac_status=$?
5583   echo "$as_me:5583: \$? = $ac_status" >&5
5584   (exit $ac_status); } &&
5585          { ac_try='test -s conftest$ac_exeext'
5586   { (eval echo "$as_me:5586: \"$ac_try\"") >&5
5587   (eval $ac_try) 2>&5
5588   ac_status=$?
5589   echo "$as_me:5589: \$? = $ac_status" >&5
5590   (exit $ac_status); }; }; then
5591   ac_cv_lib_mytinfo_tgoto=yes
5592 else
5593   echo "$as_me: failed program was:" >&5
5594 cat conftest.$ac_ext >&5
5595 ac_cv_lib_mytinfo_tgoto=no
5596 fi
5597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5598 LIBS=$ac_check_lib_save_LIBS
5599 fi
5600 echo "$as_me:5600: result: $ac_cv_lib_mytinfo_tgoto" >&5
5601 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5602 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5603
5604 cf_add_libs="-lmytinfo"
5605 # Filter out duplicates - this happens with badly-designed ".pc" files...
5606 for cf_add_1lib in $LIBS
5607 do
5608         for cf_add_2lib in $cf_add_libs
5609         do
5610                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5611                 then
5612                         cf_add_1lib=
5613                         break
5614                 fi
5615         done
5616         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5617 done
5618 LIBS="$cf_add_libs"
5619
5620 fi
5621
5622         ;;
5623 (hpux10.*)
5624         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5625         # next (1998), and xcurses "newer" (2000).  There is no header file for
5626         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5627         # term.h) for cur_colr
5628         if test "x$cf_cv_screen" = "xcurses_colr"
5629         then
5630                 echo "$as_me:5630: checking for initscr in -lcur_colr" >&5
5631 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5632 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5633   echo $ECHO_N "(cached) $ECHO_C" >&6
5634 else
5635   ac_check_lib_save_LIBS=$LIBS
5636 LIBS="-lcur_colr  $LIBS"
5637 cat >conftest.$ac_ext <<_ACEOF
5638 #line 5638 "configure"
5639 #include "confdefs.h"
5640
5641 /* Override any gcc2 internal prototype to avoid an error.  */
5642 #ifdef __cplusplus
5643 extern "C"
5644 #endif
5645 /* We use char because int might match the return type of a gcc2
5646    builtin and then its argument prototype would still apply.  */
5647 char initscr ();
5648 int
5649 main (void)
5650 {
5651 initscr ();
5652   ;
5653   return 0;
5654 }
5655 _ACEOF
5656 rm -f conftest.$ac_objext conftest$ac_exeext
5657 if { (eval echo "$as_me:5657: \"$ac_link\"") >&5
5658   (eval $ac_link) 2>&5
5659   ac_status=$?
5660   echo "$as_me:5660: \$? = $ac_status" >&5
5661   (exit $ac_status); } &&
5662          { ac_try='test -s conftest$ac_exeext'
5663   { (eval echo "$as_me:5663: \"$ac_try\"") >&5
5664   (eval $ac_try) 2>&5
5665   ac_status=$?
5666   echo "$as_me:5666: \$? = $ac_status" >&5
5667   (exit $ac_status); }; }; then
5668   ac_cv_lib_cur_colr_initscr=yes
5669 else
5670   echo "$as_me: failed program was:" >&5
5671 cat conftest.$ac_ext >&5
5672 ac_cv_lib_cur_colr_initscr=no
5673 fi
5674 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5675 LIBS=$ac_check_lib_save_LIBS
5676 fi
5677 echo "$as_me:5677: result: $ac_cv_lib_cur_colr_initscr" >&5
5678 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5679 if test $ac_cv_lib_cur_colr_initscr = yes; then
5680
5681 cf_add_libs="-lcur_colr"
5682 # Filter out duplicates - this happens with badly-designed ".pc" files...
5683 for cf_add_1lib in $LIBS
5684 do
5685         for cf_add_2lib in $cf_add_libs
5686         do
5687                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5688                 then
5689                         cf_add_1lib=
5690                         break
5691                 fi
5692         done
5693         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5694 done
5695 LIBS="$cf_add_libs"
5696
5697                         ac_cv_func_initscr=yes
5698
5699 else
5700
5701                 echo "$as_me:5701: checking for initscr in -lHcurses" >&5
5702 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5703 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5704   echo $ECHO_N "(cached) $ECHO_C" >&6
5705 else
5706   ac_check_lib_save_LIBS=$LIBS
5707 LIBS="-lHcurses  $LIBS"
5708 cat >conftest.$ac_ext <<_ACEOF
5709 #line 5709 "configure"
5710 #include "confdefs.h"
5711
5712 /* Override any gcc2 internal prototype to avoid an error.  */
5713 #ifdef __cplusplus
5714 extern "C"
5715 #endif
5716 /* We use char because int might match the return type of a gcc2
5717    builtin and then its argument prototype would still apply.  */
5718 char initscr ();
5719 int
5720 main (void)
5721 {
5722 initscr ();
5723   ;
5724   return 0;
5725 }
5726 _ACEOF
5727 rm -f conftest.$ac_objext conftest$ac_exeext
5728 if { (eval echo "$as_me:5728: \"$ac_link\"") >&5
5729   (eval $ac_link) 2>&5
5730   ac_status=$?
5731   echo "$as_me:5731: \$? = $ac_status" >&5
5732   (exit $ac_status); } &&
5733          { ac_try='test -s conftest$ac_exeext'
5734   { (eval echo "$as_me:5734: \"$ac_try\"") >&5
5735   (eval $ac_try) 2>&5
5736   ac_status=$?
5737   echo "$as_me:5737: \$? = $ac_status" >&5
5738   (exit $ac_status); }; }; then
5739   ac_cv_lib_Hcurses_initscr=yes
5740 else
5741   echo "$as_me: failed program was:" >&5
5742 cat conftest.$ac_ext >&5
5743 ac_cv_lib_Hcurses_initscr=no
5744 fi
5745 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5746 LIBS=$ac_check_lib_save_LIBS
5747 fi
5748 echo "$as_me:5748: result: $ac_cv_lib_Hcurses_initscr" >&5
5749 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5750 if test $ac_cv_lib_Hcurses_initscr = yes; then
5751
5752                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5753
5754 cf_add_libs="-lHcurses"
5755 # Filter out duplicates - this happens with badly-designed ".pc" files...
5756 for cf_add_1lib in $LIBS
5757 do
5758         for cf_add_2lib in $cf_add_libs
5759         do
5760                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5761                 then
5762                         cf_add_1lib=
5763                         break
5764                 fi
5765         done
5766         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5767 done
5768 LIBS="$cf_add_libs"
5769
5770                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5771                         ac_cv_func_initscr=yes
5772
5773 fi
5774
5775 fi
5776
5777         fi
5778         ;;
5779 (linux*)
5780         case `arch 2>/dev/null` in
5781         (x86_64)
5782                 if test -d /lib64
5783                 then
5784
5785 if test -n "/lib64" ; then
5786         for cf_add_libdir in /lib64
5787         do
5788                 if test $cf_add_libdir = /usr/lib ; then
5789                         :
5790                 elif test -d $cf_add_libdir
5791                 then
5792                         cf_have_libdir=no
5793                         if test -n "$LDFLAGS$LIBS" ; then
5794                                 # a loop is needed to ensure we can add subdirs of existing dirs
5795                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5796                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5797                                                 cf_have_libdir=yes; break
5798                                         fi
5799                                 done
5800                         fi
5801                         if test "$cf_have_libdir" = no ; then
5802                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5803
5804 echo "${as_me:-configure}:5804: testing adding $cf_add_libdir to library-path ..." 1>&5
5805
5806                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5807                         fi
5808                 fi
5809         done
5810 fi
5811
5812                 else
5813
5814 if test -n "/lib" ; then
5815         for cf_add_libdir in /lib
5816         do
5817                 if test $cf_add_libdir = /usr/lib ; then
5818                         :
5819                 elif test -d $cf_add_libdir
5820                 then
5821                         cf_have_libdir=no
5822                         if test -n "$LDFLAGS$LIBS" ; then
5823                                 # a loop is needed to ensure we can add subdirs of existing dirs
5824                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5825                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5826                                                 cf_have_libdir=yes; break
5827                                         fi
5828                                 done
5829                         fi
5830                         if test "$cf_have_libdir" = no ; then
5831                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5832
5833 echo "${as_me:-configure}:5833: testing adding $cf_add_libdir to library-path ..." 1>&5
5834
5835                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5836                         fi
5837                 fi
5838         done
5839 fi
5840
5841                 fi
5842                 ;;
5843         (*)
5844
5845 if test -n "/lib" ; then
5846         for cf_add_libdir in /lib
5847         do
5848                 if test $cf_add_libdir = /usr/lib ; then
5849                         :
5850                 elif test -d $cf_add_libdir
5851                 then
5852                         cf_have_libdir=no
5853                         if test -n "$LDFLAGS$LIBS" ; then
5854                                 # a loop is needed to ensure we can add subdirs of existing dirs
5855                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5856                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5857                                                 cf_have_libdir=yes; break
5858                                         fi
5859                                 done
5860                         fi
5861                         if test "$cf_have_libdir" = no ; then
5862                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5863
5864 echo "${as_me:-configure}:5864: testing adding $cf_add_libdir to library-path ..." 1>&5
5865
5866                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5867                         fi
5868                 fi
5869         done
5870 fi
5871
5872                 ;;
5873         esac
5874         ;;
5875 (sunos3*|sunos4*)
5876         if test "x$cf_cv_screen" = "xcurses_5lib"
5877         then
5878                 if test -d /usr/5lib ; then
5879
5880 if test -n "/usr/5lib" ; then
5881         for cf_add_libdir in /usr/5lib
5882         do
5883                 if test $cf_add_libdir = /usr/lib ; then
5884                         :
5885                 elif test -d $cf_add_libdir
5886                 then
5887                         cf_have_libdir=no
5888                         if test -n "$LDFLAGS$LIBS" ; then
5889                                 # a loop is needed to ensure we can add subdirs of existing dirs
5890                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5891                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5892                                                 cf_have_libdir=yes; break
5893                                         fi
5894                                 done
5895                         fi
5896                         if test "$cf_have_libdir" = no ; then
5897                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5898
5899 echo "${as_me:-configure}:5899: testing adding $cf_add_libdir to library-path ..." 1>&5
5900
5901                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5902                         fi
5903                 fi
5904         done
5905 fi
5906
5907 cf_add_libs="-lcurses -ltermcap"
5908 # Filter out duplicates - this happens with badly-designed ".pc" files...
5909 for cf_add_1lib in $LIBS
5910 do
5911         for cf_add_2lib in $cf_add_libs
5912         do
5913                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5914                 then
5915                         cf_add_1lib=
5916                         break
5917                 fi
5918         done
5919         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5920 done
5921 LIBS="$cf_add_libs"
5922
5923                 fi
5924         fi
5925         ac_cv_func_initscr=yes
5926         ;;
5927 esac
5928
5929 if test ".$ac_cv_func_initscr" != .yes ; then
5930         cf_save_LIBS="$LIBS"
5931
5932         if test ".${cf_cv_ncurses_version:-no}" != .no
5933         then
5934                 cf_check_list="ncurses curses cursesX"
5935         else
5936                 cf_check_list="cursesX curses ncurses"
5937         fi
5938
5939         # Check for library containing tgoto.  Do this before curses library
5940         # because it may be needed to link the test-case for initscr.
5941         if test "x$cf_term_lib" = x
5942         then
5943                 echo "$as_me:5943: checking for tgoto" >&5
5944 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5945 if test "${ac_cv_func_tgoto+set}" = set; then
5946   echo $ECHO_N "(cached) $ECHO_C" >&6
5947 else
5948   cat >conftest.$ac_ext <<_ACEOF
5949 #line 5949 "configure"
5950 #include "confdefs.h"
5951 /* System header to define __stub macros and hopefully few prototypes,
5952     which can conflict with char tgoto (); below.  */
5953 #include <assert.h>
5954 /* Override any gcc2 internal prototype to avoid an error.  */
5955 #ifdef __cplusplus
5956 extern "C"
5957 #endif
5958 /* We use char because int might match the return type of a gcc2
5959    builtin and then its argument prototype would still apply.  */
5960 char tgoto ();
5961 char (*f) ();
5962
5963 int
5964 main (void)
5965 {
5966 /* The GNU C library defines this for functions which it implements
5967     to always fail with ENOSYS.  Some functions are actually named
5968     something starting with __ and the normal name is an alias.  */
5969 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5970 choke me
5971 #else
5972 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5973 #endif
5974
5975   ;
5976   return 0;
5977 }
5978 _ACEOF
5979 rm -f conftest.$ac_objext conftest$ac_exeext
5980 if { (eval echo "$as_me:5980: \"$ac_link\"") >&5
5981   (eval $ac_link) 2>&5
5982   ac_status=$?
5983   echo "$as_me:5983: \$? = $ac_status" >&5
5984   (exit $ac_status); } &&
5985          { ac_try='test -s conftest$ac_exeext'
5986   { (eval echo "$as_me:5986: \"$ac_try\"") >&5
5987   (eval $ac_try) 2>&5
5988   ac_status=$?
5989   echo "$as_me:5989: \$? = $ac_status" >&5
5990   (exit $ac_status); }; }; then
5991   ac_cv_func_tgoto=yes
5992 else
5993   echo "$as_me: failed program was:" >&5
5994 cat conftest.$ac_ext >&5
5995 ac_cv_func_tgoto=no
5996 fi
5997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5998 fi
5999 echo "$as_me:5999: result: $ac_cv_func_tgoto" >&5
6000 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6001 if test $ac_cv_func_tgoto = yes; then
6002   cf_term_lib=predefined
6003 else
6004
6005                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6006                         do
6007                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6008 echo "$as_me:6008: checking for tgoto in -l$cf_term_lib" >&5
6009 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6010 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6011   echo $ECHO_N "(cached) $ECHO_C" >&6
6012 else
6013   ac_check_lib_save_LIBS=$LIBS
6014 LIBS="-l$cf_term_lib  $LIBS"
6015 cat >conftest.$ac_ext <<_ACEOF
6016 #line 6016 "configure"
6017 #include "confdefs.h"
6018
6019 /* Override any gcc2 internal prototype to avoid an error.  */
6020 #ifdef __cplusplus
6021 extern "C"
6022 #endif
6023 /* We use char because int might match the return type of a gcc2
6024    builtin and then its argument prototype would still apply.  */
6025 char tgoto ();
6026 int
6027 main (void)
6028 {
6029 tgoto ();
6030   ;
6031   return 0;
6032 }
6033 _ACEOF
6034 rm -f conftest.$ac_objext conftest$ac_exeext
6035 if { (eval echo "$as_me:6035: \"$ac_link\"") >&5
6036   (eval $ac_link) 2>&5
6037   ac_status=$?
6038   echo "$as_me:6038: \$? = $ac_status" >&5
6039   (exit $ac_status); } &&
6040          { ac_try='test -s conftest$ac_exeext'
6041   { (eval echo "$as_me:6041: \"$ac_try\"") >&5
6042   (eval $ac_try) 2>&5
6043   ac_status=$?
6044   echo "$as_me:6044: \$? = $ac_status" >&5
6045   (exit $ac_status); }; }; then
6046   eval "$as_ac_Lib=yes"
6047 else
6048   echo "$as_me: failed program was:" >&5
6049 cat conftest.$ac_ext >&5
6050 eval "$as_ac_Lib=no"
6051 fi
6052 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6053 LIBS=$ac_check_lib_save_LIBS
6054 fi
6055 echo "$as_me:6055: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6056 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6057 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6058   break
6059 fi
6060
6061                         done
6062
6063 fi
6064
6065         fi
6066
6067         # Check for library containing initscr
6068         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6069         if test "x$cf_curs_lib" = x
6070         then
6071                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6072                 do
6073                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6074                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6075                                 echo "$as_me:6075: checking if we can link with $cf_curs_lib library" >&5
6076 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6077                                 cat >conftest.$ac_ext <<_ACEOF
6078 #line 6078 "configure"
6079 #include "confdefs.h"
6080 #include <${cf_cv_ncurses_header:-curses.h}>
6081 int
6082 main (void)
6083 {
6084 initscr()
6085   ;
6086   return 0;
6087 }
6088 _ACEOF
6089 rm -f conftest.$ac_objext conftest$ac_exeext
6090 if { (eval echo "$as_me:6090: \"$ac_link\"") >&5
6091   (eval $ac_link) 2>&5
6092   ac_status=$?
6093   echo "$as_me:6093: \$? = $ac_status" >&5
6094   (exit $ac_status); } &&
6095          { ac_try='test -s conftest$ac_exeext'
6096   { (eval echo "$as_me:6096: \"$ac_try\"") >&5
6097   (eval $ac_try) 2>&5
6098   ac_status=$?
6099   echo "$as_me:6099: \$? = $ac_status" >&5
6100   (exit $ac_status); }; }; then
6101   cf_result=yes
6102 else
6103   echo "$as_me: failed program was:" >&5
6104 cat conftest.$ac_ext >&5
6105 cf_result=no
6106 fi
6107 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6108                                 echo "$as_me:6108: result: $cf_result" >&5
6109 echo "${ECHO_T}$cf_result" >&6
6110                                 test $cf_result = yes && break
6111                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6112                                 cf_result=no
6113                         elif test "$cf_term_lib" != predefined ; then
6114                                 echo "$as_me:6114: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6115 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6116                                 cat >conftest.$ac_ext <<_ACEOF
6117 #line 6117 "configure"
6118 #include "confdefs.h"
6119 #include <${cf_cv_ncurses_header:-curses.h}>
6120 int
6121 main (void)
6122 {
6123 initscr(); tgoto((char *)0, 0, 0);
6124   ;
6125   return 0;
6126 }
6127 _ACEOF
6128 rm -f conftest.$ac_objext conftest$ac_exeext
6129 if { (eval echo "$as_me:6129: \"$ac_link\"") >&5
6130   (eval $ac_link) 2>&5
6131   ac_status=$?
6132   echo "$as_me:6132: \$? = $ac_status" >&5
6133   (exit $ac_status); } &&
6134          { ac_try='test -s conftest$ac_exeext'
6135   { (eval echo "$as_me:6135: \"$ac_try\"") >&5
6136   (eval $ac_try) 2>&5
6137   ac_status=$?
6138   echo "$as_me:6138: \$? = $ac_status" >&5
6139   (exit $ac_status); }; }; then
6140   cf_result=no
6141 else
6142   echo "$as_me: failed program was:" >&5
6143 cat conftest.$ac_ext >&5
6144
6145                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6146                                         cat >conftest.$ac_ext <<_ACEOF
6147 #line 6147 "configure"
6148 #include "confdefs.h"
6149 #include <${cf_cv_ncurses_header:-curses.h}>
6150 int
6151 main (void)
6152 {
6153 initscr()
6154   ;
6155   return 0;
6156 }
6157 _ACEOF
6158 rm -f conftest.$ac_objext conftest$ac_exeext
6159 if { (eval echo "$as_me:6159: \"$ac_link\"") >&5
6160   (eval $ac_link) 2>&5
6161   ac_status=$?
6162   echo "$as_me:6162: \$? = $ac_status" >&5
6163   (exit $ac_status); } &&
6164          { ac_try='test -s conftest$ac_exeext'
6165   { (eval echo "$as_me:6165: \"$ac_try\"") >&5
6166   (eval $ac_try) 2>&5
6167   ac_status=$?
6168   echo "$as_me:6168: \$? = $ac_status" >&5
6169   (exit $ac_status); }; }; then
6170   cf_result=yes
6171 else
6172   echo "$as_me: failed program was:" >&5
6173 cat conftest.$ac_ext >&5
6174 cf_result=error
6175 fi
6176 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6177
6178 fi
6179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6180                                 echo "$as_me:6180: result: $cf_result" >&5
6181 echo "${ECHO_T}$cf_result" >&6
6182                                 test $cf_result != error && break
6183                         fi
6184                 done
6185         fi
6186         test $cf_curs_lib = unknown && { { echo "$as_me:6186: error: no curses library found" >&5
6187 echo "$as_me: error: no curses library found" >&2;}
6188    { (exit 1); exit 1; }; }
6189 fi
6190 fi
6191
6192         ;;
6193 (ncursesw*)
6194
6195 echo "$as_me:6195: checking for multibyte character support" >&5
6196 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6197 if test "${cf_cv_utf8_lib+set}" = set; then
6198   echo $ECHO_N "(cached) $ECHO_C" >&6
6199 else
6200
6201         cf_save_LIBS="$LIBS"
6202         cat >conftest.$ac_ext <<_ACEOF
6203 #line 6203 "configure"
6204 #include "confdefs.h"
6205
6206 #include <stdlib.h>
6207 int
6208 main (void)
6209 {
6210 putwc(0,0);
6211   ;
6212   return 0;
6213 }
6214 _ACEOF
6215 rm -f conftest.$ac_objext conftest$ac_exeext
6216 if { (eval echo "$as_me:6216: \"$ac_link\"") >&5
6217   (eval $ac_link) 2>&5
6218   ac_status=$?
6219   echo "$as_me:6219: \$? = $ac_status" >&5
6220   (exit $ac_status); } &&
6221          { ac_try='test -s conftest$ac_exeext'
6222   { (eval echo "$as_me:6222: \"$ac_try\"") >&5
6223   (eval $ac_try) 2>&5
6224   ac_status=$?
6225   echo "$as_me:6225: \$? = $ac_status" >&5
6226   (exit $ac_status); }; }; then
6227   cf_cv_utf8_lib=yes
6228 else
6229   echo "$as_me: failed program was:" >&5
6230 cat conftest.$ac_ext >&5
6231
6232 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6233 # will be set on completion of the AC_TRY_LINK below.
6234 cf_cv_header_path_utf8=
6235 cf_cv_library_path_utf8=
6236
6237 echo "${as_me:-configure}:6237: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6238
6239 cf_save_LIBS="$LIBS"
6240
6241 cat >conftest.$ac_ext <<_ACEOF
6242 #line 6242 "configure"
6243 #include "confdefs.h"
6244
6245 #include <libutf8.h>
6246 int
6247 main (void)
6248 {
6249 putwc(0,0);
6250   ;
6251   return 0;
6252 }
6253 _ACEOF
6254 rm -f conftest.$ac_objext conftest$ac_exeext
6255 if { (eval echo "$as_me:6255: \"$ac_link\"") >&5
6256   (eval $ac_link) 2>&5
6257   ac_status=$?
6258   echo "$as_me:6258: \$? = $ac_status" >&5
6259   (exit $ac_status); } &&
6260          { ac_try='test -s conftest$ac_exeext'
6261   { (eval echo "$as_me:6261: \"$ac_try\"") >&5
6262   (eval $ac_try) 2>&5
6263   ac_status=$?
6264   echo "$as_me:6264: \$? = $ac_status" >&5
6265   (exit $ac_status); }; }; then
6266
6267         cf_cv_find_linkage_utf8=yes
6268         cf_cv_header_path_utf8=/usr/include
6269         cf_cv_library_path_utf8=/usr/lib
6270
6271 else
6272   echo "$as_me: failed program was:" >&5
6273 cat conftest.$ac_ext >&5
6274
6275 LIBS="-lutf8  $cf_save_LIBS"
6276
6277 cat >conftest.$ac_ext <<_ACEOF
6278 #line 6278 "configure"
6279 #include "confdefs.h"
6280
6281 #include <libutf8.h>
6282 int
6283 main (void)
6284 {
6285 putwc(0,0);
6286   ;
6287   return 0;
6288 }
6289 _ACEOF
6290 rm -f conftest.$ac_objext conftest$ac_exeext
6291 if { (eval echo "$as_me:6291: \"$ac_link\"") >&5
6292   (eval $ac_link) 2>&5
6293   ac_status=$?
6294   echo "$as_me:6294: \$? = $ac_status" >&5
6295   (exit $ac_status); } &&
6296          { ac_try='test -s conftest$ac_exeext'
6297   { (eval echo "$as_me:6297: \"$ac_try\"") >&5
6298   (eval $ac_try) 2>&5
6299   ac_status=$?
6300   echo "$as_me:6300: \$? = $ac_status" >&5
6301   (exit $ac_status); }; }; then
6302
6303         cf_cv_find_linkage_utf8=yes
6304         cf_cv_header_path_utf8=/usr/include
6305         cf_cv_library_path_utf8=/usr/lib
6306         cf_cv_library_file_utf8="-lutf8"
6307
6308 else
6309   echo "$as_me: failed program was:" >&5
6310 cat conftest.$ac_ext >&5
6311
6312         cf_cv_find_linkage_utf8=no
6313         LIBS="$cf_save_LIBS"
6314
6315         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6316
6317 echo "${as_me:-configure}:6317: testing find linkage for utf8 library ..." 1>&5
6318
6319 echo "${as_me:-configure}:6319: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6320
6321         cf_save_CPPFLAGS="$CPPFLAGS"
6322         cf_test_CPPFLAGS="$CPPFLAGS"
6323
6324 cf_search=
6325
6326 # collect the current set of include-directories from compiler flags
6327 cf_header_path_list=""
6328 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6329         for cf_header_path in $CPPFLAGS $CFLAGS
6330         do
6331                 case $cf_header_path in
6332                 (-I*)
6333                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6334
6335 test "x$cf_header_path" != "xNONE" && \
6336 test -d "$cf_header_path" && \
6337  {
6338         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6339         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6340         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6341         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6342         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6343         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6344 }
6345
6346                         cf_header_path_list="$cf_header_path_list $cf_search"
6347                         ;;
6348                 esac
6349         done
6350 fi
6351
6352 # add the variations for the package we are looking for
6353
6354 cf_search=
6355
6356 test "x$prefix" != "xNONE" && \
6357 test -d "$prefix" && \
6358  {
6359         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6360         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6361         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6362         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6363         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6364         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6365 }
6366
6367 for cf_subdir_prefix in \
6368         /usr \
6369         /usr/local \
6370         /usr/pkg \
6371         /opt \
6372         /opt/local \
6373         $HOME
6374 do
6375
6376 test "x$cf_subdir_prefix" != "x$prefix" && \
6377 test -d "$cf_subdir_prefix" && \
6378 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6379         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6380         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6381         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6382         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6383         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6384         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6385 }
6386
6387 done
6388
6389 test "$includedir" != NONE && \
6390 test "$includedir" != "/usr/include" && \
6391 test -d "$includedir" && {
6392         test -d $includedir &&    cf_search="$cf_search $includedir"
6393         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6394 }
6395
6396 test "$oldincludedir" != NONE && \
6397 test "$oldincludedir" != "/usr/include" && \
6398 test -d "$oldincludedir" && {
6399         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6400         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6401 }
6402
6403 cf_search="$cf_search $cf_header_path_list"
6404
6405         for cf_cv_header_path_utf8 in $cf_search
6406         do
6407                 if test -d $cf_cv_header_path_utf8 ; then
6408                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6409
6410 echo "${as_me:-configure}:6410: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6411
6412                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6413                         cat >conftest.$ac_ext <<_ACEOF
6414 #line 6414 "configure"
6415 #include "confdefs.h"
6416
6417 #include <libutf8.h>
6418 int
6419 main (void)
6420 {
6421 putwc(0,0);
6422   ;
6423   return 0;
6424 }
6425 _ACEOF
6426 rm -f conftest.$ac_objext
6427 if { (eval echo "$as_me:6427: \"$ac_compile\"") >&5
6428   (eval $ac_compile) 2>&5
6429   ac_status=$?
6430   echo "$as_me:6430: \$? = $ac_status" >&5
6431   (exit $ac_status); } &&
6432          { ac_try='test -s conftest.$ac_objext'
6433   { (eval echo "$as_me:6433: \"$ac_try\"") >&5
6434   (eval $ac_try) 2>&5
6435   ac_status=$?
6436   echo "$as_me:6436: \$? = $ac_status" >&5
6437   (exit $ac_status); }; }; then
6438
6439                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6440
6441 echo "${as_me:-configure}:6441: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6442
6443                                 cf_cv_find_linkage_utf8=maybe
6444                                 cf_test_CPPFLAGS="$CPPFLAGS"
6445                                 break
6446 else
6447   echo "$as_me: failed program was:" >&5
6448 cat conftest.$ac_ext >&5
6449
6450                                 CPPFLAGS="$cf_save_CPPFLAGS"
6451
6452 fi
6453 rm -f conftest.$ac_objext conftest.$ac_ext
6454                 fi
6455         done
6456
6457         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6458
6459 echo "${as_me:-configure}:6459: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6460
6461                 cf_save_LIBS="$LIBS"
6462                 cf_save_LDFLAGS="$LDFLAGS"
6463
6464                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6465
6466 cf_search=
6467 cf_library_path_list=""
6468 if test -n "${LDFLAGS}${LIBS}" ; then
6469         for cf_library_path in $LDFLAGS $LIBS
6470         do
6471                 case $cf_library_path in
6472                 (-L*)
6473                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6474
6475 test "x$cf_library_path" != "xNONE" && \
6476 test -d "$cf_library_path" && \
6477  {
6478         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6479         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6480         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6481         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6482         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6483         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6484 }
6485
6486                         cf_library_path_list="$cf_library_path_list $cf_search"
6487                         ;;
6488                 esac
6489         done
6490 fi
6491
6492 cf_search=
6493
6494 test "x$prefix" != "xNONE" && \
6495 test -d "$prefix" && \
6496  {
6497         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6498         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6499         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6500         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6501         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6502         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6503 }
6504
6505 for cf_subdir_prefix in \
6506         /usr \
6507         /usr/local \
6508         /usr/pkg \
6509         /opt \
6510         /opt/local \
6511         $HOME
6512 do
6513
6514 test "x$cf_subdir_prefix" != "x$prefix" && \
6515 test -d "$cf_subdir_prefix" && \
6516 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6517         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6518         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6519         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6520         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6521         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6522         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6523 }
6524
6525 done
6526
6527 cf_search="$cf_library_path_list $cf_search"
6528
6529                         for cf_cv_library_path_utf8 in $cf_search
6530                         do
6531                                 if test -d $cf_cv_library_path_utf8 ; then
6532                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6533
6534 echo "${as_me:-configure}:6534: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6535
6536                                         CPPFLAGS="$cf_test_CPPFLAGS"
6537                                         LIBS="-lutf8  $cf_save_LIBS"
6538                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6539                                         cat >conftest.$ac_ext <<_ACEOF
6540 #line 6540 "configure"
6541 #include "confdefs.h"
6542
6543 #include <libutf8.h>
6544 int
6545 main (void)
6546 {
6547 putwc(0,0);
6548   ;
6549   return 0;
6550 }
6551 _ACEOF
6552 rm -f conftest.$ac_objext conftest$ac_exeext
6553 if { (eval echo "$as_me:6553: \"$ac_link\"") >&5
6554   (eval $ac_link) 2>&5
6555   ac_status=$?
6556   echo "$as_me:6556: \$? = $ac_status" >&5
6557   (exit $ac_status); } &&
6558          { ac_try='test -s conftest$ac_exeext'
6559   { (eval echo "$as_me:6559: \"$ac_try\"") >&5
6560   (eval $ac_try) 2>&5
6561   ac_status=$?
6562   echo "$as_me:6562: \$? = $ac_status" >&5
6563   (exit $ac_status); }; }; then
6564
6565                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6566
6567 echo "${as_me:-configure}:6567: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6568
6569                                         cf_cv_find_linkage_utf8=yes
6570                                         cf_cv_library_file_utf8="-lutf8"
6571                                         break
6572 else
6573   echo "$as_me: failed program was:" >&5
6574 cat conftest.$ac_ext >&5
6575
6576                                         CPPFLAGS="$cf_save_CPPFLAGS"
6577                                         LIBS="$cf_save_LIBS"
6578                                         LDFLAGS="$cf_save_LDFLAGS"
6579
6580 fi
6581 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6582                                 fi
6583                         done
6584                         CPPFLAGS="$cf_save_CPPFLAGS"
6585                         LDFLAGS="$cf_save_LDFLAGS"
6586                 fi
6587
6588         else
6589                 cf_cv_find_linkage_utf8=no
6590         fi
6591
6592 fi
6593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6594
6595 fi
6596 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6597
6598 LIBS="$cf_save_LIBS"
6599
6600 if test "$cf_cv_find_linkage_utf8" = yes ; then
6601 cf_cv_utf8_lib=add-on
6602 else
6603 cf_cv_utf8_lib=no
6604 fi
6605
6606 fi
6607 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6608 fi
6609 echo "$as_me:6609: result: $cf_cv_utf8_lib" >&5
6610 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6611
6612 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6613 # ncurses/ncursesw:
6614 if test "$cf_cv_utf8_lib" = "add-on" ; then
6615
6616 cat >>confdefs.h <<\EOF
6617 #define HAVE_LIBUTF8_H 1
6618 EOF
6619
6620 if test -n "$cf_cv_header_path_utf8" ; then
6621   for cf_add_incdir in $cf_cv_header_path_utf8
6622   do
6623         while test $cf_add_incdir != /usr/include
6624         do
6625           if test -d $cf_add_incdir
6626           then
6627                 cf_have_incdir=no
6628                 if test -n "$CFLAGS$CPPFLAGS" ; then
6629                   # a loop is needed to ensure we can add subdirs of existing dirs
6630                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6631                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6632                           cf_have_incdir=yes; break
6633                         fi
6634                   done
6635                 fi
6636
6637                 if test "$cf_have_incdir" = no ; then
6638                   if test "$cf_add_incdir" = /usr/local/include ; then
6639                         if test "$GCC" = yes
6640                         then
6641                           cf_save_CPPFLAGS=$CPPFLAGS
6642                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6643                           cat >conftest.$ac_ext <<_ACEOF
6644 #line 6644 "configure"
6645 #include "confdefs.h"
6646 #include <stdio.h>
6647 int
6648 main (void)
6649 {
6650 printf("Hello")
6651   ;
6652   return 0;
6653 }
6654 _ACEOF
6655 rm -f conftest.$ac_objext
6656 if { (eval echo "$as_me:6656: \"$ac_compile\"") >&5
6657   (eval $ac_compile) 2>&5
6658   ac_status=$?
6659   echo "$as_me:6659: \$? = $ac_status" >&5
6660   (exit $ac_status); } &&
6661          { ac_try='test -s conftest.$ac_objext'
6662   { (eval echo "$as_me:6662: \"$ac_try\"") >&5
6663   (eval $ac_try) 2>&5
6664   ac_status=$?
6665   echo "$as_me:6665: \$? = $ac_status" >&5
6666   (exit $ac_status); }; }; then
6667   :
6668 else
6669   echo "$as_me: failed program was:" >&5
6670 cat conftest.$ac_ext >&5
6671 cf_have_incdir=yes
6672 fi
6673 rm -f conftest.$ac_objext conftest.$ac_ext
6674                           CPPFLAGS=$cf_save_CPPFLAGS
6675                         fi
6676                   fi
6677                 fi
6678
6679                 if test "$cf_have_incdir" = no ; then
6680                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6681
6682 echo "${as_me:-configure}:6682: testing adding $cf_add_incdir to include-path ..." 1>&5
6683
6684                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6685
6686                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6687                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6688                   cf_add_incdir="$cf_top_incdir"
6689                 else
6690                   break
6691                 fi
6692           else
6693                 break
6694           fi
6695         done
6696   done
6697 fi
6698
6699 if test -n "$cf_cv_library_path_utf8" ; then
6700         for cf_add_libdir in $cf_cv_library_path_utf8
6701         do
6702                 if test $cf_add_libdir = /usr/lib ; then
6703                         :
6704                 elif test -d $cf_add_libdir
6705                 then
6706                         cf_have_libdir=no
6707                         if test -n "$LDFLAGS$LIBS" ; then
6708                                 # a loop is needed to ensure we can add subdirs of existing dirs
6709                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6710                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6711                                                 cf_have_libdir=yes; break
6712                                         fi
6713                                 done
6714                         fi
6715                         if test "$cf_have_libdir" = no ; then
6716                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6717
6718 echo "${as_me:-configure}:6718: testing adding $cf_add_libdir to library-path ..." 1>&5
6719
6720                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6721                         fi
6722                 fi
6723         done
6724 fi
6725
6726 cf_add_libs="$cf_cv_library_file_utf8"
6727 # Filter out duplicates - this happens with badly-designed ".pc" files...
6728 for cf_add_1lib in $LIBS
6729 do
6730         for cf_add_2lib in $cf_add_libs
6731         do
6732                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6733                 then
6734                         cf_add_1lib=
6735                         break
6736                 fi
6737         done
6738         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6739 done
6740 LIBS="$cf_add_libs"
6741
6742 fi
6743
6744 cf_ncuconfig_root=$cf_cv_screen
6745 cf_have_ncuconfig=no
6746
6747 if test "x${PKG_CONFIG:=none}" != xnone; then
6748         echo "$as_me:6748: checking pkg-config for $cf_ncuconfig_root" >&5
6749 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6750         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6751                 echo "$as_me:6751: result: yes" >&5
6752 echo "${ECHO_T}yes" >&6
6753
6754                 echo "$as_me:6754: checking if the $cf_ncuconfig_root package files work" >&5
6755 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6756                 cf_have_ncuconfig=unknown
6757
6758                 cf_save_CPPFLAGS="$CPPFLAGS"
6759                 cf_save_LIBS="$LIBS"
6760
6761                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6762
6763 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6764 # Filter out duplicates - this happens with badly-designed ".pc" files...
6765 for cf_add_1lib in $LIBS
6766 do
6767         for cf_add_2lib in $cf_add_libs
6768         do
6769                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6770                 then
6771                         cf_add_1lib=
6772                         break
6773                 fi
6774         done
6775         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6776 done
6777 LIBS="$cf_add_libs"
6778
6779                 cat >conftest.$ac_ext <<_ACEOF
6780 #line 6780 "configure"
6781 #include "confdefs.h"
6782 #include <${cf_cv_ncurses_header:-curses.h}>
6783 int
6784 main (void)
6785 {
6786 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6787   ;
6788   return 0;
6789 }
6790 _ACEOF
6791 rm -f conftest.$ac_objext conftest$ac_exeext
6792 if { (eval echo "$as_me:6792: \"$ac_link\"") >&5
6793   (eval $ac_link) 2>&5
6794   ac_status=$?
6795   echo "$as_me:6795: \$? = $ac_status" >&5
6796   (exit $ac_status); } &&
6797          { ac_try='test -s conftest$ac_exeext'
6798   { (eval echo "$as_me:6798: \"$ac_try\"") >&5
6799   (eval $ac_try) 2>&5
6800   ac_status=$?
6801   echo "$as_me:6801: \$? = $ac_status" >&5
6802   (exit $ac_status); }; }; then
6803   if test "$cross_compiling" = yes; then
6804   cf_have_ncuconfig=maybe
6805 else
6806   cat >conftest.$ac_ext <<_ACEOF
6807 #line 6807 "configure"
6808 #include "confdefs.h"
6809 #include <${cf_cv_ncurses_header:-curses.h}>
6810                                 int main(void)
6811                                 { char *xx = curses_version(); return (xx == 0); }
6812 _ACEOF
6813 rm -f conftest$ac_exeext
6814 if { (eval echo "$as_me:6814: \"$ac_link\"") >&5
6815   (eval $ac_link) 2>&5
6816   ac_status=$?
6817   echo "$as_me:6817: \$? = $ac_status" >&5
6818   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6819   { (eval echo "$as_me:6819: \"$ac_try\"") >&5
6820   (eval $ac_try) 2>&5
6821   ac_status=$?
6822   echo "$as_me:6822: \$? = $ac_status" >&5
6823   (exit $ac_status); }; }; then
6824   cf_have_ncuconfig=yes
6825 else
6826   echo "$as_me: program exited with status $ac_status" >&5
6827 echo "$as_me: failed program was:" >&5
6828 cat conftest.$ac_ext >&5
6829 cf_have_ncuconfig=no
6830 fi
6831 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6832 fi
6833 else
6834   echo "$as_me: failed program was:" >&5
6835 cat conftest.$ac_ext >&5
6836 cf_have_ncuconfig=no
6837 fi
6838 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6839                 echo "$as_me:6839: result: $cf_have_ncuconfig" >&5
6840 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6841                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6842                 if test "$cf_have_ncuconfig" != "yes"
6843                 then
6844                         CPPFLAGS="$cf_save_CPPFLAGS"
6845                         LIBS="$cf_save_LIBS"
6846                         NCURSES_CONFIG_PKG=none
6847                 else
6848
6849 cat >>confdefs.h <<\EOF
6850 #define NCURSES 1
6851 EOF
6852
6853                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6854                 fi
6855
6856 echo "$as_me:6856: checking for terminfo header" >&5
6857 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6858 if test "${cf_cv_term_header+set}" = set; then
6859   echo $ECHO_N "(cached) $ECHO_C" >&6
6860 else
6861
6862 case ${cf_cv_ncurses_header} in
6863 (*/ncurses.h|*/ncursesw.h)
6864         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6865         ;;
6866 (*)
6867         cf_term_header=term.h
6868         ;;
6869 esac
6870
6871 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6872 do
6873 cat >conftest.$ac_ext <<_ACEOF
6874 #line 6874 "configure"
6875 #include "confdefs.h"
6876 #include <stdio.h>
6877 #include <${cf_cv_ncurses_header:-curses.h}>
6878 #include <$cf_test>
6879
6880 int
6881 main (void)
6882 {
6883 int x = auto_left_margin
6884   ;
6885   return 0;
6886 }
6887 _ACEOF
6888 rm -f conftest.$ac_objext
6889 if { (eval echo "$as_me:6889: \"$ac_compile\"") >&5
6890   (eval $ac_compile) 2>&5
6891   ac_status=$?
6892   echo "$as_me:6892: \$? = $ac_status" >&5
6893   (exit $ac_status); } &&
6894          { ac_try='test -s conftest.$ac_objext'
6895   { (eval echo "$as_me:6895: \"$ac_try\"") >&5
6896   (eval $ac_try) 2>&5
6897   ac_status=$?
6898   echo "$as_me:6898: \$? = $ac_status" >&5
6899   (exit $ac_status); }; }; then
6900
6901         cf_cv_term_header="$cf_test"
6902 else
6903   echo "$as_me: failed program was:" >&5
6904 cat conftest.$ac_ext >&5
6905
6906         cf_cv_term_header=unknown
6907
6908 fi
6909 rm -f conftest.$ac_objext conftest.$ac_ext
6910         test "$cf_cv_term_header" != unknown && break
6911 done
6912
6913 fi
6914 echo "$as_me:6914: result: $cf_cv_term_header" >&5
6915 echo "${ECHO_T}$cf_cv_term_header" >&6
6916
6917 # Set definitions to allow ifdef'ing to accommodate subdirectories
6918
6919 case $cf_cv_term_header in
6920 (*term.h)
6921
6922 cat >>confdefs.h <<\EOF
6923 #define HAVE_TERM_H 1
6924 EOF
6925
6926         ;;
6927 esac
6928
6929 case $cf_cv_term_header in
6930 (ncurses/term.h)
6931
6932 cat >>confdefs.h <<\EOF
6933 #define HAVE_NCURSES_TERM_H 1
6934 EOF
6935
6936         ;;
6937 (ncursesw/term.h)
6938
6939 cat >>confdefs.h <<\EOF
6940 #define HAVE_NCURSESW_TERM_H 1
6941 EOF
6942
6943         ;;
6944 esac
6945
6946         else
6947                 echo "$as_me:6947: result: no" >&5
6948 echo "${ECHO_T}no" >&6
6949                 NCURSES_CONFIG_PKG=none
6950         fi
6951 else
6952         NCURSES_CONFIG_PKG=none
6953 fi
6954
6955 if test "x$cf_have_ncuconfig" = "xno"; then
6956         echo "Looking for ${cf_ncuconfig_root}-config"
6957
6958 if test -n "$ac_tool_prefix"; then
6959   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6960   do
6961     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6962 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6963 echo "$as_me:6963: checking for $ac_word" >&5
6964 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6965 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6966   echo $ECHO_N "(cached) $ECHO_C" >&6
6967 else
6968   if test -n "$NCURSES_CONFIG"; then
6969   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6970 else
6971   ac_save_IFS=$IFS; IFS=$ac_path_separator
6972 ac_dummy="$PATH"
6973 for ac_dir in $ac_dummy; do
6974   IFS=$ac_save_IFS
6975   test -z "$ac_dir" && ac_dir=.
6976   $as_executable_p "$ac_dir/$ac_word" || continue
6977 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6978 echo "$as_me:6978: found $ac_dir/$ac_word" >&5
6979 break
6980 done
6981
6982 fi
6983 fi
6984 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6985 if test -n "$NCURSES_CONFIG"; then
6986   echo "$as_me:6986: result: $NCURSES_CONFIG" >&5
6987 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6988 else
6989   echo "$as_me:6989: result: no" >&5
6990 echo "${ECHO_T}no" >&6
6991 fi
6992
6993     test -n "$NCURSES_CONFIG" && break
6994   done
6995 fi
6996 if test -z "$NCURSES_CONFIG"; then
6997   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6998   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6999 do
7000   # Extract the first word of "$ac_prog", so it can be a program name with args.
7001 set dummy $ac_prog; ac_word=$2
7002 echo "$as_me:7002: checking for $ac_word" >&5
7003 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7004 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7005   echo $ECHO_N "(cached) $ECHO_C" >&6
7006 else
7007   if test -n "$ac_ct_NCURSES_CONFIG"; then
7008   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7009 else
7010   ac_save_IFS=$IFS; IFS=$ac_path_separator
7011 ac_dummy="$PATH"
7012 for ac_dir in $ac_dummy; do
7013   IFS=$ac_save_IFS
7014   test -z "$ac_dir" && ac_dir=.
7015   $as_executable_p "$ac_dir/$ac_word" || continue
7016 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7017 echo "$as_me:7017: found $ac_dir/$ac_word" >&5
7018 break
7019 done
7020
7021 fi
7022 fi
7023 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7024 if test -n "$ac_ct_NCURSES_CONFIG"; then
7025   echo "$as_me:7025: result: $ac_ct_NCURSES_CONFIG" >&5
7026 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7027 else
7028   echo "$as_me:7028: result: no" >&5
7029 echo "${ECHO_T}no" >&6
7030 fi
7031
7032   test -n "$ac_ct_NCURSES_CONFIG" && break
7033 done
7034 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7035
7036   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7037 fi
7038
7039         if test "$NCURSES_CONFIG" != none ; then
7040
7041                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7042
7043 cf_add_libs="`$NCURSES_CONFIG --libs`"
7044 # Filter out duplicates - this happens with badly-designed ".pc" files...
7045 for cf_add_1lib in $LIBS
7046 do
7047         for cf_add_2lib in $cf_add_libs
7048         do
7049                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7050                 then
7051                         cf_add_1lib=
7052                         break
7053                 fi
7054         done
7055         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7056 done
7057 LIBS="$cf_add_libs"
7058
7059                 # even with config script, some packages use no-override for curses.h
7060
7061 echo "$as_me:7061: checking if we have identified curses headers" >&5
7062 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7063 if test "${cf_cv_ncurses_header+set}" = set; then
7064   echo $ECHO_N "(cached) $ECHO_C" >&6
7065 else
7066
7067 cf_cv_ncurses_header=none
7068 for cf_header in \
7069         ncurses.h $cf_cv_screen/ncurses.h \
7070         curses.h $cf_cv_screen/curses.h
7071 do
7072 cat >conftest.$ac_ext <<_ACEOF
7073 #line 7073 "configure"
7074 #include "confdefs.h"
7075 #include <${cf_header}>
7076 int
7077 main (void)
7078 {
7079 initscr(); tgoto("?", 0,0)
7080   ;
7081   return 0;
7082 }
7083 _ACEOF
7084 rm -f conftest.$ac_objext
7085 if { (eval echo "$as_me:7085: \"$ac_compile\"") >&5
7086   (eval $ac_compile) 2>&5
7087   ac_status=$?
7088   echo "$as_me:7088: \$? = $ac_status" >&5
7089   (exit $ac_status); } &&
7090          { ac_try='test -s conftest.$ac_objext'
7091   { (eval echo "$as_me:7091: \"$ac_try\"") >&5
7092   (eval $ac_try) 2>&5
7093   ac_status=$?
7094   echo "$as_me:7094: \$? = $ac_status" >&5
7095   (exit $ac_status); }; }; then
7096   cf_cv_ncurses_header=$cf_header; break
7097 else
7098   echo "$as_me: failed program was:" >&5
7099 cat conftest.$ac_ext >&5
7100 fi
7101 rm -f conftest.$ac_objext conftest.$ac_ext
7102 done
7103
7104 fi
7105 echo "$as_me:7105: result: $cf_cv_ncurses_header" >&5
7106 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7107
7108 if test "$cf_cv_ncurses_header" = none ; then
7109         { { echo "$as_me:7109: error: No curses header-files found" >&5
7110 echo "$as_me: error: No curses header-files found" >&2;}
7111    { (exit 1); exit 1; }; }
7112 fi
7113
7114 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7115
7116 for ac_header in $cf_cv_ncurses_header
7117 do
7118 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7119 echo "$as_me:7119: checking for $ac_header" >&5
7120 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7121 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7122   echo $ECHO_N "(cached) $ECHO_C" >&6
7123 else
7124   cat >conftest.$ac_ext <<_ACEOF
7125 #line 7125 "configure"
7126 #include "confdefs.h"
7127 #include <$ac_header>
7128 _ACEOF
7129 if { (eval echo "$as_me:7129: \"$ac_cpp conftest.$ac_ext\"") >&5
7130   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7131   ac_status=$?
7132   egrep -v '^ *\+' conftest.er1 >conftest.err
7133   rm -f conftest.er1
7134   cat conftest.err >&5
7135   echo "$as_me:7135: \$? = $ac_status" >&5
7136   (exit $ac_status); } >/dev/null; then
7137   if test -s conftest.err; then
7138     ac_cpp_err=$ac_c_preproc_warn_flag
7139   else
7140     ac_cpp_err=
7141   fi
7142 else
7143   ac_cpp_err=yes
7144 fi
7145 if test -z "$ac_cpp_err"; then
7146   eval "$as_ac_Header=yes"
7147 else
7148   echo "$as_me: failed program was:" >&5
7149   cat conftest.$ac_ext >&5
7150   eval "$as_ac_Header=no"
7151 fi
7152 rm -f conftest.err conftest.$ac_ext
7153 fi
7154 echo "$as_me:7154: result: `eval echo '${'$as_ac_Header'}'`" >&5
7155 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7156 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7157   cat >>confdefs.h <<EOF
7158 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7159 EOF
7160
7161 fi
7162 done
7163
7164 cat >>confdefs.h <<\EOF
7165 #define NCURSES 1
7166 EOF
7167
7168 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7169
7170                 cat >>confdefs.h <<EOF
7171 #define $cf_nculib_ROOT 1
7172 EOF
7173
7174                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7175
7176         else
7177
7178 cf_ncuhdr_root=$cf_cv_screen
7179
7180 test -n "$cf_cv_curses_dir" && \
7181 test "$cf_cv_curses_dir" != "no" && { \
7182
7183 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7184   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7185   do
7186         while test $cf_add_incdir != /usr/include
7187         do
7188           if test -d $cf_add_incdir
7189           then
7190                 cf_have_incdir=no
7191                 if test -n "$CFLAGS$CPPFLAGS" ; then
7192                   # a loop is needed to ensure we can add subdirs of existing dirs
7193                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7194                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7195                           cf_have_incdir=yes; break
7196                         fi
7197                   done
7198                 fi
7199
7200                 if test "$cf_have_incdir" = no ; then
7201                   if test "$cf_add_incdir" = /usr/local/include ; then
7202                         if test "$GCC" = yes
7203                         then
7204                           cf_save_CPPFLAGS=$CPPFLAGS
7205                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7206                           cat >conftest.$ac_ext <<_ACEOF
7207 #line 7207 "configure"
7208 #include "confdefs.h"
7209 #include <stdio.h>
7210 int
7211 main (void)
7212 {
7213 printf("Hello")
7214   ;
7215   return 0;
7216 }
7217 _ACEOF
7218 rm -f conftest.$ac_objext
7219 if { (eval echo "$as_me:7219: \"$ac_compile\"") >&5
7220   (eval $ac_compile) 2>&5
7221   ac_status=$?
7222   echo "$as_me:7222: \$? = $ac_status" >&5
7223   (exit $ac_status); } &&
7224          { ac_try='test -s conftest.$ac_objext'
7225   { (eval echo "$as_me:7225: \"$ac_try\"") >&5
7226   (eval $ac_try) 2>&5
7227   ac_status=$?
7228   echo "$as_me:7228: \$? = $ac_status" >&5
7229   (exit $ac_status); }; }; then
7230   :
7231 else
7232   echo "$as_me: failed program was:" >&5
7233 cat conftest.$ac_ext >&5
7234 cf_have_incdir=yes
7235 fi
7236 rm -f conftest.$ac_objext conftest.$ac_ext
7237                           CPPFLAGS=$cf_save_CPPFLAGS
7238                         fi
7239                   fi
7240                 fi
7241
7242                 if test "$cf_have_incdir" = no ; then
7243                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7244
7245 echo "${as_me:-configure}:7245: testing adding $cf_add_incdir to include-path ..." 1>&5
7246
7247                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7248
7249                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7250                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7251                   cf_add_incdir="$cf_top_incdir"
7252                 else
7253                   break
7254                 fi
7255           else
7256                 break
7257           fi
7258         done
7259   done
7260 fi
7261
7262 }
7263
7264 echo "$as_me:7264: checking for $cf_ncuhdr_root header in include-path" >&5
7265 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7266 if test "${cf_cv_ncurses_h+set}" = set; then
7267   echo $ECHO_N "(cached) $ECHO_C" >&6
7268 else
7269
7270         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7271         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7272         for cf_header in $cf_header_list
7273         do
7274
7275         cat >conftest.$ac_ext <<_ACEOF
7276 #line 7276 "configure"
7277 #include "confdefs.h"
7278
7279 #include <$cf_header>
7280 int
7281 main (void)
7282 {
7283
7284 #ifdef NCURSES_VERSION
7285
7286 printf("%s\n", NCURSES_VERSION);
7287 #else
7288 #ifdef __NCURSES_H
7289 printf("old\n");
7290 #else
7291         make an error
7292 #endif
7293 #endif
7294
7295   ;
7296   return 0;
7297 }
7298 _ACEOF
7299 rm -f conftest.$ac_objext
7300 if { (eval echo "$as_me:7300: \"$ac_compile\"") >&5
7301   (eval $ac_compile) 2>&5
7302   ac_status=$?
7303   echo "$as_me:7303: \$? = $ac_status" >&5
7304   (exit $ac_status); } &&
7305          { ac_try='test -s conftest.$ac_objext'
7306   { (eval echo "$as_me:7306: \"$ac_try\"") >&5
7307   (eval $ac_try) 2>&5
7308   ac_status=$?
7309   echo "$as_me:7309: \$? = $ac_status" >&5
7310   (exit $ac_status); }; }; then
7311   cf_cv_ncurses_h=$cf_header
7312
7313 else
7314   echo "$as_me: failed program was:" >&5
7315 cat conftest.$ac_ext >&5
7316 cf_cv_ncurses_h=no
7317 fi
7318 rm -f conftest.$ac_objext conftest.$ac_ext
7319
7320                 test "$cf_cv_ncurses_h" != no && break
7321         done
7322
7323 fi
7324 echo "$as_me:7324: result: $cf_cv_ncurses_h" >&5
7325 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7326
7327 if test "$cf_cv_ncurses_h" != no ; then
7328         cf_cv_ncurses_header=$cf_cv_ncurses_h
7329 else
7330
7331 echo "$as_me:7331: checking for $cf_ncuhdr_root include-path" >&5
7332 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7333 if test "${cf_cv_ncurses_h2+set}" = set; then
7334   echo $ECHO_N "(cached) $ECHO_C" >&6
7335 else
7336
7337         test -n "$verbose" && echo
7338
7339 cf_search=
7340
7341 # collect the current set of include-directories from compiler flags
7342 cf_header_path_list=""
7343 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7344         for cf_header_path in $CPPFLAGS $CFLAGS
7345         do
7346                 case $cf_header_path in
7347                 (-I*)
7348                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7349
7350 test "x$cf_header_path" != "xNONE" && \
7351 test -d "$cf_header_path" && \
7352  {
7353         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7354         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7355         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7356         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7357         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7358         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"
7359 }
7360
7361                         cf_header_path_list="$cf_header_path_list $cf_search"
7362                         ;;
7363                 esac
7364         done
7365 fi
7366
7367 # add the variations for the package we are looking for
7368
7369 cf_search=
7370
7371 test "x$prefix" != "xNONE" && \
7372 test -d "$prefix" && \
7373  {
7374         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7375         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7376         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7377         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7378         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7379         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7380 }
7381
7382 for cf_subdir_prefix in \
7383         /usr \
7384         /usr/local \
7385         /usr/pkg \
7386         /opt \
7387         /opt/local \
7388         $HOME
7389 do
7390
7391 test "x$cf_subdir_prefix" != "x$prefix" && \
7392 test -d "$cf_subdir_prefix" && \
7393 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7394         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7395         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7396         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7397         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7398         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7399         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"
7400 }
7401
7402 done
7403
7404 test "$includedir" != NONE && \
7405 test "$includedir" != "/usr/include" && \
7406 test -d "$includedir" && {
7407         test -d $includedir &&    cf_search="$cf_search $includedir"
7408         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7409 }
7410
7411 test "$oldincludedir" != NONE && \
7412 test "$oldincludedir" != "/usr/include" && \
7413 test -d "$oldincludedir" && {
7414         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7415         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7416 }
7417
7418 cf_search="$cf_search $cf_header_path_list"
7419
7420         test -n "$verbose" && echo search path $cf_search
7421         cf_save2_CPPFLAGS="$CPPFLAGS"
7422         for cf_incdir in $cf_search
7423         do
7424
7425 if test -n "$cf_incdir" ; then
7426   for cf_add_incdir in $cf_incdir
7427   do
7428         while test $cf_add_incdir != /usr/include
7429         do
7430           if test -d $cf_add_incdir
7431           then
7432                 cf_have_incdir=no
7433                 if test -n "$CFLAGS$CPPFLAGS" ; then
7434                   # a loop is needed to ensure we can add subdirs of existing dirs
7435                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7436                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7437                           cf_have_incdir=yes; break
7438                         fi
7439                   done
7440                 fi
7441
7442                 if test "$cf_have_incdir" = no ; then
7443                   if test "$cf_add_incdir" = /usr/local/include ; then
7444                         if test "$GCC" = yes
7445                         then
7446                           cf_save_CPPFLAGS=$CPPFLAGS
7447                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7448                           cat >conftest.$ac_ext <<_ACEOF
7449 #line 7449 "configure"
7450 #include "confdefs.h"
7451 #include <stdio.h>
7452 int
7453 main (void)
7454 {
7455 printf("Hello")
7456   ;
7457   return 0;
7458 }
7459 _ACEOF
7460 rm -f conftest.$ac_objext
7461 if { (eval echo "$as_me:7461: \"$ac_compile\"") >&5
7462   (eval $ac_compile) 2>&5
7463   ac_status=$?
7464   echo "$as_me:7464: \$? = $ac_status" >&5
7465   (exit $ac_status); } &&
7466          { ac_try='test -s conftest.$ac_objext'
7467   { (eval echo "$as_me:7467: \"$ac_try\"") >&5
7468   (eval $ac_try) 2>&5
7469   ac_status=$?
7470   echo "$as_me:7470: \$? = $ac_status" >&5
7471   (exit $ac_status); }; }; then
7472   :
7473 else
7474   echo "$as_me: failed program was:" >&5
7475 cat conftest.$ac_ext >&5
7476 cf_have_incdir=yes
7477 fi
7478 rm -f conftest.$ac_objext conftest.$ac_ext
7479                           CPPFLAGS=$cf_save_CPPFLAGS
7480                         fi
7481                   fi
7482                 fi
7483
7484                 if test "$cf_have_incdir" = no ; then
7485                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7486
7487 echo "${as_me:-configure}:7487: testing adding $cf_add_incdir to include-path ..." 1>&5
7488
7489                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7490
7491                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7492                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7493                   cf_add_incdir="$cf_top_incdir"
7494                 else
7495                   break
7496                 fi
7497           else
7498                 break
7499           fi
7500         done
7501   done
7502 fi
7503
7504                 for cf_header in \
7505                         ncurses.h \
7506                         curses.h
7507                 do
7508
7509         cat >conftest.$ac_ext <<_ACEOF
7510 #line 7510 "configure"
7511 #include "confdefs.h"
7512
7513 #include <$cf_header>
7514 int
7515 main (void)
7516 {
7517
7518 #ifdef NCURSES_VERSION
7519
7520 printf("%s\n", NCURSES_VERSION);
7521 #else
7522 #ifdef __NCURSES_H
7523 printf("old\n");
7524 #else
7525         make an error
7526 #endif
7527 #endif
7528
7529   ;
7530   return 0;
7531 }
7532 _ACEOF
7533 rm -f conftest.$ac_objext
7534 if { (eval echo "$as_me:7534: \"$ac_compile\"") >&5
7535   (eval $ac_compile) 2>&5
7536   ac_status=$?
7537   echo "$as_me:7537: \$? = $ac_status" >&5
7538   (exit $ac_status); } &&
7539          { ac_try='test -s conftest.$ac_objext'
7540   { (eval echo "$as_me:7540: \"$ac_try\"") >&5
7541   (eval $ac_try) 2>&5
7542   ac_status=$?
7543   echo "$as_me:7543: \$? = $ac_status" >&5
7544   (exit $ac_status); }; }; then
7545   cf_cv_ncurses_h2=$cf_header
7546
7547 else
7548   echo "$as_me: failed program was:" >&5
7549 cat conftest.$ac_ext >&5
7550 cf_cv_ncurses_h2=no
7551 fi
7552 rm -f conftest.$ac_objext conftest.$ac_ext
7553
7554                         if test "$cf_cv_ncurses_h2" != no ; then
7555                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7556                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7557                                 break
7558                         fi
7559                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7560                 done
7561                 CPPFLAGS="$cf_save2_CPPFLAGS"
7562                 test "$cf_cv_ncurses_h2" != no && break
7563         done
7564         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7564: error: not found" >&5
7565 echo "$as_me: error: not found" >&2;}
7566    { (exit 1); exit 1; }; }
7567
7568 fi
7569 echo "$as_me:7569: result: $cf_cv_ncurses_h2" >&5
7570 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7571
7572         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7573         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7574         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7575                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7576         fi
7577
7578 if test -n "$cf_1st_incdir" ; then
7579   for cf_add_incdir in $cf_1st_incdir
7580   do
7581         while test $cf_add_incdir != /usr/include
7582         do
7583           if test -d $cf_add_incdir
7584           then
7585                 cf_have_incdir=no
7586                 if test -n "$CFLAGS$CPPFLAGS" ; then
7587                   # a loop is needed to ensure we can add subdirs of existing dirs
7588                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7589                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7590                           cf_have_incdir=yes; break
7591                         fi
7592                   done
7593                 fi
7594
7595                 if test "$cf_have_incdir" = no ; then
7596                   if test "$cf_add_incdir" = /usr/local/include ; then
7597                         if test "$GCC" = yes
7598                         then
7599                           cf_save_CPPFLAGS=$CPPFLAGS
7600                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7601                           cat >conftest.$ac_ext <<_ACEOF
7602 #line 7602 "configure"
7603 #include "confdefs.h"
7604 #include <stdio.h>
7605 int
7606 main (void)
7607 {
7608 printf("Hello")
7609   ;
7610   return 0;
7611 }
7612 _ACEOF
7613 rm -f conftest.$ac_objext
7614 if { (eval echo "$as_me:7614: \"$ac_compile\"") >&5
7615   (eval $ac_compile) 2>&5
7616   ac_status=$?
7617   echo "$as_me:7617: \$? = $ac_status" >&5
7618   (exit $ac_status); } &&
7619          { ac_try='test -s conftest.$ac_objext'
7620   { (eval echo "$as_me:7620: \"$ac_try\"") >&5
7621   (eval $ac_try) 2>&5
7622   ac_status=$?
7623   echo "$as_me:7623: \$? = $ac_status" >&5
7624   (exit $ac_status); }; }; then
7625   :
7626 else
7627   echo "$as_me: failed program was:" >&5
7628 cat conftest.$ac_ext >&5
7629 cf_have_incdir=yes
7630 fi
7631 rm -f conftest.$ac_objext conftest.$ac_ext
7632                           CPPFLAGS=$cf_save_CPPFLAGS
7633                         fi
7634                   fi
7635                 fi
7636
7637                 if test "$cf_have_incdir" = no ; then
7638                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7639
7640 echo "${as_me:-configure}:7640: testing adding $cf_add_incdir to include-path ..." 1>&5
7641
7642                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7643
7644                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7645                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7646                   cf_add_incdir="$cf_top_incdir"
7647                 else
7648                   break
7649                 fi
7650           else
7651                 break
7652           fi
7653         done
7654   done
7655 fi
7656
7657 fi
7658
7659 # Set definitions to allow ifdef'ing for ncurses.h
7660
7661 case $cf_cv_ncurses_header in
7662 (*ncurses.h)
7663
7664 cat >>confdefs.h <<\EOF
7665 #define HAVE_NCURSES_H 1
7666 EOF
7667
7668         ;;
7669 esac
7670
7671 case $cf_cv_ncurses_header in
7672 (ncurses/curses.h|ncurses/ncurses.h)
7673
7674 cat >>confdefs.h <<\EOF
7675 #define HAVE_NCURSES_NCURSES_H 1
7676 EOF
7677
7678         ;;
7679 (ncursesw/curses.h|ncursesw/ncurses.h)
7680
7681 cat >>confdefs.h <<\EOF
7682 #define HAVE_NCURSESW_NCURSES_H 1
7683 EOF
7684
7685         ;;
7686 esac
7687
7688 echo "$as_me:7688: checking for terminfo header" >&5
7689 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7690 if test "${cf_cv_term_header+set}" = set; then
7691   echo $ECHO_N "(cached) $ECHO_C" >&6
7692 else
7693
7694 case ${cf_cv_ncurses_header} in
7695 (*/ncurses.h|*/ncursesw.h)
7696         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7697         ;;
7698 (*)
7699         cf_term_header=term.h
7700         ;;
7701 esac
7702
7703 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7704 do
7705 cat >conftest.$ac_ext <<_ACEOF
7706 #line 7706 "configure"
7707 #include "confdefs.h"
7708 #include <stdio.h>
7709 #include <${cf_cv_ncurses_header:-curses.h}>
7710 #include <$cf_test>
7711
7712 int
7713 main (void)
7714 {
7715 int x = auto_left_margin
7716   ;
7717   return 0;
7718 }
7719 _ACEOF
7720 rm -f conftest.$ac_objext
7721 if { (eval echo "$as_me:7721: \"$ac_compile\"") >&5
7722   (eval $ac_compile) 2>&5
7723   ac_status=$?
7724   echo "$as_me:7724: \$? = $ac_status" >&5
7725   (exit $ac_status); } &&
7726          { ac_try='test -s conftest.$ac_objext'
7727   { (eval echo "$as_me:7727: \"$ac_try\"") >&5
7728   (eval $ac_try) 2>&5
7729   ac_status=$?
7730   echo "$as_me:7730: \$? = $ac_status" >&5
7731   (exit $ac_status); }; }; then
7732
7733         cf_cv_term_header="$cf_test"
7734 else
7735   echo "$as_me: failed program was:" >&5
7736 cat conftest.$ac_ext >&5
7737
7738         cf_cv_term_header=unknown
7739
7740 fi
7741 rm -f conftest.$ac_objext conftest.$ac_ext
7742         test "$cf_cv_term_header" != unknown && break
7743 done
7744
7745 fi
7746 echo "$as_me:7746: result: $cf_cv_term_header" >&5
7747 echo "${ECHO_T}$cf_cv_term_header" >&6
7748
7749 # Set definitions to allow ifdef'ing to accommodate subdirectories
7750
7751 case $cf_cv_term_header in
7752 (*term.h)
7753
7754 cat >>confdefs.h <<\EOF
7755 #define HAVE_TERM_H 1
7756 EOF
7757
7758         ;;
7759 esac
7760
7761 case $cf_cv_term_header in
7762 (ncurses/term.h)
7763
7764 cat >>confdefs.h <<\EOF
7765 #define HAVE_NCURSES_TERM_H 1
7766 EOF
7767
7768         ;;
7769 (ncursesw/term.h)
7770
7771 cat >>confdefs.h <<\EOF
7772 #define HAVE_NCURSESW_TERM_H 1
7773 EOF
7774
7775         ;;
7776 esac
7777
7778 # some applications need this, but should check for NCURSES_VERSION
7779
7780 cat >>confdefs.h <<\EOF
7781 #define NCURSES 1
7782 EOF
7783
7784 echo "$as_me:7784: checking for ncurses version" >&5
7785 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7786 if test "${cf_cv_ncurses_version+set}" = set; then
7787   echo $ECHO_N "(cached) $ECHO_C" >&6
7788 else
7789
7790         cf_cv_ncurses_version=no
7791         cf_tempfile=out$$
7792         rm -f $cf_tempfile
7793         if test "$cross_compiling" = yes; then
7794
7795         # This will not work if the preprocessor splits the line after the
7796         # Autoconf token.  The 'unproto' program does that.
7797         cat > conftest.$ac_ext <<EOF
7798 #include <${cf_cv_ncurses_header:-curses.h}>
7799 #undef Autoconf
7800 #ifdef NCURSES_VERSION
7801 Autoconf NCURSES_VERSION
7802 #else
7803 #ifdef __NCURSES_H
7804 Autoconf "old"
7805 #endif
7806 ;
7807 #endif
7808 EOF
7809         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7810         { (eval echo "$as_me:7810: \"$cf_try\"") >&5
7811   (eval $cf_try) 2>&5
7812   ac_status=$?
7813   echo "$as_me:7813: \$? = $ac_status" >&5
7814   (exit $ac_status); }
7815         if test -f conftest.out ; then
7816                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7817                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7818                 rm -f conftest.out
7819         fi
7820
7821 else
7822   cat >conftest.$ac_ext <<_ACEOF
7823 #line 7823 "configure"
7824 #include "confdefs.h"
7825
7826 #include <${cf_cv_ncurses_header:-curses.h}>
7827 #include <stdio.h>
7828 int main(void)
7829 {
7830         FILE *fp = fopen("$cf_tempfile", "w");
7831 #ifdef NCURSES_VERSION
7832 # ifdef NCURSES_VERSION_PATCH
7833         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7834 # else
7835         fprintf(fp, "%s\n", NCURSES_VERSION);
7836 # endif
7837 #else
7838 # ifdef __NCURSES_H
7839         fprintf(fp, "old\n");
7840 # else
7841         make an error
7842 # endif
7843 #endif
7844         ${cf_cv_main_return:-return}(0);
7845 }
7846 _ACEOF
7847 rm -f conftest$ac_exeext
7848 if { (eval echo "$as_me:7848: \"$ac_link\"") >&5
7849   (eval $ac_link) 2>&5
7850   ac_status=$?
7851   echo "$as_me:7851: \$? = $ac_status" >&5
7852   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7853   { (eval echo "$as_me:7853: \"$ac_try\"") >&5
7854   (eval $ac_try) 2>&5
7855   ac_status=$?
7856   echo "$as_me:7856: \$? = $ac_status" >&5
7857   (exit $ac_status); }; }; then
7858
7859         cf_cv_ncurses_version=`cat $cf_tempfile`
7860 else
7861   echo "$as_me: program exited with status $ac_status" >&5
7862 echo "$as_me: failed program was:" >&5
7863 cat conftest.$ac_ext >&5
7864 fi
7865 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7866 fi
7867         rm -f $cf_tempfile
7868
7869 fi
7870 echo "$as_me:7870: result: $cf_cv_ncurses_version" >&5
7871 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7872 test "$cf_cv_ncurses_version" = no ||
7873 cat >>confdefs.h <<\EOF
7874 #define NCURSES 1
7875 EOF
7876
7877 cf_nculib_root=$cf_cv_screen
7878         # This works, except for the special case where we find gpm, but
7879         # ncurses is in a nonstandard location via $LIBS, and we really want
7880         # to link gpm.
7881 cf_ncurses_LIBS=""
7882 cf_ncurses_SAVE="$LIBS"
7883 echo "$as_me:7883: checking for Gpm_Open in -lgpm" >&5
7884 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7885 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7886   echo $ECHO_N "(cached) $ECHO_C" >&6
7887 else
7888   ac_check_lib_save_LIBS=$LIBS
7889 LIBS="-lgpm  $LIBS"
7890 cat >conftest.$ac_ext <<_ACEOF
7891 #line 7891 "configure"
7892 #include "confdefs.h"
7893
7894 /* Override any gcc2 internal prototype to avoid an error.  */
7895 #ifdef __cplusplus
7896 extern "C"
7897 #endif
7898 /* We use char because int might match the return type of a gcc2
7899    builtin and then its argument prototype would still apply.  */
7900 char Gpm_Open ();
7901 int
7902 main (void)
7903 {
7904 Gpm_Open ();
7905   ;
7906   return 0;
7907 }
7908 _ACEOF
7909 rm -f conftest.$ac_objext conftest$ac_exeext
7910 if { (eval echo "$as_me:7910: \"$ac_link\"") >&5
7911   (eval $ac_link) 2>&5
7912   ac_status=$?
7913   echo "$as_me:7913: \$? = $ac_status" >&5
7914   (exit $ac_status); } &&
7915          { ac_try='test -s conftest$ac_exeext'
7916   { (eval echo "$as_me:7916: \"$ac_try\"") >&5
7917   (eval $ac_try) 2>&5
7918   ac_status=$?
7919   echo "$as_me:7919: \$? = $ac_status" >&5
7920   (exit $ac_status); }; }; then
7921   ac_cv_lib_gpm_Gpm_Open=yes
7922 else
7923   echo "$as_me: failed program was:" >&5
7924 cat conftest.$ac_ext >&5
7925 ac_cv_lib_gpm_Gpm_Open=no
7926 fi
7927 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7928 LIBS=$ac_check_lib_save_LIBS
7929 fi
7930 echo "$as_me:7930: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7931 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7932 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7933   echo "$as_me:7933: checking for initscr in -lgpm" >&5
7934 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7935 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7936   echo $ECHO_N "(cached) $ECHO_C" >&6
7937 else
7938   ac_check_lib_save_LIBS=$LIBS
7939 LIBS="-lgpm  $LIBS"
7940 cat >conftest.$ac_ext <<_ACEOF
7941 #line 7941 "configure"
7942 #include "confdefs.h"
7943
7944 /* Override any gcc2 internal prototype to avoid an error.  */
7945 #ifdef __cplusplus
7946 extern "C"
7947 #endif
7948 /* We use char because int might match the return type of a gcc2
7949    builtin and then its argument prototype would still apply.  */
7950 char initscr ();
7951 int
7952 main (void)
7953 {
7954 initscr ();
7955   ;
7956   return 0;
7957 }
7958 _ACEOF
7959 rm -f conftest.$ac_objext conftest$ac_exeext
7960 if { (eval echo "$as_me:7960: \"$ac_link\"") >&5
7961   (eval $ac_link) 2>&5
7962   ac_status=$?
7963   echo "$as_me:7963: \$? = $ac_status" >&5
7964   (exit $ac_status); } &&
7965          { ac_try='test -s conftest$ac_exeext'
7966   { (eval echo "$as_me:7966: \"$ac_try\"") >&5
7967   (eval $ac_try) 2>&5
7968   ac_status=$?
7969   echo "$as_me:7969: \$? = $ac_status" >&5
7970   (exit $ac_status); }; }; then
7971   ac_cv_lib_gpm_initscr=yes
7972 else
7973   echo "$as_me: failed program was:" >&5
7974 cat conftest.$ac_ext >&5
7975 ac_cv_lib_gpm_initscr=no
7976 fi
7977 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7978 LIBS=$ac_check_lib_save_LIBS
7979 fi
7980 echo "$as_me:7980: result: $ac_cv_lib_gpm_initscr" >&5
7981 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7982 if test $ac_cv_lib_gpm_initscr = yes; then
7983   LIBS="$cf_ncurses_SAVE"
7984 else
7985   cf_ncurses_LIBS="-lgpm"
7986 fi
7987
7988 fi
7989
7990 case $host_os in
7991 (freebsd*)
7992         # This is only necessary if you are linking against an obsolete
7993         # version of ncurses (but it should do no harm, since it's static).
7994         if test "$cf_nculib_root" = ncurses ; then
7995                 echo "$as_me:7995: checking for tgoto in -lmytinfo" >&5
7996 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7997 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7998   echo $ECHO_N "(cached) $ECHO_C" >&6
7999 else
8000   ac_check_lib_save_LIBS=$LIBS
8001 LIBS="-lmytinfo  $LIBS"
8002 cat >conftest.$ac_ext <<_ACEOF
8003 #line 8003 "configure"
8004 #include "confdefs.h"
8005
8006 /* Override any gcc2 internal prototype to avoid an error.  */
8007 #ifdef __cplusplus
8008 extern "C"
8009 #endif
8010 /* We use char because int might match the return type of a gcc2
8011    builtin and then its argument prototype would still apply.  */
8012 char tgoto ();
8013 int
8014 main (void)
8015 {
8016 tgoto ();
8017   ;
8018   return 0;
8019 }
8020 _ACEOF
8021 rm -f conftest.$ac_objext conftest$ac_exeext
8022 if { (eval echo "$as_me:8022: \"$ac_link\"") >&5
8023   (eval $ac_link) 2>&5
8024   ac_status=$?
8025   echo "$as_me:8025: \$? = $ac_status" >&5
8026   (exit $ac_status); } &&
8027          { ac_try='test -s conftest$ac_exeext'
8028   { (eval echo "$as_me:8028: \"$ac_try\"") >&5
8029   (eval $ac_try) 2>&5
8030   ac_status=$?
8031   echo "$as_me:8031: \$? = $ac_status" >&5
8032   (exit $ac_status); }; }; then
8033   ac_cv_lib_mytinfo_tgoto=yes
8034 else
8035   echo "$as_me: failed program was:" >&5
8036 cat conftest.$ac_ext >&5
8037 ac_cv_lib_mytinfo_tgoto=no
8038 fi
8039 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8040 LIBS=$ac_check_lib_save_LIBS
8041 fi
8042 echo "$as_me:8042: result: $ac_cv_lib_mytinfo_tgoto" >&5
8043 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8044 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8045   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8046 fi
8047
8048         fi
8049         ;;
8050 esac
8051
8052 cf_add_libs="$cf_ncurses_LIBS"
8053 # Filter out duplicates - this happens with badly-designed ".pc" files...
8054 for cf_add_1lib in $LIBS
8055 do
8056         for cf_add_2lib in $cf_add_libs
8057         do
8058                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8059                 then
8060                         cf_add_1lib=
8061                         break
8062                 fi
8063         done
8064         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8065 done
8066 LIBS="$cf_add_libs"
8067
8068 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8069 then
8070
8071 cf_add_libs="-l$cf_nculib_root"
8072 # Filter out duplicates - this happens with badly-designed ".pc" files...
8073 for cf_add_1lib in $LIBS
8074 do
8075         for cf_add_2lib in $cf_add_libs
8076         do
8077                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8078                 then
8079                         cf_add_1lib=
8080                         break
8081                 fi
8082         done
8083         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8084 done
8085 LIBS="$cf_add_libs"
8086
8087 else
8088
8089         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8090         cf_libdir=""
8091         echo "$as_me:8091: checking for initscr" >&5
8092 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8093 if test "${ac_cv_func_initscr+set}" = set; then
8094   echo $ECHO_N "(cached) $ECHO_C" >&6
8095 else
8096   cat >conftest.$ac_ext <<_ACEOF
8097 #line 8097 "configure"
8098 #include "confdefs.h"
8099 /* System header to define __stub macros and hopefully few prototypes,
8100     which can conflict with char initscr (); below.  */
8101 #include <assert.h>
8102 /* Override any gcc2 internal prototype to avoid an error.  */
8103 #ifdef __cplusplus
8104 extern "C"
8105 #endif
8106 /* We use char because int might match the return type of a gcc2
8107    builtin and then its argument prototype would still apply.  */
8108 char initscr ();
8109 char (*f) ();
8110
8111 int
8112 main (void)
8113 {
8114 /* The GNU C library defines this for functions which it implements
8115     to always fail with ENOSYS.  Some functions are actually named
8116     something starting with __ and the normal name is an alias.  */
8117 #if defined (__stub_initscr) || defined (__stub___initscr)
8118 choke me
8119 #else
8120 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8121 #endif
8122
8123   ;
8124   return 0;
8125 }
8126 _ACEOF
8127 rm -f conftest.$ac_objext conftest$ac_exeext
8128 if { (eval echo "$as_me:8128: \"$ac_link\"") >&5
8129   (eval $ac_link) 2>&5
8130   ac_status=$?
8131   echo "$as_me:8131: \$? = $ac_status" >&5
8132   (exit $ac_status); } &&
8133          { ac_try='test -s conftest$ac_exeext'
8134   { (eval echo "$as_me:8134: \"$ac_try\"") >&5
8135   (eval $ac_try) 2>&5
8136   ac_status=$?
8137   echo "$as_me:8137: \$? = $ac_status" >&5
8138   (exit $ac_status); }; }; then
8139   ac_cv_func_initscr=yes
8140 else
8141   echo "$as_me: failed program was:" >&5
8142 cat conftest.$ac_ext >&5
8143 ac_cv_func_initscr=no
8144 fi
8145 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8146 fi
8147 echo "$as_me:8147: result: $ac_cv_func_initscr" >&5
8148 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8149 if test $ac_cv_func_initscr = yes; then
8150   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8151 else
8152
8153                 cf_save_LIBS="$LIBS"
8154                 echo "$as_me:8154: checking for initscr in -l$cf_nculib_root" >&5
8155 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8156                 LIBS="-l$cf_nculib_root $LIBS"
8157                 cat >conftest.$ac_ext <<_ACEOF
8158 #line 8158 "configure"
8159 #include "confdefs.h"
8160 #include <${cf_cv_ncurses_header:-curses.h}>
8161 int
8162 main (void)
8163 {
8164 initscr()
8165   ;
8166   return 0;
8167 }
8168 _ACEOF
8169 rm -f conftest.$ac_objext conftest$ac_exeext
8170 if { (eval echo "$as_me:8170: \"$ac_link\"") >&5
8171   (eval $ac_link) 2>&5
8172   ac_status=$?
8173   echo "$as_me:8173: \$? = $ac_status" >&5
8174   (exit $ac_status); } &&
8175          { ac_try='test -s conftest$ac_exeext'
8176   { (eval echo "$as_me:8176: \"$ac_try\"") >&5
8177   (eval $ac_try) 2>&5
8178   ac_status=$?
8179   echo "$as_me:8179: \$? = $ac_status" >&5
8180   (exit $ac_status); }; }; then
8181   echo "$as_me:8181: result: yes" >&5
8182 echo "${ECHO_T}yes" >&6
8183                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8184
8185 else
8186   echo "$as_me: failed program was:" >&5
8187 cat conftest.$ac_ext >&5
8188 echo "$as_me:8188: result: no" >&5
8189 echo "${ECHO_T}no" >&6
8190
8191 cf_search=
8192 cf_library_path_list=""
8193 if test -n "${LDFLAGS}${LIBS}" ; then
8194         for cf_library_path in $LDFLAGS $LIBS
8195         do
8196                 case $cf_library_path in
8197                 (-L*)
8198                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8199
8200 test "x$cf_library_path" != "xNONE" && \
8201 test -d "$cf_library_path" && \
8202  {
8203         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8204         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8205         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8206         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8207         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8208         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"
8209 }
8210
8211                         cf_library_path_list="$cf_library_path_list $cf_search"
8212                         ;;
8213                 esac
8214         done
8215 fi
8216
8217 cf_search=
8218
8219 test "x$prefix" != "xNONE" && \
8220 test -d "$prefix" && \
8221  {
8222         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8223         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8224         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8225         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8226         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8227         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8228 }
8229
8230 for cf_subdir_prefix in \
8231         /usr \
8232         /usr/local \
8233         /usr/pkg \
8234         /opt \
8235         /opt/local \
8236         $HOME
8237 do
8238
8239 test "x$cf_subdir_prefix" != "x$prefix" && \
8240 test -d "$cf_subdir_prefix" && \
8241 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8242         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8243         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8244         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8245         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8246         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8247         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"
8248 }
8249
8250 done
8251
8252 cf_search="$cf_library_path_list $cf_search"
8253
8254                         for cf_libdir in $cf_search
8255                         do
8256                                 echo "$as_me:8256: checking for -l$cf_nculib_root in $cf_libdir" >&5
8257 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8258                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8259                                 cat >conftest.$ac_ext <<_ACEOF
8260 #line 8260 "configure"
8261 #include "confdefs.h"
8262 #include <${cf_cv_ncurses_header:-curses.h}>
8263 int
8264 main (void)
8265 {
8266 initscr()
8267   ;
8268   return 0;
8269 }
8270 _ACEOF
8271 rm -f conftest.$ac_objext conftest$ac_exeext
8272 if { (eval echo "$as_me:8272: \"$ac_link\"") >&5
8273   (eval $ac_link) 2>&5
8274   ac_status=$?
8275   echo "$as_me:8275: \$? = $ac_status" >&5
8276   (exit $ac_status); } &&
8277          { ac_try='test -s conftest$ac_exeext'
8278   { (eval echo "$as_me:8278: \"$ac_try\"") >&5
8279   (eval $ac_try) 2>&5
8280   ac_status=$?
8281   echo "$as_me:8281: \$? = $ac_status" >&5
8282   (exit $ac_status); }; }; then
8283   echo "$as_me:8283: result: yes" >&5
8284 echo "${ECHO_T}yes" >&6
8285                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8286                                          break
8287 else
8288   echo "$as_me: failed program was:" >&5
8289 cat conftest.$ac_ext >&5
8290 echo "$as_me:8290: result: no" >&5
8291 echo "${ECHO_T}no" >&6
8292                                          LIBS="$cf_save_LIBS"
8293 fi
8294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8295                         done
8296
8297 fi
8298 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8299
8300 fi
8301
8302 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8303
8304 if test $cf_found_library = no ; then
8305         { { echo "$as_me:8305: error: Cannot link $cf_nculib_root library" >&5
8306 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8307    { (exit 1); exit 1; }; }
8308 fi
8309
8310 fi
8311
8312 if test -n "$cf_ncurses_LIBS" ; then
8313         echo "$as_me:8313: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8314 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8315         cf_ncurses_SAVE="$LIBS"
8316         for p in $cf_ncurses_LIBS ; do
8317                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8318                 if test "$q" != "$LIBS" ; then
8319                         LIBS="$q"
8320                 fi
8321         done
8322         cat >conftest.$ac_ext <<_ACEOF
8323 #line 8323 "configure"
8324 #include "confdefs.h"
8325 #include <${cf_cv_ncurses_header:-curses.h}>
8326 int
8327 main (void)
8328 {
8329 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8330   ;
8331   return 0;
8332 }
8333 _ACEOF
8334 rm -f conftest.$ac_objext conftest$ac_exeext
8335 if { (eval echo "$as_me:8335: \"$ac_link\"") >&5
8336   (eval $ac_link) 2>&5
8337   ac_status=$?
8338   echo "$as_me:8338: \$? = $ac_status" >&5
8339   (exit $ac_status); } &&
8340          { ac_try='test -s conftest$ac_exeext'
8341   { (eval echo "$as_me:8341: \"$ac_try\"") >&5
8342   (eval $ac_try) 2>&5
8343   ac_status=$?
8344   echo "$as_me:8344: \$? = $ac_status" >&5
8345   (exit $ac_status); }; }; then
8346   echo "$as_me:8346: result: yes" >&5
8347 echo "${ECHO_T}yes" >&6
8348 else
8349   echo "$as_me: failed program was:" >&5
8350 cat conftest.$ac_ext >&5
8351 echo "$as_me:8351: result: no" >&5
8352 echo "${ECHO_T}no" >&6
8353                  LIBS="$cf_ncurses_SAVE"
8354 fi
8355 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8356 fi
8357
8358 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8359
8360 cat >>confdefs.h <<EOF
8361 #define $cf_nculib_ROOT 1
8362 EOF
8363
8364         fi
8365 else
8366         NCURSES_CONFIG=none
8367 fi
8368
8369         ;;
8370 (ncurses*)
8371
8372 cf_ncuconfig_root=$cf_cv_screen
8373 cf_have_ncuconfig=no
8374
8375 if test "x${PKG_CONFIG:=none}" != xnone; then
8376         echo "$as_me:8376: checking pkg-config for $cf_ncuconfig_root" >&5
8377 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8378         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8379                 echo "$as_me:8379: result: yes" >&5
8380 echo "${ECHO_T}yes" >&6
8381
8382                 echo "$as_me:8382: checking if the $cf_ncuconfig_root package files work" >&5
8383 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8384                 cf_have_ncuconfig=unknown
8385
8386                 cf_save_CPPFLAGS="$CPPFLAGS"
8387                 cf_save_LIBS="$LIBS"
8388
8389                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8390
8391 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8392 # Filter out duplicates - this happens with badly-designed ".pc" files...
8393 for cf_add_1lib in $LIBS
8394 do
8395         for cf_add_2lib in $cf_add_libs
8396         do
8397                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8398                 then
8399                         cf_add_1lib=
8400                         break
8401                 fi
8402         done
8403         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8404 done
8405 LIBS="$cf_add_libs"
8406
8407                 cat >conftest.$ac_ext <<_ACEOF
8408 #line 8408 "configure"
8409 #include "confdefs.h"
8410 #include <${cf_cv_ncurses_header:-curses.h}>
8411 int
8412 main (void)
8413 {
8414 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8415   ;
8416   return 0;
8417 }
8418 _ACEOF
8419 rm -f conftest.$ac_objext conftest$ac_exeext
8420 if { (eval echo "$as_me:8420: \"$ac_link\"") >&5
8421   (eval $ac_link) 2>&5
8422   ac_status=$?
8423   echo "$as_me:8423: \$? = $ac_status" >&5
8424   (exit $ac_status); } &&
8425          { ac_try='test -s conftest$ac_exeext'
8426   { (eval echo "$as_me:8426: \"$ac_try\"") >&5
8427   (eval $ac_try) 2>&5
8428   ac_status=$?
8429   echo "$as_me:8429: \$? = $ac_status" >&5
8430   (exit $ac_status); }; }; then
8431   if test "$cross_compiling" = yes; then
8432   cf_have_ncuconfig=maybe
8433 else
8434   cat >conftest.$ac_ext <<_ACEOF
8435 #line 8435 "configure"
8436 #include "confdefs.h"
8437 #include <${cf_cv_ncurses_header:-curses.h}>
8438                                 int main(void)
8439                                 { char *xx = curses_version(); return (xx == 0); }
8440 _ACEOF
8441 rm -f conftest$ac_exeext
8442 if { (eval echo "$as_me:8442: \"$ac_link\"") >&5
8443   (eval $ac_link) 2>&5
8444   ac_status=$?
8445   echo "$as_me:8445: \$? = $ac_status" >&5
8446   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8447   { (eval echo "$as_me:8447: \"$ac_try\"") >&5
8448   (eval $ac_try) 2>&5
8449   ac_status=$?
8450   echo "$as_me:8450: \$? = $ac_status" >&5
8451   (exit $ac_status); }; }; then
8452   cf_have_ncuconfig=yes
8453 else
8454   echo "$as_me: program exited with status $ac_status" >&5
8455 echo "$as_me: failed program was:" >&5
8456 cat conftest.$ac_ext >&5
8457 cf_have_ncuconfig=no
8458 fi
8459 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8460 fi
8461 else
8462   echo "$as_me: failed program was:" >&5
8463 cat conftest.$ac_ext >&5
8464 cf_have_ncuconfig=no
8465 fi
8466 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8467                 echo "$as_me:8467: result: $cf_have_ncuconfig" >&5
8468 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8469                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8470                 if test "$cf_have_ncuconfig" != "yes"
8471                 then
8472                         CPPFLAGS="$cf_save_CPPFLAGS"
8473                         LIBS="$cf_save_LIBS"
8474                         NCURSES_CONFIG_PKG=none
8475                 else
8476
8477 cat >>confdefs.h <<\EOF
8478 #define NCURSES 1
8479 EOF
8480
8481                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8482                 fi
8483
8484 echo "$as_me:8484: checking for terminfo header" >&5
8485 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8486 if test "${cf_cv_term_header+set}" = set; then
8487   echo $ECHO_N "(cached) $ECHO_C" >&6
8488 else
8489
8490 case ${cf_cv_ncurses_header} in
8491 (*/ncurses.h|*/ncursesw.h)
8492         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8493         ;;
8494 (*)
8495         cf_term_header=term.h
8496         ;;
8497 esac
8498
8499 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8500 do
8501 cat >conftest.$ac_ext <<_ACEOF
8502 #line 8502 "configure"
8503 #include "confdefs.h"
8504 #include <stdio.h>
8505 #include <${cf_cv_ncurses_header:-curses.h}>
8506 #include <$cf_test>
8507
8508 int
8509 main (void)
8510 {
8511 int x = auto_left_margin
8512   ;
8513   return 0;
8514 }
8515 _ACEOF
8516 rm -f conftest.$ac_objext
8517 if { (eval echo "$as_me:8517: \"$ac_compile\"") >&5
8518   (eval $ac_compile) 2>&5
8519   ac_status=$?
8520   echo "$as_me:8520: \$? = $ac_status" >&5
8521   (exit $ac_status); } &&
8522          { ac_try='test -s conftest.$ac_objext'
8523   { (eval echo "$as_me:8523: \"$ac_try\"") >&5
8524   (eval $ac_try) 2>&5
8525   ac_status=$?
8526   echo "$as_me:8526: \$? = $ac_status" >&5
8527   (exit $ac_status); }; }; then
8528
8529         cf_cv_term_header="$cf_test"
8530 else
8531   echo "$as_me: failed program was:" >&5
8532 cat conftest.$ac_ext >&5
8533
8534         cf_cv_term_header=unknown
8535
8536 fi
8537 rm -f conftest.$ac_objext conftest.$ac_ext
8538         test "$cf_cv_term_header" != unknown && break
8539 done
8540
8541 fi
8542 echo "$as_me:8542: result: $cf_cv_term_header" >&5
8543 echo "${ECHO_T}$cf_cv_term_header" >&6
8544
8545 # Set definitions to allow ifdef'ing to accommodate subdirectories
8546
8547 case $cf_cv_term_header in
8548 (*term.h)
8549
8550 cat >>confdefs.h <<\EOF
8551 #define HAVE_TERM_H 1
8552 EOF
8553
8554         ;;
8555 esac
8556
8557 case $cf_cv_term_header in
8558 (ncurses/term.h)
8559
8560 cat >>confdefs.h <<\EOF
8561 #define HAVE_NCURSES_TERM_H 1
8562 EOF
8563
8564         ;;
8565 (ncursesw/term.h)
8566
8567 cat >>confdefs.h <<\EOF
8568 #define HAVE_NCURSESW_TERM_H 1
8569 EOF
8570
8571         ;;
8572 esac
8573
8574         else
8575                 echo "$as_me:8575: result: no" >&5
8576 echo "${ECHO_T}no" >&6
8577                 NCURSES_CONFIG_PKG=none
8578         fi
8579 else
8580         NCURSES_CONFIG_PKG=none
8581 fi
8582
8583 if test "x$cf_have_ncuconfig" = "xno"; then
8584         echo "Looking for ${cf_ncuconfig_root}-config"
8585
8586 if test -n "$ac_tool_prefix"; then
8587   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8588   do
8589     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8590 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8591 echo "$as_me:8591: checking for $ac_word" >&5
8592 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8593 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8594   echo $ECHO_N "(cached) $ECHO_C" >&6
8595 else
8596   if test -n "$NCURSES_CONFIG"; then
8597   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8598 else
8599   ac_save_IFS=$IFS; IFS=$ac_path_separator
8600 ac_dummy="$PATH"
8601 for ac_dir in $ac_dummy; do
8602   IFS=$ac_save_IFS
8603   test -z "$ac_dir" && ac_dir=.
8604   $as_executable_p "$ac_dir/$ac_word" || continue
8605 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8606 echo "$as_me:8606: found $ac_dir/$ac_word" >&5
8607 break
8608 done
8609
8610 fi
8611 fi
8612 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8613 if test -n "$NCURSES_CONFIG"; then
8614   echo "$as_me:8614: result: $NCURSES_CONFIG" >&5
8615 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8616 else
8617   echo "$as_me:8617: result: no" >&5
8618 echo "${ECHO_T}no" >&6
8619 fi
8620
8621     test -n "$NCURSES_CONFIG" && break
8622   done
8623 fi
8624 if test -z "$NCURSES_CONFIG"; then
8625   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8626   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8627 do
8628   # Extract the first word of "$ac_prog", so it can be a program name with args.
8629 set dummy $ac_prog; ac_word=$2
8630 echo "$as_me:8630: checking for $ac_word" >&5
8631 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8632 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8633   echo $ECHO_N "(cached) $ECHO_C" >&6
8634 else
8635   if test -n "$ac_ct_NCURSES_CONFIG"; then
8636   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8637 else
8638   ac_save_IFS=$IFS; IFS=$ac_path_separator
8639 ac_dummy="$PATH"
8640 for ac_dir in $ac_dummy; do
8641   IFS=$ac_save_IFS
8642   test -z "$ac_dir" && ac_dir=.
8643   $as_executable_p "$ac_dir/$ac_word" || continue
8644 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8645 echo "$as_me:8645: found $ac_dir/$ac_word" >&5
8646 break
8647 done
8648
8649 fi
8650 fi
8651 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8652 if test -n "$ac_ct_NCURSES_CONFIG"; then
8653   echo "$as_me:8653: result: $ac_ct_NCURSES_CONFIG" >&5
8654 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8655 else
8656   echo "$as_me:8656: result: no" >&5
8657 echo "${ECHO_T}no" >&6
8658 fi
8659
8660   test -n "$ac_ct_NCURSES_CONFIG" && break
8661 done
8662 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8663
8664   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8665 fi
8666
8667         if test "$NCURSES_CONFIG" != none ; then
8668
8669                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8670
8671 cf_add_libs="`$NCURSES_CONFIG --libs`"
8672 # Filter out duplicates - this happens with badly-designed ".pc" files...
8673 for cf_add_1lib in $LIBS
8674 do
8675         for cf_add_2lib in $cf_add_libs
8676         do
8677                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8678                 then
8679                         cf_add_1lib=
8680                         break
8681                 fi
8682         done
8683         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8684 done
8685 LIBS="$cf_add_libs"
8686
8687                 # even with config script, some packages use no-override for curses.h
8688
8689 echo "$as_me:8689: checking if we have identified curses headers" >&5
8690 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8691 if test "${cf_cv_ncurses_header+set}" = set; then
8692   echo $ECHO_N "(cached) $ECHO_C" >&6
8693 else
8694
8695 cf_cv_ncurses_header=none
8696 for cf_header in \
8697         ncurses.h $cf_cv_screen/ncurses.h \
8698         curses.h $cf_cv_screen/curses.h
8699 do
8700 cat >conftest.$ac_ext <<_ACEOF
8701 #line 8701 "configure"
8702 #include "confdefs.h"
8703 #include <${cf_header}>
8704 int
8705 main (void)
8706 {
8707 initscr(); tgoto("?", 0,0)
8708   ;
8709   return 0;
8710 }
8711 _ACEOF
8712 rm -f conftest.$ac_objext
8713 if { (eval echo "$as_me:8713: \"$ac_compile\"") >&5
8714   (eval $ac_compile) 2>&5
8715   ac_status=$?
8716   echo "$as_me:8716: \$? = $ac_status" >&5
8717   (exit $ac_status); } &&
8718          { ac_try='test -s conftest.$ac_objext'
8719   { (eval echo "$as_me:8719: \"$ac_try\"") >&5
8720   (eval $ac_try) 2>&5
8721   ac_status=$?
8722   echo "$as_me:8722: \$? = $ac_status" >&5
8723   (exit $ac_status); }; }; then
8724   cf_cv_ncurses_header=$cf_header; break
8725 else
8726   echo "$as_me: failed program was:" >&5
8727 cat conftest.$ac_ext >&5
8728 fi
8729 rm -f conftest.$ac_objext conftest.$ac_ext
8730 done
8731
8732 fi
8733 echo "$as_me:8733: result: $cf_cv_ncurses_header" >&5
8734 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8735
8736 if test "$cf_cv_ncurses_header" = none ; then
8737         { { echo "$as_me:8737: error: No curses header-files found" >&5
8738 echo "$as_me: error: No curses header-files found" >&2;}
8739    { (exit 1); exit 1; }; }
8740 fi
8741
8742 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8743
8744 for ac_header in $cf_cv_ncurses_header
8745 do
8746 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8747 echo "$as_me:8747: checking for $ac_header" >&5
8748 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8749 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8750   echo $ECHO_N "(cached) $ECHO_C" >&6
8751 else
8752   cat >conftest.$ac_ext <<_ACEOF
8753 #line 8753 "configure"
8754 #include "confdefs.h"
8755 #include <$ac_header>
8756 _ACEOF
8757 if { (eval echo "$as_me:8757: \"$ac_cpp conftest.$ac_ext\"") >&5
8758   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8759   ac_status=$?
8760   egrep -v '^ *\+' conftest.er1 >conftest.err
8761   rm -f conftest.er1
8762   cat conftest.err >&5
8763   echo "$as_me:8763: \$? = $ac_status" >&5
8764   (exit $ac_status); } >/dev/null; then
8765   if test -s conftest.err; then
8766     ac_cpp_err=$ac_c_preproc_warn_flag
8767   else
8768     ac_cpp_err=
8769   fi
8770 else
8771   ac_cpp_err=yes
8772 fi
8773 if test -z "$ac_cpp_err"; then
8774   eval "$as_ac_Header=yes"
8775 else
8776   echo "$as_me: failed program was:" >&5
8777   cat conftest.$ac_ext >&5
8778   eval "$as_ac_Header=no"
8779 fi
8780 rm -f conftest.err conftest.$ac_ext
8781 fi
8782 echo "$as_me:8782: result: `eval echo '${'$as_ac_Header'}'`" >&5
8783 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8784 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8785   cat >>confdefs.h <<EOF
8786 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8787 EOF
8788
8789 fi
8790 done
8791
8792 cat >>confdefs.h <<\EOF
8793 #define NCURSES 1
8794 EOF
8795
8796 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8797
8798                 cat >>confdefs.h <<EOF
8799 #define $cf_nculib_ROOT 1
8800 EOF
8801
8802                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8803
8804         else
8805
8806 cf_ncuhdr_root=$cf_cv_screen
8807
8808 test -n "$cf_cv_curses_dir" && \
8809 test "$cf_cv_curses_dir" != "no" && { \
8810
8811 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8812   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8813   do
8814         while test $cf_add_incdir != /usr/include
8815         do
8816           if test -d $cf_add_incdir
8817           then
8818                 cf_have_incdir=no
8819                 if test -n "$CFLAGS$CPPFLAGS" ; then
8820                   # a loop is needed to ensure we can add subdirs of existing dirs
8821                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8822                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8823                           cf_have_incdir=yes; break
8824                         fi
8825                   done
8826                 fi
8827
8828                 if test "$cf_have_incdir" = no ; then
8829                   if test "$cf_add_incdir" = /usr/local/include ; then
8830                         if test "$GCC" = yes
8831                         then
8832                           cf_save_CPPFLAGS=$CPPFLAGS
8833                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8834                           cat >conftest.$ac_ext <<_ACEOF
8835 #line 8835 "configure"
8836 #include "confdefs.h"
8837 #include <stdio.h>
8838 int
8839 main (void)
8840 {
8841 printf("Hello")
8842   ;
8843   return 0;
8844 }
8845 _ACEOF
8846 rm -f conftest.$ac_objext
8847 if { (eval echo "$as_me:8847: \"$ac_compile\"") >&5
8848   (eval $ac_compile) 2>&5
8849   ac_status=$?
8850   echo "$as_me:8850: \$? = $ac_status" >&5
8851   (exit $ac_status); } &&
8852          { ac_try='test -s conftest.$ac_objext'
8853   { (eval echo "$as_me:8853: \"$ac_try\"") >&5
8854   (eval $ac_try) 2>&5
8855   ac_status=$?
8856   echo "$as_me:8856: \$? = $ac_status" >&5
8857   (exit $ac_status); }; }; then
8858   :
8859 else
8860   echo "$as_me: failed program was:" >&5
8861 cat conftest.$ac_ext >&5
8862 cf_have_incdir=yes
8863 fi
8864 rm -f conftest.$ac_objext conftest.$ac_ext
8865                           CPPFLAGS=$cf_save_CPPFLAGS
8866                         fi
8867                   fi
8868                 fi
8869
8870                 if test "$cf_have_incdir" = no ; then
8871                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8872
8873 echo "${as_me:-configure}:8873: testing adding $cf_add_incdir to include-path ..." 1>&5
8874
8875                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8876
8877                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8878                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8879                   cf_add_incdir="$cf_top_incdir"
8880                 else
8881                   break
8882                 fi
8883           else
8884                 break
8885           fi
8886         done
8887   done
8888 fi
8889
8890 }
8891
8892 echo "$as_me:8892: checking for $cf_ncuhdr_root header in include-path" >&5
8893 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8894 if test "${cf_cv_ncurses_h+set}" = set; then
8895   echo $ECHO_N "(cached) $ECHO_C" >&6
8896 else
8897
8898         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8899         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8900         for cf_header in $cf_header_list
8901         do
8902
8903         cat >conftest.$ac_ext <<_ACEOF
8904 #line 8904 "configure"
8905 #include "confdefs.h"
8906
8907 #include <$cf_header>
8908 int
8909 main (void)
8910 {
8911
8912 #ifdef NCURSES_VERSION
8913
8914 printf("%s\n", NCURSES_VERSION);
8915 #else
8916 #ifdef __NCURSES_H
8917 printf("old\n");
8918 #else
8919         make an error
8920 #endif
8921 #endif
8922
8923   ;
8924   return 0;
8925 }
8926 _ACEOF
8927 rm -f conftest.$ac_objext
8928 if { (eval echo "$as_me:8928: \"$ac_compile\"") >&5
8929   (eval $ac_compile) 2>&5
8930   ac_status=$?
8931   echo "$as_me:8931: \$? = $ac_status" >&5
8932   (exit $ac_status); } &&
8933          { ac_try='test -s conftest.$ac_objext'
8934   { (eval echo "$as_me:8934: \"$ac_try\"") >&5
8935   (eval $ac_try) 2>&5
8936   ac_status=$?
8937   echo "$as_me:8937: \$? = $ac_status" >&5
8938   (exit $ac_status); }; }; then
8939   cf_cv_ncurses_h=$cf_header
8940
8941 else
8942   echo "$as_me: failed program was:" >&5
8943 cat conftest.$ac_ext >&5
8944 cf_cv_ncurses_h=no
8945 fi
8946 rm -f conftest.$ac_objext conftest.$ac_ext
8947
8948                 test "$cf_cv_ncurses_h" != no && break
8949         done
8950
8951 fi
8952 echo "$as_me:8952: result: $cf_cv_ncurses_h" >&5
8953 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8954
8955 if test "$cf_cv_ncurses_h" != no ; then
8956         cf_cv_ncurses_header=$cf_cv_ncurses_h
8957 else
8958
8959 echo "$as_me:8959: checking for $cf_ncuhdr_root include-path" >&5
8960 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8961 if test "${cf_cv_ncurses_h2+set}" = set; then
8962   echo $ECHO_N "(cached) $ECHO_C" >&6
8963 else
8964
8965         test -n "$verbose" && echo
8966
8967 cf_search=
8968
8969 # collect the current set of include-directories from compiler flags
8970 cf_header_path_list=""
8971 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8972         for cf_header_path in $CPPFLAGS $CFLAGS
8973         do
8974                 case $cf_header_path in
8975                 (-I*)
8976                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8977
8978 test "x$cf_header_path" != "xNONE" && \
8979 test -d "$cf_header_path" && \
8980  {
8981         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8982         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8983         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8984         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8985         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8986         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"
8987 }
8988
8989                         cf_header_path_list="$cf_header_path_list $cf_search"
8990                         ;;
8991                 esac
8992         done
8993 fi
8994
8995 # add the variations for the package we are looking for
8996
8997 cf_search=
8998
8999 test "x$prefix" != "xNONE" && \
9000 test -d "$prefix" && \
9001  {
9002         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9003         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9004         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9005         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9006         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9007         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9008 }
9009
9010 for cf_subdir_prefix in \
9011         /usr \
9012         /usr/local \
9013         /usr/pkg \
9014         /opt \
9015         /opt/local \
9016         $HOME
9017 do
9018
9019 test "x$cf_subdir_prefix" != "x$prefix" && \
9020 test -d "$cf_subdir_prefix" && \
9021 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9022         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9023         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9024         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9025         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9026         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9027         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"
9028 }
9029
9030 done
9031
9032 test "$includedir" != NONE && \
9033 test "$includedir" != "/usr/include" && \
9034 test -d "$includedir" && {
9035         test -d $includedir &&    cf_search="$cf_search $includedir"
9036         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9037 }
9038
9039 test "$oldincludedir" != NONE && \
9040 test "$oldincludedir" != "/usr/include" && \
9041 test -d "$oldincludedir" && {
9042         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9043         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9044 }
9045
9046 cf_search="$cf_search $cf_header_path_list"
9047
9048         test -n "$verbose" && echo search path $cf_search
9049         cf_save2_CPPFLAGS="$CPPFLAGS"
9050         for cf_incdir in $cf_search
9051         do
9052
9053 if test -n "$cf_incdir" ; then
9054   for cf_add_incdir in $cf_incdir
9055   do
9056         while test $cf_add_incdir != /usr/include
9057         do
9058           if test -d $cf_add_incdir
9059           then
9060                 cf_have_incdir=no
9061                 if test -n "$CFLAGS$CPPFLAGS" ; then
9062                   # a loop is needed to ensure we can add subdirs of existing dirs
9063                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9064                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9065                           cf_have_incdir=yes; break
9066                         fi
9067                   done
9068                 fi
9069
9070                 if test "$cf_have_incdir" = no ; then
9071                   if test "$cf_add_incdir" = /usr/local/include ; then
9072                         if test "$GCC" = yes
9073                         then
9074                           cf_save_CPPFLAGS=$CPPFLAGS
9075                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9076                           cat >conftest.$ac_ext <<_ACEOF
9077 #line 9077 "configure"
9078 #include "confdefs.h"
9079 #include <stdio.h>
9080 int
9081 main (void)
9082 {
9083 printf("Hello")
9084   ;
9085   return 0;
9086 }
9087 _ACEOF
9088 rm -f conftest.$ac_objext
9089 if { (eval echo "$as_me:9089: \"$ac_compile\"") >&5
9090   (eval $ac_compile) 2>&5
9091   ac_status=$?
9092   echo "$as_me:9092: \$? = $ac_status" >&5
9093   (exit $ac_status); } &&
9094          { ac_try='test -s conftest.$ac_objext'
9095   { (eval echo "$as_me:9095: \"$ac_try\"") >&5
9096   (eval $ac_try) 2>&5
9097   ac_status=$?
9098   echo "$as_me:9098: \$? = $ac_status" >&5
9099   (exit $ac_status); }; }; then
9100   :
9101 else
9102   echo "$as_me: failed program was:" >&5
9103 cat conftest.$ac_ext >&5
9104 cf_have_incdir=yes
9105 fi
9106 rm -f conftest.$ac_objext conftest.$ac_ext
9107                           CPPFLAGS=$cf_save_CPPFLAGS
9108                         fi
9109                   fi
9110                 fi
9111
9112                 if test "$cf_have_incdir" = no ; then
9113                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9114
9115 echo "${as_me:-configure}:9115: testing adding $cf_add_incdir to include-path ..." 1>&5
9116
9117                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9118
9119                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9120                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9121                   cf_add_incdir="$cf_top_incdir"
9122                 else
9123                   break
9124                 fi
9125           else
9126                 break
9127           fi
9128         done
9129   done
9130 fi
9131
9132                 for cf_header in \
9133                         ncurses.h \
9134                         curses.h
9135                 do
9136
9137         cat >conftest.$ac_ext <<_ACEOF
9138 #line 9138 "configure"
9139 #include "confdefs.h"
9140
9141 #include <$cf_header>
9142 int
9143 main (void)
9144 {
9145
9146 #ifdef NCURSES_VERSION
9147
9148 printf("%s\n", NCURSES_VERSION);
9149 #else
9150 #ifdef __NCURSES_H
9151 printf("old\n");
9152 #else
9153         make an error
9154 #endif
9155 #endif
9156
9157   ;
9158   return 0;
9159 }
9160 _ACEOF
9161 rm -f conftest.$ac_objext
9162 if { (eval echo "$as_me:9162: \"$ac_compile\"") >&5
9163   (eval $ac_compile) 2>&5
9164   ac_status=$?
9165   echo "$as_me:9165: \$? = $ac_status" >&5
9166   (exit $ac_status); } &&
9167          { ac_try='test -s conftest.$ac_objext'
9168   { (eval echo "$as_me:9168: \"$ac_try\"") >&5
9169   (eval $ac_try) 2>&5
9170   ac_status=$?
9171   echo "$as_me:9171: \$? = $ac_status" >&5
9172   (exit $ac_status); }; }; then
9173   cf_cv_ncurses_h2=$cf_header
9174
9175 else
9176   echo "$as_me: failed program was:" >&5
9177 cat conftest.$ac_ext >&5
9178 cf_cv_ncurses_h2=no
9179 fi
9180 rm -f conftest.$ac_objext conftest.$ac_ext
9181
9182                         if test "$cf_cv_ncurses_h2" != no ; then
9183                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9184                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9185                                 break
9186                         fi
9187                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9188                 done
9189                 CPPFLAGS="$cf_save2_CPPFLAGS"
9190                 test "$cf_cv_ncurses_h2" != no && break
9191         done
9192         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9192: error: not found" >&5
9193 echo "$as_me: error: not found" >&2;}
9194    { (exit 1); exit 1; }; }
9195
9196 fi
9197 echo "$as_me:9197: result: $cf_cv_ncurses_h2" >&5
9198 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9199
9200         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9201         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9202         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9203                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9204         fi
9205
9206 if test -n "$cf_1st_incdir" ; then
9207   for cf_add_incdir in $cf_1st_incdir
9208   do
9209         while test $cf_add_incdir != /usr/include
9210         do
9211           if test -d $cf_add_incdir
9212           then
9213                 cf_have_incdir=no
9214                 if test -n "$CFLAGS$CPPFLAGS" ; then
9215                   # a loop is needed to ensure we can add subdirs of existing dirs
9216                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9217                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9218                           cf_have_incdir=yes; break
9219                         fi
9220                   done
9221                 fi
9222
9223                 if test "$cf_have_incdir" = no ; then
9224                   if test "$cf_add_incdir" = /usr/local/include ; then
9225                         if test "$GCC" = yes
9226                         then
9227                           cf_save_CPPFLAGS=$CPPFLAGS
9228                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9229                           cat >conftest.$ac_ext <<_ACEOF
9230 #line 9230 "configure"
9231 #include "confdefs.h"
9232 #include <stdio.h>
9233 int
9234 main (void)
9235 {
9236 printf("Hello")
9237   ;
9238   return 0;
9239 }
9240 _ACEOF
9241 rm -f conftest.$ac_objext
9242 if { (eval echo "$as_me:9242: \"$ac_compile\"") >&5
9243   (eval $ac_compile) 2>&5
9244   ac_status=$?
9245   echo "$as_me:9245: \$? = $ac_status" >&5
9246   (exit $ac_status); } &&
9247          { ac_try='test -s conftest.$ac_objext'
9248   { (eval echo "$as_me:9248: \"$ac_try\"") >&5
9249   (eval $ac_try) 2>&5
9250   ac_status=$?
9251   echo "$as_me:9251: \$? = $ac_status" >&5
9252   (exit $ac_status); }; }; then
9253   :
9254 else
9255   echo "$as_me: failed program was:" >&5
9256 cat conftest.$ac_ext >&5
9257 cf_have_incdir=yes
9258 fi
9259 rm -f conftest.$ac_objext conftest.$ac_ext
9260                           CPPFLAGS=$cf_save_CPPFLAGS
9261                         fi
9262                   fi
9263                 fi
9264
9265                 if test "$cf_have_incdir" = no ; then
9266                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9267
9268 echo "${as_me:-configure}:9268: testing adding $cf_add_incdir to include-path ..." 1>&5
9269
9270                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9271
9272                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9273                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9274                   cf_add_incdir="$cf_top_incdir"
9275                 else
9276                   break
9277                 fi
9278           else
9279                 break
9280           fi
9281         done
9282   done
9283 fi
9284
9285 fi
9286
9287 # Set definitions to allow ifdef'ing for ncurses.h
9288
9289 case $cf_cv_ncurses_header in
9290 (*ncurses.h)
9291
9292 cat >>confdefs.h <<\EOF
9293 #define HAVE_NCURSES_H 1
9294 EOF
9295
9296         ;;
9297 esac
9298
9299 case $cf_cv_ncurses_header in
9300 (ncurses/curses.h|ncurses/ncurses.h)
9301
9302 cat >>confdefs.h <<\EOF
9303 #define HAVE_NCURSES_NCURSES_H 1
9304 EOF
9305
9306         ;;
9307 (ncursesw/curses.h|ncursesw/ncurses.h)
9308
9309 cat >>confdefs.h <<\EOF
9310 #define HAVE_NCURSESW_NCURSES_H 1
9311 EOF
9312
9313         ;;
9314 esac
9315
9316 echo "$as_me:9316: checking for terminfo header" >&5
9317 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9318 if test "${cf_cv_term_header+set}" = set; then
9319   echo $ECHO_N "(cached) $ECHO_C" >&6
9320 else
9321
9322 case ${cf_cv_ncurses_header} in
9323 (*/ncurses.h|*/ncursesw.h)
9324         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9325         ;;
9326 (*)
9327         cf_term_header=term.h
9328         ;;
9329 esac
9330
9331 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9332 do
9333 cat >conftest.$ac_ext <<_ACEOF
9334 #line 9334 "configure"
9335 #include "confdefs.h"
9336 #include <stdio.h>
9337 #include <${cf_cv_ncurses_header:-curses.h}>
9338 #include <$cf_test>
9339
9340 int
9341 main (void)
9342 {
9343 int x = auto_left_margin
9344   ;
9345   return 0;
9346 }
9347 _ACEOF
9348 rm -f conftest.$ac_objext
9349 if { (eval echo "$as_me:9349: \"$ac_compile\"") >&5
9350   (eval $ac_compile) 2>&5
9351   ac_status=$?
9352   echo "$as_me:9352: \$? = $ac_status" >&5
9353   (exit $ac_status); } &&
9354          { ac_try='test -s conftest.$ac_objext'
9355   { (eval echo "$as_me:9355: \"$ac_try\"") >&5
9356   (eval $ac_try) 2>&5
9357   ac_status=$?
9358   echo "$as_me:9358: \$? = $ac_status" >&5
9359   (exit $ac_status); }; }; then
9360
9361         cf_cv_term_header="$cf_test"
9362 else
9363   echo "$as_me: failed program was:" >&5
9364 cat conftest.$ac_ext >&5
9365
9366         cf_cv_term_header=unknown
9367
9368 fi
9369 rm -f conftest.$ac_objext conftest.$ac_ext
9370         test "$cf_cv_term_header" != unknown && break
9371 done
9372
9373 fi
9374 echo "$as_me:9374: result: $cf_cv_term_header" >&5
9375 echo "${ECHO_T}$cf_cv_term_header" >&6
9376
9377 # Set definitions to allow ifdef'ing to accommodate subdirectories
9378
9379 case $cf_cv_term_header in
9380 (*term.h)
9381
9382 cat >>confdefs.h <<\EOF
9383 #define HAVE_TERM_H 1
9384 EOF
9385
9386         ;;
9387 esac
9388
9389 case $cf_cv_term_header in
9390 (ncurses/term.h)
9391
9392 cat >>confdefs.h <<\EOF
9393 #define HAVE_NCURSES_TERM_H 1
9394 EOF
9395
9396         ;;
9397 (ncursesw/term.h)
9398
9399 cat >>confdefs.h <<\EOF
9400 #define HAVE_NCURSESW_TERM_H 1
9401 EOF
9402
9403         ;;
9404 esac
9405
9406 # some applications need this, but should check for NCURSES_VERSION
9407
9408 cat >>confdefs.h <<\EOF
9409 #define NCURSES 1
9410 EOF
9411
9412 echo "$as_me:9412: checking for ncurses version" >&5
9413 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9414 if test "${cf_cv_ncurses_version+set}" = set; then
9415   echo $ECHO_N "(cached) $ECHO_C" >&6
9416 else
9417
9418         cf_cv_ncurses_version=no
9419         cf_tempfile=out$$
9420         rm -f $cf_tempfile
9421         if test "$cross_compiling" = yes; then
9422
9423         # This will not work if the preprocessor splits the line after the
9424         # Autoconf token.  The 'unproto' program does that.
9425         cat > conftest.$ac_ext <<EOF
9426 #include <${cf_cv_ncurses_header:-curses.h}>
9427 #undef Autoconf
9428 #ifdef NCURSES_VERSION
9429 Autoconf NCURSES_VERSION
9430 #else
9431 #ifdef __NCURSES_H
9432 Autoconf "old"
9433 #endif
9434 ;
9435 #endif
9436 EOF
9437         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9438         { (eval echo "$as_me:9438: \"$cf_try\"") >&5
9439   (eval $cf_try) 2>&5
9440   ac_status=$?
9441   echo "$as_me:9441: \$? = $ac_status" >&5
9442   (exit $ac_status); }
9443         if test -f conftest.out ; then
9444                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9445                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9446                 rm -f conftest.out
9447         fi
9448
9449 else
9450   cat >conftest.$ac_ext <<_ACEOF
9451 #line 9451 "configure"
9452 #include "confdefs.h"
9453
9454 #include <${cf_cv_ncurses_header:-curses.h}>
9455 #include <stdio.h>
9456 int main(void)
9457 {
9458         FILE *fp = fopen("$cf_tempfile", "w");
9459 #ifdef NCURSES_VERSION
9460 # ifdef NCURSES_VERSION_PATCH
9461         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9462 # else
9463         fprintf(fp, "%s\n", NCURSES_VERSION);
9464 # endif
9465 #else
9466 # ifdef __NCURSES_H
9467         fprintf(fp, "old\n");
9468 # else
9469         make an error
9470 # endif
9471 #endif
9472         ${cf_cv_main_return:-return}(0);
9473 }
9474 _ACEOF
9475 rm -f conftest$ac_exeext
9476 if { (eval echo "$as_me:9476: \"$ac_link\"") >&5
9477   (eval $ac_link) 2>&5
9478   ac_status=$?
9479   echo "$as_me:9479: \$? = $ac_status" >&5
9480   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9481   { (eval echo "$as_me:9481: \"$ac_try\"") >&5
9482   (eval $ac_try) 2>&5
9483   ac_status=$?
9484   echo "$as_me:9484: \$? = $ac_status" >&5
9485   (exit $ac_status); }; }; then
9486
9487         cf_cv_ncurses_version=`cat $cf_tempfile`
9488 else
9489   echo "$as_me: program exited with status $ac_status" >&5
9490 echo "$as_me: failed program was:" >&5
9491 cat conftest.$ac_ext >&5
9492 fi
9493 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9494 fi
9495         rm -f $cf_tempfile
9496
9497 fi
9498 echo "$as_me:9498: result: $cf_cv_ncurses_version" >&5
9499 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9500 test "$cf_cv_ncurses_version" = no ||
9501 cat >>confdefs.h <<\EOF
9502 #define NCURSES 1
9503 EOF
9504
9505 cf_nculib_root=$cf_cv_screen
9506         # This works, except for the special case where we find gpm, but
9507         # ncurses is in a nonstandard location via $LIBS, and we really want
9508         # to link gpm.
9509 cf_ncurses_LIBS=""
9510 cf_ncurses_SAVE="$LIBS"
9511 echo "$as_me:9511: checking for Gpm_Open in -lgpm" >&5
9512 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9513 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9514   echo $ECHO_N "(cached) $ECHO_C" >&6
9515 else
9516   ac_check_lib_save_LIBS=$LIBS
9517 LIBS="-lgpm  $LIBS"
9518 cat >conftest.$ac_ext <<_ACEOF
9519 #line 9519 "configure"
9520 #include "confdefs.h"
9521
9522 /* Override any gcc2 internal prototype to avoid an error.  */
9523 #ifdef __cplusplus
9524 extern "C"
9525 #endif
9526 /* We use char because int might match the return type of a gcc2
9527    builtin and then its argument prototype would still apply.  */
9528 char Gpm_Open ();
9529 int
9530 main (void)
9531 {
9532 Gpm_Open ();
9533   ;
9534   return 0;
9535 }
9536 _ACEOF
9537 rm -f conftest.$ac_objext conftest$ac_exeext
9538 if { (eval echo "$as_me:9538: \"$ac_link\"") >&5
9539   (eval $ac_link) 2>&5
9540   ac_status=$?
9541   echo "$as_me:9541: \$? = $ac_status" >&5
9542   (exit $ac_status); } &&
9543          { ac_try='test -s conftest$ac_exeext'
9544   { (eval echo "$as_me:9544: \"$ac_try\"") >&5
9545   (eval $ac_try) 2>&5
9546   ac_status=$?
9547   echo "$as_me:9547: \$? = $ac_status" >&5
9548   (exit $ac_status); }; }; then
9549   ac_cv_lib_gpm_Gpm_Open=yes
9550 else
9551   echo "$as_me: failed program was:" >&5
9552 cat conftest.$ac_ext >&5
9553 ac_cv_lib_gpm_Gpm_Open=no
9554 fi
9555 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9556 LIBS=$ac_check_lib_save_LIBS
9557 fi
9558 echo "$as_me:9558: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9559 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9560 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9561   echo "$as_me:9561: checking for initscr in -lgpm" >&5
9562 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9563 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9564   echo $ECHO_N "(cached) $ECHO_C" >&6
9565 else
9566   ac_check_lib_save_LIBS=$LIBS
9567 LIBS="-lgpm  $LIBS"
9568 cat >conftest.$ac_ext <<_ACEOF
9569 #line 9569 "configure"
9570 #include "confdefs.h"
9571
9572 /* Override any gcc2 internal prototype to avoid an error.  */
9573 #ifdef __cplusplus
9574 extern "C"
9575 #endif
9576 /* We use char because int might match the return type of a gcc2
9577    builtin and then its argument prototype would still apply.  */
9578 char initscr ();
9579 int
9580 main (void)
9581 {
9582 initscr ();
9583   ;
9584   return 0;
9585 }
9586 _ACEOF
9587 rm -f conftest.$ac_objext conftest$ac_exeext
9588 if { (eval echo "$as_me:9588: \"$ac_link\"") >&5
9589   (eval $ac_link) 2>&5
9590   ac_status=$?
9591   echo "$as_me:9591: \$? = $ac_status" >&5
9592   (exit $ac_status); } &&
9593          { ac_try='test -s conftest$ac_exeext'
9594   { (eval echo "$as_me:9594: \"$ac_try\"") >&5
9595   (eval $ac_try) 2>&5
9596   ac_status=$?
9597   echo "$as_me:9597: \$? = $ac_status" >&5
9598   (exit $ac_status); }; }; then
9599   ac_cv_lib_gpm_initscr=yes
9600 else
9601   echo "$as_me: failed program was:" >&5
9602 cat conftest.$ac_ext >&5
9603 ac_cv_lib_gpm_initscr=no
9604 fi
9605 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9606 LIBS=$ac_check_lib_save_LIBS
9607 fi
9608 echo "$as_me:9608: result: $ac_cv_lib_gpm_initscr" >&5
9609 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9610 if test $ac_cv_lib_gpm_initscr = yes; then
9611   LIBS="$cf_ncurses_SAVE"
9612 else
9613   cf_ncurses_LIBS="-lgpm"
9614 fi
9615
9616 fi
9617
9618 case $host_os in
9619 (freebsd*)
9620         # This is only necessary if you are linking against an obsolete
9621         # version of ncurses (but it should do no harm, since it's static).
9622         if test "$cf_nculib_root" = ncurses ; then
9623                 echo "$as_me:9623: checking for tgoto in -lmytinfo" >&5
9624 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9625 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9626   echo $ECHO_N "(cached) $ECHO_C" >&6
9627 else
9628   ac_check_lib_save_LIBS=$LIBS
9629 LIBS="-lmytinfo  $LIBS"
9630 cat >conftest.$ac_ext <<_ACEOF
9631 #line 9631 "configure"
9632 #include "confdefs.h"
9633
9634 /* Override any gcc2 internal prototype to avoid an error.  */
9635 #ifdef __cplusplus
9636 extern "C"
9637 #endif
9638 /* We use char because int might match the return type of a gcc2
9639    builtin and then its argument prototype would still apply.  */
9640 char tgoto ();
9641 int
9642 main (void)
9643 {
9644 tgoto ();
9645   ;
9646   return 0;
9647 }
9648 _ACEOF
9649 rm -f conftest.$ac_objext conftest$ac_exeext
9650 if { (eval echo "$as_me:9650: \"$ac_link\"") >&5
9651   (eval $ac_link) 2>&5
9652   ac_status=$?
9653   echo "$as_me:9653: \$? = $ac_status" >&5
9654   (exit $ac_status); } &&
9655          { ac_try='test -s conftest$ac_exeext'
9656   { (eval echo "$as_me:9656: \"$ac_try\"") >&5
9657   (eval $ac_try) 2>&5
9658   ac_status=$?
9659   echo "$as_me:9659: \$? = $ac_status" >&5
9660   (exit $ac_status); }; }; then
9661   ac_cv_lib_mytinfo_tgoto=yes
9662 else
9663   echo "$as_me: failed program was:" >&5
9664 cat conftest.$ac_ext >&5
9665 ac_cv_lib_mytinfo_tgoto=no
9666 fi
9667 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9668 LIBS=$ac_check_lib_save_LIBS
9669 fi
9670 echo "$as_me:9670: result: $ac_cv_lib_mytinfo_tgoto" >&5
9671 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9672 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9673   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9674 fi
9675
9676         fi
9677         ;;
9678 esac
9679
9680 cf_add_libs="$cf_ncurses_LIBS"
9681 # Filter out duplicates - this happens with badly-designed ".pc" files...
9682 for cf_add_1lib in $LIBS
9683 do
9684         for cf_add_2lib in $cf_add_libs
9685         do
9686                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9687                 then
9688                         cf_add_1lib=
9689                         break
9690                 fi
9691         done
9692         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9693 done
9694 LIBS="$cf_add_libs"
9695
9696 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9697 then
9698
9699 cf_add_libs="-l$cf_nculib_root"
9700 # Filter out duplicates - this happens with badly-designed ".pc" files...
9701 for cf_add_1lib in $LIBS
9702 do
9703         for cf_add_2lib in $cf_add_libs
9704         do
9705                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9706                 then
9707                         cf_add_1lib=
9708                         break
9709                 fi
9710         done
9711         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9712 done
9713 LIBS="$cf_add_libs"
9714
9715 else
9716
9717         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9718         cf_libdir=""
9719         echo "$as_me:9719: checking for initscr" >&5
9720 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9721 if test "${ac_cv_func_initscr+set}" = set; then
9722   echo $ECHO_N "(cached) $ECHO_C" >&6
9723 else
9724   cat >conftest.$ac_ext <<_ACEOF
9725 #line 9725 "configure"
9726 #include "confdefs.h"
9727 /* System header to define __stub macros and hopefully few prototypes,
9728     which can conflict with char initscr (); below.  */
9729 #include <assert.h>
9730 /* Override any gcc2 internal prototype to avoid an error.  */
9731 #ifdef __cplusplus
9732 extern "C"
9733 #endif
9734 /* We use char because int might match the return type of a gcc2
9735    builtin and then its argument prototype would still apply.  */
9736 char initscr ();
9737 char (*f) ();
9738
9739 int
9740 main (void)
9741 {
9742 /* The GNU C library defines this for functions which it implements
9743     to always fail with ENOSYS.  Some functions are actually named
9744     something starting with __ and the normal name is an alias.  */
9745 #if defined (__stub_initscr) || defined (__stub___initscr)
9746 choke me
9747 #else
9748 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9749 #endif
9750
9751   ;
9752   return 0;
9753 }
9754 _ACEOF
9755 rm -f conftest.$ac_objext conftest$ac_exeext
9756 if { (eval echo "$as_me:9756: \"$ac_link\"") >&5
9757   (eval $ac_link) 2>&5
9758   ac_status=$?
9759   echo "$as_me:9759: \$? = $ac_status" >&5
9760   (exit $ac_status); } &&
9761          { ac_try='test -s conftest$ac_exeext'
9762   { (eval echo "$as_me:9762: \"$ac_try\"") >&5
9763   (eval $ac_try) 2>&5
9764   ac_status=$?
9765   echo "$as_me:9765: \$? = $ac_status" >&5
9766   (exit $ac_status); }; }; then
9767   ac_cv_func_initscr=yes
9768 else
9769   echo "$as_me: failed program was:" >&5
9770 cat conftest.$ac_ext >&5
9771 ac_cv_func_initscr=no
9772 fi
9773 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9774 fi
9775 echo "$as_me:9775: result: $ac_cv_func_initscr" >&5
9776 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9777 if test $ac_cv_func_initscr = yes; then
9778   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9779 else
9780
9781                 cf_save_LIBS="$LIBS"
9782                 echo "$as_me:9782: checking for initscr in -l$cf_nculib_root" >&5
9783 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9784                 LIBS="-l$cf_nculib_root $LIBS"
9785                 cat >conftest.$ac_ext <<_ACEOF
9786 #line 9786 "configure"
9787 #include "confdefs.h"
9788 #include <${cf_cv_ncurses_header:-curses.h}>
9789 int
9790 main (void)
9791 {
9792 initscr()
9793   ;
9794   return 0;
9795 }
9796 _ACEOF
9797 rm -f conftest.$ac_objext conftest$ac_exeext
9798 if { (eval echo "$as_me:9798: \"$ac_link\"") >&5
9799   (eval $ac_link) 2>&5
9800   ac_status=$?
9801   echo "$as_me:9801: \$? = $ac_status" >&5
9802   (exit $ac_status); } &&
9803          { ac_try='test -s conftest$ac_exeext'
9804   { (eval echo "$as_me:9804: \"$ac_try\"") >&5
9805   (eval $ac_try) 2>&5
9806   ac_status=$?
9807   echo "$as_me:9807: \$? = $ac_status" >&5
9808   (exit $ac_status); }; }; then
9809   echo "$as_me:9809: result: yes" >&5
9810 echo "${ECHO_T}yes" >&6
9811                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9812
9813 else
9814   echo "$as_me: failed program was:" >&5
9815 cat conftest.$ac_ext >&5
9816 echo "$as_me:9816: result: no" >&5
9817 echo "${ECHO_T}no" >&6
9818
9819 cf_search=
9820 cf_library_path_list=""
9821 if test -n "${LDFLAGS}${LIBS}" ; then
9822         for cf_library_path in $LDFLAGS $LIBS
9823         do
9824                 case $cf_library_path in
9825                 (-L*)
9826                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9827
9828 test "x$cf_library_path" != "xNONE" && \
9829 test -d "$cf_library_path" && \
9830  {
9831         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9832         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9833         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9834         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9835         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9836         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"
9837 }
9838
9839                         cf_library_path_list="$cf_library_path_list $cf_search"
9840                         ;;
9841                 esac
9842         done
9843 fi
9844
9845 cf_search=
9846
9847 test "x$prefix" != "xNONE" && \
9848 test -d "$prefix" && \
9849  {
9850         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9851         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9852         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9853         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9854         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9855         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9856 }
9857
9858 for cf_subdir_prefix in \
9859         /usr \
9860         /usr/local \
9861         /usr/pkg \
9862         /opt \
9863         /opt/local \
9864         $HOME
9865 do
9866
9867 test "x$cf_subdir_prefix" != "x$prefix" && \
9868 test -d "$cf_subdir_prefix" && \
9869 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9870         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9871         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9872         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9873         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9874         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9875         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"
9876 }
9877
9878 done
9879
9880 cf_search="$cf_library_path_list $cf_search"
9881
9882                         for cf_libdir in $cf_search
9883                         do
9884                                 echo "$as_me:9884: checking for -l$cf_nculib_root in $cf_libdir" >&5
9885 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9886                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9887                                 cat >conftest.$ac_ext <<_ACEOF
9888 #line 9888 "configure"
9889 #include "confdefs.h"
9890 #include <${cf_cv_ncurses_header:-curses.h}>
9891 int
9892 main (void)
9893 {
9894 initscr()
9895   ;
9896   return 0;
9897 }
9898 _ACEOF
9899 rm -f conftest.$ac_objext conftest$ac_exeext
9900 if { (eval echo "$as_me:9900: \"$ac_link\"") >&5
9901   (eval $ac_link) 2>&5
9902   ac_status=$?
9903   echo "$as_me:9903: \$? = $ac_status" >&5
9904   (exit $ac_status); } &&
9905          { ac_try='test -s conftest$ac_exeext'
9906   { (eval echo "$as_me:9906: \"$ac_try\"") >&5
9907   (eval $ac_try) 2>&5
9908   ac_status=$?
9909   echo "$as_me:9909: \$? = $ac_status" >&5
9910   (exit $ac_status); }; }; then
9911   echo "$as_me:9911: result: yes" >&5
9912 echo "${ECHO_T}yes" >&6
9913                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9914                                          break
9915 else
9916   echo "$as_me: failed program was:" >&5
9917 cat conftest.$ac_ext >&5
9918 echo "$as_me:9918: result: no" >&5
9919 echo "${ECHO_T}no" >&6
9920                                          LIBS="$cf_save_LIBS"
9921 fi
9922 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9923                         done
9924
9925 fi
9926 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9927
9928 fi
9929
9930 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9931
9932 if test $cf_found_library = no ; then
9933         { { echo "$as_me:9933: error: Cannot link $cf_nculib_root library" >&5
9934 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9935    { (exit 1); exit 1; }; }
9936 fi
9937
9938 fi
9939
9940 if test -n "$cf_ncurses_LIBS" ; then
9941         echo "$as_me:9941: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9942 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9943         cf_ncurses_SAVE="$LIBS"
9944         for p in $cf_ncurses_LIBS ; do
9945                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9946                 if test "$q" != "$LIBS" ; then
9947                         LIBS="$q"
9948                 fi
9949         done
9950         cat >conftest.$ac_ext <<_ACEOF
9951 #line 9951 "configure"
9952 #include "confdefs.h"
9953 #include <${cf_cv_ncurses_header:-curses.h}>
9954 int
9955 main (void)
9956 {
9957 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9958   ;
9959   return 0;
9960 }
9961 _ACEOF
9962 rm -f conftest.$ac_objext conftest$ac_exeext
9963 if { (eval echo "$as_me:9963: \"$ac_link\"") >&5
9964   (eval $ac_link) 2>&5
9965   ac_status=$?
9966   echo "$as_me:9966: \$? = $ac_status" >&5
9967   (exit $ac_status); } &&
9968          { ac_try='test -s conftest$ac_exeext'
9969   { (eval echo "$as_me:9969: \"$ac_try\"") >&5
9970   (eval $ac_try) 2>&5
9971   ac_status=$?
9972   echo "$as_me:9972: \$? = $ac_status" >&5
9973   (exit $ac_status); }; }; then
9974   echo "$as_me:9974: result: yes" >&5
9975 echo "${ECHO_T}yes" >&6
9976 else
9977   echo "$as_me: failed program was:" >&5
9978 cat conftest.$ac_ext >&5
9979 echo "$as_me:9979: result: no" >&5
9980 echo "${ECHO_T}no" >&6
9981                  LIBS="$cf_ncurses_SAVE"
9982 fi
9983 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9984 fi
9985
9986 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9987
9988 cat >>confdefs.h <<EOF
9989 #define $cf_nculib_ROOT 1
9990 EOF
9991
9992         fi
9993 else
9994         NCURSES_CONFIG=none
9995 fi
9996
9997         ;;
9998 (pdcurses)
9999         echo "$as_me:9999: checking for X" >&5
10000 echo $ECHO_N "checking for X... $ECHO_C" >&6
10001
10002 # Check whether --with-x or --without-x was given.
10003 if test "${with_x+set}" = set; then
10004   withval="$with_x"
10005
10006 fi;
10007 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10008 if test "x$with_x" = xno; then
10009   # The user explicitly disabled X.
10010   have_x=disabled
10011 else
10012   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10013     # Both variables are already set.
10014     have_x=yes
10015   else
10016     if test "${ac_cv_have_x+set}" = set; then
10017   echo $ECHO_N "(cached) $ECHO_C" >&6
10018 else
10019   # One or both of the vars are not set, and there is no cached value.
10020 ac_x_includes=no ac_x_libraries=no
10021 rm -fr conftest.dir
10022 if mkdir conftest.dir; then
10023   cd conftest.dir
10024   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10025   cat >Imakefile <<'EOF'
10026 acfindx:
10027         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10028 EOF
10029   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10030     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10031     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10032     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10033     for ac_extension in a so sl dylib dll; do
10034       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10035          test -f $ac_im_libdir/libX11.$ac_extension; then
10036         ac_im_usrlibdir=$ac_im_libdir; break
10037       fi
10038     done
10039     # Screen out bogus values from the imake configuration.  They are
10040     # bogus both because they are the default anyway, and because
10041     # using them would break gcc on systems where it needs fixed includes.
10042     case $ac_im_incroot in
10043         /usr/include) ;;
10044         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10045     esac
10046     case $ac_im_usrlibdir in
10047         /usr/lib | /lib) ;;
10048         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10049     esac
10050   fi
10051   cd ..
10052   rm -fr conftest.dir
10053 fi
10054
10055 # Standard set of common directories for X headers.
10056 # Check X11 before X11Rn because it is often a symlink to the current release.
10057 ac_x_header_dirs='
10058 /usr/X11/include
10059 /usr/X11R6/include
10060 /usr/X11R5/include
10061 /usr/X11R4/include
10062
10063 /usr/include/X11
10064 /usr/include/X11R6
10065 /usr/include/X11R5
10066 /usr/include/X11R4
10067
10068 /usr/local/X11/include
10069 /usr/local/X11R6/include
10070 /usr/local/X11R5/include
10071 /usr/local/X11R4/include
10072
10073 /usr/local/include/X11
10074 /usr/local/include/X11R6
10075 /usr/local/include/X11R5
10076 /usr/local/include/X11R4
10077
10078 /usr/X386/include
10079 /usr/x386/include
10080 /usr/XFree86/include/X11
10081
10082 /usr/include
10083 /usr/local/include
10084 /usr/unsupported/include
10085 /usr/athena/include
10086 /usr/local/x11r5/include
10087 /usr/lpp/Xamples/include
10088
10089 /usr/openwin/include
10090 /usr/openwin/share/include'
10091
10092 if test "$ac_x_includes" = no; then
10093   # Guess where to find include files, by looking for Intrinsic.h.
10094   # First, try using that file with no special directory specified.
10095   cat >conftest.$ac_ext <<_ACEOF
10096 #line 10096 "configure"
10097 #include "confdefs.h"
10098 #include <X11/Intrinsic.h>
10099 _ACEOF
10100 if { (eval echo "$as_me:10100: \"$ac_cpp conftest.$ac_ext\"") >&5
10101   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10102   ac_status=$?
10103   egrep -v '^ *\+' conftest.er1 >conftest.err
10104   rm -f conftest.er1
10105   cat conftest.err >&5
10106   echo "$as_me:10106: \$? = $ac_status" >&5
10107   (exit $ac_status); } >/dev/null; then
10108   if test -s conftest.err; then
10109     ac_cpp_err=$ac_c_preproc_warn_flag
10110   else
10111     ac_cpp_err=
10112   fi
10113 else
10114   ac_cpp_err=yes
10115 fi
10116 if test -z "$ac_cpp_err"; then
10117   # We can compile using X headers with no special include directory.
10118 ac_x_includes=
10119 else
10120   echo "$as_me: failed program was:" >&5
10121   cat conftest.$ac_ext >&5
10122   for ac_dir in $ac_x_header_dirs; do
10123   if test -r "$ac_dir/X11/Intrinsic.h"; then
10124     ac_x_includes=$ac_dir
10125     break
10126   fi
10127 done
10128 fi
10129 rm -f conftest.err conftest.$ac_ext
10130 fi # $ac_x_includes = no
10131
10132 if test "$ac_x_libraries" = no; then
10133   # Check for the libraries.
10134   # See if we find them without any special options.
10135   # Don't add to $LIBS permanently.
10136   ac_save_LIBS=$LIBS
10137   LIBS="-lXt $LIBS"
10138   cat >conftest.$ac_ext <<_ACEOF
10139 #line 10139 "configure"
10140 #include "confdefs.h"
10141 #include <X11/Intrinsic.h>
10142 int
10143 main (void)
10144 {
10145 XtMalloc (0)
10146   ;
10147   return 0;
10148 }
10149 _ACEOF
10150 rm -f conftest.$ac_objext conftest$ac_exeext
10151 if { (eval echo "$as_me:10151: \"$ac_link\"") >&5
10152   (eval $ac_link) 2>&5
10153   ac_status=$?
10154   echo "$as_me:10154: \$? = $ac_status" >&5
10155   (exit $ac_status); } &&
10156          { ac_try='test -s conftest$ac_exeext'
10157   { (eval echo "$as_me:10157: \"$ac_try\"") >&5
10158   (eval $ac_try) 2>&5
10159   ac_status=$?
10160   echo "$as_me:10160: \$? = $ac_status" >&5
10161   (exit $ac_status); }; }; then
10162   LIBS=$ac_save_LIBS
10163 # We can link X programs with no special library path.
10164 ac_x_libraries=
10165 else
10166   echo "$as_me: failed program was:" >&5
10167 cat conftest.$ac_ext >&5
10168 LIBS=$ac_save_LIBS
10169 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10170 do
10171   # Don't even attempt the hair of trying to link an X program!
10172   for ac_extension in a so sl dylib dll; do
10173     if test -r $ac_dir/libXt.$ac_extension; then
10174       ac_x_libraries=$ac_dir
10175       break 2
10176     fi
10177   done
10178 done
10179 fi
10180 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10181 fi # $ac_x_libraries = no
10182
10183 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10184   # Didn't find X anywhere.  Cache the known absence of X.
10185   ac_cv_have_x="have_x=no"
10186 else
10187   # Record where we found X for the cache.
10188   ac_cv_have_x="have_x=yes \
10189                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10190 fi
10191 fi
10192
10193   fi
10194   eval "$ac_cv_have_x"
10195 fi # $with_x != no
10196
10197 if test "$have_x" != yes; then
10198   echo "$as_me:10198: result: $have_x" >&5
10199 echo "${ECHO_T}$have_x" >&6
10200   no_x=yes
10201 else
10202   # If each of the values was on the command line, it overrides each guess.
10203   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10204   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10205   # Update the cache value to reflect the command line values.
10206   ac_cv_have_x="have_x=yes \
10207                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10208   echo "$as_me:10208: result: libraries $x_libraries, headers $x_includes" >&5
10209 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10210 fi
10211
10212 if test "$no_x" = yes; then
10213   # Not all programs may use this symbol, but it does not hurt to define it.
10214
10215 cat >>confdefs.h <<\EOF
10216 #define X_DISPLAY_MISSING 1
10217 EOF
10218
10219   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10220 else
10221   if test -n "$x_includes"; then
10222     X_CFLAGS="$X_CFLAGS -I$x_includes"
10223   fi
10224
10225   # It would also be nice to do this for all -L options, not just this one.
10226   if test -n "$x_libraries"; then
10227     X_LIBS="$X_LIBS -L$x_libraries"
10228     # For Solaris; some versions of Sun CC require a space after -R and
10229     # others require no space.  Words are not sufficient . . . .
10230     case `(uname -sr) 2>/dev/null` in
10231     "SunOS 5"*)
10232       echo "$as_me:10232: checking whether -R must be followed by a space" >&5
10233 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10234       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10235       cat >conftest.$ac_ext <<_ACEOF
10236 #line 10236 "configure"
10237 #include "confdefs.h"
10238
10239 int
10240 main (void)
10241 {
10242
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   ac_R_nospace=yes
10260 else
10261   echo "$as_me: failed program was:" >&5
10262 cat conftest.$ac_ext >&5
10263 ac_R_nospace=no
10264 fi
10265 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10266       if test $ac_R_nospace = yes; then
10267         echo "$as_me:10267: result: no" >&5
10268 echo "${ECHO_T}no" >&6
10269         X_LIBS="$X_LIBS -R$x_libraries"
10270       else
10271         LIBS="$ac_xsave_LIBS -R $x_libraries"
10272         cat >conftest.$ac_ext <<_ACEOF
10273 #line 10273 "configure"
10274 #include "confdefs.h"
10275
10276 int
10277 main (void)
10278 {
10279
10280   ;
10281   return 0;
10282 }
10283 _ACEOF
10284 rm -f conftest.$ac_objext conftest$ac_exeext
10285 if { (eval echo "$as_me:10285: \"$ac_link\"") >&5
10286   (eval $ac_link) 2>&5
10287   ac_status=$?
10288   echo "$as_me:10288: \$? = $ac_status" >&5
10289   (exit $ac_status); } &&
10290          { ac_try='test -s conftest$ac_exeext'
10291   { (eval echo "$as_me:10291: \"$ac_try\"") >&5
10292   (eval $ac_try) 2>&5
10293   ac_status=$?
10294   echo "$as_me:10294: \$? = $ac_status" >&5
10295   (exit $ac_status); }; }; then
10296   ac_R_space=yes
10297 else
10298   echo "$as_me: failed program was:" >&5
10299 cat conftest.$ac_ext >&5
10300 ac_R_space=no
10301 fi
10302 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10303         if test $ac_R_space = yes; then
10304           echo "$as_me:10304: result: yes" >&5
10305 echo "${ECHO_T}yes" >&6
10306           X_LIBS="$X_LIBS -R $x_libraries"
10307         else
10308           echo "$as_me:10308: result: neither works" >&5
10309 echo "${ECHO_T}neither works" >&6
10310         fi
10311       fi
10312       LIBS=$ac_xsave_LIBS
10313     esac
10314   fi
10315
10316   # Check for system-dependent libraries X programs must link with.
10317   # Do this before checking for the system-independent R6 libraries
10318   # (-lICE), since we may need -lsocket or whatever for X linking.
10319
10320   if test "$ISC" = yes; then
10321     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10322   else
10323     # Martyn Johnson says this is needed for Ultrix, if the X
10324     # libraries were built with DECnet support.  And Karl Berry says
10325     # the Alpha needs dnet_stub (dnet does not exist).
10326     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10327     cat >conftest.$ac_ext <<_ACEOF
10328 #line 10328 "configure"
10329 #include "confdefs.h"
10330
10331 /* Override any gcc2 internal prototype to avoid an error.  */
10332 #ifdef __cplusplus
10333 extern "C"
10334 #endif
10335 /* We use char because int might match the return type of a gcc2
10336    builtin and then its argument prototype would still apply.  */
10337 char XOpenDisplay ();
10338 int
10339 main (void)
10340 {
10341 XOpenDisplay ();
10342   ;
10343   return 0;
10344 }
10345 _ACEOF
10346 rm -f conftest.$ac_objext conftest$ac_exeext
10347 if { (eval echo "$as_me:10347: \"$ac_link\"") >&5
10348   (eval $ac_link) 2>&5
10349   ac_status=$?
10350   echo "$as_me:10350: \$? = $ac_status" >&5
10351   (exit $ac_status); } &&
10352          { ac_try='test -s conftest$ac_exeext'
10353   { (eval echo "$as_me:10353: \"$ac_try\"") >&5
10354   (eval $ac_try) 2>&5
10355   ac_status=$?
10356   echo "$as_me:10356: \$? = $ac_status" >&5
10357   (exit $ac_status); }; }; then
10358   :
10359 else
10360   echo "$as_me: failed program was:" >&5
10361 cat conftest.$ac_ext >&5
10362 echo "$as_me:10362: checking for dnet_ntoa in -ldnet" >&5
10363 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10364 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10365   echo $ECHO_N "(cached) $ECHO_C" >&6
10366 else
10367   ac_check_lib_save_LIBS=$LIBS
10368 LIBS="-ldnet  $LIBS"
10369 cat >conftest.$ac_ext <<_ACEOF
10370 #line 10370 "configure"
10371 #include "confdefs.h"
10372
10373 /* Override any gcc2 internal prototype to avoid an error.  */
10374 #ifdef __cplusplus
10375 extern "C"
10376 #endif
10377 /* We use char because int might match the return type of a gcc2
10378    builtin and then its argument prototype would still apply.  */
10379 char dnet_ntoa ();
10380 int
10381 main (void)
10382 {
10383 dnet_ntoa ();
10384   ;
10385   return 0;
10386 }
10387 _ACEOF
10388 rm -f conftest.$ac_objext conftest$ac_exeext
10389 if { (eval echo "$as_me:10389: \"$ac_link\"") >&5
10390   (eval $ac_link) 2>&5
10391   ac_status=$?
10392   echo "$as_me:10392: \$? = $ac_status" >&5
10393   (exit $ac_status); } &&
10394          { ac_try='test -s conftest$ac_exeext'
10395   { (eval echo "$as_me:10395: \"$ac_try\"") >&5
10396   (eval $ac_try) 2>&5
10397   ac_status=$?
10398   echo "$as_me:10398: \$? = $ac_status" >&5
10399   (exit $ac_status); }; }; then
10400   ac_cv_lib_dnet_dnet_ntoa=yes
10401 else
10402   echo "$as_me: failed program was:" >&5
10403 cat conftest.$ac_ext >&5
10404 ac_cv_lib_dnet_dnet_ntoa=no
10405 fi
10406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10407 LIBS=$ac_check_lib_save_LIBS
10408 fi
10409 echo "$as_me:10409: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10410 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10411 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10412   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10413 fi
10414
10415     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10416       echo "$as_me:10416: checking for dnet_ntoa in -ldnet_stub" >&5
10417 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10418 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10419   echo $ECHO_N "(cached) $ECHO_C" >&6
10420 else
10421   ac_check_lib_save_LIBS=$LIBS
10422 LIBS="-ldnet_stub  $LIBS"
10423 cat >conftest.$ac_ext <<_ACEOF
10424 #line 10424 "configure"
10425 #include "confdefs.h"
10426
10427 /* Override any gcc2 internal prototype to avoid an error.  */
10428 #ifdef __cplusplus
10429 extern "C"
10430 #endif
10431 /* We use char because int might match the return type of a gcc2
10432    builtin and then its argument prototype would still apply.  */
10433 char dnet_ntoa ();
10434 int
10435 main (void)
10436 {
10437 dnet_ntoa ();
10438   ;
10439   return 0;
10440 }
10441 _ACEOF
10442 rm -f conftest.$ac_objext conftest$ac_exeext
10443 if { (eval echo "$as_me:10443: \"$ac_link\"") >&5
10444   (eval $ac_link) 2>&5
10445   ac_status=$?
10446   echo "$as_me:10446: \$? = $ac_status" >&5
10447   (exit $ac_status); } &&
10448          { ac_try='test -s conftest$ac_exeext'
10449   { (eval echo "$as_me:10449: \"$ac_try\"") >&5
10450   (eval $ac_try) 2>&5
10451   ac_status=$?
10452   echo "$as_me:10452: \$? = $ac_status" >&5
10453   (exit $ac_status); }; }; then
10454   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10455 else
10456   echo "$as_me: failed program was:" >&5
10457 cat conftest.$ac_ext >&5
10458 ac_cv_lib_dnet_stub_dnet_ntoa=no
10459 fi
10460 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10461 LIBS=$ac_check_lib_save_LIBS
10462 fi
10463 echo "$as_me:10463: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10464 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10465 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10466   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10467 fi
10468
10469     fi
10470 fi
10471 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10472     LIBS="$ac_xsave_LIBS"
10473
10474     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10475     # to get the SysV transport functions.
10476     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10477     # needs -lnsl.
10478     # The nsl library prevents programs from opening the X display
10479     # on Irix 5.2, according to T.E. Dickey.
10480     # The functions gethostbyname, getservbyname, and inet_addr are
10481     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10482     echo "$as_me:10482: checking for gethostbyname" >&5
10483 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10484 if test "${ac_cv_func_gethostbyname+set}" = set; then
10485   echo $ECHO_N "(cached) $ECHO_C" >&6
10486 else
10487   cat >conftest.$ac_ext <<_ACEOF
10488 #line 10488 "configure"
10489 #include "confdefs.h"
10490 /* System header to define __stub macros and hopefully few prototypes,
10491     which can conflict with char gethostbyname (); below.  */
10492 #include <assert.h>
10493 /* Override any gcc2 internal prototype to avoid an error.  */
10494 #ifdef __cplusplus
10495 extern "C"
10496 #endif
10497 /* We use char because int might match the return type of a gcc2
10498    builtin and then its argument prototype would still apply.  */
10499 char gethostbyname ();
10500 char (*f) ();
10501
10502 int
10503 main (void)
10504 {
10505 /* The GNU C library defines this for functions which it implements
10506     to always fail with ENOSYS.  Some functions are actually named
10507     something starting with __ and the normal name is an alias.  */
10508 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10509 choke me
10510 #else
10511 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10512 #endif
10513
10514   ;
10515   return 0;
10516 }
10517 _ACEOF
10518 rm -f conftest.$ac_objext conftest$ac_exeext
10519 if { (eval echo "$as_me:10519: \"$ac_link\"") >&5
10520   (eval $ac_link) 2>&5
10521   ac_status=$?
10522   echo "$as_me:10522: \$? = $ac_status" >&5
10523   (exit $ac_status); } &&
10524          { ac_try='test -s conftest$ac_exeext'
10525   { (eval echo "$as_me:10525: \"$ac_try\"") >&5
10526   (eval $ac_try) 2>&5
10527   ac_status=$?
10528   echo "$as_me:10528: \$? = $ac_status" >&5
10529   (exit $ac_status); }; }; then
10530   ac_cv_func_gethostbyname=yes
10531 else
10532   echo "$as_me: failed program was:" >&5
10533 cat conftest.$ac_ext >&5
10534 ac_cv_func_gethostbyname=no
10535 fi
10536 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10537 fi
10538 echo "$as_me:10538: result: $ac_cv_func_gethostbyname" >&5
10539 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10540
10541     if test $ac_cv_func_gethostbyname = no; then
10542       echo "$as_me:10542: checking for gethostbyname in -lnsl" >&5
10543 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10544 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10545   echo $ECHO_N "(cached) $ECHO_C" >&6
10546 else
10547   ac_check_lib_save_LIBS=$LIBS
10548 LIBS="-lnsl  $LIBS"
10549 cat >conftest.$ac_ext <<_ACEOF
10550 #line 10550 "configure"
10551 #include "confdefs.h"
10552
10553 /* Override any gcc2 internal prototype to avoid an error.  */
10554 #ifdef __cplusplus
10555 extern "C"
10556 #endif
10557 /* We use char because int might match the return type of a gcc2
10558    builtin and then its argument prototype would still apply.  */
10559 char gethostbyname ();
10560 int
10561 main (void)
10562 {
10563 gethostbyname ();
10564   ;
10565   return 0;
10566 }
10567 _ACEOF
10568 rm -f conftest.$ac_objext conftest$ac_exeext
10569 if { (eval echo "$as_me:10569: \"$ac_link\"") >&5
10570   (eval $ac_link) 2>&5
10571   ac_status=$?
10572   echo "$as_me:10572: \$? = $ac_status" >&5
10573   (exit $ac_status); } &&
10574          { ac_try='test -s conftest$ac_exeext'
10575   { (eval echo "$as_me:10575: \"$ac_try\"") >&5
10576   (eval $ac_try) 2>&5
10577   ac_status=$?
10578   echo "$as_me:10578: \$? = $ac_status" >&5
10579   (exit $ac_status); }; }; then
10580   ac_cv_lib_nsl_gethostbyname=yes
10581 else
10582   echo "$as_me: failed program was:" >&5
10583 cat conftest.$ac_ext >&5
10584 ac_cv_lib_nsl_gethostbyname=no
10585 fi
10586 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10587 LIBS=$ac_check_lib_save_LIBS
10588 fi
10589 echo "$as_me:10589: result: $ac_cv_lib_nsl_gethostbyname" >&5
10590 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10591 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10592   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10593 fi
10594
10595       if test $ac_cv_lib_nsl_gethostbyname = no; then
10596         echo "$as_me:10596: checking for gethostbyname in -lbsd" >&5
10597 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10598 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10599   echo $ECHO_N "(cached) $ECHO_C" >&6
10600 else
10601   ac_check_lib_save_LIBS=$LIBS
10602 LIBS="-lbsd  $LIBS"
10603 cat >conftest.$ac_ext <<_ACEOF
10604 #line 10604 "configure"
10605 #include "confdefs.h"
10606
10607 /* Override any gcc2 internal prototype to avoid an error.  */
10608 #ifdef __cplusplus
10609 extern "C"
10610 #endif
10611 /* We use char because int might match the return type of a gcc2
10612    builtin and then its argument prototype would still apply.  */
10613 char gethostbyname ();
10614 int
10615 main (void)
10616 {
10617 gethostbyname ();
10618   ;
10619   return 0;
10620 }
10621 _ACEOF
10622 rm -f conftest.$ac_objext conftest$ac_exeext
10623 if { (eval echo "$as_me:10623: \"$ac_link\"") >&5
10624   (eval $ac_link) 2>&5
10625   ac_status=$?
10626   echo "$as_me:10626: \$? = $ac_status" >&5
10627   (exit $ac_status); } &&
10628          { ac_try='test -s conftest$ac_exeext'
10629   { (eval echo "$as_me:10629: \"$ac_try\"") >&5
10630   (eval $ac_try) 2>&5
10631   ac_status=$?
10632   echo "$as_me:10632: \$? = $ac_status" >&5
10633   (exit $ac_status); }; }; then
10634   ac_cv_lib_bsd_gethostbyname=yes
10635 else
10636   echo "$as_me: failed program was:" >&5
10637 cat conftest.$ac_ext >&5
10638 ac_cv_lib_bsd_gethostbyname=no
10639 fi
10640 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10641 LIBS=$ac_check_lib_save_LIBS
10642 fi
10643 echo "$as_me:10643: result: $ac_cv_lib_bsd_gethostbyname" >&5
10644 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10645 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10646   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10647 fi
10648
10649       fi
10650     fi
10651
10652     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10653     # socket/setsockopt and other routines are undefined under SCO ODT
10654     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10655     # on later versions), says Simon Leinen: it contains gethostby*
10656     # variants that don't use the nameserver (or something).  -lsocket
10657     # must be given before -lnsl if both are needed.  We assume that
10658     # if connect needs -lnsl, so does gethostbyname.
10659     echo "$as_me:10659: checking for connect" >&5
10660 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10661 if test "${ac_cv_func_connect+set}" = set; then
10662   echo $ECHO_N "(cached) $ECHO_C" >&6
10663 else
10664   cat >conftest.$ac_ext <<_ACEOF
10665 #line 10665 "configure"
10666 #include "confdefs.h"
10667 /* System header to define __stub macros and hopefully few prototypes,
10668     which can conflict with char connect (); below.  */
10669 #include <assert.h>
10670 /* Override any gcc2 internal prototype to avoid an error.  */
10671 #ifdef __cplusplus
10672 extern "C"
10673 #endif
10674 /* We use char because int might match the return type of a gcc2
10675    builtin and then its argument prototype would still apply.  */
10676 char connect ();
10677 char (*f) ();
10678
10679 int
10680 main (void)
10681 {
10682 /* The GNU C library defines this for functions which it implements
10683     to always fail with ENOSYS.  Some functions are actually named
10684     something starting with __ and the normal name is an alias.  */
10685 #if defined (__stub_connect) || defined (__stub___connect)
10686 choke me
10687 #else
10688 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10689 #endif
10690
10691   ;
10692   return 0;
10693 }
10694 _ACEOF
10695 rm -f conftest.$ac_objext conftest$ac_exeext
10696 if { (eval echo "$as_me:10696: \"$ac_link\"") >&5
10697   (eval $ac_link) 2>&5
10698   ac_status=$?
10699   echo "$as_me:10699: \$? = $ac_status" >&5
10700   (exit $ac_status); } &&
10701          { ac_try='test -s conftest$ac_exeext'
10702   { (eval echo "$as_me:10702: \"$ac_try\"") >&5
10703   (eval $ac_try) 2>&5
10704   ac_status=$?
10705   echo "$as_me:10705: \$? = $ac_status" >&5
10706   (exit $ac_status); }; }; then
10707   ac_cv_func_connect=yes
10708 else
10709   echo "$as_me: failed program was:" >&5
10710 cat conftest.$ac_ext >&5
10711 ac_cv_func_connect=no
10712 fi
10713 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10714 fi
10715 echo "$as_me:10715: result: $ac_cv_func_connect" >&5
10716 echo "${ECHO_T}$ac_cv_func_connect" >&6
10717
10718     if test $ac_cv_func_connect = no; then
10719       echo "$as_me:10719: checking for connect in -lsocket" >&5
10720 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10721 if test "${ac_cv_lib_socket_connect+set}" = set; then
10722   echo $ECHO_N "(cached) $ECHO_C" >&6
10723 else
10724   ac_check_lib_save_LIBS=$LIBS
10725 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10726 cat >conftest.$ac_ext <<_ACEOF
10727 #line 10727 "configure"
10728 #include "confdefs.h"
10729
10730 /* Override any gcc2 internal prototype to avoid an error.  */
10731 #ifdef __cplusplus
10732 extern "C"
10733 #endif
10734 /* We use char because int might match the return type of a gcc2
10735    builtin and then its argument prototype would still apply.  */
10736 char connect ();
10737 int
10738 main (void)
10739 {
10740 connect ();
10741   ;
10742   return 0;
10743 }
10744 _ACEOF
10745 rm -f conftest.$ac_objext conftest$ac_exeext
10746 if { (eval echo "$as_me:10746: \"$ac_link\"") >&5
10747   (eval $ac_link) 2>&5
10748   ac_status=$?
10749   echo "$as_me:10749: \$? = $ac_status" >&5
10750   (exit $ac_status); } &&
10751          { ac_try='test -s conftest$ac_exeext'
10752   { (eval echo "$as_me:10752: \"$ac_try\"") >&5
10753   (eval $ac_try) 2>&5
10754   ac_status=$?
10755   echo "$as_me:10755: \$? = $ac_status" >&5
10756   (exit $ac_status); }; }; then
10757   ac_cv_lib_socket_connect=yes
10758 else
10759   echo "$as_me: failed program was:" >&5
10760 cat conftest.$ac_ext >&5
10761 ac_cv_lib_socket_connect=no
10762 fi
10763 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10764 LIBS=$ac_check_lib_save_LIBS
10765 fi
10766 echo "$as_me:10766: result: $ac_cv_lib_socket_connect" >&5
10767 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10768 if test $ac_cv_lib_socket_connect = yes; then
10769   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10770 fi
10771
10772     fi
10773
10774     # Guillermo Gomez says -lposix is necessary on A/UX.
10775     echo "$as_me:10775: checking for remove" >&5
10776 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10777 if test "${ac_cv_func_remove+set}" = set; then
10778   echo $ECHO_N "(cached) $ECHO_C" >&6
10779 else
10780   cat >conftest.$ac_ext <<_ACEOF
10781 #line 10781 "configure"
10782 #include "confdefs.h"
10783 /* System header to define __stub macros and hopefully few prototypes,
10784     which can conflict with char remove (); below.  */
10785 #include <assert.h>
10786 /* Override any gcc2 internal prototype to avoid an error.  */
10787 #ifdef __cplusplus
10788 extern "C"
10789 #endif
10790 /* We use char because int might match the return type of a gcc2
10791    builtin and then its argument prototype would still apply.  */
10792 char remove ();
10793 char (*f) ();
10794
10795 int
10796 main (void)
10797 {
10798 /* The GNU C library defines this for functions which it implements
10799     to always fail with ENOSYS.  Some functions are actually named
10800     something starting with __ and the normal name is an alias.  */
10801 #if defined (__stub_remove) || defined (__stub___remove)
10802 choke me
10803 #else
10804 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10805 #endif
10806
10807   ;
10808   return 0;
10809 }
10810 _ACEOF
10811 rm -f conftest.$ac_objext conftest$ac_exeext
10812 if { (eval echo "$as_me:10812: \"$ac_link\"") >&5
10813   (eval $ac_link) 2>&5
10814   ac_status=$?
10815   echo "$as_me:10815: \$? = $ac_status" >&5
10816   (exit $ac_status); } &&
10817          { ac_try='test -s conftest$ac_exeext'
10818   { (eval echo "$as_me:10818: \"$ac_try\"") >&5
10819   (eval $ac_try) 2>&5
10820   ac_status=$?
10821   echo "$as_me:10821: \$? = $ac_status" >&5
10822   (exit $ac_status); }; }; then
10823   ac_cv_func_remove=yes
10824 else
10825   echo "$as_me: failed program was:" >&5
10826 cat conftest.$ac_ext >&5
10827 ac_cv_func_remove=no
10828 fi
10829 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10830 fi
10831 echo "$as_me:10831: result: $ac_cv_func_remove" >&5
10832 echo "${ECHO_T}$ac_cv_func_remove" >&6
10833
10834     if test $ac_cv_func_remove = no; then
10835       echo "$as_me:10835: checking for remove in -lposix" >&5
10836 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10837 if test "${ac_cv_lib_posix_remove+set}" = set; then
10838   echo $ECHO_N "(cached) $ECHO_C" >&6
10839 else
10840   ac_check_lib_save_LIBS=$LIBS
10841 LIBS="-lposix  $LIBS"
10842 cat >conftest.$ac_ext <<_ACEOF
10843 #line 10843 "configure"
10844 #include "confdefs.h"
10845
10846 /* Override any gcc2 internal prototype to avoid an error.  */
10847 #ifdef __cplusplus
10848 extern "C"
10849 #endif
10850 /* We use char because int might match the return type of a gcc2
10851    builtin and then its argument prototype would still apply.  */
10852 char remove ();
10853 int
10854 main (void)
10855 {
10856 remove ();
10857   ;
10858   return 0;
10859 }
10860 _ACEOF
10861 rm -f conftest.$ac_objext conftest$ac_exeext
10862 if { (eval echo "$as_me:10862: \"$ac_link\"") >&5
10863   (eval $ac_link) 2>&5
10864   ac_status=$?
10865   echo "$as_me:10865: \$? = $ac_status" >&5
10866   (exit $ac_status); } &&
10867          { ac_try='test -s conftest$ac_exeext'
10868   { (eval echo "$as_me:10868: \"$ac_try\"") >&5
10869   (eval $ac_try) 2>&5
10870   ac_status=$?
10871   echo "$as_me:10871: \$? = $ac_status" >&5
10872   (exit $ac_status); }; }; then
10873   ac_cv_lib_posix_remove=yes
10874 else
10875   echo "$as_me: failed program was:" >&5
10876 cat conftest.$ac_ext >&5
10877 ac_cv_lib_posix_remove=no
10878 fi
10879 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10880 LIBS=$ac_check_lib_save_LIBS
10881 fi
10882 echo "$as_me:10882: result: $ac_cv_lib_posix_remove" >&5
10883 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10884 if test $ac_cv_lib_posix_remove = yes; then
10885   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10886 fi
10887
10888     fi
10889
10890     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10891     echo "$as_me:10891: checking for shmat" >&5
10892 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10893 if test "${ac_cv_func_shmat+set}" = set; then
10894   echo $ECHO_N "(cached) $ECHO_C" >&6
10895 else
10896   cat >conftest.$ac_ext <<_ACEOF
10897 #line 10897 "configure"
10898 #include "confdefs.h"
10899 /* System header to define __stub macros and hopefully few prototypes,
10900     which can conflict with char shmat (); below.  */
10901 #include <assert.h>
10902 /* Override any gcc2 internal prototype to avoid an error.  */
10903 #ifdef __cplusplus
10904 extern "C"
10905 #endif
10906 /* We use char because int might match the return type of a gcc2
10907    builtin and then its argument prototype would still apply.  */
10908 char shmat ();
10909 char (*f) ();
10910
10911 int
10912 main (void)
10913 {
10914 /* The GNU C library defines this for functions which it implements
10915     to always fail with ENOSYS.  Some functions are actually named
10916     something starting with __ and the normal name is an alias.  */
10917 #if defined (__stub_shmat) || defined (__stub___shmat)
10918 choke me
10919 #else
10920 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10921 #endif
10922
10923   ;
10924   return 0;
10925 }
10926 _ACEOF
10927 rm -f conftest.$ac_objext conftest$ac_exeext
10928 if { (eval echo "$as_me:10928: \"$ac_link\"") >&5
10929   (eval $ac_link) 2>&5
10930   ac_status=$?
10931   echo "$as_me:10931: \$? = $ac_status" >&5
10932   (exit $ac_status); } &&
10933          { ac_try='test -s conftest$ac_exeext'
10934   { (eval echo "$as_me:10934: \"$ac_try\"") >&5
10935   (eval $ac_try) 2>&5
10936   ac_status=$?
10937   echo "$as_me:10937: \$? = $ac_status" >&5
10938   (exit $ac_status); }; }; then
10939   ac_cv_func_shmat=yes
10940 else
10941   echo "$as_me: failed program was:" >&5
10942 cat conftest.$ac_ext >&5
10943 ac_cv_func_shmat=no
10944 fi
10945 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10946 fi
10947 echo "$as_me:10947: result: $ac_cv_func_shmat" >&5
10948 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10949
10950     if test $ac_cv_func_shmat = no; then
10951       echo "$as_me:10951: checking for shmat in -lipc" >&5
10952 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10953 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10954   echo $ECHO_N "(cached) $ECHO_C" >&6
10955 else
10956   ac_check_lib_save_LIBS=$LIBS
10957 LIBS="-lipc  $LIBS"
10958 cat >conftest.$ac_ext <<_ACEOF
10959 #line 10959 "configure"
10960 #include "confdefs.h"
10961
10962 /* Override any gcc2 internal prototype to avoid an error.  */
10963 #ifdef __cplusplus
10964 extern "C"
10965 #endif
10966 /* We use char because int might match the return type of a gcc2
10967    builtin and then its argument prototype would still apply.  */
10968 char shmat ();
10969 int
10970 main (void)
10971 {
10972 shmat ();
10973   ;
10974   return 0;
10975 }
10976 _ACEOF
10977 rm -f conftest.$ac_objext conftest$ac_exeext
10978 if { (eval echo "$as_me:10978: \"$ac_link\"") >&5
10979   (eval $ac_link) 2>&5
10980   ac_status=$?
10981   echo "$as_me:10981: \$? = $ac_status" >&5
10982   (exit $ac_status); } &&
10983          { ac_try='test -s conftest$ac_exeext'
10984   { (eval echo "$as_me:10984: \"$ac_try\"") >&5
10985   (eval $ac_try) 2>&5
10986   ac_status=$?
10987   echo "$as_me:10987: \$? = $ac_status" >&5
10988   (exit $ac_status); }; }; then
10989   ac_cv_lib_ipc_shmat=yes
10990 else
10991   echo "$as_me: failed program was:" >&5
10992 cat conftest.$ac_ext >&5
10993 ac_cv_lib_ipc_shmat=no
10994 fi
10995 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10996 LIBS=$ac_check_lib_save_LIBS
10997 fi
10998 echo "$as_me:10998: result: $ac_cv_lib_ipc_shmat" >&5
10999 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11000 if test $ac_cv_lib_ipc_shmat = yes; then
11001   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11002 fi
11003
11004     fi
11005   fi
11006
11007   # Check for libraries that X11R6 Xt/Xaw programs need.
11008   ac_save_LDFLAGS=$LDFLAGS
11009   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11010   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11011   # check for ICE first), but we must link in the order -lSM -lICE or
11012   # we get undefined symbols.  So assume we have SM if we have ICE.
11013   # These have to be linked with before -lX11, unlike the other
11014   # libraries we check for below, so use a different variable.
11015   # John Interrante, Karl Berry
11016   echo "$as_me:11016: checking for IceConnectionNumber in -lICE" >&5
11017 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11018 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11019   echo $ECHO_N "(cached) $ECHO_C" >&6
11020 else
11021   ac_check_lib_save_LIBS=$LIBS
11022 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11023 cat >conftest.$ac_ext <<_ACEOF
11024 #line 11024 "configure"
11025 #include "confdefs.h"
11026
11027 /* Override any gcc2 internal prototype to avoid an error.  */
11028 #ifdef __cplusplus
11029 extern "C"
11030 #endif
11031 /* We use char because int might match the return type of a gcc2
11032    builtin and then its argument prototype would still apply.  */
11033 char IceConnectionNumber ();
11034 int
11035 main (void)
11036 {
11037 IceConnectionNumber ();
11038   ;
11039   return 0;
11040 }
11041 _ACEOF
11042 rm -f conftest.$ac_objext conftest$ac_exeext
11043 if { (eval echo "$as_me:11043: \"$ac_link\"") >&5
11044   (eval $ac_link) 2>&5
11045   ac_status=$?
11046   echo "$as_me:11046: \$? = $ac_status" >&5
11047   (exit $ac_status); } &&
11048          { ac_try='test -s conftest$ac_exeext'
11049   { (eval echo "$as_me:11049: \"$ac_try\"") >&5
11050   (eval $ac_try) 2>&5
11051   ac_status=$?
11052   echo "$as_me:11052: \$? = $ac_status" >&5
11053   (exit $ac_status); }; }; then
11054   ac_cv_lib_ICE_IceConnectionNumber=yes
11055 else
11056   echo "$as_me: failed program was:" >&5
11057 cat conftest.$ac_ext >&5
11058 ac_cv_lib_ICE_IceConnectionNumber=no
11059 fi
11060 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11061 LIBS=$ac_check_lib_save_LIBS
11062 fi
11063 echo "$as_me:11063: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11064 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11065 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11066   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11067 fi
11068
11069   LDFLAGS=$ac_save_LDFLAGS
11070
11071 fi
11072
11073 cf_x_athena=${cf_x_athena:-Xaw}
11074
11075 echo "$as_me:11075: checking if you want to link with Xaw 3d library" >&5
11076 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11077 withval=
11078
11079 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11080 if test "${with_Xaw3d+set}" = set; then
11081   withval="$with_Xaw3d"
11082
11083 fi;
11084 if test "$withval" = yes ; then
11085         cf_x_athena=Xaw3d
11086         echo "$as_me:11086: result: yes" >&5
11087 echo "${ECHO_T}yes" >&6
11088 else
11089         echo "$as_me:11089: result: no" >&5
11090 echo "${ECHO_T}no" >&6
11091 fi
11092
11093 echo "$as_me:11093: checking if you want to link with Xaw 3d xft library" >&5
11094 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
11095 withval=
11096
11097 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
11098 if test "${with_Xaw3dxft+set}" = set; then
11099   withval="$with_Xaw3dxft"
11100
11101 fi;
11102 if test "$withval" = yes ; then
11103         cf_x_athena=Xaw3dxft
11104         echo "$as_me:11104: result: yes" >&5
11105 echo "${ECHO_T}yes" >&6
11106 else
11107         echo "$as_me:11107: result: no" >&5
11108 echo "${ECHO_T}no" >&6
11109 fi
11110
11111 echo "$as_me:11111: checking if you want to link with neXT Athena library" >&5
11112 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11113 withval=
11114
11115 # Check whether --with-neXtaw or --without-neXtaw was given.
11116 if test "${with_neXtaw+set}" = set; then
11117   withval="$with_neXtaw"
11118
11119 fi;
11120 if test "$withval" = yes ; then
11121         cf_x_athena=neXtaw
11122         echo "$as_me:11122: result: yes" >&5
11123 echo "${ECHO_T}yes" >&6
11124 else
11125         echo "$as_me:11125: result: no" >&5
11126 echo "${ECHO_T}no" >&6
11127 fi
11128
11129 echo "$as_me:11129: checking if you want to link with Athena-Plus library" >&5
11130 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11131 withval=
11132
11133 # Check whether --with-XawPlus or --without-XawPlus was given.
11134 if test "${with_XawPlus+set}" = set; then
11135   withval="$with_XawPlus"
11136
11137 fi;
11138 if test "$withval" = yes ; then
11139         cf_x_athena=XawPlus
11140         echo "$as_me:11140: result: yes" >&5
11141 echo "${ECHO_T}yes" >&6
11142 else
11143         echo "$as_me:11143: result: no" >&5
11144 echo "${ECHO_T}no" >&6
11145 fi
11146
11147 cf_x_athena_lib=""
11148
11149 if test "$PKG_CONFIG" != none ; then
11150         cf_athena_list=
11151         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11152         for cf_athena_pkg in \
11153                 $cf_athena_list \
11154                 ${cf_x_athena} \
11155                 ${cf_x_athena}-devel \
11156                 lib${cf_x_athena} \
11157                 lib${cf_x_athena}-devel
11158         do
11159
11160 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11161         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11162
11163 echo "${as_me:-configure}:11163: testing found package $cf_athena_pkg ..." 1>&5
11164
11165         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11166         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11167         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11168
11169 echo "${as_me:-configure}:11169: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11170
11171         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11172
11173 echo "${as_me:-configure}:11173: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11174
11175 cf_fix_cppflags=no
11176 cf_new_cflags=
11177 cf_new_cppflags=
11178 cf_new_extra_cppflags=
11179
11180 for cf_add_cflags in $cf_pkgconfig_incs
11181 do
11182 case $cf_fix_cppflags in
11183 (no)
11184         case $cf_add_cflags in
11185         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11186                 case $cf_add_cflags in
11187                 (-D*)
11188                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11189
11190                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11191                                 && test -z "${cf_tst_cflags}" \
11192                                 && cf_fix_cppflags=yes
11193
11194                         if test $cf_fix_cppflags = yes ; then
11195
11196         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11197         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11198
11199                                 continue
11200                         elif test "${cf_tst_cflags}" = "\"'" ; then
11201
11202         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11203         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11204
11205                                 continue
11206                         fi
11207                         ;;
11208                 esac
11209                 case "$CPPFLAGS" in
11210                 (*$cf_add_cflags)
11211                         ;;
11212                 (*)
11213                         case $cf_add_cflags in
11214                         (-D*)
11215                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11216
11217 CPPFLAGS=`echo "$CPPFLAGS" | \
11218         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11219                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11220
11221                                 ;;
11222                         esac
11223
11224         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11225         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11226
11227                         ;;
11228                 esac
11229                 ;;
11230         (*)
11231
11232         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11233         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11234
11235                 ;;
11236         esac
11237         ;;
11238 (yes)
11239
11240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11242
11243         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11244
11245         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11246                 && test -z "${cf_tst_cflags}" \
11247                 && cf_fix_cppflags=no
11248         ;;
11249 esac
11250 done
11251
11252 if test -n "$cf_new_cflags" ; then
11253
11254         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11255         CFLAGS="${CFLAGS}$cf_new_cflags"
11256
11257 fi
11258
11259 if test -n "$cf_new_cppflags" ; then
11260
11261         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11262         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11263
11264 fi
11265
11266 if test -n "$cf_new_extra_cppflags" ; then
11267
11268         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11269         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11270
11271 fi
11272
11273 cf_add_libs="$cf_pkgconfig_libs"
11274 # Filter out duplicates - this happens with badly-designed ".pc" files...
11275 for cf_add_1lib in $LIBS
11276 do
11277         for cf_add_2lib in $cf_add_libs
11278         do
11279                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11280                 then
11281                         cf_add_1lib=
11282                         break
11283                 fi
11284         done
11285         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11286 done
11287 LIBS="$cf_add_libs"
11288
11289                         cf_x_athena_lib="$cf_pkgconfig_libs"
11290
11291 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11292
11293                         cat >>confdefs.h <<EOF
11294 #define $cf_x_athena_LIBS 1
11295 EOF
11296
11297         for cf_trim_lib in Xmu Xt X11
11298         do
11299                 case "$LIBS" in
11300                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11301                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11302                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11303
11304 echo "${as_me:-configure}:11304: testing ..trimmed $LIBS ..." 1>&5
11305
11306                         ;;
11307                 esac
11308         done
11309
11310 echo "$as_me:11310: checking for usable $cf_x_athena/Xmu package" >&5
11311 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11312 if test "${cf_cv_xaw_compat+set}" = set; then
11313   echo $ECHO_N "(cached) $ECHO_C" >&6
11314 else
11315
11316 cat >conftest.$ac_ext <<_ACEOF
11317 #line 11317 "configure"
11318 #include "confdefs.h"
11319
11320 #include <X11/Xmu/CharSet.h>
11321
11322 int
11323 main (void)
11324 {
11325
11326 int check = XmuCompareISOLatin1("big", "small")
11327
11328   ;
11329   return 0;
11330 }
11331 _ACEOF
11332 rm -f conftest.$ac_objext conftest$ac_exeext
11333 if { (eval echo "$as_me:11333: \"$ac_link\"") >&5
11334   (eval $ac_link) 2>&5
11335   ac_status=$?
11336   echo "$as_me:11336: \$? = $ac_status" >&5
11337   (exit $ac_status); } &&
11338          { ac_try='test -s conftest$ac_exeext'
11339   { (eval echo "$as_me:11339: \"$ac_try\"") >&5
11340   (eval $ac_try) 2>&5
11341   ac_status=$?
11342   echo "$as_me:11342: \$? = $ac_status" >&5
11343   (exit $ac_status); }; }; then
11344   cf_cv_xaw_compat=yes
11345 else
11346   echo "$as_me: failed program was:" >&5
11347 cat conftest.$ac_ext >&5
11348 cf_cv_xaw_compat=no
11349 fi
11350 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11351 fi
11352 echo "$as_me:11352: result: $cf_cv_xaw_compat" >&5
11353 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11354
11355                         if test "$cf_cv_xaw_compat" = no
11356                         then
11357                                 # workaround for broken ".pc" files...
11358                                 case "$cf_x_athena_lib" in
11359                                 (*-lXmu*)
11360                                         ;;
11361                                 (*)
11362                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11363
11364 echo "${as_me:-configure}:11364: testing work around broken package ..." 1>&5
11365
11366                                         cf_save_xmu="$LIBS"
11367                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11368
11369 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11370         test -n "$verbose" && echo "    found package xmu" 1>&6
11371
11372 echo "${as_me:-configure}:11372: testing found package xmu ..." 1>&5
11373
11374         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11375         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11376         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11377
11378 echo "${as_me:-configure}:11378: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11379
11380         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11381
11382 echo "${as_me:-configure}:11382: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11383
11384 cf_fix_cppflags=no
11385 cf_new_cflags=
11386 cf_new_cppflags=
11387 cf_new_extra_cppflags=
11388
11389 for cf_add_cflags in $cf_pkgconfig_incs
11390 do
11391 case $cf_fix_cppflags in
11392 (no)
11393         case $cf_add_cflags in
11394         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11395                 case $cf_add_cflags in
11396                 (-D*)
11397                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11398
11399                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11400                                 && test -z "${cf_tst_cflags}" \
11401                                 && cf_fix_cppflags=yes
11402
11403                         if test $cf_fix_cppflags = yes ; then
11404
11405         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11406         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11407
11408                                 continue
11409                         elif test "${cf_tst_cflags}" = "\"'" ; then
11410
11411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11413
11414                                 continue
11415                         fi
11416                         ;;
11417                 esac
11418                 case "$CPPFLAGS" in
11419                 (*$cf_add_cflags)
11420                         ;;
11421                 (*)
11422                         case $cf_add_cflags in
11423                         (-D*)
11424                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11425
11426 CPPFLAGS=`echo "$CPPFLAGS" | \
11427         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11428                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11429
11430                                 ;;
11431                         esac
11432
11433         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11434         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11435
11436                         ;;
11437                 esac
11438                 ;;
11439         (*)
11440
11441         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11442         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11443
11444                 ;;
11445         esac
11446         ;;
11447 (yes)
11448
11449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11451
11452         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11453
11454         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11455                 && test -z "${cf_tst_cflags}" \
11456                 && cf_fix_cppflags=no
11457         ;;
11458 esac
11459 done
11460
11461 if test -n "$cf_new_cflags" ; then
11462
11463         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11464         CFLAGS="${CFLAGS}$cf_new_cflags"
11465
11466 fi
11467
11468 if test -n "$cf_new_cppflags" ; then
11469
11470         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11471         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11472
11473 fi
11474
11475 if test -n "$cf_new_extra_cppflags" ; then
11476
11477         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11478         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11479
11480 fi
11481
11482 cf_add_libs="$cf_pkgconfig_libs"
11483 # Filter out duplicates - this happens with badly-designed ".pc" files...
11484 for cf_add_1lib in $LIBS
11485 do
11486         for cf_add_2lib in $cf_add_libs
11487         do
11488                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11489                 then
11490                         cf_add_1lib=
11491                         break
11492                 fi
11493         done
11494         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11495 done
11496 LIBS="$cf_add_libs"
11497
11498                                                         LIBS="$cf_save_xmu"
11499
11500 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11501
11502 echo "${as_me:-configure}:11502: testing ...before $LIBS ..." 1>&5
11503
11504 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11505 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11506
11507 echo "${as_me:-configure}:11507: testing ...after  $LIBS ..." 1>&5
11508
11509 else
11510         cf_pkgconfig_incs=
11511         cf_pkgconfig_libs=
11512
11513 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11514
11515 echo "${as_me:-configure}:11515: testing ...before $LIBS ..." 1>&5
11516
11517 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11518 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11519
11520 echo "${as_me:-configure}:11520: testing ...after  $LIBS ..." 1>&5
11521
11522 fi
11523
11524         for cf_trim_lib in Xmu Xt X11
11525         do
11526                 case "$LIBS" in
11527                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11528                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11529                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11530
11531 echo "${as_me:-configure}:11531: testing ..trimmed $LIBS ..." 1>&5
11532
11533                         ;;
11534                 esac
11535         done
11536
11537                                         ;;
11538                                 esac
11539                         fi
11540
11541                         break
11542 else
11543         cf_pkgconfig_incs=
11544         cf_pkgconfig_libs=
11545         :
11546 fi
11547
11548         done
11549 fi
11550
11551 if test -z "$cf_x_athena_lib" ; then
11552
11553 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11554         test -n "$verbose" && echo "    found package Xext" 1>&6
11555
11556 echo "${as_me:-configure}:11556: testing found package Xext ..." 1>&5
11557
11558         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11559         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11560         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11561
11562 echo "${as_me:-configure}:11562: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11563
11564         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11565
11566 echo "${as_me:-configure}:11566: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11567
11568 cf_fix_cppflags=no
11569 cf_new_cflags=
11570 cf_new_cppflags=
11571 cf_new_extra_cppflags=
11572
11573 for cf_add_cflags in $cf_pkgconfig_incs
11574 do
11575 case $cf_fix_cppflags in
11576 (no)
11577         case $cf_add_cflags in
11578         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11579                 case $cf_add_cflags in
11580                 (-D*)
11581                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11582
11583                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11584                                 && test -z "${cf_tst_cflags}" \
11585                                 && cf_fix_cppflags=yes
11586
11587                         if test $cf_fix_cppflags = yes ; then
11588
11589         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11590         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11591
11592                                 continue
11593                         elif test "${cf_tst_cflags}" = "\"'" ; then
11594
11595         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11596         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11597
11598                                 continue
11599                         fi
11600                         ;;
11601                 esac
11602                 case "$CPPFLAGS" in
11603                 (*$cf_add_cflags)
11604                         ;;
11605                 (*)
11606                         case $cf_add_cflags in
11607                         (-D*)
11608                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11609
11610 CPPFLAGS=`echo "$CPPFLAGS" | \
11611         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11612                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11613
11614                                 ;;
11615                         esac
11616
11617         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11618         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11619
11620                         ;;
11621                 esac
11622                 ;;
11623         (*)
11624
11625         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11626         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11627
11628                 ;;
11629         esac
11630         ;;
11631 (yes)
11632
11633         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11634         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11635
11636         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11637
11638         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11639                 && test -z "${cf_tst_cflags}" \
11640                 && cf_fix_cppflags=no
11641         ;;
11642 esac
11643 done
11644
11645 if test -n "$cf_new_cflags" ; then
11646
11647         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11648         CFLAGS="${CFLAGS}$cf_new_cflags"
11649
11650 fi
11651
11652 if test -n "$cf_new_cppflags" ; then
11653
11654         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11655         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11656
11657 fi
11658
11659 if test -n "$cf_new_extra_cppflags" ; then
11660
11661         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11662         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11663
11664 fi
11665
11666 cf_add_libs="$cf_pkgconfig_libs"
11667 # Filter out duplicates - this happens with badly-designed ".pc" files...
11668 for cf_add_1lib in $LIBS
11669 do
11670         for cf_add_2lib in $cf_add_libs
11671         do
11672                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11673                 then
11674                         cf_add_1lib=
11675                         break
11676                 fi
11677         done
11678         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11679 done
11680 LIBS="$cf_add_libs"
11681
11682         :
11683 else
11684         cf_pkgconfig_incs=
11685         cf_pkgconfig_libs=
11686
11687         echo "$as_me:11687: checking for XextCreateExtension in -lXext" >&5
11688 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11689 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11690   echo $ECHO_N "(cached) $ECHO_C" >&6
11691 else
11692   ac_check_lib_save_LIBS=$LIBS
11693 LIBS="-lXext  $LIBS"
11694 cat >conftest.$ac_ext <<_ACEOF
11695 #line 11695 "configure"
11696 #include "confdefs.h"
11697
11698 /* Override any gcc2 internal prototype to avoid an error.  */
11699 #ifdef __cplusplus
11700 extern "C"
11701 #endif
11702 /* We use char because int might match the return type of a gcc2
11703    builtin and then its argument prototype would still apply.  */
11704 char XextCreateExtension ();
11705 int
11706 main (void)
11707 {
11708 XextCreateExtension ();
11709   ;
11710   return 0;
11711 }
11712 _ACEOF
11713 rm -f conftest.$ac_objext conftest$ac_exeext
11714 if { (eval echo "$as_me:11714: \"$ac_link\"") >&5
11715   (eval $ac_link) 2>&5
11716   ac_status=$?
11717   echo "$as_me:11717: \$? = $ac_status" >&5
11718   (exit $ac_status); } &&
11719          { ac_try='test -s conftest$ac_exeext'
11720   { (eval echo "$as_me:11720: \"$ac_try\"") >&5
11721   (eval $ac_try) 2>&5
11722   ac_status=$?
11723   echo "$as_me:11723: \$? = $ac_status" >&5
11724   (exit $ac_status); }; }; then
11725   ac_cv_lib_Xext_XextCreateExtension=yes
11726 else
11727   echo "$as_me: failed program was:" >&5
11728 cat conftest.$ac_ext >&5
11729 ac_cv_lib_Xext_XextCreateExtension=no
11730 fi
11731 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11732 LIBS=$ac_check_lib_save_LIBS
11733 fi
11734 echo "$as_me:11734: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11735 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11736 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11737
11738 cf_add_libs="-lXext"
11739 # Filter out duplicates - this happens with badly-designed ".pc" files...
11740 for cf_add_1lib in $LIBS
11741 do
11742         for cf_add_2lib in $cf_add_libs
11743         do
11744                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11745                 then
11746                         cf_add_1lib=
11747                         break
11748                 fi
11749         done
11750         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11751 done
11752 LIBS="$cf_add_libs"
11753
11754 fi
11755
11756 fi
11757
11758 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11759 # in some cases has installed dummy files in the former, other cases replaced
11760 # it with a link to the new location).  This complicates the configure script.
11761 # Check for that pitfall, and recover using pkg-config
11762 #
11763 # If none of these are set, the configuration is almost certainly broken.
11764 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11765 then
11766
11767 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11768         test -n "$verbose" && echo "    found package x11" 1>&6
11769
11770 echo "${as_me:-configure}:11770: testing found package x11 ..." 1>&5
11771
11772         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11773         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11774         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11775
11776 echo "${as_me:-configure}:11776: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11777
11778         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11779
11780 echo "${as_me:-configure}:11780: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11781
11782 cf_fix_cppflags=no
11783 cf_new_cflags=
11784 cf_new_cppflags=
11785 cf_new_extra_cppflags=
11786
11787 for cf_add_cflags in $cf_pkgconfig_incs
11788 do
11789 case $cf_fix_cppflags in
11790 (no)
11791         case $cf_add_cflags in
11792         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11793                 case $cf_add_cflags in
11794                 (-D*)
11795                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11796
11797                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11798                                 && test -z "${cf_tst_cflags}" \
11799                                 && cf_fix_cppflags=yes
11800
11801                         if test $cf_fix_cppflags = yes ; then
11802
11803         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11804         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11805
11806                                 continue
11807                         elif test "${cf_tst_cflags}" = "\"'" ; then
11808
11809         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11810         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11811
11812                                 continue
11813                         fi
11814                         ;;
11815                 esac
11816                 case "$CPPFLAGS" in
11817                 (*$cf_add_cflags)
11818                         ;;
11819                 (*)
11820                         case $cf_add_cflags in
11821                         (-D*)
11822                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11823
11824 CPPFLAGS=`echo "$CPPFLAGS" | \
11825         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11826                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11827
11828                                 ;;
11829                         esac
11830
11831         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11832         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11833
11834                         ;;
11835                 esac
11836                 ;;
11837         (*)
11838
11839         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11840         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11841
11842                 ;;
11843         esac
11844         ;;
11845 (yes)
11846
11847         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11848         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11849
11850         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11851
11852         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11853                 && test -z "${cf_tst_cflags}" \
11854                 && cf_fix_cppflags=no
11855         ;;
11856 esac
11857 done
11858
11859 if test -n "$cf_new_cflags" ; then
11860
11861         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11862         CFLAGS="${CFLAGS}$cf_new_cflags"
11863
11864 fi
11865
11866 if test -n "$cf_new_cppflags" ; then
11867
11868         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11869         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11870
11871 fi
11872
11873 if test -n "$cf_new_extra_cppflags" ; then
11874
11875         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11876         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11877
11878 fi
11879
11880 cf_add_libs="$cf_pkgconfig_libs"
11881 # Filter out duplicates - this happens with badly-designed ".pc" files...
11882 for cf_add_1lib in $LIBS
11883 do
11884         for cf_add_2lib in $cf_add_libs
11885         do
11886                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11887                 then
11888                         cf_add_1lib=
11889                         break
11890                 fi
11891         done
11892         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11893 done
11894 LIBS="$cf_add_libs"
11895
11896         :
11897 else
11898         cf_pkgconfig_incs=
11899         cf_pkgconfig_libs=
11900         { echo "$as_me:11900: WARNING: unable to find X11 library" >&5
11901 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11902 fi
11903
11904 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11905         test -n "$verbose" && echo "    found package ice" 1>&6
11906
11907 echo "${as_me:-configure}:11907: testing found package ice ..." 1>&5
11908
11909         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11910         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11911         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11912
11913 echo "${as_me:-configure}:11913: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11914
11915         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11916
11917 echo "${as_me:-configure}:11917: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11918
11919 cf_fix_cppflags=no
11920 cf_new_cflags=
11921 cf_new_cppflags=
11922 cf_new_extra_cppflags=
11923
11924 for cf_add_cflags in $cf_pkgconfig_incs
11925 do
11926 case $cf_fix_cppflags in
11927 (no)
11928         case $cf_add_cflags in
11929         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11930                 case $cf_add_cflags in
11931                 (-D*)
11932                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11933
11934                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11935                                 && test -z "${cf_tst_cflags}" \
11936                                 && cf_fix_cppflags=yes
11937
11938                         if test $cf_fix_cppflags = yes ; then
11939
11940         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11941         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11942
11943                                 continue
11944                         elif test "${cf_tst_cflags}" = "\"'" ; then
11945
11946         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11947         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11948
11949                                 continue
11950                         fi
11951                         ;;
11952                 esac
11953                 case "$CPPFLAGS" in
11954                 (*$cf_add_cflags)
11955                         ;;
11956                 (*)
11957                         case $cf_add_cflags in
11958                         (-D*)
11959                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11960
11961 CPPFLAGS=`echo "$CPPFLAGS" | \
11962         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11963                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11964
11965                                 ;;
11966                         esac
11967
11968         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11969         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11970
11971                         ;;
11972                 esac
11973                 ;;
11974         (*)
11975
11976         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11977         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11978
11979                 ;;
11980         esac
11981         ;;
11982 (yes)
11983
11984         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11985         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11986
11987         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11988
11989         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11990                 && test -z "${cf_tst_cflags}" \
11991                 && cf_fix_cppflags=no
11992         ;;
11993 esac
11994 done
11995
11996 if test -n "$cf_new_cflags" ; then
11997
11998         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11999         CFLAGS="${CFLAGS}$cf_new_cflags"
12000
12001 fi
12002
12003 if test -n "$cf_new_cppflags" ; then
12004
12005         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12006         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12007
12008 fi
12009
12010 if test -n "$cf_new_extra_cppflags" ; then
12011
12012         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12013         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12014
12015 fi
12016
12017 cf_add_libs="$cf_pkgconfig_libs"
12018 # Filter out duplicates - this happens with badly-designed ".pc" files...
12019 for cf_add_1lib in $LIBS
12020 do
12021         for cf_add_2lib in $cf_add_libs
12022         do
12023                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12024                 then
12025                         cf_add_1lib=
12026                         break
12027                 fi
12028         done
12029         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12030 done
12031 LIBS="$cf_add_libs"
12032
12033         :
12034 else
12035         cf_pkgconfig_incs=
12036         cf_pkgconfig_libs=
12037         { echo "$as_me:12037: WARNING: unable to find ICE library" >&5
12038 echo "$as_me: WARNING: unable to find ICE library" >&2;}
12039 fi
12040
12041 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12042         test -n "$verbose" && echo "    found package sm" 1>&6
12043
12044 echo "${as_me:-configure}:12044: testing found package sm ..." 1>&5
12045
12046         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12047         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12048         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12049
12050 echo "${as_me:-configure}:12050: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12051
12052         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12053
12054 echo "${as_me:-configure}:12054: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12055
12056 cf_fix_cppflags=no
12057 cf_new_cflags=
12058 cf_new_cppflags=
12059 cf_new_extra_cppflags=
12060
12061 for cf_add_cflags in $cf_pkgconfig_incs
12062 do
12063 case $cf_fix_cppflags in
12064 (no)
12065         case $cf_add_cflags in
12066         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12067                 case $cf_add_cflags in
12068                 (-D*)
12069                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12070
12071                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12072                                 && test -z "${cf_tst_cflags}" \
12073                                 && cf_fix_cppflags=yes
12074
12075                         if test $cf_fix_cppflags = yes ; then
12076
12077         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12078         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12079
12080                                 continue
12081                         elif test "${cf_tst_cflags}" = "\"'" ; then
12082
12083         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12084         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12085
12086                                 continue
12087                         fi
12088                         ;;
12089                 esac
12090                 case "$CPPFLAGS" in
12091                 (*$cf_add_cflags)
12092                         ;;
12093                 (*)
12094                         case $cf_add_cflags in
12095                         (-D*)
12096                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12097
12098 CPPFLAGS=`echo "$CPPFLAGS" | \
12099         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12100                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12101
12102                                 ;;
12103                         esac
12104
12105         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12106         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12107
12108                         ;;
12109                 esac
12110                 ;;
12111         (*)
12112
12113         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12114         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12115
12116                 ;;
12117         esac
12118         ;;
12119 (yes)
12120
12121         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12122         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12123
12124         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12125
12126         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12127                 && test -z "${cf_tst_cflags}" \
12128                 && cf_fix_cppflags=no
12129         ;;
12130 esac
12131 done
12132
12133 if test -n "$cf_new_cflags" ; then
12134
12135         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12136         CFLAGS="${CFLAGS}$cf_new_cflags"
12137
12138 fi
12139
12140 if test -n "$cf_new_cppflags" ; then
12141
12142         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12143         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12144
12145 fi
12146
12147 if test -n "$cf_new_extra_cppflags" ; then
12148
12149         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12150         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12151
12152 fi
12153
12154 cf_add_libs="$cf_pkgconfig_libs"
12155 # Filter out duplicates - this happens with badly-designed ".pc" files...
12156 for cf_add_1lib in $LIBS
12157 do
12158         for cf_add_2lib in $cf_add_libs
12159         do
12160                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12161                 then
12162                         cf_add_1lib=
12163                         break
12164                 fi
12165         done
12166         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12167 done
12168 LIBS="$cf_add_libs"
12169
12170         :
12171 else
12172         cf_pkgconfig_incs=
12173         cf_pkgconfig_libs=
12174         { echo "$as_me:12174: WARNING: unable to find SM library" >&5
12175 echo "$as_me: WARNING: unable to find SM library" >&2;}
12176 fi
12177
12178 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12179         test -n "$verbose" && echo "    found package xt" 1>&6
12180
12181 echo "${as_me:-configure}:12181: testing found package xt ..." 1>&5
12182
12183         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12184         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12185         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12186
12187 echo "${as_me:-configure}:12187: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12188
12189         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12190
12191 echo "${as_me:-configure}:12191: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12192
12193 cf_fix_cppflags=no
12194 cf_new_cflags=
12195 cf_new_cppflags=
12196 cf_new_extra_cppflags=
12197
12198 for cf_add_cflags in $cf_pkgconfig_incs
12199 do
12200 case $cf_fix_cppflags in
12201 (no)
12202         case $cf_add_cflags in
12203         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12204                 case $cf_add_cflags in
12205                 (-D*)
12206                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12207
12208                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12209                                 && test -z "${cf_tst_cflags}" \
12210                                 && cf_fix_cppflags=yes
12211
12212                         if test $cf_fix_cppflags = yes ; then
12213
12214         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12215         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12216
12217                                 continue
12218                         elif test "${cf_tst_cflags}" = "\"'" ; then
12219
12220         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12221         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12222
12223                                 continue
12224                         fi
12225                         ;;
12226                 esac
12227                 case "$CPPFLAGS" in
12228                 (*$cf_add_cflags)
12229                         ;;
12230                 (*)
12231                         case $cf_add_cflags in
12232                         (-D*)
12233                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12234
12235 CPPFLAGS=`echo "$CPPFLAGS" | \
12236         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12237                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12238
12239                                 ;;
12240                         esac
12241
12242         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12243         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12244
12245                         ;;
12246                 esac
12247                 ;;
12248         (*)
12249
12250         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12251         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12252
12253                 ;;
12254         esac
12255         ;;
12256 (yes)
12257
12258         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12259         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12260
12261         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12262
12263         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12264                 && test -z "${cf_tst_cflags}" \
12265                 && cf_fix_cppflags=no
12266         ;;
12267 esac
12268 done
12269
12270 if test -n "$cf_new_cflags" ; then
12271
12272         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12273         CFLAGS="${CFLAGS}$cf_new_cflags"
12274
12275 fi
12276
12277 if test -n "$cf_new_cppflags" ; then
12278
12279         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12280         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12281
12282 fi
12283
12284 if test -n "$cf_new_extra_cppflags" ; then
12285
12286         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12287         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12288
12289 fi
12290
12291 cf_add_libs="$cf_pkgconfig_libs"
12292 # Filter out duplicates - this happens with badly-designed ".pc" files...
12293 for cf_add_1lib in $LIBS
12294 do
12295         for cf_add_2lib in $cf_add_libs
12296         do
12297                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12298                 then
12299                         cf_add_1lib=
12300                         break
12301                 fi
12302         done
12303         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12304 done
12305 LIBS="$cf_add_libs"
12306
12307         :
12308 else
12309         cf_pkgconfig_incs=
12310         cf_pkgconfig_libs=
12311         { echo "$as_me:12311: WARNING: unable to find Xt library" >&5
12312 echo "$as_me: WARNING: unable to find Xt library" >&2;}
12313 fi
12314
12315 fi
12316
12317 cf_have_X_LIBS=no
12318
12319 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12320         test -n "$verbose" && echo "    found package xt" 1>&6
12321
12322 echo "${as_me:-configure}:12322: testing found package xt ..." 1>&5
12323
12324         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12325         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12326         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12327
12328 echo "${as_me:-configure}:12328: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12329
12330         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12331
12332 echo "${as_me:-configure}:12332: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12333
12334 cf_fix_cppflags=no
12335 cf_new_cflags=
12336 cf_new_cppflags=
12337 cf_new_extra_cppflags=
12338
12339 for cf_add_cflags in $cf_pkgconfig_incs
12340 do
12341 case $cf_fix_cppflags in
12342 (no)
12343         case $cf_add_cflags in
12344         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12345                 case $cf_add_cflags in
12346                 (-D*)
12347                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12348
12349                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12350                                 && test -z "${cf_tst_cflags}" \
12351                                 && cf_fix_cppflags=yes
12352
12353                         if test $cf_fix_cppflags = yes ; then
12354
12355         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12356         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12357
12358                                 continue
12359                         elif test "${cf_tst_cflags}" = "\"'" ; then
12360
12361         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12362         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12363
12364                                 continue
12365                         fi
12366                         ;;
12367                 esac
12368                 case "$CPPFLAGS" in
12369                 (*$cf_add_cflags)
12370                         ;;
12371                 (*)
12372                         case $cf_add_cflags in
12373                         (-D*)
12374                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12375
12376 CPPFLAGS=`echo "$CPPFLAGS" | \
12377         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12378                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12379
12380                                 ;;
12381                         esac
12382
12383         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12384         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12385
12386                         ;;
12387                 esac
12388                 ;;
12389         (*)
12390
12391         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12392         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12393
12394                 ;;
12395         esac
12396         ;;
12397 (yes)
12398
12399         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12400         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12401
12402         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12403
12404         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12405                 && test -z "${cf_tst_cflags}" \
12406                 && cf_fix_cppflags=no
12407         ;;
12408 esac
12409 done
12410
12411 if test -n "$cf_new_cflags" ; then
12412
12413         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12414         CFLAGS="${CFLAGS}$cf_new_cflags"
12415
12416 fi
12417
12418 if test -n "$cf_new_cppflags" ; then
12419
12420         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12421         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12422
12423 fi
12424
12425 if test -n "$cf_new_extra_cppflags" ; then
12426
12427         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12428         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12429
12430 fi
12431
12432 cf_add_libs="$cf_pkgconfig_libs"
12433 # Filter out duplicates - this happens with badly-designed ".pc" files...
12434 for cf_add_1lib in $LIBS
12435 do
12436         for cf_add_2lib in $cf_add_libs
12437         do
12438                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12439                 then
12440                         cf_add_1lib=
12441                         break
12442                 fi
12443         done
12444         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12445 done
12446 LIBS="$cf_add_libs"
12447
12448         case "x$LIBS" in
12449         (*-lX11*)
12450                 ;;
12451         (*)
12452 # we have an "xt" package, but it may omit Xt's dependency on X11
12453 echo "$as_me:12453: checking for usable X dependency" >&5
12454 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
12455 if test "${cf_cv_xt_x11_compat+set}" = set; then
12456   echo $ECHO_N "(cached) $ECHO_C" >&6
12457 else
12458
12459 cat >conftest.$ac_ext <<_ACEOF
12460 #line 12460 "configure"
12461 #include "confdefs.h"
12462
12463 #include <X11/Xlib.h>
12464
12465 int
12466 main (void)
12467 {
12468
12469         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12470         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12471         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12472         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12473
12474   ;
12475   return 0;
12476 }
12477 _ACEOF
12478 rm -f conftest.$ac_objext conftest$ac_exeext
12479 if { (eval echo "$as_me:12479: \"$ac_link\"") >&5
12480   (eval $ac_link) 2>&5
12481   ac_status=$?
12482   echo "$as_me:12482: \$? = $ac_status" >&5
12483   (exit $ac_status); } &&
12484          { ac_try='test -s conftest$ac_exeext'
12485   { (eval echo "$as_me:12485: \"$ac_try\"") >&5
12486   (eval $ac_try) 2>&5
12487   ac_status=$?
12488   echo "$as_me:12488: \$? = $ac_status" >&5
12489   (exit $ac_status); }; }; then
12490   cf_cv_xt_x11_compat=yes
12491 else
12492   echo "$as_me: failed program was:" >&5
12493 cat conftest.$ac_ext >&5
12494 cf_cv_xt_x11_compat=no
12495 fi
12496 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12497 fi
12498 echo "$as_me:12498: result: $cf_cv_xt_x11_compat" >&5
12499 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12500                 if test "$cf_cv_xt_x11_compat" = no
12501                 then
12502                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12503
12504 echo "${as_me:-configure}:12504: testing work around broken X11 dependency ..." 1>&5
12505
12506                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12507
12508 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12509         test -n "$verbose" && echo "    found package x11" 1>&6
12510
12511 echo "${as_me:-configure}:12511: testing found package x11 ..." 1>&5
12512
12513         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12514         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12515         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12516
12517 echo "${as_me:-configure}:12517: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12518
12519         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12520
12521 echo "${as_me:-configure}:12521: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12522
12523 cf_fix_cppflags=no
12524 cf_new_cflags=
12525 cf_new_cppflags=
12526 cf_new_extra_cppflags=
12527
12528 for cf_add_cflags in $cf_pkgconfig_incs
12529 do
12530 case $cf_fix_cppflags in
12531 (no)
12532         case $cf_add_cflags in
12533         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12534                 case $cf_add_cflags in
12535                 (-D*)
12536                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12537
12538                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12539                                 && test -z "${cf_tst_cflags}" \
12540                                 && cf_fix_cppflags=yes
12541
12542                         if test $cf_fix_cppflags = yes ; then
12543
12544         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12545         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12546
12547                                 continue
12548                         elif test "${cf_tst_cflags}" = "\"'" ; then
12549
12550         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12551         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12552
12553                                 continue
12554                         fi
12555                         ;;
12556                 esac
12557                 case "$CPPFLAGS" in
12558                 (*$cf_add_cflags)
12559                         ;;
12560                 (*)
12561                         case $cf_add_cflags in
12562                         (-D*)
12563                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12564
12565 CPPFLAGS=`echo "$CPPFLAGS" | \
12566         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12567                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12568
12569                                 ;;
12570                         esac
12571
12572         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12573         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12574
12575                         ;;
12576                 esac
12577                 ;;
12578         (*)
12579
12580         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12581         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12582
12583                 ;;
12584         esac
12585         ;;
12586 (yes)
12587
12588         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12589         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12590
12591         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12592
12593         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12594                 && test -z "${cf_tst_cflags}" \
12595                 && cf_fix_cppflags=no
12596         ;;
12597 esac
12598 done
12599
12600 if test -n "$cf_new_cflags" ; then
12601
12602         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12603         CFLAGS="${CFLAGS}$cf_new_cflags"
12604
12605 fi
12606
12607 if test -n "$cf_new_cppflags" ; then
12608
12609         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12610         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12611
12612 fi
12613
12614 if test -n "$cf_new_extra_cppflags" ; then
12615
12616         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12617         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12618
12619 fi
12620
12621 cf_add_libs="$cf_pkgconfig_libs"
12622 # Filter out duplicates - this happens with badly-designed ".pc" files...
12623 for cf_add_1lib in $LIBS
12624 do
12625         for cf_add_2lib in $cf_add_libs
12626         do
12627                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12628                 then
12629                         cf_add_1lib=
12630                         break
12631                 fi
12632         done
12633         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12634 done
12635 LIBS="$cf_add_libs"
12636
12637         :
12638 else
12639         cf_pkgconfig_incs=
12640         cf_pkgconfig_libs=
12641
12642 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12643
12644 echo "${as_me:-configure}:12644: testing ...before $LIBS ..." 1>&5
12645
12646 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12647 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12648
12649 echo "${as_me:-configure}:12649: testing ...after  $LIBS ..." 1>&5
12650
12651 fi
12652
12653                 fi
12654                 ;;
12655         esac
12656
12657 echo "$as_me:12657: checking for usable X Toolkit package" >&5
12658 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12659 if test "${cf_cv_xt_ice_compat+set}" = set; then
12660   echo $ECHO_N "(cached) $ECHO_C" >&6
12661 else
12662
12663 cat >conftest.$ac_ext <<_ACEOF
12664 #line 12664 "configure"
12665 #include "confdefs.h"
12666
12667 #include <X11/Shell.h>
12668
12669 int
12670 main (void)
12671 {
12672 int num = IceConnectionNumber(0)
12673
12674   ;
12675   return 0;
12676 }
12677 _ACEOF
12678 rm -f conftest.$ac_objext conftest$ac_exeext
12679 if { (eval echo "$as_me:12679: \"$ac_link\"") >&5
12680   (eval $ac_link) 2>&5
12681   ac_status=$?
12682   echo "$as_me:12682: \$? = $ac_status" >&5
12683   (exit $ac_status); } &&
12684          { ac_try='test -s conftest$ac_exeext'
12685   { (eval echo "$as_me:12685: \"$ac_try\"") >&5
12686   (eval $ac_try) 2>&5
12687   ac_status=$?
12688   echo "$as_me:12688: \$? = $ac_status" >&5
12689   (exit $ac_status); }; }; then
12690   cf_cv_xt_ice_compat=yes
12691 else
12692   echo "$as_me: failed program was:" >&5
12693 cat conftest.$ac_ext >&5
12694 cf_cv_xt_ice_compat=no
12695 fi
12696 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12697 fi
12698 echo "$as_me:12698: result: $cf_cv_xt_ice_compat" >&5
12699 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12700
12701         if test "$cf_cv_xt_ice_compat" = no
12702         then
12703                 # workaround for broken ".pc" files used for X Toolkit.
12704                 case "x$X_PRE_LIBS" in
12705                 (*-lICE*)
12706                         case "x$LIBS" in
12707                         (*-lICE*)
12708                                 ;;
12709                         (*)
12710                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12711
12712 echo "${as_me:-configure}:12712: testing work around broken ICE dependency ..." 1>&5
12713
12714 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12715         test -n "$verbose" && echo "    found package ice" 1>&6
12716
12717 echo "${as_me:-configure}:12717: testing found package ice ..." 1>&5
12718
12719         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12720         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12721         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12722
12723 echo "${as_me:-configure}:12723: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12724
12725         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12726
12727 echo "${as_me:-configure}:12727: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12728
12729 cf_fix_cppflags=no
12730 cf_new_cflags=
12731 cf_new_cppflags=
12732 cf_new_extra_cppflags=
12733
12734 for cf_add_cflags in $cf_pkgconfig_incs
12735 do
12736 case $cf_fix_cppflags in
12737 (no)
12738         case $cf_add_cflags in
12739         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12740                 case $cf_add_cflags in
12741                 (-D*)
12742                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12743
12744                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12745                                 && test -z "${cf_tst_cflags}" \
12746                                 && cf_fix_cppflags=yes
12747
12748                         if test $cf_fix_cppflags = yes ; then
12749
12750         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12751         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12752
12753                                 continue
12754                         elif test "${cf_tst_cflags}" = "\"'" ; then
12755
12756         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12757         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12758
12759                                 continue
12760                         fi
12761                         ;;
12762                 esac
12763                 case "$CPPFLAGS" in
12764                 (*$cf_add_cflags)
12765                         ;;
12766                 (*)
12767                         case $cf_add_cflags in
12768                         (-D*)
12769                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12770
12771 CPPFLAGS=`echo "$CPPFLAGS" | \
12772         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12773                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12774
12775                                 ;;
12776                         esac
12777
12778         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12779         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12780
12781                         ;;
12782                 esac
12783                 ;;
12784         (*)
12785
12786         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12787         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12788
12789                 ;;
12790         esac
12791         ;;
12792 (yes)
12793
12794         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12795         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12796
12797         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12798
12799         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12800                 && test -z "${cf_tst_cflags}" \
12801                 && cf_fix_cppflags=no
12802         ;;
12803 esac
12804 done
12805
12806 if test -n "$cf_new_cflags" ; then
12807
12808         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12809         CFLAGS="${CFLAGS}$cf_new_cflags"
12810
12811 fi
12812
12813 if test -n "$cf_new_cppflags" ; then
12814
12815         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12816         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12817
12818 fi
12819
12820 if test -n "$cf_new_extra_cppflags" ; then
12821
12822         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12823         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12824
12825 fi
12826
12827 cf_add_libs="$cf_pkgconfig_libs"
12828 # Filter out duplicates - this happens with badly-designed ".pc" files...
12829 for cf_add_1lib in $LIBS
12830 do
12831         for cf_add_2lib in $cf_add_libs
12832         do
12833                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12834                 then
12835                         cf_add_1lib=
12836                         break
12837                 fi
12838         done
12839         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12840 done
12841 LIBS="$cf_add_libs"
12842
12843 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12844         test -n "$verbose" && echo "    found package sm" 1>&6
12845
12846 echo "${as_me:-configure}:12846: testing found package sm ..." 1>&5
12847
12848         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12849         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12850         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12851
12852 echo "${as_me:-configure}:12852: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12853
12854         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12855
12856 echo "${as_me:-configure}:12856: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12857
12858 cf_fix_cppflags=no
12859 cf_new_cflags=
12860 cf_new_cppflags=
12861 cf_new_extra_cppflags=
12862
12863 for cf_add_cflags in $cf_pkgconfig_incs
12864 do
12865 case $cf_fix_cppflags in
12866 (no)
12867         case $cf_add_cflags in
12868         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12869                 case $cf_add_cflags in
12870                 (-D*)
12871                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12872
12873                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12874                                 && test -z "${cf_tst_cflags}" \
12875                                 && cf_fix_cppflags=yes
12876
12877                         if test $cf_fix_cppflags = yes ; then
12878
12879         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12880         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12881
12882                                 continue
12883                         elif test "${cf_tst_cflags}" = "\"'" ; then
12884
12885         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12886         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12887
12888                                 continue
12889                         fi
12890                         ;;
12891                 esac
12892                 case "$CPPFLAGS" in
12893                 (*$cf_add_cflags)
12894                         ;;
12895                 (*)
12896                         case $cf_add_cflags in
12897                         (-D*)
12898                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12899
12900 CPPFLAGS=`echo "$CPPFLAGS" | \
12901         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12902                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12903
12904                                 ;;
12905                         esac
12906
12907         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12908         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12909
12910                         ;;
12911                 esac
12912                 ;;
12913         (*)
12914
12915         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12916         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12917
12918                 ;;
12919         esac
12920         ;;
12921 (yes)
12922
12923         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12924         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12925
12926         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12927
12928         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12929                 && test -z "${cf_tst_cflags}" \
12930                 && cf_fix_cppflags=no
12931         ;;
12932 esac
12933 done
12934
12935 if test -n "$cf_new_cflags" ; then
12936
12937         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12938         CFLAGS="${CFLAGS}$cf_new_cflags"
12939
12940 fi
12941
12942 if test -n "$cf_new_cppflags" ; then
12943
12944         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12945         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12946
12947 fi
12948
12949 if test -n "$cf_new_extra_cppflags" ; then
12950
12951         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12952         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12953
12954 fi
12955
12956 cf_add_libs="$cf_pkgconfig_libs"
12957 # Filter out duplicates - this happens with badly-designed ".pc" files...
12958 for cf_add_1lib in $LIBS
12959 do
12960         for cf_add_2lib in $cf_add_libs
12961         do
12962                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12963                 then
12964                         cf_add_1lib=
12965                         break
12966                 fi
12967         done
12968         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12969 done
12970 LIBS="$cf_add_libs"
12971
12972         :
12973 else
12974         cf_pkgconfig_incs=
12975         cf_pkgconfig_libs=
12976         :
12977 fi
12978
12979 else
12980         cf_pkgconfig_incs=
12981         cf_pkgconfig_libs=
12982
12983 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12984
12985 echo "${as_me:-configure}:12985: testing ...before $LIBS ..." 1>&5
12986
12987 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12988 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12989
12990 echo "${as_me:-configure}:12990: testing ...after  $LIBS ..." 1>&5
12991
12992 fi
12993
12994                                 ;;
12995                         esac
12996                         ;;
12997                 esac
12998         fi
12999
13000         cf_have_X_LIBS=yes
13001
13002 else
13003         cf_pkgconfig_incs=
13004         cf_pkgconfig_libs=
13005
13006         LDFLAGS="$X_LIBS $LDFLAGS"
13007
13008 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13009
13010 echo "${as_me:-configure}:13010: testing checking additions to CFLAGS ..." 1>&5
13011
13012 cf_check_cflags="$CFLAGS"
13013 cf_check_cppflags="$CPPFLAGS"
13014
13015 cf_fix_cppflags=no
13016 cf_new_cflags=
13017 cf_new_cppflags=
13018 cf_new_extra_cppflags=
13019
13020 for cf_add_cflags in $X_CFLAGS
13021 do
13022 case $cf_fix_cppflags in
13023 (no)
13024         case $cf_add_cflags in
13025         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13026                 case $cf_add_cflags in
13027                 (-D*)
13028                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13029
13030                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13031                                 && test -z "${cf_tst_cflags}" \
13032                                 && cf_fix_cppflags=yes
13033
13034                         if test $cf_fix_cppflags = yes ; then
13035
13036         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13037         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13038
13039                                 continue
13040                         elif test "${cf_tst_cflags}" = "\"'" ; then
13041
13042         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13043         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13044
13045                                 continue
13046                         fi
13047                         ;;
13048                 esac
13049                 case "$CPPFLAGS" in
13050                 (*$cf_add_cflags)
13051                         ;;
13052                 (*)
13053                         case $cf_add_cflags in
13054                         (-D*)
13055                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13056
13057 CPPFLAGS=`echo "$CPPFLAGS" | \
13058         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13059                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13060
13061                                 ;;
13062                         esac
13063
13064         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13065         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13066
13067                         ;;
13068                 esac
13069                 ;;
13070         (*)
13071
13072         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13073         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13074
13075                 ;;
13076         esac
13077         ;;
13078 (yes)
13079
13080         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13081         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13082
13083         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13084
13085         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13086                 && test -z "${cf_tst_cflags}" \
13087                 && cf_fix_cppflags=no
13088         ;;
13089 esac
13090 done
13091
13092 if test -n "$cf_new_cflags" ; then
13093         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13094
13095 echo "${as_me:-configure}:13095: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13096
13097         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13098         CFLAGS="${CFLAGS}$cf_new_cflags"
13099
13100 fi
13101
13102 if test -n "$cf_new_cppflags" ; then
13103         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13104
13105 echo "${as_me:-configure}:13105: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13106
13107         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13108         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13109
13110 fi
13111
13112 if test -n "$cf_new_extra_cppflags" ; then
13113         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13114
13115 echo "${as_me:-configure}:13115: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13116
13117         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13118         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13119
13120 fi
13121
13122 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13123 cat >conftest.$ac_ext <<_ACEOF
13124 #line 13124 "configure"
13125 #include "confdefs.h"
13126 #include <stdio.h>
13127 int
13128 main (void)
13129 {
13130 printf("Hello world");
13131   ;
13132   return 0;
13133 }
13134 _ACEOF
13135 rm -f conftest.$ac_objext conftest$ac_exeext
13136 if { (eval echo "$as_me:13136: \"$ac_link\"") >&5
13137   (eval $ac_link) 2>&5
13138   ac_status=$?
13139   echo "$as_me:13139: \$? = $ac_status" >&5
13140   (exit $ac_status); } &&
13141          { ac_try='test -s conftest$ac_exeext'
13142   { (eval echo "$as_me:13142: \"$ac_try\"") >&5
13143   (eval $ac_try) 2>&5
13144   ac_status=$?
13145   echo "$as_me:13145: \$? = $ac_status" >&5
13146   (exit $ac_status); }; }; then
13147   :
13148 else
13149   echo "$as_me: failed program was:" >&5
13150 cat conftest.$ac_ext >&5
13151 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13152
13153 echo "${as_me:-configure}:13153: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13154
13155          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13156                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13157
13158 echo "${as_me:-configure}:13158: testing but keeping change to \$CPPFLAGS ..." 1>&5
13159
13160          fi
13161          CFLAGS="$cf_check_flags"
13162 fi
13163 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13164 fi
13165
13166         echo "$as_me:13166: checking for XOpenDisplay" >&5
13167 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
13168 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
13169   echo $ECHO_N "(cached) $ECHO_C" >&6
13170 else
13171   cat >conftest.$ac_ext <<_ACEOF
13172 #line 13172 "configure"
13173 #include "confdefs.h"
13174 /* System header to define __stub macros and hopefully few prototypes,
13175     which can conflict with char XOpenDisplay (); below.  */
13176 #include <assert.h>
13177 /* Override any gcc2 internal prototype to avoid an error.  */
13178 #ifdef __cplusplus
13179 extern "C"
13180 #endif
13181 /* We use char because int might match the return type of a gcc2
13182    builtin and then its argument prototype would still apply.  */
13183 char XOpenDisplay ();
13184 char (*f) ();
13185
13186 int
13187 main (void)
13188 {
13189 /* The GNU C library defines this for functions which it implements
13190     to always fail with ENOSYS.  Some functions are actually named
13191     something starting with __ and the normal name is an alias.  */
13192 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
13193 choke me
13194 #else
13195 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13196 #endif
13197
13198   ;
13199   return 0;
13200 }
13201 _ACEOF
13202 rm -f conftest.$ac_objext conftest$ac_exeext
13203 if { (eval echo "$as_me:13203: \"$ac_link\"") >&5
13204   (eval $ac_link) 2>&5
13205   ac_status=$?
13206   echo "$as_me:13206: \$? = $ac_status" >&5
13207   (exit $ac_status); } &&
13208          { ac_try='test -s conftest$ac_exeext'
13209   { (eval echo "$as_me:13209: \"$ac_try\"") >&5
13210   (eval $ac_try) 2>&5
13211   ac_status=$?
13212   echo "$as_me:13212: \$? = $ac_status" >&5
13213   (exit $ac_status); }; }; then
13214   ac_cv_func_XOpenDisplay=yes
13215 else
13216   echo "$as_me: failed program was:" >&5
13217 cat conftest.$ac_ext >&5
13218 ac_cv_func_XOpenDisplay=no
13219 fi
13220 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13221 fi
13222 echo "$as_me:13222: result: $ac_cv_func_XOpenDisplay" >&5
13223 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
13224 if test $ac_cv_func_XOpenDisplay = yes; then
13225   :
13226 else
13227
13228         echo "$as_me:13228: checking for XOpenDisplay in -lX11" >&5
13229 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13230 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13231   echo $ECHO_N "(cached) $ECHO_C" >&6
13232 else
13233   ac_check_lib_save_LIBS=$LIBS
13234 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13235 cat >conftest.$ac_ext <<_ACEOF
13236 #line 13236 "configure"
13237 #include "confdefs.h"
13238
13239 /* Override any gcc2 internal prototype to avoid an error.  */
13240 #ifdef __cplusplus
13241 extern "C"
13242 #endif
13243 /* We use char because int might match the return type of a gcc2
13244    builtin and then its argument prototype would still apply.  */
13245 char XOpenDisplay ();
13246 int
13247 main (void)
13248 {
13249 XOpenDisplay ();
13250   ;
13251   return 0;
13252 }
13253 _ACEOF
13254 rm -f conftest.$ac_objext conftest$ac_exeext
13255 if { (eval echo "$as_me:13255: \"$ac_link\"") >&5
13256   (eval $ac_link) 2>&5
13257   ac_status=$?
13258   echo "$as_me:13258: \$? = $ac_status" >&5
13259   (exit $ac_status); } &&
13260          { ac_try='test -s conftest$ac_exeext'
13261   { (eval echo "$as_me:13261: \"$ac_try\"") >&5
13262   (eval $ac_try) 2>&5
13263   ac_status=$?
13264   echo "$as_me:13264: \$? = $ac_status" >&5
13265   (exit $ac_status); }; }; then
13266   ac_cv_lib_X11_XOpenDisplay=yes
13267 else
13268   echo "$as_me: failed program was:" >&5
13269 cat conftest.$ac_ext >&5
13270 ac_cv_lib_X11_XOpenDisplay=no
13271 fi
13272 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13273 LIBS=$ac_check_lib_save_LIBS
13274 fi
13275 echo "$as_me:13275: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13276 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13277 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13278
13279 cf_add_libs="-lX11"
13280 # Filter out duplicates - this happens with badly-designed ".pc" files...
13281 for cf_add_1lib in $LIBS
13282 do
13283         for cf_add_2lib in $cf_add_libs
13284         do
13285                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13286                 then
13287                         cf_add_1lib=
13288                         break
13289                 fi
13290         done
13291         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13292 done
13293 LIBS="$cf_add_libs"
13294
13295 fi
13296
13297 fi
13298
13299         echo "$as_me:13299: checking for XtAppInitialize" >&5
13300 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
13301 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
13302   echo $ECHO_N "(cached) $ECHO_C" >&6
13303 else
13304   cat >conftest.$ac_ext <<_ACEOF
13305 #line 13305 "configure"
13306 #include "confdefs.h"
13307 /* System header to define __stub macros and hopefully few prototypes,
13308     which can conflict with char XtAppInitialize (); below.  */
13309 #include <assert.h>
13310 /* Override any gcc2 internal prototype to avoid an error.  */
13311 #ifdef __cplusplus
13312 extern "C"
13313 #endif
13314 /* We use char because int might match the return type of a gcc2
13315    builtin and then its argument prototype would still apply.  */
13316 char XtAppInitialize ();
13317 char (*f) ();
13318
13319 int
13320 main (void)
13321 {
13322 /* The GNU C library defines this for functions which it implements
13323     to always fail with ENOSYS.  Some functions are actually named
13324     something starting with __ and the normal name is an alias.  */
13325 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
13326 choke me
13327 #else
13328 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13329 #endif
13330
13331   ;
13332   return 0;
13333 }
13334 _ACEOF
13335 rm -f conftest.$ac_objext conftest$ac_exeext
13336 if { (eval echo "$as_me:13336: \"$ac_link\"") >&5
13337   (eval $ac_link) 2>&5
13338   ac_status=$?
13339   echo "$as_me:13339: \$? = $ac_status" >&5
13340   (exit $ac_status); } &&
13341          { ac_try='test -s conftest$ac_exeext'
13342   { (eval echo "$as_me:13342: \"$ac_try\"") >&5
13343   (eval $ac_try) 2>&5
13344   ac_status=$?
13345   echo "$as_me:13345: \$? = $ac_status" >&5
13346   (exit $ac_status); }; }; then
13347   ac_cv_func_XtAppInitialize=yes
13348 else
13349   echo "$as_me: failed program was:" >&5
13350 cat conftest.$ac_ext >&5
13351 ac_cv_func_XtAppInitialize=no
13352 fi
13353 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13354 fi
13355 echo "$as_me:13355: result: $ac_cv_func_XtAppInitialize" >&5
13356 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
13357 if test $ac_cv_func_XtAppInitialize = yes; then
13358   :
13359 else
13360
13361         echo "$as_me:13361: checking for XtAppInitialize in -lXt" >&5
13362 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
13363 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
13364   echo $ECHO_N "(cached) $ECHO_C" >&6
13365 else
13366   ac_check_lib_save_LIBS=$LIBS
13367 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13368 cat >conftest.$ac_ext <<_ACEOF
13369 #line 13369 "configure"
13370 #include "confdefs.h"
13371
13372 /* Override any gcc2 internal prototype to avoid an error.  */
13373 #ifdef __cplusplus
13374 extern "C"
13375 #endif
13376 /* We use char because int might match the return type of a gcc2
13377    builtin and then its argument prototype would still apply.  */
13378 char XtAppInitialize ();
13379 int
13380 main (void)
13381 {
13382 XtAppInitialize ();
13383   ;
13384   return 0;
13385 }
13386 _ACEOF
13387 rm -f conftest.$ac_objext conftest$ac_exeext
13388 if { (eval echo "$as_me:13388: \"$ac_link\"") >&5
13389   (eval $ac_link) 2>&5
13390   ac_status=$?
13391   echo "$as_me:13391: \$? = $ac_status" >&5
13392   (exit $ac_status); } &&
13393          { ac_try='test -s conftest$ac_exeext'
13394   { (eval echo "$as_me:13394: \"$ac_try\"") >&5
13395   (eval $ac_try) 2>&5
13396   ac_status=$?
13397   echo "$as_me:13397: \$? = $ac_status" >&5
13398   (exit $ac_status); }; }; then
13399   ac_cv_lib_Xt_XtAppInitialize=yes
13400 else
13401   echo "$as_me: failed program was:" >&5
13402 cat conftest.$ac_ext >&5
13403 ac_cv_lib_Xt_XtAppInitialize=no
13404 fi
13405 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13406 LIBS=$ac_check_lib_save_LIBS
13407 fi
13408 echo "$as_me:13408: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
13409 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
13410 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
13411
13412 cat >>confdefs.h <<\EOF
13413 #define HAVE_LIBXT 1
13414 EOF
13415
13416                  cf_have_X_LIBS=Xt
13417                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13418 fi
13419
13420 fi
13421
13422 fi
13423
13424 if test $cf_have_X_LIBS = no ; then
13425         { echo "$as_me:13425: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13426 test program.  You will have to check and add the proper libraries by hand
13427 to makefile." >&5
13428 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13429 test program.  You will have to check and add the proper libraries by hand
13430 to makefile." >&2;}
13431 fi
13432
13433 cf_x_athena_root=$cf_x_athena
13434 cf_x_athena_inc=""
13435
13436 for cf_path in default \
13437         /usr/contrib/X11R6 \
13438         /usr/contrib/X11R5 \
13439         /usr/lib/X11R5 \
13440         /usr/local
13441 do
13442         if test -z "$cf_x_athena_inc" ; then
13443                 cf_save="$CPPFLAGS"
13444                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
13445                 if test $cf_path != default ; then
13446                         CPPFLAGS="$cf_save -I$cf_path/include"
13447                         echo "$as_me:13447: checking for $cf_test in $cf_path" >&5
13448 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
13449                 else
13450                         echo "$as_me:13450: checking for $cf_test" >&5
13451 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
13452                 fi
13453                 cat >conftest.$ac_ext <<_ACEOF
13454 #line 13454 "configure"
13455 #include "confdefs.h"
13456
13457 #include <X11/Intrinsic.h>
13458 #include <$cf_test>
13459 int
13460 main (void)
13461 {
13462
13463   ;
13464   return 0;
13465 }
13466 _ACEOF
13467 rm -f conftest.$ac_objext
13468 if { (eval echo "$as_me:13468: \"$ac_compile\"") >&5
13469   (eval $ac_compile) 2>&5
13470   ac_status=$?
13471   echo "$as_me:13471: \$? = $ac_status" >&5
13472   (exit $ac_status); } &&
13473          { ac_try='test -s conftest.$ac_objext'
13474   { (eval echo "$as_me:13474: \"$ac_try\"") >&5
13475   (eval $ac_try) 2>&5
13476   ac_status=$?
13477   echo "$as_me:13477: \$? = $ac_status" >&5
13478   (exit $ac_status); }; }; then
13479   cf_result=yes
13480 else
13481   echo "$as_me: failed program was:" >&5
13482 cat conftest.$ac_ext >&5
13483 cf_result=no
13484 fi
13485 rm -f conftest.$ac_objext conftest.$ac_ext
13486                 echo "$as_me:13486: result: $cf_result" >&5
13487 echo "${ECHO_T}$cf_result" >&6
13488                 if test "$cf_result" = yes ; then
13489                         cf_x_athena_inc=$cf_path
13490                         break
13491                 else
13492                         CPPFLAGS="$cf_save"
13493                 fi
13494         fi
13495 done
13496
13497 if test -z "$cf_x_athena_inc" ; then
13498         { echo "$as_me:13498: WARNING: Unable to successfully find Athena header files with test program" >&5
13499 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
13500 elif test "$cf_x_athena_inc" != default ; then
13501         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
13502 fi
13503
13504 cf_x_athena_root=$cf_x_athena
13505 cf_x_athena_lib=""
13506
13507 for cf_path in default \
13508         /usr/contrib/X11R6 \
13509         /usr/contrib/X11R5 \
13510         /usr/lib/X11R5 \
13511         /usr/local
13512 do
13513         for cf_lib in \
13514                 ${cf_x_athena_root} \
13515                 ${cf_x_athena_root}7 \
13516                 ${cf_x_athena_root}6
13517         do
13518         for cf_libs in \
13519                 "-l$cf_lib -lXmu" \
13520                 "-l$cf_lib -lXpm -lXmu" \
13521                 "-l${cf_lib}_s -lXmu_s"
13522         do
13523                 if test -z "$cf_x_athena_lib" ; then
13524                         cf_save="$LIBS"
13525                         cf_test=XawSimpleMenuAddGlobalActions
13526                         if test $cf_path != default ; then
13527
13528 cf_add_libs="-L$cf_path/lib $cf_libs"
13529 # Filter out duplicates - this happens with badly-designed ".pc" files...
13530 for cf_add_1lib in $LIBS
13531 do
13532         for cf_add_2lib in $cf_add_libs
13533         do
13534                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13535                 then
13536                         cf_add_1lib=
13537                         break
13538                 fi
13539         done
13540         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13541 done
13542 LIBS="$cf_add_libs"
13543
13544                                 echo "$as_me:13544: checking for $cf_libs in $cf_path" >&5
13545 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13546                         else
13547
13548 cf_add_libs="$cf_libs"
13549 # Filter out duplicates - this happens with badly-designed ".pc" files...
13550 for cf_add_1lib in $LIBS
13551 do
13552         for cf_add_2lib in $cf_add_libs
13553         do
13554                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13555                 then
13556                         cf_add_1lib=
13557                         break
13558                 fi
13559         done
13560         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13561 done
13562 LIBS="$cf_add_libs"
13563
13564                                 echo "$as_me:13564: checking for $cf_test in $cf_libs" >&5
13565 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13566                         fi
13567                         cat >conftest.$ac_ext <<_ACEOF
13568 #line 13568 "configure"
13569 #include "confdefs.h"
13570
13571 #include <X11/Intrinsic.h>
13572 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13573
13574 int
13575 main (void)
13576 {
13577
13578 $cf_test((XtAppContext) 0)
13579   ;
13580   return 0;
13581 }
13582 _ACEOF
13583 rm -f conftest.$ac_objext conftest$ac_exeext
13584 if { (eval echo "$as_me:13584: \"$ac_link\"") >&5
13585   (eval $ac_link) 2>&5
13586   ac_status=$?
13587   echo "$as_me:13587: \$? = $ac_status" >&5
13588   (exit $ac_status); } &&
13589          { ac_try='test -s conftest$ac_exeext'
13590   { (eval echo "$as_me:13590: \"$ac_try\"") >&5
13591   (eval $ac_try) 2>&5
13592   ac_status=$?
13593   echo "$as_me:13593: \$? = $ac_status" >&5
13594   (exit $ac_status); }; }; then
13595   cf_result=yes
13596 else
13597   echo "$as_me: failed program was:" >&5
13598 cat conftest.$ac_ext >&5
13599 cf_result=no
13600 fi
13601 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13602                         echo "$as_me:13602: result: $cf_result" >&5
13603 echo "${ECHO_T}$cf_result" >&6
13604                         if test "$cf_result" = yes ; then
13605                                 cf_x_athena_lib="$cf_libs"
13606                                 break
13607                         fi
13608                         LIBS="$cf_save"
13609                 fi
13610         done # cf_libs
13611                 test -n "$cf_x_athena_lib" && break
13612         done # cf_lib
13613 done
13614
13615 if test -z "$cf_x_athena_lib" ; then
13616         { { echo "$as_me:13616: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13617 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13618    { (exit 1); exit 1; }; }
13619 fi
13620
13621 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13622
13623 cat >>confdefs.h <<EOF
13624 #define $cf_x_athena_LIBS 1
13625 EOF
13626
13627 fi
13628
13629 if test -n "$ac_tool_prefix"; then
13630   for ac_prog in xcurses-config
13631   do
13632     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13633 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13634 echo "$as_me:13634: checking for $ac_word" >&5
13635 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13636 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13637   echo $ECHO_N "(cached) $ECHO_C" >&6
13638 else
13639   if test -n "$XCURSES_CONFIG"; then
13640   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13641 else
13642   ac_save_IFS=$IFS; IFS=$ac_path_separator
13643 ac_dummy="$PATH"
13644 for ac_dir in $ac_dummy; do
13645   IFS=$ac_save_IFS
13646   test -z "$ac_dir" && ac_dir=.
13647   $as_executable_p "$ac_dir/$ac_word" || continue
13648 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13649 echo "$as_me:13649: found $ac_dir/$ac_word" >&5
13650 break
13651 done
13652
13653 fi
13654 fi
13655 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13656 if test -n "$XCURSES_CONFIG"; then
13657   echo "$as_me:13657: result: $XCURSES_CONFIG" >&5
13658 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13659 else
13660   echo "$as_me:13660: result: no" >&5
13661 echo "${ECHO_T}no" >&6
13662 fi
13663
13664     test -n "$XCURSES_CONFIG" && break
13665   done
13666 fi
13667 if test -z "$XCURSES_CONFIG"; then
13668   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13669   for ac_prog in xcurses-config
13670 do
13671   # Extract the first word of "$ac_prog", so it can be a program name with args.
13672 set dummy $ac_prog; ac_word=$2
13673 echo "$as_me:13673: checking for $ac_word" >&5
13674 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13675 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13676   echo $ECHO_N "(cached) $ECHO_C" >&6
13677 else
13678   if test -n "$ac_ct_XCURSES_CONFIG"; then
13679   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13680 else
13681   ac_save_IFS=$IFS; IFS=$ac_path_separator
13682 ac_dummy="$PATH"
13683 for ac_dir in $ac_dummy; do
13684   IFS=$ac_save_IFS
13685   test -z "$ac_dir" && ac_dir=.
13686   $as_executable_p "$ac_dir/$ac_word" || continue
13687 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13688 echo "$as_me:13688: found $ac_dir/$ac_word" >&5
13689 break
13690 done
13691
13692 fi
13693 fi
13694 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13695 if test -n "$ac_ct_XCURSES_CONFIG"; then
13696   echo "$as_me:13696: result: $ac_ct_XCURSES_CONFIG" >&5
13697 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13698 else
13699   echo "$as_me:13699: result: no" >&5
13700 echo "${ECHO_T}no" >&6
13701 fi
13702
13703   test -n "$ac_ct_XCURSES_CONFIG" && break
13704 done
13705 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13706
13707   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13708 fi
13709
13710 if test "$XCURSES_CONFIG" != none ; then
13711
13712 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13713
13714 cf_add_libs="`$XCURSES_CONFIG --libs`"
13715 # Filter out duplicates - this happens with badly-designed ".pc" files...
13716 for cf_add_1lib in $LIBS
13717 do
13718         for cf_add_2lib in $cf_add_libs
13719         do
13720                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13721                 then
13722                         cf_add_1lib=
13723                         break
13724                 fi
13725         done
13726         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13727 done
13728 LIBS="$cf_add_libs"
13729
13730 cf_cv_lib_XCurses=yes
13731
13732 else
13733
13734 LDFLAGS="$LDFLAGS $X_LIBS"
13735
13736 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13737
13738 echo "${as_me:-configure}:13738: testing checking additions to CFLAGS ..." 1>&5
13739
13740 cf_check_cflags="$CFLAGS"
13741 cf_check_cppflags="$CPPFLAGS"
13742
13743 cf_fix_cppflags=no
13744 cf_new_cflags=
13745 cf_new_cppflags=
13746 cf_new_extra_cppflags=
13747
13748 for cf_add_cflags in $X_CFLAGS
13749 do
13750 case $cf_fix_cppflags in
13751 (no)
13752         case $cf_add_cflags in
13753         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13754                 case $cf_add_cflags in
13755                 (-D*)
13756                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13757
13758                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13759                                 && test -z "${cf_tst_cflags}" \
13760                                 && cf_fix_cppflags=yes
13761
13762                         if test $cf_fix_cppflags = yes ; then
13763
13764         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13765         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13766
13767                                 continue
13768                         elif test "${cf_tst_cflags}" = "\"'" ; then
13769
13770         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13771         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13772
13773                                 continue
13774                         fi
13775                         ;;
13776                 esac
13777                 case "$CPPFLAGS" in
13778                 (*$cf_add_cflags)
13779                         ;;
13780                 (*)
13781                         case $cf_add_cflags in
13782                         (-D*)
13783                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13784
13785 CPPFLAGS=`echo "$CPPFLAGS" | \
13786         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13787                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13788
13789                                 ;;
13790                         esac
13791
13792         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13793         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13794
13795                         ;;
13796                 esac
13797                 ;;
13798         (*)
13799
13800         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13801         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13802
13803                 ;;
13804         esac
13805         ;;
13806 (yes)
13807
13808         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13809         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13810
13811         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13812
13813         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13814                 && test -z "${cf_tst_cflags}" \
13815                 && cf_fix_cppflags=no
13816         ;;
13817 esac
13818 done
13819
13820 if test -n "$cf_new_cflags" ; then
13821         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13822
13823 echo "${as_me:-configure}:13823: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13824
13825         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13826         CFLAGS="${CFLAGS}$cf_new_cflags"
13827
13828 fi
13829
13830 if test -n "$cf_new_cppflags" ; then
13831         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13832
13833 echo "${as_me:-configure}:13833: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13834
13835         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13836         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13837
13838 fi
13839
13840 if test -n "$cf_new_extra_cppflags" ; then
13841         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13842
13843 echo "${as_me:-configure}:13843: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13844
13845         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13846         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13847
13848 fi
13849
13850 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13851 cat >conftest.$ac_ext <<_ACEOF
13852 #line 13852 "configure"
13853 #include "confdefs.h"
13854 #include <stdio.h>
13855 int
13856 main (void)
13857 {
13858 printf("Hello world");
13859   ;
13860   return 0;
13861 }
13862 _ACEOF
13863 rm -f conftest.$ac_objext conftest$ac_exeext
13864 if { (eval echo "$as_me:13864: \"$ac_link\"") >&5
13865   (eval $ac_link) 2>&5
13866   ac_status=$?
13867   echo "$as_me:13867: \$? = $ac_status" >&5
13868   (exit $ac_status); } &&
13869          { ac_try='test -s conftest$ac_exeext'
13870   { (eval echo "$as_me:13870: \"$ac_try\"") >&5
13871   (eval $ac_try) 2>&5
13872   ac_status=$?
13873   echo "$as_me:13873: \$? = $ac_status" >&5
13874   (exit $ac_status); }; }; then
13875   :
13876 else
13877   echo "$as_me: failed program was:" >&5
13878 cat conftest.$ac_ext >&5
13879 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13880
13881 echo "${as_me:-configure}:13881: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13882
13883          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13884                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13885
13886 echo "${as_me:-configure}:13886: testing but keeping change to \$CPPFLAGS ..." 1>&5
13887
13888          fi
13889          CFLAGS="$cf_check_flags"
13890 fi
13891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13892 fi
13893
13894 echo "$as_me:13894: checking for XOpenDisplay in -lX11" >&5
13895 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13896 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13897   echo $ECHO_N "(cached) $ECHO_C" >&6
13898 else
13899   ac_check_lib_save_LIBS=$LIBS
13900 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13901 cat >conftest.$ac_ext <<_ACEOF
13902 #line 13902 "configure"
13903 #include "confdefs.h"
13904
13905 /* Override any gcc2 internal prototype to avoid an error.  */
13906 #ifdef __cplusplus
13907 extern "C"
13908 #endif
13909 /* We use char because int might match the return type of a gcc2
13910    builtin and then its argument prototype would still apply.  */
13911 char XOpenDisplay ();
13912 int
13913 main (void)
13914 {
13915 XOpenDisplay ();
13916   ;
13917   return 0;
13918 }
13919 _ACEOF
13920 rm -f conftest.$ac_objext conftest$ac_exeext
13921 if { (eval echo "$as_me:13921: \"$ac_link\"") >&5
13922   (eval $ac_link) 2>&5
13923   ac_status=$?
13924   echo "$as_me:13924: \$? = $ac_status" >&5
13925   (exit $ac_status); } &&
13926          { ac_try='test -s conftest$ac_exeext'
13927   { (eval echo "$as_me:13927: \"$ac_try\"") >&5
13928   (eval $ac_try) 2>&5
13929   ac_status=$?
13930   echo "$as_me:13930: \$? = $ac_status" >&5
13931   (exit $ac_status); }; }; then
13932   ac_cv_lib_X11_XOpenDisplay=yes
13933 else
13934   echo "$as_me: failed program was:" >&5
13935 cat conftest.$ac_ext >&5
13936 ac_cv_lib_X11_XOpenDisplay=no
13937 fi
13938 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13939 LIBS=$ac_check_lib_save_LIBS
13940 fi
13941 echo "$as_me:13941: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13942 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13943 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13944
13945 cf_add_libs="-lX11"
13946 # Filter out duplicates - this happens with badly-designed ".pc" files...
13947 for cf_add_1lib in $LIBS
13948 do
13949         for cf_add_2lib in $cf_add_libs
13950         do
13951                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13952                 then
13953                         cf_add_1lib=
13954                         break
13955                 fi
13956         done
13957         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13958 done
13959 LIBS="$cf_add_libs"
13960
13961 fi
13962
13963 echo "$as_me:13963: checking for XCurses library" >&5
13964 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13965 if test "${cf_cv_lib_XCurses+set}" = set; then
13966   echo $ECHO_N "(cached) $ECHO_C" >&6
13967 else
13968
13969 cf_add_libs="-lXCurses"
13970 # Filter out duplicates - this happens with badly-designed ".pc" files...
13971 for cf_add_1lib in $LIBS
13972 do
13973         for cf_add_2lib in $cf_add_libs
13974         do
13975                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13976                 then
13977                         cf_add_1lib=
13978                         break
13979                 fi
13980         done
13981         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13982 done
13983 LIBS="$cf_add_libs"
13984
13985 cat >conftest.$ac_ext <<_ACEOF
13986 #line 13986 "configure"
13987 #include "confdefs.h"
13988
13989 #include <xcurses.h>
13990 char *XCursesProgramName = "test";
13991
13992 int
13993 main (void)
13994 {
13995 XCursesExit();
13996   ;
13997   return 0;
13998 }
13999 _ACEOF
14000 rm -f conftest.$ac_objext conftest$ac_exeext
14001 if { (eval echo "$as_me:14001: \"$ac_link\"") >&5
14002   (eval $ac_link) 2>&5
14003   ac_status=$?
14004   echo "$as_me:14004: \$? = $ac_status" >&5
14005   (exit $ac_status); } &&
14006          { ac_try='test -s conftest$ac_exeext'
14007   { (eval echo "$as_me:14007: \"$ac_try\"") >&5
14008   (eval $ac_try) 2>&5
14009   ac_status=$?
14010   echo "$as_me:14010: \$? = $ac_status" >&5
14011   (exit $ac_status); }; }; then
14012   cf_cv_lib_XCurses=yes
14013 else
14014   echo "$as_me: failed program was:" >&5
14015 cat conftest.$ac_ext >&5
14016 cf_cv_lib_XCurses=no
14017 fi
14018 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14019
14020 fi
14021 echo "$as_me:14021: result: $cf_cv_lib_XCurses" >&5
14022 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
14023
14024 fi
14025
14026 if test $cf_cv_lib_XCurses = yes ; then
14027
14028 cat >>confdefs.h <<\EOF
14029 #define UNIX 1
14030 EOF
14031
14032 cat >>confdefs.h <<\EOF
14033 #define XCURSES 1
14034 EOF
14035
14036         echo "$as_me:14036: checking for xcurses.h" >&5
14037 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
14038 if test "${ac_cv_header_xcurses_h+set}" = set; then
14039   echo $ECHO_N "(cached) $ECHO_C" >&6
14040 else
14041   cat >conftest.$ac_ext <<_ACEOF
14042 #line 14042 "configure"
14043 #include "confdefs.h"
14044 #include <xcurses.h>
14045 _ACEOF
14046 if { (eval echo "$as_me:14046: \"$ac_cpp conftest.$ac_ext\"") >&5
14047   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14048   ac_status=$?
14049   egrep -v '^ *\+' conftest.er1 >conftest.err
14050   rm -f conftest.er1
14051   cat conftest.err >&5
14052   echo "$as_me:14052: \$? = $ac_status" >&5
14053   (exit $ac_status); } >/dev/null; then
14054   if test -s conftest.err; then
14055     ac_cpp_err=$ac_c_preproc_warn_flag
14056   else
14057     ac_cpp_err=
14058   fi
14059 else
14060   ac_cpp_err=yes
14061 fi
14062 if test -z "$ac_cpp_err"; then
14063   ac_cv_header_xcurses_h=yes
14064 else
14065   echo "$as_me: failed program was:" >&5
14066   cat conftest.$ac_ext >&5
14067   ac_cv_header_xcurses_h=no
14068 fi
14069 rm -f conftest.err conftest.$ac_ext
14070 fi
14071 echo "$as_me:14071: result: $ac_cv_header_xcurses_h" >&5
14072 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
14073 if test $ac_cv_header_xcurses_h = yes; then
14074
14075 cat >>confdefs.h <<\EOF
14076 #define HAVE_XCURSES 1
14077 EOF
14078
14079 fi
14080
14081 else
14082         { { echo "$as_me:14082: error: Cannot link with XCurses" >&5
14083 echo "$as_me: error: Cannot link with XCurses" >&2;}
14084    { (exit 1); exit 1; }; }
14085 fi
14086
14087         ;;
14088 (*)
14089         { { echo "$as_me:14089: error: unexpected screen-value: $cf_cv_screen" >&5
14090 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
14091    { (exit 1); exit 1; }; }
14092         ;;
14093 esac
14094
14095 : ${cf_nculib_root:=$cf_cv_screen}
14096 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
14097 echo "$as_me:14097: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
14098 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
14099 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14100   echo $ECHO_N "(cached) $ECHO_C" >&6
14101 else
14102   ac_check_lib_save_LIBS=$LIBS
14103 LIBS="-l$cf_nculib_root  $LIBS"
14104 cat >conftest.$ac_ext <<_ACEOF
14105 #line 14105 "configure"
14106 #include "confdefs.h"
14107
14108 /* Override any gcc2 internal prototype to avoid an error.  */
14109 #ifdef __cplusplus
14110 extern "C"
14111 #endif
14112 /* We use char because int might match the return type of a gcc2
14113    builtin and then its argument prototype would still apply.  */
14114 char _nc_init_pthreads ();
14115 int
14116 main (void)
14117 {
14118 _nc_init_pthreads ();
14119   ;
14120   return 0;
14121 }
14122 _ACEOF
14123 rm -f conftest.$ac_objext conftest$ac_exeext
14124 if { (eval echo "$as_me:14124: \"$ac_link\"") >&5
14125   (eval $ac_link) 2>&5
14126   ac_status=$?
14127   echo "$as_me:14127: \$? = $ac_status" >&5
14128   (exit $ac_status); } &&
14129          { ac_try='test -s conftest$ac_exeext'
14130   { (eval echo "$as_me:14130: \"$ac_try\"") >&5
14131   (eval $ac_try) 2>&5
14132   ac_status=$?
14133   echo "$as_me:14133: \$? = $ac_status" >&5
14134   (exit $ac_status); }; }; then
14135   eval "$as_ac_Lib=yes"
14136 else
14137   echo "$as_me: failed program was:" >&5
14138 cat conftest.$ac_ext >&5
14139 eval "$as_ac_Lib=no"
14140 fi
14141 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14142 LIBS=$ac_check_lib_save_LIBS
14143 fi
14144 echo "$as_me:14144: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14145 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14146 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14147   cf_cv_ncurses_pthreads=yes
14148 else
14149   cf_cv_ncurses_pthreads=no
14150 fi
14151
14152 if test "$cf_cv_ncurses_pthreads" = yes
14153 then
14154
14155 cf_add_libs="-lpthread"
14156 # Filter out duplicates - this happens with badly-designed ".pc" files...
14157 for cf_add_1lib in $LIBS
14158 do
14159         for cf_add_2lib in $cf_add_libs
14160         do
14161                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14162                 then
14163                         cf_add_1lib=
14164                         break
14165                 fi
14166         done
14167         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14168 done
14169 LIBS="$cf_add_libs"
14170
14171 fi
14172
14173 case $cf_cv_screen in
14174 (ncurses*)
14175         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
14176         ;;
14177 esac
14178
14179 cf_curses_headers=
14180
14181 case $cf_cv_screen in
14182 (pdcurses)
14183         cf_default_panel=no
14184         cf_default_form=no
14185         cf_default_menu=no
14186         cf_default_tinfo=no
14187         ;;
14188 (xcurses|bsdcurses)
14189         cf_default_panel=no
14190         cf_default_form=no
14191         cf_default_menu=no
14192         cf_default_tinfo=yes
14193         ;;
14194 (*)
14195         cf_default_panel=yes
14196         cf_default_form=yes
14197         cf_default_menu=yes
14198         cf_default_tinfo=yes
14199         case $cf_cv_screen in
14200         (ncurses*)
14201                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
14202                 ;;
14203         esac
14204         ;;
14205 esac
14206
14207 echo "$as_me:14207: checking if you want to check for panel functions" >&5
14208 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
14209
14210 # Check whether --enable-panel or --disable-panel was given.
14211 if test "${enable_panel+set}" = set; then
14212   enableval="$enable_panel"
14213   test "$enableval" != no && enableval=yes
14214         if test "$enableval" != "yes" ; then
14215     cf_enable_panel=no
14216         else
14217                 cf_enable_panel=$cf_default_panel
14218         fi
14219 else
14220   enableval=yes
14221         cf_enable_panel=$cf_default_panel
14222
14223 fi;
14224 echo "$as_me:14224: result: $cf_enable_panel" >&5
14225 echo "${ECHO_T}$cf_enable_panel" >&6
14226 if test $cf_enable_panel = yes
14227 then
14228
14229 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
14230 echo "$as_me:14230: checking for new_panel in -lpanel$cf_cv_libtype" >&5
14231 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
14232 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14233   echo $ECHO_N "(cached) $ECHO_C" >&6
14234 else
14235   ac_check_lib_save_LIBS=$LIBS
14236 LIBS="-lpanel$cf_cv_libtype  $LIBS"
14237 cat >conftest.$ac_ext <<_ACEOF
14238 #line 14238 "configure"
14239 #include "confdefs.h"
14240
14241 /* Override any gcc2 internal prototype to avoid an error.  */
14242 #ifdef __cplusplus
14243 extern "C"
14244 #endif
14245 /* We use char because int might match the return type of a gcc2
14246    builtin and then its argument prototype would still apply.  */
14247 char new_panel ();
14248 int
14249 main (void)
14250 {
14251 new_panel ();
14252   ;
14253   return 0;
14254 }
14255 _ACEOF
14256 rm -f conftest.$ac_objext conftest$ac_exeext
14257 if { (eval echo "$as_me:14257: \"$ac_link\"") >&5
14258   (eval $ac_link) 2>&5
14259   ac_status=$?
14260   echo "$as_me:14260: \$? = $ac_status" >&5
14261   (exit $ac_status); } &&
14262          { ac_try='test -s conftest$ac_exeext'
14263   { (eval echo "$as_me:14263: \"$ac_try\"") >&5
14264   (eval $ac_try) 2>&5
14265   ac_status=$?
14266   echo "$as_me:14266: \$? = $ac_status" >&5
14267   (exit $ac_status); }; }; then
14268   eval "$as_ac_Lib=yes"
14269 else
14270   echo "$as_me: failed program was:" >&5
14271 cat conftest.$ac_ext >&5
14272 eval "$as_ac_Lib=no"
14273 fi
14274 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14275 LIBS=$ac_check_lib_save_LIBS
14276 fi
14277 echo "$as_me:14277: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14278 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14279 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14280
14281 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14282
14283 cf_add_libs="-lpanel$cf_cv_libtype"
14284 # Filter out duplicates - this happens with badly-designed ".pc" files...
14285 for cf_add_1lib in $LIBS
14286 do
14287         for cf_add_2lib in $cf_add_libs
14288         do
14289                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14290                 then
14291                         cf_add_1lib=
14292                         break
14293                 fi
14294         done
14295         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14296 done
14297 LIBS="$cf_add_libs"
14298
14299 cat >>confdefs.h <<EOF
14300 #define $cf_upper 1
14301 EOF
14302
14303 fi
14304
14305         cf_curses_headers="$cf_curses_headers panel.h"
14306 fi
14307
14308 echo "$as_me:14308: checking if you want to check for menu functions" >&5
14309 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
14310
14311 # Check whether --enable-menu or --disable-menu was given.
14312 if test "${enable_menu+set}" = set; then
14313   enableval="$enable_menu"
14314   test "$enableval" != no && enableval=yes
14315         if test "$enableval" != "yes" ; then
14316     cf_enable_menu=no
14317         else
14318                 cf_enable_menu=$cf_default_menu
14319         fi
14320 else
14321   enableval=yes
14322         cf_enable_menu=$cf_default_menu
14323
14324 fi;
14325 echo "$as_me:14325: result: $cf_enable_menu" >&5
14326 echo "${ECHO_T}$cf_enable_menu" >&6
14327 if test $cf_enable_menu = yes
14328 then
14329         case $cf_cv_screen in
14330         (ncurses*)
14331                 ;;
14332         (curses*)
14333
14334 echo "$as_me:14334: checking for NetBSD menu.h" >&5
14335 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
14336 if test "${cf_cv_netbsd_menu_h+set}" = set; then
14337   echo $ECHO_N "(cached) $ECHO_C" >&6
14338 else
14339
14340 cat >conftest.$ac_ext <<_ACEOF
14341 #line 14341 "configure"
14342 #include "confdefs.h"
14343
14344 #include <${cf_cv_ncurses_header:-curses.h}>
14345 #include <menu.h>
14346
14347 int
14348 main (void)
14349 {
14350
14351         MENU *menu;
14352         int y = menu->max_item_width;
14353
14354   ;
14355   return 0;
14356 }
14357 _ACEOF
14358 rm -f conftest.$ac_objext
14359 if { (eval echo "$as_me:14359: \"$ac_compile\"") >&5
14360   (eval $ac_compile) 2>&5
14361   ac_status=$?
14362   echo "$as_me:14362: \$? = $ac_status" >&5
14363   (exit $ac_status); } &&
14364          { ac_try='test -s conftest.$ac_objext'
14365   { (eval echo "$as_me:14365: \"$ac_try\"") >&5
14366   (eval $ac_try) 2>&5
14367   ac_status=$?
14368   echo "$as_me:14368: \$? = $ac_status" >&5
14369   (exit $ac_status); }; }; then
14370   cf_cv_netbsd_menu_h=yes
14371
14372 else
14373   echo "$as_me: failed program was:" >&5
14374 cat conftest.$ac_ext >&5
14375 cf_cv_netbsd_menu_h=no
14376 fi
14377 rm -f conftest.$ac_objext conftest.$ac_ext
14378
14379 fi
14380 echo "$as_me:14380: result: $cf_cv_netbsd_menu_h" >&5
14381 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
14382
14383 test "$cf_cv_netbsd_menu_h" = yes &&
14384 cat >>confdefs.h <<\EOF
14385 #define HAVE_NETBSD_MENU_H 1
14386 EOF
14387
14388                 ;;
14389         esac
14390
14391 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
14392 echo "$as_me:14392: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
14393 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
14394 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14395   echo $ECHO_N "(cached) $ECHO_C" >&6
14396 else
14397   ac_check_lib_save_LIBS=$LIBS
14398 LIBS="-lmenu$cf_cv_libtype  $LIBS"
14399 cat >conftest.$ac_ext <<_ACEOF
14400 #line 14400 "configure"
14401 #include "confdefs.h"
14402
14403 /* Override any gcc2 internal prototype to avoid an error.  */
14404 #ifdef __cplusplus
14405 extern "C"
14406 #endif
14407 /* We use char because int might match the return type of a gcc2
14408    builtin and then its argument prototype would still apply.  */
14409 char menu_driver ();
14410 int
14411 main (void)
14412 {
14413 menu_driver ();
14414   ;
14415   return 0;
14416 }
14417 _ACEOF
14418 rm -f conftest.$ac_objext conftest$ac_exeext
14419 if { (eval echo "$as_me:14419: \"$ac_link\"") >&5
14420   (eval $ac_link) 2>&5
14421   ac_status=$?
14422   echo "$as_me:14422: \$? = $ac_status" >&5
14423   (exit $ac_status); } &&
14424          { ac_try='test -s conftest$ac_exeext'
14425   { (eval echo "$as_me:14425: \"$ac_try\"") >&5
14426   (eval $ac_try) 2>&5
14427   ac_status=$?
14428   echo "$as_me:14428: \$? = $ac_status" >&5
14429   (exit $ac_status); }; }; then
14430   eval "$as_ac_Lib=yes"
14431 else
14432   echo "$as_me: failed program was:" >&5
14433 cat conftest.$ac_ext >&5
14434 eval "$as_ac_Lib=no"
14435 fi
14436 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14437 LIBS=$ac_check_lib_save_LIBS
14438 fi
14439 echo "$as_me:14439: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14440 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14441 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14442
14443 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14444
14445 cf_add_libs="-lmenu$cf_cv_libtype"
14446 # Filter out duplicates - this happens with badly-designed ".pc" files...
14447 for cf_add_1lib in $LIBS
14448 do
14449         for cf_add_2lib in $cf_add_libs
14450         do
14451                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14452                 then
14453                         cf_add_1lib=
14454                         break
14455                 fi
14456         done
14457         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14458 done
14459 LIBS="$cf_add_libs"
14460
14461 cat >>confdefs.h <<EOF
14462 #define $cf_upper 1
14463 EOF
14464
14465 fi
14466
14467         cf_curses_headers="$cf_curses_headers menu.h"
14468 fi
14469
14470 echo "$as_me:14470: checking if you want to check for form functions" >&5
14471 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
14472
14473 # Check whether --enable-form or --disable-form was given.
14474 if test "${enable_form+set}" = set; then
14475   enableval="$enable_form"
14476   test "$enableval" != no && enableval=yes
14477         if test "$enableval" != "yes" ; then
14478     cf_enable_form=no
14479         else
14480                 cf_enable_form=$cf_default_form
14481         fi
14482 else
14483   enableval=yes
14484         cf_enable_form=$cf_default_form
14485
14486 fi;
14487 echo "$as_me:14487: result: $cf_enable_form" >&5
14488 echo "${ECHO_T}$cf_enable_form" >&6
14489 if test $cf_enable_form = yes
14490 then
14491         case $cf_cv_screen in
14492         (ncurses*)
14493                 ;;
14494         (curses*)
14495
14496 echo "$as_me:14496: checking for NetBSD form.h" >&5
14497 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
14498 if test "${cf_cv_netbsd_form_h+set}" = set; then
14499   echo $ECHO_N "(cached) $ECHO_C" >&6
14500 else
14501
14502 cat >conftest.$ac_ext <<_ACEOF
14503 #line 14503 "configure"
14504 #include "confdefs.h"
14505
14506 #include <${cf_cv_ncurses_header:-curses.h}>
14507 #include <form.h>
14508
14509 int
14510 main (void)
14511 {
14512
14513         FORM *form;
14514         int y = current_field(form)->cursor_ypos;
14515         int x = current_field(form)->cursor_xpos;
14516
14517   ;
14518   return 0;
14519 }
14520 _ACEOF
14521 rm -f conftest.$ac_objext
14522 if { (eval echo "$as_me:14522: \"$ac_compile\"") >&5
14523   (eval $ac_compile) 2>&5
14524   ac_status=$?
14525   echo "$as_me:14525: \$? = $ac_status" >&5
14526   (exit $ac_status); } &&
14527          { ac_try='test -s conftest.$ac_objext'
14528   { (eval echo "$as_me:14528: \"$ac_try\"") >&5
14529   (eval $ac_try) 2>&5
14530   ac_status=$?
14531   echo "$as_me:14531: \$? = $ac_status" >&5
14532   (exit $ac_status); }; }; then
14533   cf_cv_netbsd_form_h=yes
14534
14535 else
14536   echo "$as_me: failed program was:" >&5
14537 cat conftest.$ac_ext >&5
14538 cf_cv_netbsd_form_h=no
14539 fi
14540 rm -f conftest.$ac_objext conftest.$ac_ext
14541
14542 fi
14543 echo "$as_me:14543: result: $cf_cv_netbsd_form_h" >&5
14544 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
14545
14546 test "$cf_cv_netbsd_form_h" = yes &&
14547 cat >>confdefs.h <<\EOF
14548 #define HAVE_NETBSD_FORM_H 1
14549 EOF
14550
14551                 ;;
14552         esac
14553
14554 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
14555 echo "$as_me:14555: checking for form_driver in -lform$cf_cv_libtype" >&5
14556 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
14557 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14558   echo $ECHO_N "(cached) $ECHO_C" >&6
14559 else
14560   ac_check_lib_save_LIBS=$LIBS
14561 LIBS="-lform$cf_cv_libtype  $LIBS"
14562 cat >conftest.$ac_ext <<_ACEOF
14563 #line 14563 "configure"
14564 #include "confdefs.h"
14565
14566 /* Override any gcc2 internal prototype to avoid an error.  */
14567 #ifdef __cplusplus
14568 extern "C"
14569 #endif
14570 /* We use char because int might match the return type of a gcc2
14571    builtin and then its argument prototype would still apply.  */
14572 char form_driver ();
14573 int
14574 main (void)
14575 {
14576 form_driver ();
14577   ;
14578   return 0;
14579 }
14580 _ACEOF
14581 rm -f conftest.$ac_objext conftest$ac_exeext
14582 if { (eval echo "$as_me:14582: \"$ac_link\"") >&5
14583   (eval $ac_link) 2>&5
14584   ac_status=$?
14585   echo "$as_me:14585: \$? = $ac_status" >&5
14586   (exit $ac_status); } &&
14587          { ac_try='test -s conftest$ac_exeext'
14588   { (eval echo "$as_me:14588: \"$ac_try\"") >&5
14589   (eval $ac_try) 2>&5
14590   ac_status=$?
14591   echo "$as_me:14591: \$? = $ac_status" >&5
14592   (exit $ac_status); }; }; then
14593   eval "$as_ac_Lib=yes"
14594 else
14595   echo "$as_me: failed program was:" >&5
14596 cat conftest.$ac_ext >&5
14597 eval "$as_ac_Lib=no"
14598 fi
14599 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14600 LIBS=$ac_check_lib_save_LIBS
14601 fi
14602 echo "$as_me:14602: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14603 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14604 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14605
14606 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14607
14608 cf_add_libs="-lform$cf_cv_libtype"
14609 # Filter out duplicates - this happens with badly-designed ".pc" files...
14610 for cf_add_1lib in $LIBS
14611 do
14612         for cf_add_2lib in $cf_add_libs
14613         do
14614                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14615                 then
14616                         cf_add_1lib=
14617                         break
14618                 fi
14619         done
14620         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14621 done
14622 LIBS="$cf_add_libs"
14623
14624 cat >>confdefs.h <<EOF
14625 #define $cf_upper 1
14626 EOF
14627
14628 fi
14629
14630         cf_curses_headers="$cf_curses_headers form.h"
14631 fi
14632
14633 # look for curses-related headers
14634
14635 for ac_header in $cf_curses_headers
14636 do
14637 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14638 echo "$as_me:14638: checking for $ac_header" >&5
14639 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14640 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14641   echo $ECHO_N "(cached) $ECHO_C" >&6
14642 else
14643   cat >conftest.$ac_ext <<_ACEOF
14644 #line 14644 "configure"
14645 #include "confdefs.h"
14646 #include <$ac_header>
14647 _ACEOF
14648 if { (eval echo "$as_me:14648: \"$ac_cpp conftest.$ac_ext\"") >&5
14649   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14650   ac_status=$?
14651   egrep -v '^ *\+' conftest.er1 >conftest.err
14652   rm -f conftest.er1
14653   cat conftest.err >&5
14654   echo "$as_me:14654: \$? = $ac_status" >&5
14655   (exit $ac_status); } >/dev/null; then
14656   if test -s conftest.err; then
14657     ac_cpp_err=$ac_c_preproc_warn_flag
14658   else
14659     ac_cpp_err=
14660   fi
14661 else
14662   ac_cpp_err=yes
14663 fi
14664 if test -z "$ac_cpp_err"; then
14665   eval "$as_ac_Header=yes"
14666 else
14667   echo "$as_me: failed program was:" >&5
14668   cat conftest.$ac_ext >&5
14669   eval "$as_ac_Header=no"
14670 fi
14671 rm -f conftest.err conftest.$ac_ext
14672 fi
14673 echo "$as_me:14673: result: `eval echo '${'$as_ac_Header'}'`" >&5
14674 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14675 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14676   cat >>confdefs.h <<EOF
14677 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14678 EOF
14679
14680 fi
14681 done
14682
14683 echo "$as_me:14683: checking for ANSI C header files" >&5
14684 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14685 if test "${ac_cv_header_stdc+set}" = set; then
14686   echo $ECHO_N "(cached) $ECHO_C" >&6
14687 else
14688   cat >conftest.$ac_ext <<_ACEOF
14689 #line 14689 "configure"
14690 #include "confdefs.h"
14691 #include <stdlib.h>
14692 #include <stdarg.h>
14693 #include <string.h>
14694 #include <float.h>
14695
14696 _ACEOF
14697 if { (eval echo "$as_me:14697: \"$ac_cpp conftest.$ac_ext\"") >&5
14698   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14699   ac_status=$?
14700   egrep -v '^ *\+' conftest.er1 >conftest.err
14701   rm -f conftest.er1
14702   cat conftest.err >&5
14703   echo "$as_me:14703: \$? = $ac_status" >&5
14704   (exit $ac_status); } >/dev/null; then
14705   if test -s conftest.err; then
14706     ac_cpp_err=$ac_c_preproc_warn_flag
14707   else
14708     ac_cpp_err=
14709   fi
14710 else
14711   ac_cpp_err=yes
14712 fi
14713 if test -z "$ac_cpp_err"; then
14714   ac_cv_header_stdc=yes
14715 else
14716   echo "$as_me: failed program was:" >&5
14717   cat conftest.$ac_ext >&5
14718   ac_cv_header_stdc=no
14719 fi
14720 rm -f conftest.err conftest.$ac_ext
14721
14722 if test $ac_cv_header_stdc = yes; then
14723   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14724   cat >conftest.$ac_ext <<_ACEOF
14725 #line 14725 "configure"
14726 #include "confdefs.h"
14727 #include <string.h>
14728
14729 _ACEOF
14730 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14731   egrep "memchr" >/dev/null 2>&1; then
14732   :
14733 else
14734   ac_cv_header_stdc=no
14735 fi
14736 rm -rf conftest*
14737
14738 fi
14739
14740 if test $ac_cv_header_stdc = yes; then
14741   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14742   cat >conftest.$ac_ext <<_ACEOF
14743 #line 14743 "configure"
14744 #include "confdefs.h"
14745 #include <stdlib.h>
14746
14747 _ACEOF
14748 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14749   egrep "free" >/dev/null 2>&1; then
14750   :
14751 else
14752   ac_cv_header_stdc=no
14753 fi
14754 rm -rf conftest*
14755
14756 fi
14757
14758 if test $ac_cv_header_stdc = yes; then
14759   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14760   if test "$cross_compiling" = yes; then
14761   :
14762 else
14763   cat >conftest.$ac_ext <<_ACEOF
14764 #line 14764 "configure"
14765 #include "confdefs.h"
14766 #include <ctype.h>
14767 #if ((' ' & 0x0FF) == 0x020)
14768 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14769 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14770 #else
14771 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14772                      || ('j' <= (c) && (c) <= 'r') \
14773                      || ('s' <= (c) && (c) <= 'z'))
14774 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14775 #endif
14776
14777 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14778 int
14779 main (void)
14780 {
14781   int i;
14782   for (i = 0; i < 256; i++)
14783     if (XOR (islower (i), ISLOWER (i))
14784         || toupper (i) != TOUPPER (i))
14785       $ac_main_return(2);
14786   $ac_main_return (0);
14787 }
14788 _ACEOF
14789 rm -f conftest$ac_exeext
14790 if { (eval echo "$as_me:14790: \"$ac_link\"") >&5
14791   (eval $ac_link) 2>&5
14792   ac_status=$?
14793   echo "$as_me:14793: \$? = $ac_status" >&5
14794   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14795   { (eval echo "$as_me:14795: \"$ac_try\"") >&5
14796   (eval $ac_try) 2>&5
14797   ac_status=$?
14798   echo "$as_me:14798: \$? = $ac_status" >&5
14799   (exit $ac_status); }; }; then
14800   :
14801 else
14802   echo "$as_me: program exited with status $ac_status" >&5
14803 echo "$as_me: failed program was:" >&5
14804 cat conftest.$ac_ext >&5
14805 ac_cv_header_stdc=no
14806 fi
14807 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14808 fi
14809 fi
14810 fi
14811 echo "$as_me:14811: result: $ac_cv_header_stdc" >&5
14812 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14813 if test $ac_cv_header_stdc = yes; then
14814
14815 cat >>confdefs.h <<\EOF
14816 #define STDC_HEADERS 1
14817 EOF
14818
14819 fi
14820
14821 echo "$as_me:14821: checking whether time.h and sys/time.h may both be included" >&5
14822 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14823 if test "${ac_cv_header_time+set}" = set; then
14824   echo $ECHO_N "(cached) $ECHO_C" >&6
14825 else
14826   cat >conftest.$ac_ext <<_ACEOF
14827 #line 14827 "configure"
14828 #include "confdefs.h"
14829 #include <sys/types.h>
14830 #include <sys/time.h>
14831 #include <time.h>
14832
14833 int
14834 main (void)
14835 {
14836 if ((struct tm *) 0)
14837 return 0;
14838   ;
14839   return 0;
14840 }
14841 _ACEOF
14842 rm -f conftest.$ac_objext
14843 if { (eval echo "$as_me:14843: \"$ac_compile\"") >&5
14844   (eval $ac_compile) 2>&5
14845   ac_status=$?
14846   echo "$as_me:14846: \$? = $ac_status" >&5
14847   (exit $ac_status); } &&
14848          { ac_try='test -s conftest.$ac_objext'
14849   { (eval echo "$as_me:14849: \"$ac_try\"") >&5
14850   (eval $ac_try) 2>&5
14851   ac_status=$?
14852   echo "$as_me:14852: \$? = $ac_status" >&5
14853   (exit $ac_status); }; }; then
14854   ac_cv_header_time=yes
14855 else
14856   echo "$as_me: failed program was:" >&5
14857 cat conftest.$ac_ext >&5
14858 ac_cv_header_time=no
14859 fi
14860 rm -f conftest.$ac_objext conftest.$ac_ext
14861 fi
14862 echo "$as_me:14862: result: $ac_cv_header_time" >&5
14863 echo "${ECHO_T}$ac_cv_header_time" >&6
14864 if test $ac_cv_header_time = yes; then
14865
14866 cat >>confdefs.h <<\EOF
14867 #define TIME_WITH_SYS_TIME 1
14868 EOF
14869
14870 fi
14871
14872 for ac_header in \
14873 getopt.h \
14874 locale.h \
14875 math.h \
14876 stdarg.h \
14877 stdint.h \
14878 sys/ioctl.h \
14879 sys/select.h \
14880 sys/time.h \
14881 termios.h \
14882 unistd.h \
14883
14884 do
14885 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14886 echo "$as_me:14886: checking for $ac_header" >&5
14887 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14888 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14889   echo $ECHO_N "(cached) $ECHO_C" >&6
14890 else
14891   cat >conftest.$ac_ext <<_ACEOF
14892 #line 14892 "configure"
14893 #include "confdefs.h"
14894 #include <$ac_header>
14895 _ACEOF
14896 if { (eval echo "$as_me:14896: \"$ac_cpp conftest.$ac_ext\"") >&5
14897   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14898   ac_status=$?
14899   egrep -v '^ *\+' conftest.er1 >conftest.err
14900   rm -f conftest.er1
14901   cat conftest.err >&5
14902   echo "$as_me:14902: \$? = $ac_status" >&5
14903   (exit $ac_status); } >/dev/null; then
14904   if test -s conftest.err; then
14905     ac_cpp_err=$ac_c_preproc_warn_flag
14906   else
14907     ac_cpp_err=
14908   fi
14909 else
14910   ac_cpp_err=yes
14911 fi
14912 if test -z "$ac_cpp_err"; then
14913   eval "$as_ac_Header=yes"
14914 else
14915   echo "$as_me: failed program was:" >&5
14916   cat conftest.$ac_ext >&5
14917   eval "$as_ac_Header=no"
14918 fi
14919 rm -f conftest.err conftest.$ac_ext
14920 fi
14921 echo "$as_me:14921: result: `eval echo '${'$as_ac_Header'}'`" >&5
14922 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14923 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14924   cat >>confdefs.h <<EOF
14925 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14926 EOF
14927
14928 fi
14929 done
14930
14931 for ac_header in unistd.h getopt.h
14932 do
14933 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14934 echo "$as_me:14934: checking for $ac_header" >&5
14935 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14936 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14937   echo $ECHO_N "(cached) $ECHO_C" >&6
14938 else
14939   cat >conftest.$ac_ext <<_ACEOF
14940 #line 14940 "configure"
14941 #include "confdefs.h"
14942 #include <$ac_header>
14943 _ACEOF
14944 if { (eval echo "$as_me:14944: \"$ac_cpp conftest.$ac_ext\"") >&5
14945   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14946   ac_status=$?
14947   egrep -v '^ *\+' conftest.er1 >conftest.err
14948   rm -f conftest.er1
14949   cat conftest.err >&5
14950   echo "$as_me:14950: \$? = $ac_status" >&5
14951   (exit $ac_status); } >/dev/null; then
14952   if test -s conftest.err; then
14953     ac_cpp_err=$ac_c_preproc_warn_flag
14954   else
14955     ac_cpp_err=
14956   fi
14957 else
14958   ac_cpp_err=yes
14959 fi
14960 if test -z "$ac_cpp_err"; then
14961   eval "$as_ac_Header=yes"
14962 else
14963   echo "$as_me: failed program was:" >&5
14964   cat conftest.$ac_ext >&5
14965   eval "$as_ac_Header=no"
14966 fi
14967 rm -f conftest.err conftest.$ac_ext
14968 fi
14969 echo "$as_me:14969: result: `eval echo '${'$as_ac_Header'}'`" >&5
14970 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14971 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14972   cat >>confdefs.h <<EOF
14973 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14974 EOF
14975
14976 fi
14977 done
14978
14979 echo "$as_me:14979: checking for header declaring getopt variables" >&5
14980 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14981 if test "${cf_cv_getopt_header+set}" = set; then
14982   echo $ECHO_N "(cached) $ECHO_C" >&6
14983 else
14984
14985 cf_cv_getopt_header=none
14986 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14987 do
14988 cat >conftest.$ac_ext <<_ACEOF
14989 #line 14989 "configure"
14990 #include "confdefs.h"
14991
14992 #include <$cf_header>
14993 int
14994 main (void)
14995 {
14996 int x = optind; char *y = optarg
14997   ;
14998   return 0;
14999 }
15000 _ACEOF
15001 rm -f conftest.$ac_objext
15002 if { (eval echo "$as_me:15002: \"$ac_compile\"") >&5
15003   (eval $ac_compile) 2>&5
15004   ac_status=$?
15005   echo "$as_me:15005: \$? = $ac_status" >&5
15006   (exit $ac_status); } &&
15007          { ac_try='test -s conftest.$ac_objext'
15008   { (eval echo "$as_me:15008: \"$ac_try\"") >&5
15009   (eval $ac_try) 2>&5
15010   ac_status=$?
15011   echo "$as_me:15011: \$? = $ac_status" >&5
15012   (exit $ac_status); }; }; then
15013   cf_cv_getopt_header=$cf_header
15014  break
15015 else
15016   echo "$as_me: failed program was:" >&5
15017 cat conftest.$ac_ext >&5
15018 fi
15019 rm -f conftest.$ac_objext conftest.$ac_ext
15020 done
15021
15022 fi
15023 echo "$as_me:15023: result: $cf_cv_getopt_header" >&5
15024 echo "${ECHO_T}$cf_cv_getopt_header" >&6
15025 if test $cf_cv_getopt_header != none ; then
15026
15027 cat >>confdefs.h <<\EOF
15028 #define HAVE_GETOPT_HEADER 1
15029 EOF
15030
15031 fi
15032 if test $cf_cv_getopt_header = getopt.h ; then
15033
15034 cat >>confdefs.h <<\EOF
15035 #define NEED_GETOPT_H 1
15036 EOF
15037
15038 fi
15039
15040 for ac_func in \
15041 getopt \
15042 gettimeofday \
15043 tdestroy \
15044 tsearch \
15045
15046 do
15047 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15048 echo "$as_me:15048: checking for $ac_func" >&5
15049 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15050 if eval "test \"\${$as_ac_var+set}\" = set"; then
15051   echo $ECHO_N "(cached) $ECHO_C" >&6
15052 else
15053   cat >conftest.$ac_ext <<_ACEOF
15054 #line 15054 "configure"
15055 #include "confdefs.h"
15056 /* System header to define __stub macros and hopefully few prototypes,
15057     which can conflict with char $ac_func (); below.  */
15058 #include <assert.h>
15059 /* Override any gcc2 internal prototype to avoid an error.  */
15060 #ifdef __cplusplus
15061 extern "C"
15062 #endif
15063 /* We use char because int might match the return type of a gcc2
15064    builtin and then its argument prototype would still apply.  */
15065 char $ac_func ();
15066 char (*f) ();
15067
15068 int
15069 main (void)
15070 {
15071 /* The GNU C library defines this for functions which it implements
15072     to always fail with ENOSYS.  Some functions are actually named
15073     something starting with __ and the normal name is an alias.  */
15074 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15075 choke me
15076 #else
15077 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15078 #endif
15079
15080   ;
15081   return 0;
15082 }
15083 _ACEOF
15084 rm -f conftest.$ac_objext conftest$ac_exeext
15085 if { (eval echo "$as_me:15085: \"$ac_link\"") >&5
15086   (eval $ac_link) 2>&5
15087   ac_status=$?
15088   echo "$as_me:15088: \$? = $ac_status" >&5
15089   (exit $ac_status); } &&
15090          { ac_try='test -s conftest$ac_exeext'
15091   { (eval echo "$as_me:15091: \"$ac_try\"") >&5
15092   (eval $ac_try) 2>&5
15093   ac_status=$?
15094   echo "$as_me:15094: \$? = $ac_status" >&5
15095   (exit $ac_status); }; }; then
15096   eval "$as_ac_var=yes"
15097 else
15098   echo "$as_me: failed program was:" >&5
15099 cat conftest.$ac_ext >&5
15100 eval "$as_ac_var=no"
15101 fi
15102 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15103 fi
15104 echo "$as_me:15104: result: `eval echo '${'$as_ac_var'}'`" >&5
15105 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15106 if test `eval echo '${'$as_ac_var'}'` = yes; then
15107   cat >>confdefs.h <<EOF
15108 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15109 EOF
15110
15111 fi
15112 done
15113
15114 if test "x$ac_cv_func_getopt" = xno; then
15115         { { echo "$as_me:15115: error: getopt is required for building programs" >&5
15116 echo "$as_me: error: getopt is required for building programs" >&2;}
15117    { (exit 1); exit 1; }; }
15118 fi
15119
15120 if test "$cf_enable_widec" = yes; then
15121
15122 for ac_func in \
15123 mblen \
15124 mbrlen \
15125 mbrtowc \
15126 mbsrtowcs \
15127 mbstowcs \
15128 mbtowc \
15129 wcsrtombs \
15130 wcstombs \
15131
15132 do
15133 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15134 echo "$as_me:15134: checking for $ac_func" >&5
15135 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15136 if eval "test \"\${$as_ac_var+set}\" = set"; then
15137   echo $ECHO_N "(cached) $ECHO_C" >&6
15138 else
15139   cat >conftest.$ac_ext <<_ACEOF
15140 #line 15140 "configure"
15141 #include "confdefs.h"
15142 /* System header to define __stub macros and hopefully few prototypes,
15143     which can conflict with char $ac_func (); below.  */
15144 #include <assert.h>
15145 /* Override any gcc2 internal prototype to avoid an error.  */
15146 #ifdef __cplusplus
15147 extern "C"
15148 #endif
15149 /* We use char because int might match the return type of a gcc2
15150    builtin and then its argument prototype would still apply.  */
15151 char $ac_func ();
15152 char (*f) ();
15153
15154 int
15155 main (void)
15156 {
15157 /* The GNU C library defines this for functions which it implements
15158     to always fail with ENOSYS.  Some functions are actually named
15159     something starting with __ and the normal name is an alias.  */
15160 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15161 choke me
15162 #else
15163 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15164 #endif
15165
15166   ;
15167   return 0;
15168 }
15169 _ACEOF
15170 rm -f conftest.$ac_objext conftest$ac_exeext
15171 if { (eval echo "$as_me:15171: \"$ac_link\"") >&5
15172   (eval $ac_link) 2>&5
15173   ac_status=$?
15174   echo "$as_me:15174: \$? = $ac_status" >&5
15175   (exit $ac_status); } &&
15176          { ac_try='test -s conftest$ac_exeext'
15177   { (eval echo "$as_me:15177: \"$ac_try\"") >&5
15178   (eval $ac_try) 2>&5
15179   ac_status=$?
15180   echo "$as_me:15180: \$? = $ac_status" >&5
15181   (exit $ac_status); }; }; then
15182   eval "$as_ac_var=yes"
15183 else
15184   echo "$as_me: failed program was:" >&5
15185 cat conftest.$ac_ext >&5
15186 eval "$as_ac_var=no"
15187 fi
15188 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15189 fi
15190 echo "$as_me:15190: result: `eval echo '${'$as_ac_var'}'`" >&5
15191 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15192 if test `eval echo '${'$as_ac_var'}'` = yes; then
15193   cat >>confdefs.h <<EOF
15194 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15195 EOF
15196
15197 fi
15198 done
15199
15200 fi
15201
15202 echo "$as_me:15202: checking definition to turn on extended curses functions" >&5
15203 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
15204 if test "${cf_cv_need_xopen_extension+set}" = set; then
15205   echo $ECHO_N "(cached) $ECHO_C" >&6
15206 else
15207
15208 cf_cv_need_xopen_extension=unknown
15209 cat >conftest.$ac_ext <<_ACEOF
15210 #line 15210 "configure"
15211 #include "confdefs.h"
15212
15213 #include <stdlib.h>
15214 #include <${cf_cv_ncurses_header:-curses.h}>
15215 int
15216 main (void)
15217 {
15218
15219 #if defined(NCURSES_VERSION_PATCH)
15220 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
15221         make an error
15222 #endif
15223 #endif
15224 #ifdef NCURSES_VERSION
15225         cchar_t check;
15226         int check2 = curs_set((int)sizeof(check));
15227 #endif
15228         long x = winnstr(stdscr, "", 0);
15229         int x1, y1;
15230         getbegyx(stdscr, y1, x1)
15231   ;
15232   return 0;
15233 }
15234 _ACEOF
15235 rm -f conftest.$ac_objext conftest$ac_exeext
15236 if { (eval echo "$as_me:15236: \"$ac_link\"") >&5
15237   (eval $ac_link) 2>&5
15238   ac_status=$?
15239   echo "$as_me:15239: \$? = $ac_status" >&5
15240   (exit $ac_status); } &&
15241          { ac_try='test -s conftest$ac_exeext'
15242   { (eval echo "$as_me:15242: \"$ac_try\"") >&5
15243   (eval $ac_try) 2>&5
15244   ac_status=$?
15245   echo "$as_me:15245: \$? = $ac_status" >&5
15246   (exit $ac_status); }; }; then
15247   cf_cv_need_xopen_extension=none
15248 else
15249   echo "$as_me: failed program was:" >&5
15250 cat conftest.$ac_ext >&5
15251
15252         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
15253         do
15254                 cat >conftest.$ac_ext <<_ACEOF
15255 #line 15255 "configure"
15256 #include "confdefs.h"
15257
15258 #define $cf_try_xopen_extension 1
15259 #include <stdlib.h>
15260 #include <${cf_cv_ncurses_header:-curses.h}>
15261 int
15262 main (void)
15263 {
15264
15265 #ifdef NCURSES_VERSION
15266                 cchar_t check;
15267                 int check2 = curs_set((int)sizeof(check));
15268 #endif
15269                 long x = winnstr(stdscr, "", 0);
15270                 int x1, y1;
15271                 getbegyx(stdscr, y1, x1)
15272   ;
15273   return 0;
15274 }
15275 _ACEOF
15276 rm -f conftest.$ac_objext conftest$ac_exeext
15277 if { (eval echo "$as_me:15277: \"$ac_link\"") >&5
15278   (eval $ac_link) 2>&5
15279   ac_status=$?
15280   echo "$as_me:15280: \$? = $ac_status" >&5
15281   (exit $ac_status); } &&
15282          { ac_try='test -s conftest$ac_exeext'
15283   { (eval echo "$as_me:15283: \"$ac_try\"") >&5
15284   (eval $ac_try) 2>&5
15285   ac_status=$?
15286   echo "$as_me:15286: \$? = $ac_status" >&5
15287   (exit $ac_status); }; }; then
15288   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
15289 else
15290   echo "$as_me: failed program was:" >&5
15291 cat conftest.$ac_ext >&5
15292 fi
15293 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15294         done
15295
15296 fi
15297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15298
15299 fi
15300 echo "$as_me:15300: result: $cf_cv_need_xopen_extension" >&5
15301 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
15302
15303 case $cf_cv_need_xopen_extension in
15304 (*_*)
15305         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
15306         ;;
15307 esac
15308
15309 echo "$as_me:15309: checking for term.h" >&5
15310 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
15311 if test "${cf_cv_term_header+set}" = set; then
15312   echo $ECHO_N "(cached) $ECHO_C" >&6
15313 else
15314
15315 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
15316 # for <term.h> if we do not find the variant.
15317
15318 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
15319
15320 case ${cf_cv_ncurses_header:-curses.h} in
15321 (*/*)
15322         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
15323         cf_header_list="$cf_header_item $cf_header_list"
15324         ;;
15325 esac
15326
15327 for cf_header in $cf_header_list
15328 do
15329         cat >conftest.$ac_ext <<_ACEOF
15330 #line 15330 "configure"
15331 #include "confdefs.h"
15332
15333 #include <${cf_cv_ncurses_header:-curses.h}>
15334 #include <${cf_header}>
15335 int
15336 main (void)
15337 {
15338 WINDOW *x
15339   ;
15340   return 0;
15341 }
15342 _ACEOF
15343 rm -f conftest.$ac_objext
15344 if { (eval echo "$as_me:15344: \"$ac_compile\"") >&5
15345   (eval $ac_compile) 2>&5
15346   ac_status=$?
15347   echo "$as_me:15347: \$? = $ac_status" >&5
15348   (exit $ac_status); } &&
15349          { ac_try='test -s conftest.$ac_objext'
15350   { (eval echo "$as_me:15350: \"$ac_try\"") >&5
15351   (eval $ac_try) 2>&5
15352   ac_status=$?
15353   echo "$as_me:15353: \$? = $ac_status" >&5
15354   (exit $ac_status); }; }; then
15355   cf_cv_term_header=$cf_header
15356          break
15357 else
15358   echo "$as_me: failed program was:" >&5
15359 cat conftest.$ac_ext >&5
15360 cf_cv_term_header=no
15361 fi
15362 rm -f conftest.$ac_objext conftest.$ac_ext
15363 done
15364
15365 case $cf_cv_term_header in
15366 (no)
15367         # If curses is ncurses, some packagers still mess it up by trying to make
15368         # us use GNU termcap.  This handles the most common case.
15369         for cf_header in ncurses/term.h ncursesw/term.h
15370         do
15371                 cat >conftest.$ac_ext <<_ACEOF
15372 #line 15372 "configure"
15373 #include "confdefs.h"
15374
15375 #include <${cf_cv_ncurses_header:-curses.h}>
15376 #ifdef NCURSES_VERSION
15377 #include <${cf_header}>
15378 #else
15379 make an error
15380 #endif
15381 int
15382 main (void)
15383 {
15384 WINDOW *x
15385   ;
15386   return 0;
15387 }
15388 _ACEOF
15389 rm -f conftest.$ac_objext
15390 if { (eval echo "$as_me:15390: \"$ac_compile\"") >&5
15391   (eval $ac_compile) 2>&5
15392   ac_status=$?
15393   echo "$as_me:15393: \$? = $ac_status" >&5
15394   (exit $ac_status); } &&
15395          { ac_try='test -s conftest.$ac_objext'
15396   { (eval echo "$as_me:15396: \"$ac_try\"") >&5
15397   (eval $ac_try) 2>&5
15398   ac_status=$?
15399   echo "$as_me:15399: \$? = $ac_status" >&5
15400   (exit $ac_status); }; }; then
15401   cf_cv_term_header=$cf_header
15402                          break
15403 else
15404   echo "$as_me: failed program was:" >&5
15405 cat conftest.$ac_ext >&5
15406 cf_cv_term_header=no
15407 fi
15408 rm -f conftest.$ac_objext conftest.$ac_ext
15409         done
15410         ;;
15411 esac
15412
15413 fi
15414 echo "$as_me:15414: result: $cf_cv_term_header" >&5
15415 echo "${ECHO_T}$cf_cv_term_header" >&6
15416
15417 case $cf_cv_term_header in
15418 (term.h)
15419
15420 cat >>confdefs.h <<\EOF
15421 #define HAVE_TERM_H 1
15422 EOF
15423
15424         ;;
15425 (ncurses/term.h)
15426
15427 cat >>confdefs.h <<\EOF
15428 #define HAVE_NCURSES_TERM_H 1
15429 EOF
15430
15431         ;;
15432 (ncursesw/term.h)
15433
15434 cat >>confdefs.h <<\EOF
15435 #define HAVE_NCURSESW_TERM_H 1
15436 EOF
15437
15438         ;;
15439 esac
15440
15441 echo "$as_me:15441: checking for unctrl.h" >&5
15442 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
15443 if test "${cf_cv_unctrl_header+set}" = set; then
15444   echo $ECHO_N "(cached) $ECHO_C" >&6
15445 else
15446
15447 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
15448 # for <unctrl.h> if we do not find the variant.
15449
15450 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
15451
15452 case ${cf_cv_ncurses_header:-curses.h} in
15453 (*/*)
15454         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
15455         cf_header_list="$cf_header_item $cf_header_list"
15456         ;;
15457 esac
15458
15459 for cf_header in $cf_header_list
15460 do
15461         cat >conftest.$ac_ext <<_ACEOF
15462 #line 15462 "configure"
15463 #include "confdefs.h"
15464
15465 #include <${cf_cv_ncurses_header:-curses.h}>
15466 #include <${cf_header}>
15467 int
15468 main (void)
15469 {
15470 WINDOW *x
15471   ;
15472   return 0;
15473 }
15474 _ACEOF
15475 rm -f conftest.$ac_objext
15476 if { (eval echo "$as_me:15476: \"$ac_compile\"") >&5
15477   (eval $ac_compile) 2>&5
15478   ac_status=$?
15479   echo "$as_me:15479: \$? = $ac_status" >&5
15480   (exit $ac_status); } &&
15481          { ac_try='test -s conftest.$ac_objext'
15482   { (eval echo "$as_me:15482: \"$ac_try\"") >&5
15483   (eval $ac_try) 2>&5
15484   ac_status=$?
15485   echo "$as_me:15485: \$? = $ac_status" >&5
15486   (exit $ac_status); }; }; then
15487   cf_cv_unctrl_header=$cf_header
15488          break
15489 else
15490   echo "$as_me: failed program was:" >&5
15491 cat conftest.$ac_ext >&5
15492 cf_cv_unctrl_header=no
15493 fi
15494 rm -f conftest.$ac_objext conftest.$ac_ext
15495 done
15496
15497 fi
15498 echo "$as_me:15498: result: $cf_cv_unctrl_header" >&5
15499 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
15500
15501 case $cf_cv_unctrl_header in
15502 (no)
15503         { echo "$as_me:15503: WARNING: unctrl.h header not found" >&5
15504 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
15505         ;;
15506 esac
15507
15508 case $cf_cv_unctrl_header in
15509 (unctrl.h)
15510
15511 cat >>confdefs.h <<\EOF
15512 #define HAVE_UNCTRL_H 1
15513 EOF
15514
15515         ;;
15516 (ncurses/unctrl.h)
15517
15518 cat >>confdefs.h <<\EOF
15519 #define HAVE_NCURSES_UNCTRL_H 1
15520 EOF
15521
15522         ;;
15523 (ncursesw/unctrl.h)
15524
15525 cat >>confdefs.h <<\EOF
15526 #define HAVE_NCURSESW_UNCTRL_H 1
15527 EOF
15528
15529         ;;
15530 esac
15531
15532 for cf_func in \
15533 alloc_pair \
15534 assume_default_colors \
15535 chgat \
15536 color_content \
15537 color_set \
15538 copywin \
15539 delscreen \
15540 dupwin \
15541 filter \
15542 getbegx \
15543 getcurx \
15544 getmaxx \
15545 getnstr \
15546 getparx \
15547 getwin \
15548 halfdelay \
15549 init_extended_color \
15550 mvderwin \
15551 mvvline \
15552 mvwin \
15553 mvwvline \
15554 napms \
15555 newpad \
15556 putwin \
15557 resize_term \
15558 resizeterm \
15559 restartterm \
15560 ripoffline \
15561 scr_dump \
15562 setupterm \
15563 slk_color \
15564 slk_init \
15565 termattrs \
15566 tgetent \
15567 tigetnum \
15568 tigetstr \
15569 tputs_sp \
15570 typeahead \
15571 use_default_colors \
15572 use_env \
15573 use_extended_names \
15574 use_screen \
15575 use_window \
15576 vid_puts \
15577 vidputs \
15578 vsscanf \
15579 vw_printw \
15580 wchgat \
15581 winsdelln \
15582 winsstr \
15583 wresize \
15584 wsyncdown \
15585 _tracef \
15586
15587 do
15588
15589 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15590
15591         echo "$as_me:15591: checking for ${cf_func}" >&5
15592 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15593
15594 echo "${as_me:-configure}:15594: testing ${cf_func} ..." 1>&5
15595
15596         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15597   echo $ECHO_N "(cached) $ECHO_C" >&6
15598 else
15599
15600                 eval cf_result='$ac_cv_func_'$cf_func
15601                 if test ".$cf_result" != ".no"; then
15602                         cat >conftest.$ac_ext <<_ACEOF
15603 #line 15603 "configure"
15604 #include "confdefs.h"
15605
15606 #ifdef HAVE_XCURSES
15607 #include <xcurses.h>
15608 char * XCursesProgramName = "test";
15609 #else
15610 #include <${cf_cv_ncurses_header:-curses.h}>
15611 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15612 #include <ncursesw/term.h>
15613 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15614 #include <ncurses/term.h>
15615 #elif defined(HAVE_TERM_H)
15616 #include <term.h>
15617 #endif
15618 #endif
15619
15620 int
15621 main (void)
15622 {
15623
15624 #ifndef ${cf_func}
15625 long foo = (long)(&${cf_func});
15626 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15627 if (foo + 1234 > 5678)
15628         ${cf_cv_main_return:-return}(foo);
15629 #endif
15630
15631   ;
15632   return 0;
15633 }
15634 _ACEOF
15635 rm -f conftest.$ac_objext conftest$ac_exeext
15636 if { (eval echo "$as_me:15636: \"$ac_link\"") >&5
15637   (eval $ac_link) 2>&5
15638   ac_status=$?
15639   echo "$as_me:15639: \$? = $ac_status" >&5
15640   (exit $ac_status); } &&
15641          { ac_try='test -s conftest$ac_exeext'
15642   { (eval echo "$as_me:15642: \"$ac_try\"") >&5
15643   (eval $ac_try) 2>&5
15644   ac_status=$?
15645   echo "$as_me:15645: \$? = $ac_status" >&5
15646   (exit $ac_status); }; }; then
15647   cf_result=yes
15648 else
15649   echo "$as_me: failed program was:" >&5
15650 cat conftest.$ac_ext >&5
15651 cf_result=no
15652 fi
15653 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15654                 fi
15655                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15656
15657 fi
15658
15659         # use the computed/retrieved cache-value:
15660         eval 'cf_result=$cf_cv_func_'$cf_func
15661         echo "$as_me:15661: result: $cf_result" >&5
15662 echo "${ECHO_T}$cf_result" >&6
15663         if test $cf_result != no; then
15664                 cat >>confdefs.h <<EOF
15665 #define HAVE_${cf_tr_func} 1
15666 EOF
15667
15668         fi
15669 done
15670
15671 for cf_func in tputs
15672 do
15673
15674 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15675
15676         echo "$as_me:15676: checking for ${cf_func}" >&5
15677 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15678
15679 echo "${as_me:-configure}:15679: testing ${cf_func} ..." 1>&5
15680
15681         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15682   echo $ECHO_N "(cached) $ECHO_C" >&6
15683 else
15684
15685                 eval cf_result='$ac_cv_func_'$cf_func
15686                 if test ".$cf_result" != ".no"; then
15687                         cat >conftest.$ac_ext <<_ACEOF
15688 #line 15688 "configure"
15689 #include "confdefs.h"
15690
15691 #ifdef HAVE_XCURSES
15692 #include <xcurses.h>
15693 char * XCursesProgramName = "test";
15694 #else
15695 #include <${cf_cv_ncurses_header:-curses.h}>
15696 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15697 #include <ncursesw/term.h>
15698 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15699 #include <ncurses/term.h>
15700 #elif defined(HAVE_TERM_H)
15701 #include <term.h>
15702 #endif
15703 #endif
15704
15705 int
15706 main (void)
15707 {
15708
15709 #ifndef ${cf_func}
15710 long foo = (long)(&${cf_func});
15711 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15712 if (foo + 1234 > 5678)
15713         ${cf_cv_main_return:-return}(foo);
15714 #endif
15715
15716   ;
15717   return 0;
15718 }
15719 _ACEOF
15720 rm -f conftest.$ac_objext conftest$ac_exeext
15721 if { (eval echo "$as_me:15721: \"$ac_link\"") >&5
15722   (eval $ac_link) 2>&5
15723   ac_status=$?
15724   echo "$as_me:15724: \$? = $ac_status" >&5
15725   (exit $ac_status); } &&
15726          { ac_try='test -s conftest$ac_exeext'
15727   { (eval echo "$as_me:15727: \"$ac_try\"") >&5
15728   (eval $ac_try) 2>&5
15729   ac_status=$?
15730   echo "$as_me:15730: \$? = $ac_status" >&5
15731   (exit $ac_status); }; }; then
15732   cf_result=yes
15733 else
15734   echo "$as_me: failed program was:" >&5
15735 cat conftest.$ac_ext >&5
15736 cf_result=no
15737 fi
15738 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15739                 fi
15740                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15741
15742 fi
15743
15744         # use the computed/retrieved cache-value:
15745         eval 'cf_result=$cf_cv_func_'$cf_func
15746         echo "$as_me:15746: result: $cf_result" >&5
15747 echo "${ECHO_T}$cf_result" >&6
15748         if test $cf_result != no; then
15749                 cat >>confdefs.h <<EOF
15750 #define HAVE_${cf_tr_func} 1
15751 EOF
15752
15753         fi
15754 done
15755
15756 if test x$cf_cv_func_tputs = xyes
15757 then
15758         cf_done=no
15759         for cf_arg in int char
15760         do
15761                 for cf_ret in int void
15762                 do
15763                         if test $cf_ret = void
15764                         then
15765                                 cf_return="/* nothing */"
15766                         else
15767                                 cf_return="return value"
15768                         fi
15769                         cat >conftest.$ac_ext <<_ACEOF
15770 #line 15770 "configure"
15771 #include "confdefs.h"
15772
15773 #include <${cf_cv_ncurses_header:-curses.h}>
15774 #include <$cf_cv_term_header>
15775
15776 static $cf_ret outc($cf_arg value) { $cf_return; }
15777
15778 int
15779 main (void)
15780 {
15781
15782         tputs("hello", 0, outc);
15783         ${cf_cv_main_return:-return}(0);
15784
15785   ;
15786   return 0;
15787 }
15788 _ACEOF
15789 rm -f conftest.$ac_objext
15790 if { (eval echo "$as_me:15790: \"$ac_compile\"") >&5
15791   (eval $ac_compile) 2>&5
15792   ac_status=$?
15793   echo "$as_me:15793: \$? = $ac_status" >&5
15794   (exit $ac_status); } &&
15795          { ac_try='test -s conftest.$ac_objext'
15796   { (eval echo "$as_me:15796: \"$ac_try\"") >&5
15797   (eval $ac_try) 2>&5
15798   ac_status=$?
15799   echo "$as_me:15799: \$? = $ac_status" >&5
15800   (exit $ac_status); }; }; then
15801
15802                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
15803
15804 echo "${as_me:-configure}:15804: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
15805
15806                 cat >>confdefs.h <<EOF
15807 #define TPUTS_ARG               $cf_arg
15808 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
15809 #define TPUTS_RETURN(value)     $cf_return
15810 EOF
15811                 cf_done=yes
15812                 break
15813
15814 else
15815   echo "$as_me: failed program was:" >&5
15816 cat conftest.$ac_ext >&5
15817 fi
15818 rm -f conftest.$ac_objext conftest.$ac_ext
15819                 done
15820                 test $cf_done = yes && break
15821         done
15822 fi
15823
15824 echo "$as_me:15824: checking for ncurses extended functions" >&5
15825 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
15826 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
15827   echo $ECHO_N "(cached) $ECHO_C" >&6
15828 else
15829
15830 cat >conftest.$ac_ext <<_ACEOF
15831 #line 15831 "configure"
15832 #include "confdefs.h"
15833
15834 #include <${cf_cv_ncurses_header:-curses.h}>
15835 int
15836 main (void)
15837 {
15838
15839 int x = NCURSES_EXT_FUNCS
15840
15841   ;
15842   return 0;
15843 }
15844 _ACEOF
15845 rm -f conftest.$ac_objext
15846 if { (eval echo "$as_me:15846: \"$ac_compile\"") >&5
15847   (eval $ac_compile) 2>&5
15848   ac_status=$?
15849   echo "$as_me:15849: \$? = $ac_status" >&5
15850   (exit $ac_status); } &&
15851          { ac_try='test -s conftest.$ac_objext'
15852   { (eval echo "$as_me:15852: \"$ac_try\"") >&5
15853   (eval $ac_try) 2>&5
15854   ac_status=$?
15855   echo "$as_me:15855: \$? = $ac_status" >&5
15856   (exit $ac_status); }; }; then
15857   cf_cv_ncurses_ext_funcs=defined
15858 else
15859   echo "$as_me: failed program was:" >&5
15860 cat conftest.$ac_ext >&5
15861
15862 cat >conftest.$ac_ext <<_ACEOF
15863 #line 15863 "configure"
15864 #include "confdefs.h"
15865
15866 #include <${cf_cv_ncurses_header:-curses.h}>
15867 int
15868 main (void)
15869 {
15870
15871         (void) assume_default_colors (0, 0);
15872         (void) curses_version ();
15873         (void) define_key (0, 0);
15874         (void) is_term_resized (0, 0);
15875         (void) key_defined (0);
15876         (void) keybound (0, 0);
15877         (void) keyok (0, 0);
15878         (void) resize_term (0, 0);
15879         (void) resizeterm (0, 0);
15880         (void) use_default_colors ();
15881         (void) use_extended_names (0);
15882         (void) wresize (0, 0, 0);
15883   ;
15884   return 0;
15885 }
15886 _ACEOF
15887 rm -f conftest.$ac_objext conftest$ac_exeext
15888 if { (eval echo "$as_me:15888: \"$ac_link\"") >&5
15889   (eval $ac_link) 2>&5
15890   ac_status=$?
15891   echo "$as_me:15891: \$? = $ac_status" >&5
15892   (exit $ac_status); } &&
15893          { ac_try='test -s conftest$ac_exeext'
15894   { (eval echo "$as_me:15894: \"$ac_try\"") >&5
15895   (eval $ac_try) 2>&5
15896   ac_status=$?
15897   echo "$as_me:15897: \$? = $ac_status" >&5
15898   (exit $ac_status); }; }; then
15899   cf_cv_ncurses_ext_funcs=yes
15900 else
15901   echo "$as_me: failed program was:" >&5
15902 cat conftest.$ac_ext >&5
15903 cf_cv_ncurses_ext_funcs=no
15904 fi
15905 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15906
15907 fi
15908 rm -f conftest.$ac_objext conftest.$ac_ext
15909
15910 fi
15911 echo "$as_me:15911: result: $cf_cv_ncurses_ext_funcs" >&5
15912 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
15913 test "$cf_cv_ncurses_ext_funcs" = yes &&
15914 cat >>confdefs.h <<\EOF
15915 #define NCURSES_EXT_FUNCS 1
15916 EOF
15917
15918 if test "$cf_enable_widec" = yes
15919 then
15920         # workaround for systems with ncurses before 20111029, due to change of
15921         # feature test macro from _XPG5 to _XOPEN_SOURCE
15922         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
15923         then
15924                 cf_define_xpg5=no
15925                 echo "$as_me:15925: checking if _XPG5 should be defined to enable wide-characters" >&5
15926 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
15927
15928                 cat >conftest.$ac_ext <<_ACEOF
15929 #line 15929 "configure"
15930 #include "confdefs.h"
15931
15932 #include <${cf_cv_ncurses_header:-curses.h}>
15933 int
15934 main (void)
15935 {
15936 int x = _XPG5
15937   ;
15938   return 0;
15939 }
15940 _ACEOF
15941 rm -f conftest.$ac_objext
15942 if { (eval echo "$as_me:15942: \"$ac_compile\"") >&5
15943   (eval $ac_compile) 2>&5
15944   ac_status=$?
15945   echo "$as_me:15945: \$? = $ac_status" >&5
15946   (exit $ac_status); } &&
15947          { ac_try='test -s conftest.$ac_objext'
15948   { (eval echo "$as_me:15948: \"$ac_try\"") >&5
15949   (eval $ac_try) 2>&5
15950   ac_status=$?
15951   echo "$as_me:15951: \$? = $ac_status" >&5
15952   (exit $ac_status); }; }; then
15953   :
15954 else
15955   echo "$as_me: failed program was:" >&5
15956 cat conftest.$ac_ext >&5
15957 cf_save_cppflags="$CPPFLAGS"
15958                          CPPFLAGS="$CPPFLAGS -D_XPG5"
15959                          cat >conftest.$ac_ext <<_ACEOF
15960 #line 15960 "configure"
15961 #include "confdefs.h"
15962
15963 #include <${cf_cv_ncurses_header:-curses.h}>
15964 int
15965 main (void)
15966 {
15967 int x = _XPG5
15968   ;
15969   return 0;
15970 }
15971 _ACEOF
15972 rm -f conftest.$ac_objext
15973 if { (eval echo "$as_me:15973: \"$ac_compile\"") >&5
15974   (eval $ac_compile) 2>&5
15975   ac_status=$?
15976   echo "$as_me:15976: \$? = $ac_status" >&5
15977   (exit $ac_status); } &&
15978          { ac_try='test -s conftest.$ac_objext'
15979   { (eval echo "$as_me:15979: \"$ac_try\"") >&5
15980   (eval $ac_try) 2>&5
15981   ac_status=$?
15982   echo "$as_me:15982: \$? = $ac_status" >&5
15983   (exit $ac_status); }; }; then
15984   cf_define_xpg5=yes
15985 else
15986   echo "$as_me: failed program was:" >&5
15987 cat conftest.$ac_ext >&5
15988 fi
15989 rm -f conftest.$ac_objext conftest.$ac_ext
15990                          CPPFLAGS="$cf_save_cppflags"
15991 fi
15992 rm -f conftest.$ac_objext conftest.$ac_ext
15993                 echo "$as_me:15993: result: $cf_define_xpg5" >&5
15994 echo "${ECHO_T}$cf_define_xpg5" >&6
15995
15996                 if test "$cf_define_xpg5" = yes
15997                 then
15998                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15999                 fi
16000         fi
16001
16002         echo "$as_me:16002: checking for wide-character functions" >&5
16003 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
16004 if test "${cf_cv_widechar_funcs+set}" = set; then
16005   echo $ECHO_N "(cached) $ECHO_C" >&6
16006 else
16007
16008         cat >conftest.$ac_ext <<_ACEOF
16009 #line 16009 "configure"
16010 #include "confdefs.h"
16011
16012 #include <${cf_cv_ncurses_header:-curses.h}>
16013 int
16014 main (void)
16015 {
16016
16017                 static wchar_t src_wchar[2];
16018                 static cchar_t dst_cchar;
16019                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
16020
16021   ;
16022   return 0;
16023 }
16024 _ACEOF
16025 rm -f conftest.$ac_objext conftest$ac_exeext
16026 if { (eval echo "$as_me:16026: \"$ac_link\"") >&5
16027   (eval $ac_link) 2>&5
16028   ac_status=$?
16029   echo "$as_me:16029: \$? = $ac_status" >&5
16030   (exit $ac_status); } &&
16031          { ac_try='test -s conftest$ac_exeext'
16032   { (eval echo "$as_me:16032: \"$ac_try\"") >&5
16033   (eval $ac_try) 2>&5
16034   ac_status=$?
16035   echo "$as_me:16035: \$? = $ac_status" >&5
16036   (exit $ac_status); }; }; then
16037   cf_cv_widechar_funcs=yes
16038 else
16039   echo "$as_me: failed program was:" >&5
16040 cat conftest.$ac_ext >&5
16041 cf_cv_widechar_funcs=no
16042 fi
16043 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16044
16045 fi
16046 echo "$as_me:16046: result: $cf_cv_widechar_funcs" >&5
16047 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
16048         if test "$cf_cv_widechar_funcs" != no ; then
16049
16050 cat >>confdefs.h <<\EOF
16051 #define USE_WIDEC_SUPPORT 1
16052 EOF
16053
16054         else
16055                 cat >>confdefs.h <<\EOF
16056 #define USE_WIDEC_SUPPORT 0
16057 EOF
16058
16059         fi
16060 else
16061         cat >>confdefs.h <<\EOF
16062 #define USE_WIDEC_SUPPORT 0
16063 EOF
16064
16065 fi
16066
16067 echo "$as_me:16067: checking if $cf_cv_screen library uses pthreads" >&5
16068 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
16069 if test "${cf_cv_use_pthreads+set}" = set; then
16070   echo $ECHO_N "(cached) $ECHO_C" >&6
16071 else
16072
16073 cat >conftest.$ac_ext <<_ACEOF
16074 #line 16074 "configure"
16075 #include "confdefs.h"
16076
16077 #include <${cf_cv_ncurses_header:-curses.h}>
16078 extern void _nc_init_pthreads(void);
16079
16080 int
16081 main (void)
16082 {
16083
16084         initscr();
16085         _nc_init_pthreads();
16086
16087   ;
16088   return 0;
16089 }
16090 _ACEOF
16091 rm -f conftest.$ac_objext conftest$ac_exeext
16092 if { (eval echo "$as_me:16092: \"$ac_link\"") >&5
16093   (eval $ac_link) 2>&5
16094   ac_status=$?
16095   echo "$as_me:16095: \$? = $ac_status" >&5
16096   (exit $ac_status); } &&
16097          { ac_try='test -s conftest$ac_exeext'
16098   { (eval echo "$as_me:16098: \"$ac_try\"") >&5
16099   (eval $ac_try) 2>&5
16100   ac_status=$?
16101   echo "$as_me:16101: \$? = $ac_status" >&5
16102   (exit $ac_status); }; }; then
16103   cf_cv_use_pthreads=yes
16104 else
16105   echo "$as_me: failed program was:" >&5
16106 cat conftest.$ac_ext >&5
16107 cf_cv_use_pthreads=no
16108 fi
16109 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16110
16111 fi
16112 echo "$as_me:16112: result: $cf_cv_use_pthreads" >&5
16113 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
16114 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
16115 #define USE_PTHREADS 1
16116 EOF
16117
16118 echo "$as_me:16118: checking if sys/time.h works with sys/select.h" >&5
16119 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
16120 if test "${cf_cv_sys_time_select+set}" = set; then
16121   echo $ECHO_N "(cached) $ECHO_C" >&6
16122 else
16123
16124 cat >conftest.$ac_ext <<_ACEOF
16125 #line 16125 "configure"
16126 #include "confdefs.h"
16127
16128 #include <sys/types.h>
16129 #ifdef HAVE_SYS_TIME_H
16130 #include <sys/time.h>
16131 #endif
16132 #ifdef HAVE_SYS_SELECT_H
16133 #include <sys/select.h>
16134 #endif
16135
16136 int
16137 main (void)
16138 {
16139
16140   ;
16141   return 0;
16142 }
16143 _ACEOF
16144 rm -f conftest.$ac_objext
16145 if { (eval echo "$as_me:16145: \"$ac_compile\"") >&5
16146   (eval $ac_compile) 2>&5
16147   ac_status=$?
16148   echo "$as_me:16148: \$? = $ac_status" >&5
16149   (exit $ac_status); } &&
16150          { ac_try='test -s conftest.$ac_objext'
16151   { (eval echo "$as_me:16151: \"$ac_try\"") >&5
16152   (eval $ac_try) 2>&5
16153   ac_status=$?
16154   echo "$as_me:16154: \$? = $ac_status" >&5
16155   (exit $ac_status); }; }; then
16156   cf_cv_sys_time_select=yes
16157 else
16158   echo "$as_me: failed program was:" >&5
16159 cat conftest.$ac_ext >&5
16160 cf_cv_sys_time_select=no
16161 fi
16162 rm -f conftest.$ac_objext conftest.$ac_ext
16163
16164 fi
16165
16166 echo "$as_me:16166: result: $cf_cv_sys_time_select" >&5
16167 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
16168 test "$cf_cv_sys_time_select" = yes &&
16169 cat >>confdefs.h <<\EOF
16170 #define HAVE_SYS_TIME_SELECT 1
16171 EOF
16172
16173 # special check for test/ditto.c
16174
16175 echo "$as_me:16175: checking for openpty in -lutil" >&5
16176 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
16177 if test "${ac_cv_lib_util_openpty+set}" = set; then
16178   echo $ECHO_N "(cached) $ECHO_C" >&6
16179 else
16180   ac_check_lib_save_LIBS=$LIBS
16181 LIBS="-lutil  $LIBS"
16182 cat >conftest.$ac_ext <<_ACEOF
16183 #line 16183 "configure"
16184 #include "confdefs.h"
16185
16186 /* Override any gcc2 internal prototype to avoid an error.  */
16187 #ifdef __cplusplus
16188 extern "C"
16189 #endif
16190 /* We use char because int might match the return type of a gcc2
16191    builtin and then its argument prototype would still apply.  */
16192 char openpty ();
16193 int
16194 main (void)
16195 {
16196 openpty ();
16197   ;
16198   return 0;
16199 }
16200 _ACEOF
16201 rm -f conftest.$ac_objext conftest$ac_exeext
16202 if { (eval echo "$as_me:16202: \"$ac_link\"") >&5
16203   (eval $ac_link) 2>&5
16204   ac_status=$?
16205   echo "$as_me:16205: \$? = $ac_status" >&5
16206   (exit $ac_status); } &&
16207          { ac_try='test -s conftest$ac_exeext'
16208   { (eval echo "$as_me:16208: \"$ac_try\"") >&5
16209   (eval $ac_try) 2>&5
16210   ac_status=$?
16211   echo "$as_me:16211: \$? = $ac_status" >&5
16212   (exit $ac_status); }; }; then
16213   ac_cv_lib_util_openpty=yes
16214 else
16215   echo "$as_me: failed program was:" >&5
16216 cat conftest.$ac_ext >&5
16217 ac_cv_lib_util_openpty=no
16218 fi
16219 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16220 LIBS=$ac_check_lib_save_LIBS
16221 fi
16222 echo "$as_me:16222: result: $ac_cv_lib_util_openpty" >&5
16223 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
16224 if test $ac_cv_lib_util_openpty = yes; then
16225   cf_cv_lib_util=yes
16226 else
16227   cf_cv_lib_util=no
16228 fi
16229
16230 echo "$as_me:16230: checking for openpty header" >&5
16231 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
16232 if test "${cf_cv_func_openpty+set}" = set; then
16233   echo $ECHO_N "(cached) $ECHO_C" >&6
16234 else
16235
16236         cf_save_LIBS="$LIBS"
16237         test $cf_cv_lib_util = yes && {
16238 cf_add_libs="-lutil"
16239 # Filter out duplicates - this happens with badly-designed ".pc" files...
16240 for cf_add_1lib in $LIBS
16241 do
16242         for cf_add_2lib in $cf_add_libs
16243         do
16244                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16245                 then
16246                         cf_add_1lib=
16247                         break
16248                 fi
16249         done
16250         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16251 done
16252 LIBS="$cf_add_libs"
16253  }
16254         for cf_header in pty.h libutil.h util.h
16255         do
16256         cat >conftest.$ac_ext <<_ACEOF
16257 #line 16257 "configure"
16258 #include "confdefs.h"
16259
16260 #include <$cf_header>
16261
16262 int
16263 main (void)
16264 {
16265
16266         int x = openpty((int *)0, (int *)0, (char *)0,
16267                                    (struct termios *)0, (struct winsize *)0);
16268
16269   ;
16270   return 0;
16271 }
16272 _ACEOF
16273 rm -f conftest.$ac_objext conftest$ac_exeext
16274 if { (eval echo "$as_me:16274: \"$ac_link\"") >&5
16275   (eval $ac_link) 2>&5
16276   ac_status=$?
16277   echo "$as_me:16277: \$? = $ac_status" >&5
16278   (exit $ac_status); } &&
16279          { ac_try='test -s conftest$ac_exeext'
16280   { (eval echo "$as_me:16280: \"$ac_try\"") >&5
16281   (eval $ac_try) 2>&5
16282   ac_status=$?
16283   echo "$as_me:16283: \$? = $ac_status" >&5
16284   (exit $ac_status); }; }; then
16285
16286                 cf_cv_func_openpty=$cf_header
16287                 break
16288
16289 else
16290   echo "$as_me: failed program was:" >&5
16291 cat conftest.$ac_ext >&5
16292
16293                 cf_cv_func_openpty=no
16294
16295 fi
16296 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16297         done
16298         LIBS="$cf_save_LIBS"
16299
16300 fi
16301 echo "$as_me:16301: result: $cf_cv_func_openpty" >&5
16302 echo "${ECHO_T}$cf_cv_func_openpty" >&6
16303
16304 if test "$cf_cv_func_openpty" != no ; then
16305
16306 cat >>confdefs.h <<EOF
16307 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
16308 EOF
16309
16310 cat >>confdefs.h <<\EOF
16311 #define USE_XTERM_PTY 1
16312 EOF
16313
16314         if test "x$cf_cv_lib_util" = xyes ; then
16315
16316 cf_add_libs="-lutil"
16317 # Filter out duplicates - this happens with badly-designed ".pc" files...
16318 for cf_add_1lib in $TEST_LIBS
16319 do
16320         for cf_add_2lib in $cf_add_libs
16321         do
16322                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16323                 then
16324                         cf_add_1lib=
16325                         break
16326                 fi
16327         done
16328         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16329 done
16330 TEST_LIBS="$cf_add_libs"
16331
16332         fi
16333 fi
16334
16335 echo "$as_me:16335: checking for function curses_version" >&5
16336 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
16337 if test "${cf_cv_func_curses_version+set}" = set; then
16338   echo $ECHO_N "(cached) $ECHO_C" >&6
16339 else
16340
16341 if test "$cross_compiling" = yes; then
16342   cf_cv_func_curses_version=unknown
16343 else
16344   cat >conftest.$ac_ext <<_ACEOF
16345 #line 16345 "configure"
16346 #include "confdefs.h"
16347
16348 #include <${cf_cv_ncurses_header:-curses.h}>
16349 int main(void)
16350 {
16351         char temp[1024];
16352         sprintf(temp, "%s\n", curses_version());
16353         ${cf_cv_main_return:-return}(0);
16354 }
16355
16356 _ACEOF
16357 rm -f conftest$ac_exeext
16358 if { (eval echo "$as_me:16358: \"$ac_link\"") >&5
16359   (eval $ac_link) 2>&5
16360   ac_status=$?
16361   echo "$as_me:16361: \$? = $ac_status" >&5
16362   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16363   { (eval echo "$as_me:16363: \"$ac_try\"") >&5
16364   (eval $ac_try) 2>&5
16365   ac_status=$?
16366   echo "$as_me:16366: \$? = $ac_status" >&5
16367   (exit $ac_status); }; }; then
16368   cf_cv_func_curses_version=yes
16369
16370 else
16371   echo "$as_me: program exited with status $ac_status" >&5
16372 echo "$as_me: failed program was:" >&5
16373 cat conftest.$ac_ext >&5
16374 cf_cv_func_curses_version=no
16375
16376 fi
16377 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16378 fi
16379 rm -f core
16380 fi
16381 echo "$as_me:16381: result: $cf_cv_func_curses_version" >&5
16382 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
16383 test "$cf_cv_func_curses_version" = yes &&
16384 cat >>confdefs.h <<\EOF
16385 #define HAVE_CURSES_VERSION 1
16386 EOF
16387
16388 echo "$as_me:16388: checking for alternate character set array" >&5
16389 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
16390 if test "${cf_cv_curses_acs_map+set}" = set; then
16391   echo $ECHO_N "(cached) $ECHO_C" >&6
16392 else
16393
16394 cf_cv_curses_acs_map=unknown
16395 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
16396 do
16397 cat >conftest.$ac_ext <<_ACEOF
16398 #line 16398 "configure"
16399 #include "confdefs.h"
16400
16401 #include <${cf_cv_ncurses_header:-curses.h}>
16402
16403 int
16404 main (void)
16405 {
16406
16407 $name['k'] = ACS_PLUS
16408
16409   ;
16410   return 0;
16411 }
16412 _ACEOF
16413 rm -f conftest.$ac_objext conftest$ac_exeext
16414 if { (eval echo "$as_me:16414: \"$ac_link\"") >&5
16415   (eval $ac_link) 2>&5
16416   ac_status=$?
16417   echo "$as_me:16417: \$? = $ac_status" >&5
16418   (exit $ac_status); } &&
16419          { ac_try='test -s conftest$ac_exeext'
16420   { (eval echo "$as_me:16420: \"$ac_try\"") >&5
16421   (eval $ac_try) 2>&5
16422   ac_status=$?
16423   echo "$as_me:16423: \$? = $ac_status" >&5
16424   (exit $ac_status); }; }; then
16425   cf_cv_curses_acs_map=$name; break
16426 else
16427   echo "$as_me: failed program was:" >&5
16428 cat conftest.$ac_ext >&5
16429 fi
16430 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16431 done
16432
16433 fi
16434 echo "$as_me:16434: result: $cf_cv_curses_acs_map" >&5
16435 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
16436
16437 test "$cf_cv_curses_acs_map" != unknown &&
16438 cat >>confdefs.h <<EOF
16439 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
16440 EOF
16441
16442 if test "$cf_enable_widec" = yes; then
16443
16444 echo "$as_me:16444: checking for wide alternate character set array" >&5
16445 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
16446 if test "${cf_cv_curses_wacs_map+set}" = set; then
16447   echo $ECHO_N "(cached) $ECHO_C" >&6
16448 else
16449
16450         cf_cv_curses_wacs_map=unknown
16451         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
16452         do
16453         cat >conftest.$ac_ext <<_ACEOF
16454 #line 16454 "configure"
16455 #include "confdefs.h"
16456
16457 #ifndef _XOPEN_SOURCE_EXTENDED
16458 #define _XOPEN_SOURCE_EXTENDED
16459 #endif
16460 #include <${cf_cv_ncurses_header:-curses.h}>
16461 int
16462 main (void)
16463 {
16464 void *foo = &($name['k'])
16465   ;
16466   return 0;
16467 }
16468 _ACEOF
16469 rm -f conftest.$ac_objext conftest$ac_exeext
16470 if { (eval echo "$as_me:16470: \"$ac_link\"") >&5
16471   (eval $ac_link) 2>&5
16472   ac_status=$?
16473   echo "$as_me:16473: \$? = $ac_status" >&5
16474   (exit $ac_status); } &&
16475          { ac_try='test -s conftest$ac_exeext'
16476   { (eval echo "$as_me:16476: \"$ac_try\"") >&5
16477   (eval $ac_try) 2>&5
16478   ac_status=$?
16479   echo "$as_me:16479: \$? = $ac_status" >&5
16480   (exit $ac_status); }; }; then
16481   cf_cv_curses_wacs_map=$name
16482          break
16483 else
16484   echo "$as_me: failed program was:" >&5
16485 cat conftest.$ac_ext >&5
16486 fi
16487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16488         done
16489 fi
16490 echo "$as_me:16490: result: $cf_cv_curses_wacs_map" >&5
16491 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
16492
16493 test "$cf_cv_curses_wacs_map" != unknown &&
16494 cat >>confdefs.h <<EOF
16495 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
16496 EOF
16497
16498 echo "$as_me:16498: checking for wide alternate character constants" >&5
16499 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
16500 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
16501   echo $ECHO_N "(cached) $ECHO_C" >&6
16502 else
16503
16504 cf_cv_curses_wacs_symbols=no
16505 if test "$cf_cv_curses_wacs_map" != unknown
16506 then
16507         cat >conftest.$ac_ext <<_ACEOF
16508 #line 16508 "configure"
16509 #include "confdefs.h"
16510
16511 #ifndef _XOPEN_SOURCE_EXTENDED
16512 #define _XOPEN_SOURCE_EXTENDED
16513 #endif
16514 #include <${cf_cv_ncurses_header:-curses.h}>
16515 int
16516 main (void)
16517 {
16518 cchar_t *foo = WACS_PLUS;
16519          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
16520   ;
16521   return 0;
16522 }
16523 _ACEOF
16524 rm -f conftest.$ac_objext conftest$ac_exeext
16525 if { (eval echo "$as_me:16525: \"$ac_link\"") >&5
16526   (eval $ac_link) 2>&5
16527   ac_status=$?
16528   echo "$as_me:16528: \$? = $ac_status" >&5
16529   (exit $ac_status); } &&
16530          { ac_try='test -s conftest$ac_exeext'
16531   { (eval echo "$as_me:16531: \"$ac_try\"") >&5
16532   (eval $ac_try) 2>&5
16533   ac_status=$?
16534   echo "$as_me:16534: \$? = $ac_status" >&5
16535   (exit $ac_status); }; }; then
16536   cf_cv_curses_wacs_symbols=yes
16537 else
16538   echo "$as_me: failed program was:" >&5
16539 cat conftest.$ac_ext >&5
16540 fi
16541 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16542 else
16543         cat >conftest.$ac_ext <<_ACEOF
16544 #line 16544 "configure"
16545 #include "confdefs.h"
16546
16547 #ifndef _XOPEN_SOURCE_EXTENDED
16548 #define _XOPEN_SOURCE_EXTENDED
16549 #endif
16550 #include <${cf_cv_ncurses_header:-curses.h}>
16551 int
16552 main (void)
16553 {
16554 cchar_t *foo = WACS_PLUS
16555   ;
16556   return 0;
16557 }
16558 _ACEOF
16559 rm -f conftest.$ac_objext conftest$ac_exeext
16560 if { (eval echo "$as_me:16560: \"$ac_link\"") >&5
16561   (eval $ac_link) 2>&5
16562   ac_status=$?
16563   echo "$as_me:16563: \$? = $ac_status" >&5
16564   (exit $ac_status); } &&
16565          { ac_try='test -s conftest$ac_exeext'
16566   { (eval echo "$as_me:16566: \"$ac_try\"") >&5
16567   (eval $ac_try) 2>&5
16568   ac_status=$?
16569   echo "$as_me:16569: \$? = $ac_status" >&5
16570   (exit $ac_status); }; }; then
16571   cf_cv_curses_wacs_symbols=yes
16572 else
16573   echo "$as_me: failed program was:" >&5
16574 cat conftest.$ac_ext >&5
16575 fi
16576 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16577 fi
16578
16579 fi
16580 echo "$as_me:16580: result: $cf_cv_curses_wacs_symbols" >&5
16581 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
16582
16583 test "$cf_cv_curses_wacs_symbols" != no &&
16584 cat >>confdefs.h <<\EOF
16585 #define CURSES_WACS_SYMBOLS 1
16586 EOF
16587
16588 fi
16589
16590 echo "$as_me:16590: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16591 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16592 cat >conftest.$ac_ext <<_ACEOF
16593 #line 16593 "configure"
16594 #include "confdefs.h"
16595
16596 #ifndef _XOPEN_SOURCE_EXTENDED
16597 #define _XOPEN_SOURCE_EXTENDED
16598 #endif
16599 #include <${cf_cv_ncurses_header:-curses.h}>
16600 int
16601 main (void)
16602 {
16603
16604 attr_t foo
16605
16606   ;
16607   return 0;
16608 }
16609 _ACEOF
16610 rm -f conftest.$ac_objext
16611 if { (eval echo "$as_me:16611: \"$ac_compile\"") >&5
16612   (eval $ac_compile) 2>&5
16613   ac_status=$?
16614   echo "$as_me:16614: \$? = $ac_status" >&5
16615   (exit $ac_status); } &&
16616          { ac_try='test -s conftest.$ac_objext'
16617   { (eval echo "$as_me:16617: \"$ac_try\"") >&5
16618   (eval $ac_try) 2>&5
16619   ac_status=$?
16620   echo "$as_me:16620: \$? = $ac_status" >&5
16621   (exit $ac_status); }; }; then
16622   cf_result=yes
16623 else
16624   echo "$as_me: failed program was:" >&5
16625 cat conftest.$ac_ext >&5
16626 cf_result=no
16627 fi
16628 rm -f conftest.$ac_objext conftest.$ac_ext
16629 echo "$as_me:16629: result: $cf_result" >&5
16630 echo "${ECHO_T}$cf_result" >&6
16631 if test $cf_result = yes ; then
16632
16633 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16634
16635 cat >>confdefs.h <<EOF
16636 #define $cf_result 1
16637 EOF
16638
16639 else
16640
16641 cat >>confdefs.h <<EOF
16642 #define attr_t long
16643 EOF
16644
16645 fi
16646
16647 if test "$cf_enable_widec" = yes; then
16648
16649 # This is needed on Tru64 5.0 to declare mbstate_t
16650 echo "$as_me:16650: checking if we must include wchar.h to declare mbstate_t" >&5
16651 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
16652 if test "${cf_cv_mbstate_t+set}" = set; then
16653   echo $ECHO_N "(cached) $ECHO_C" >&6
16654 else
16655
16656 cat >conftest.$ac_ext <<_ACEOF
16657 #line 16657 "configure"
16658 #include "confdefs.h"
16659
16660 #include <stdlib.h>
16661 #include <stdarg.h>
16662 #include <stdio.h>
16663 #ifdef HAVE_LIBUTF8_H
16664 #include <libutf8.h>
16665 #endif
16666 int
16667 main (void)
16668 {
16669 mbstate_t state
16670   ;
16671   return 0;
16672 }
16673 _ACEOF
16674 rm -f conftest.$ac_objext
16675 if { (eval echo "$as_me:16675: \"$ac_compile\"") >&5
16676   (eval $ac_compile) 2>&5
16677   ac_status=$?
16678   echo "$as_me:16678: \$? = $ac_status" >&5
16679   (exit $ac_status); } &&
16680          { ac_try='test -s conftest.$ac_objext'
16681   { (eval echo "$as_me:16681: \"$ac_try\"") >&5
16682   (eval $ac_try) 2>&5
16683   ac_status=$?
16684   echo "$as_me:16684: \$? = $ac_status" >&5
16685   (exit $ac_status); }; }; then
16686   cf_cv_mbstate_t=no
16687 else
16688   echo "$as_me: failed program was:" >&5
16689 cat conftest.$ac_ext >&5
16690 cat >conftest.$ac_ext <<_ACEOF
16691 #line 16691 "configure"
16692 #include "confdefs.h"
16693
16694 #include <stdlib.h>
16695 #include <stdarg.h>
16696 #include <stdio.h>
16697 #include <wchar.h>
16698 #ifdef HAVE_LIBUTF8_H
16699 #include <libutf8.h>
16700 #endif
16701 int
16702 main (void)
16703 {
16704 mbstate_t value
16705   ;
16706   return 0;
16707 }
16708 _ACEOF
16709 rm -f conftest.$ac_objext
16710 if { (eval echo "$as_me:16710: \"$ac_compile\"") >&5
16711   (eval $ac_compile) 2>&5
16712   ac_status=$?
16713   echo "$as_me:16713: \$? = $ac_status" >&5
16714   (exit $ac_status); } &&
16715          { ac_try='test -s conftest.$ac_objext'
16716   { (eval echo "$as_me:16716: \"$ac_try\"") >&5
16717   (eval $ac_try) 2>&5
16718   ac_status=$?
16719   echo "$as_me:16719: \$? = $ac_status" >&5
16720   (exit $ac_status); }; }; then
16721   cf_cv_mbstate_t=yes
16722 else
16723   echo "$as_me: failed program was:" >&5
16724 cat conftest.$ac_ext >&5
16725 cf_cv_mbstate_t=unknown
16726 fi
16727 rm -f conftest.$ac_objext conftest.$ac_ext
16728 fi
16729 rm -f conftest.$ac_objext conftest.$ac_ext
16730 fi
16731 echo "$as_me:16731: result: $cf_cv_mbstate_t" >&5
16732 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
16733
16734 if test "$cf_cv_mbstate_t" = yes ; then
16735
16736 cat >>confdefs.h <<\EOF
16737 #define NEED_WCHAR_H 1
16738 EOF
16739
16740         NEED_WCHAR_H=1
16741 fi
16742
16743 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
16744 if test "$cf_cv_mbstate_t" = unknown ; then
16745         NCURSES_MBSTATE_T=1
16746 fi
16747
16748 # if we find mbstate_t in either place, use substitution to provide a fallback.
16749 if test "$cf_cv_mbstate_t" != unknown ; then
16750         NCURSES_OK_MBSTATE_T=1
16751 fi
16752
16753 # This is needed on Tru64 5.0 to declare wchar_t
16754 echo "$as_me:16754: checking if we must include wchar.h to declare wchar_t" >&5
16755 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
16756 if test "${cf_cv_wchar_t+set}" = set; then
16757   echo $ECHO_N "(cached) $ECHO_C" >&6
16758 else
16759
16760 cat >conftest.$ac_ext <<_ACEOF
16761 #line 16761 "configure"
16762 #include "confdefs.h"
16763
16764 #include <stdlib.h>
16765 #include <stdarg.h>
16766 #include <stdio.h>
16767 #ifdef HAVE_LIBUTF8_H
16768 #include <libutf8.h>
16769 #endif
16770 int
16771 main (void)
16772 {
16773 wchar_t state
16774   ;
16775   return 0;
16776 }
16777 _ACEOF
16778 rm -f conftest.$ac_objext
16779 if { (eval echo "$as_me:16779: \"$ac_compile\"") >&5
16780   (eval $ac_compile) 2>&5
16781   ac_status=$?
16782   echo "$as_me:16782: \$? = $ac_status" >&5
16783   (exit $ac_status); } &&
16784          { ac_try='test -s conftest.$ac_objext'
16785   { (eval echo "$as_me:16785: \"$ac_try\"") >&5
16786   (eval $ac_try) 2>&5
16787   ac_status=$?
16788   echo "$as_me:16788: \$? = $ac_status" >&5
16789   (exit $ac_status); }; }; then
16790   cf_cv_wchar_t=no
16791 else
16792   echo "$as_me: failed program was:" >&5
16793 cat conftest.$ac_ext >&5
16794 cat >conftest.$ac_ext <<_ACEOF
16795 #line 16795 "configure"
16796 #include "confdefs.h"
16797
16798 #include <stdlib.h>
16799 #include <stdarg.h>
16800 #include <stdio.h>
16801 #include <wchar.h>
16802 #ifdef HAVE_LIBUTF8_H
16803 #include <libutf8.h>
16804 #endif
16805 int
16806 main (void)
16807 {
16808 wchar_t value
16809   ;
16810   return 0;
16811 }
16812 _ACEOF
16813 rm -f conftest.$ac_objext
16814 if { (eval echo "$as_me:16814: \"$ac_compile\"") >&5
16815   (eval $ac_compile) 2>&5
16816   ac_status=$?
16817   echo "$as_me:16817: \$? = $ac_status" >&5
16818   (exit $ac_status); } &&
16819          { ac_try='test -s conftest.$ac_objext'
16820   { (eval echo "$as_me:16820: \"$ac_try\"") >&5
16821   (eval $ac_try) 2>&5
16822   ac_status=$?
16823   echo "$as_me:16823: \$? = $ac_status" >&5
16824   (exit $ac_status); }; }; then
16825   cf_cv_wchar_t=yes
16826 else
16827   echo "$as_me: failed program was:" >&5
16828 cat conftest.$ac_ext >&5
16829 cf_cv_wchar_t=unknown
16830 fi
16831 rm -f conftest.$ac_objext conftest.$ac_ext
16832 fi
16833 rm -f conftest.$ac_objext conftest.$ac_ext
16834 fi
16835 echo "$as_me:16835: result: $cf_cv_wchar_t" >&5
16836 echo "${ECHO_T}$cf_cv_wchar_t" >&6
16837
16838 if test "$cf_cv_wchar_t" = yes ; then
16839
16840 cat >>confdefs.h <<\EOF
16841 #define NEED_WCHAR_H 1
16842 EOF
16843
16844         NEED_WCHAR_H=1
16845 fi
16846
16847 # if we do not find wchar_t in either place, use substitution to provide a fallback.
16848 if test "$cf_cv_wchar_t" = unknown ; then
16849         NCURSES_WCHAR_T=1
16850 fi
16851
16852 # if we find wchar_t in either place, use substitution to provide a fallback.
16853 if test "$cf_cv_wchar_t" != unknown ; then
16854         NCURSES_OK_WCHAR_T=1
16855 fi
16856
16857 # This is needed on Tru64 5.0 to declare wint_t
16858 echo "$as_me:16858: checking if we must include wchar.h to declare wint_t" >&5
16859 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
16860 if test "${cf_cv_wint_t+set}" = set; then
16861   echo $ECHO_N "(cached) $ECHO_C" >&6
16862 else
16863
16864 cat >conftest.$ac_ext <<_ACEOF
16865 #line 16865 "configure"
16866 #include "confdefs.h"
16867
16868 #include <stdlib.h>
16869 #include <stdarg.h>
16870 #include <stdio.h>
16871 #ifdef HAVE_LIBUTF8_H
16872 #include <libutf8.h>
16873 #endif
16874 int
16875 main (void)
16876 {
16877 wint_t state
16878   ;
16879   return 0;
16880 }
16881 _ACEOF
16882 rm -f conftest.$ac_objext
16883 if { (eval echo "$as_me:16883: \"$ac_compile\"") >&5
16884   (eval $ac_compile) 2>&5
16885   ac_status=$?
16886   echo "$as_me:16886: \$? = $ac_status" >&5
16887   (exit $ac_status); } &&
16888          { ac_try='test -s conftest.$ac_objext'
16889   { (eval echo "$as_me:16889: \"$ac_try\"") >&5
16890   (eval $ac_try) 2>&5
16891   ac_status=$?
16892   echo "$as_me:16892: \$? = $ac_status" >&5
16893   (exit $ac_status); }; }; then
16894   cf_cv_wint_t=no
16895 else
16896   echo "$as_me: failed program was:" >&5
16897 cat conftest.$ac_ext >&5
16898 cat >conftest.$ac_ext <<_ACEOF
16899 #line 16899 "configure"
16900 #include "confdefs.h"
16901
16902 #include <stdlib.h>
16903 #include <stdarg.h>
16904 #include <stdio.h>
16905 #include <wchar.h>
16906 #ifdef HAVE_LIBUTF8_H
16907 #include <libutf8.h>
16908 #endif
16909 int
16910 main (void)
16911 {
16912 wint_t value
16913   ;
16914   return 0;
16915 }
16916 _ACEOF
16917 rm -f conftest.$ac_objext
16918 if { (eval echo "$as_me:16918: \"$ac_compile\"") >&5
16919   (eval $ac_compile) 2>&5
16920   ac_status=$?
16921   echo "$as_me:16921: \$? = $ac_status" >&5
16922   (exit $ac_status); } &&
16923          { ac_try='test -s conftest.$ac_objext'
16924   { (eval echo "$as_me:16924: \"$ac_try\"") >&5
16925   (eval $ac_try) 2>&5
16926   ac_status=$?
16927   echo "$as_me:16927: \$? = $ac_status" >&5
16928   (exit $ac_status); }; }; then
16929   cf_cv_wint_t=yes
16930 else
16931   echo "$as_me: failed program was:" >&5
16932 cat conftest.$ac_ext >&5
16933 cf_cv_wint_t=unknown
16934 fi
16935 rm -f conftest.$ac_objext conftest.$ac_ext
16936 fi
16937 rm -f conftest.$ac_objext conftest.$ac_ext
16938 fi
16939 echo "$as_me:16939: result: $cf_cv_wint_t" >&5
16940 echo "${ECHO_T}$cf_cv_wint_t" >&6
16941
16942 if test "$cf_cv_wint_t" = yes ; then
16943
16944 cat >>confdefs.h <<\EOF
16945 #define NEED_WCHAR_H 1
16946 EOF
16947
16948         NEED_WCHAR_H=1
16949 fi
16950
16951 # if we do not find wint_t in either place, use substitution to provide a fallback.
16952 if test "$cf_cv_wint_t" = unknown ; then
16953         NCURSES_WINT_T=1
16954 fi
16955
16956 # if we find wint_t in either place, use substitution to provide a fallback.
16957 if test "$cf_cv_wint_t" != unknown ; then
16958         NCURSES_OK_WINT_T=1
16959 fi
16960
16961         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
16962
16963 echo "$as_me:16963: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16964 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16965 cat >conftest.$ac_ext <<_ACEOF
16966 #line 16966 "configure"
16967 #include "confdefs.h"
16968
16969 #ifndef _XOPEN_SOURCE_EXTENDED
16970 #define _XOPEN_SOURCE_EXTENDED
16971 #endif
16972 #include <${cf_cv_ncurses_header:-curses.h}>
16973 int
16974 main (void)
16975 {
16976
16977 mbstate_t foo
16978
16979   ;
16980   return 0;
16981 }
16982 _ACEOF
16983 rm -f conftest.$ac_objext
16984 if { (eval echo "$as_me:16984: \"$ac_compile\"") >&5
16985   (eval $ac_compile) 2>&5
16986   ac_status=$?
16987   echo "$as_me:16987: \$? = $ac_status" >&5
16988   (exit $ac_status); } &&
16989          { ac_try='test -s conftest.$ac_objext'
16990   { (eval echo "$as_me:16990: \"$ac_try\"") >&5
16991   (eval $ac_try) 2>&5
16992   ac_status=$?
16993   echo "$as_me:16993: \$? = $ac_status" >&5
16994   (exit $ac_status); }; }; then
16995   cf_result=yes
16996 else
16997   echo "$as_me: failed program was:" >&5
16998 cat conftest.$ac_ext >&5
16999 cf_result=no
17000 fi
17001 rm -f conftest.$ac_objext conftest.$ac_ext
17002 echo "$as_me:17002: result: $cf_result" >&5
17003 echo "${ECHO_T}$cf_result" >&6
17004 if test $cf_result = yes ; then
17005
17006 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17007
17008 cat >>confdefs.h <<EOF
17009 #define $cf_result 1
17010 EOF
17011
17012 else
17013
17014 cat >>confdefs.h <<EOF
17015 #define mbstate_t long
17016 EOF
17017
17018 fi
17019
17020         fi
17021
17022         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
17023
17024 echo "$as_me:17024: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17025 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17026 cat >conftest.$ac_ext <<_ACEOF
17027 #line 17027 "configure"
17028 #include "confdefs.h"
17029
17030 #ifndef _XOPEN_SOURCE_EXTENDED
17031 #define _XOPEN_SOURCE_EXTENDED
17032 #endif
17033 #include <${cf_cv_ncurses_header:-curses.h}>
17034 int
17035 main (void)
17036 {
17037
17038 wchar_t foo
17039
17040   ;
17041   return 0;
17042 }
17043 _ACEOF
17044 rm -f conftest.$ac_objext
17045 if { (eval echo "$as_me:17045: \"$ac_compile\"") >&5
17046   (eval $ac_compile) 2>&5
17047   ac_status=$?
17048   echo "$as_me:17048: \$? = $ac_status" >&5
17049   (exit $ac_status); } &&
17050          { ac_try='test -s conftest.$ac_objext'
17051   { (eval echo "$as_me:17051: \"$ac_try\"") >&5
17052   (eval $ac_try) 2>&5
17053   ac_status=$?
17054   echo "$as_me:17054: \$? = $ac_status" >&5
17055   (exit $ac_status); }; }; then
17056   cf_result=yes
17057 else
17058   echo "$as_me: failed program was:" >&5
17059 cat conftest.$ac_ext >&5
17060 cf_result=no
17061 fi
17062 rm -f conftest.$ac_objext conftest.$ac_ext
17063 echo "$as_me:17063: result: $cf_result" >&5
17064 echo "${ECHO_T}$cf_result" >&6
17065 if test $cf_result = yes ; then
17066
17067 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17068
17069 cat >>confdefs.h <<EOF
17070 #define $cf_result 1
17071 EOF
17072
17073 else
17074
17075 cat >>confdefs.h <<EOF
17076 #define wchar_t long
17077 EOF
17078
17079 fi
17080
17081         fi
17082
17083         if test "$NCURSES_OK_WINT_T" = 0 ; then
17084
17085 echo "$as_me:17085: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17086 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17087 cat >conftest.$ac_ext <<_ACEOF
17088 #line 17088 "configure"
17089 #include "confdefs.h"
17090
17091 #ifndef _XOPEN_SOURCE_EXTENDED
17092 #define _XOPEN_SOURCE_EXTENDED
17093 #endif
17094 #include <${cf_cv_ncurses_header:-curses.h}>
17095 int
17096 main (void)
17097 {
17098
17099 wint_t foo
17100
17101   ;
17102   return 0;
17103 }
17104 _ACEOF
17105 rm -f conftest.$ac_objext
17106 if { (eval echo "$as_me:17106: \"$ac_compile\"") >&5
17107   (eval $ac_compile) 2>&5
17108   ac_status=$?
17109   echo "$as_me:17109: \$? = $ac_status" >&5
17110   (exit $ac_status); } &&
17111          { ac_try='test -s conftest.$ac_objext'
17112   { (eval echo "$as_me:17112: \"$ac_try\"") >&5
17113   (eval $ac_try) 2>&5
17114   ac_status=$?
17115   echo "$as_me:17115: \$? = $ac_status" >&5
17116   (exit $ac_status); }; }; then
17117   cf_result=yes
17118 else
17119   echo "$as_me: failed program was:" >&5
17120 cat conftest.$ac_ext >&5
17121 cf_result=no
17122 fi
17123 rm -f conftest.$ac_objext conftest.$ac_ext
17124 echo "$as_me:17124: result: $cf_result" >&5
17125 echo "${ECHO_T}$cf_result" >&6
17126 if test $cf_result = yes ; then
17127
17128 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17129
17130 cat >>confdefs.h <<EOF
17131 #define $cf_result 1
17132 EOF
17133
17134 else
17135
17136 cat >>confdefs.h <<EOF
17137 #define wint_t long
17138 EOF
17139
17140 fi
17141
17142         fi
17143 fi
17144
17145 for cf_data in \
17146 curscr \
17147 ospeed \
17148 boolnames \
17149 boolfnames \
17150 ttytype
17151 do
17152 echo "$as_me:17152: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17153 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17154
17155 cat >conftest.$ac_ext <<_ACEOF
17156 #line 17156 "configure"
17157 #include "confdefs.h"
17158
17159 #ifdef HAVE_XCURSES
17160 #include <xcurses.h>
17161 char * XCursesProgramName = "test";
17162 #else
17163 #include <${cf_cv_ncurses_header:-curses.h}>
17164 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17165 #include <ncursesw/term.h>
17166 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17167 #include <ncurses/term.h>
17168 #elif defined(HAVE_TERM_H)
17169 #include <term.h>
17170 #endif
17171 #endif
17172
17173 int
17174 main (void)
17175 {
17176
17177 void *foo = &($cf_data)
17178
17179   ;
17180   return 0;
17181 }
17182 _ACEOF
17183 rm -f conftest.$ac_objext
17184 if { (eval echo "$as_me:17184: \"$ac_compile\"") >&5
17185   (eval $ac_compile) 2>&5
17186   ac_status=$?
17187   echo "$as_me:17187: \$? = $ac_status" >&5
17188   (exit $ac_status); } &&
17189          { ac_try='test -s conftest.$ac_objext'
17190   { (eval echo "$as_me:17190: \"$ac_try\"") >&5
17191   (eval $ac_try) 2>&5
17192   ac_status=$?
17193   echo "$as_me:17193: \$? = $ac_status" >&5
17194   (exit $ac_status); }; }; then
17195   cf_result=yes
17196
17197 else
17198   echo "$as_me: failed program was:" >&5
17199 cat conftest.$ac_ext >&5
17200 cf_result=no
17201 fi
17202 rm -f conftest.$ac_objext conftest.$ac_ext
17203 echo "$as_me:17203: result: $cf_result" >&5
17204 echo "${ECHO_T}$cf_result" >&6
17205
17206 if test $cf_result = yes ; then
17207
17208 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17209
17210         cat >>confdefs.h <<EOF
17211 #define $cf_result 1
17212 EOF
17213
17214 else
17215         echo "$as_me:17215: checking for data $cf_data in library" >&5
17216 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17217         # BSD linkers insist on making weak linkage, but resolve at runtime.
17218         if test "$cross_compiling" = yes; then
17219
17220         # cross-compiling
17221         cat >conftest.$ac_ext <<_ACEOF
17222 #line 17222 "configure"
17223 #include "confdefs.h"
17224
17225 #ifdef HAVE_XCURSES
17226 #include <xcurses.h>
17227 char * XCursesProgramName = "test";
17228 #else
17229 #include <${cf_cv_ncurses_header:-curses.h}>
17230 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17231 #include <ncursesw/term.h>
17232 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17233 #include <ncurses/term.h>
17234 #elif defined(HAVE_TERM_H)
17235 #include <term.h>
17236 #endif
17237 #endif
17238
17239 extern char $cf_data;
17240 int
17241 main (void)
17242 {
17243
17244         do {
17245                 void *foo = &($cf_data);
17246                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17247                 ${cf_cv_main_return:-return}(foo == 0);
17248         } while (0)
17249
17250   ;
17251   return 0;
17252 }
17253 _ACEOF
17254 rm -f conftest.$ac_objext conftest$ac_exeext
17255 if { (eval echo "$as_me:17255: \"$ac_link\"") >&5
17256   (eval $ac_link) 2>&5
17257   ac_status=$?
17258   echo "$as_me:17258: \$? = $ac_status" >&5
17259   (exit $ac_status); } &&
17260          { ac_try='test -s conftest$ac_exeext'
17261   { (eval echo "$as_me:17261: \"$ac_try\"") >&5
17262   (eval $ac_try) 2>&5
17263   ac_status=$?
17264   echo "$as_me:17264: \$? = $ac_status" >&5
17265   (exit $ac_status); }; }; then
17266   cf_result=yes
17267 else
17268   echo "$as_me: failed program was:" >&5
17269 cat conftest.$ac_ext >&5
17270 cf_result=no
17271 fi
17272 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17273
17274 else
17275   cat >conftest.$ac_ext <<_ACEOF
17276 #line 17276 "configure"
17277 #include "confdefs.h"
17278
17279 #ifdef HAVE_XCURSES
17280 #include <xcurses.h>
17281 char * XCursesProgramName = "test";
17282 #else
17283 #include <${cf_cv_ncurses_header:-curses.h}>
17284 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17285 #include <ncursesw/term.h>
17286 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17287 #include <ncurses/term.h>
17288 #elif defined(HAVE_TERM_H)
17289 #include <term.h>
17290 #endif
17291 #endif
17292
17293 extern char $cf_data;
17294 int main(void)
17295 {
17296         void *foo = &($cf_data);
17297         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17298         ${cf_cv_main_return:-return}(foo == 0);
17299 }
17300 _ACEOF
17301 rm -f conftest$ac_exeext
17302 if { (eval echo "$as_me:17302: \"$ac_link\"") >&5
17303   (eval $ac_link) 2>&5
17304   ac_status=$?
17305   echo "$as_me:17305: \$? = $ac_status" >&5
17306   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17307   { (eval echo "$as_me:17307: \"$ac_try\"") >&5
17308   (eval $ac_try) 2>&5
17309   ac_status=$?
17310   echo "$as_me:17310: \$? = $ac_status" >&5
17311   (exit $ac_status); }; }; then
17312   cf_result=yes
17313
17314 else
17315   echo "$as_me: program exited with status $ac_status" >&5
17316 echo "$as_me: failed program was:" >&5
17317 cat conftest.$ac_ext >&5
17318 cf_result=no
17319 fi
17320 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17321 fi
17322         echo "$as_me:17322: result: $cf_result" >&5
17323 echo "${ECHO_T}$cf_result" >&6
17324         if test $cf_result = yes ; then
17325
17326 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17327
17328                 cat >>confdefs.h <<EOF
17329 #define $cf_result 1
17330 EOF
17331
17332                 # do not exit loop here, since we prefer system's declarations
17333         fi
17334 fi
17335 done
17336
17337 if ( test "$GCC" = yes || test "$GXX" = yes )
17338 then
17339 echo "$as_me:17339: checking if you want to turn on gcc warnings" >&5
17340 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
17341
17342 # Check whether --enable-warnings or --disable-warnings was given.
17343 if test "${enable_warnings+set}" = set; then
17344   enableval="$enable_warnings"
17345   test "$enableval" != yes && enableval=no
17346         if test "$enableval" != "no" ; then
17347     with_warnings=yes
17348         else
17349                 with_warnings=no
17350         fi
17351 else
17352   enableval=no
17353         with_warnings=no
17354
17355 fi;
17356 echo "$as_me:17356: result: $with_warnings" >&5
17357 echo "${ECHO_T}$with_warnings" >&6
17358 if test "$with_warnings" = "yes"
17359 then
17360
17361 if test "$GCC" = yes
17362 then
17363 cat > conftest.i <<EOF
17364 #ifndef GCC_PRINTF
17365 #define GCC_PRINTF 0
17366 #endif
17367 #ifndef GCC_SCANF
17368 #define GCC_SCANF 0
17369 #endif
17370 #ifndef GCC_NORETURN
17371 #define GCC_NORETURN /* nothing */
17372 #endif
17373 #ifndef GCC_UNUSED
17374 #define GCC_UNUSED /* nothing */
17375 #endif
17376 EOF
17377 if test "$GCC" = yes
17378 then
17379         { echo "$as_me:17379: checking for $CC __attribute__ directives..." >&5
17380 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
17381 cat > conftest.$ac_ext <<EOF
17382 #line 17382 "${as_me:-configure}"
17383 #include "confdefs.h"
17384 #include "conftest.h"
17385 #include "conftest.i"
17386 #if     GCC_PRINTF
17387 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
17388 #else
17389 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
17390 #endif
17391 #if     GCC_SCANF
17392 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
17393 #else
17394 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
17395 #endif
17396 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
17397 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
17398 extern void foo(void) GCC_NORETURN;
17399 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
17400 EOF
17401         cf_printf_attribute=no
17402         cf_scanf_attribute=no
17403         for cf_attribute in scanf printf unused noreturn
17404         do
17405
17406 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17407
17408                 cf_directive="__attribute__(($cf_attribute))"
17409                 echo "checking for $CC $cf_directive" 1>&5
17410
17411                 case $cf_attribute in
17412                 (printf)
17413                         cf_printf_attribute=yes
17414                         cat >conftest.h <<EOF
17415 #define GCC_$cf_ATTRIBUTE 1
17416 EOF
17417                         ;;
17418                 (scanf)
17419                         cf_scanf_attribute=yes
17420                         cat >conftest.h <<EOF
17421 #define GCC_$cf_ATTRIBUTE 1
17422 EOF
17423                         ;;
17424                 (*)
17425                         cat >conftest.h <<EOF
17426 #define GCC_$cf_ATTRIBUTE $cf_directive
17427 EOF
17428                         ;;
17429                 esac
17430
17431                 if { (eval echo "$as_me:17431: \"$ac_compile\"") >&5
17432   (eval $ac_compile) 2>&5
17433   ac_status=$?
17434   echo "$as_me:17434: \$? = $ac_status" >&5
17435   (exit $ac_status); }; then
17436                         test -n "$verbose" && echo "$as_me:17436: result: ... $cf_attribute" >&5
17437 echo "${ECHO_T}... $cf_attribute" >&6
17438                         cat conftest.h >>confdefs.h
17439                         case $cf_attribute in
17440                         (noreturn)
17441
17442 cat >>confdefs.h <<EOF
17443 #define GCC_NORETURN $cf_directive
17444 EOF
17445
17446                                 ;;
17447                         (printf)
17448                                 cf_value='/* nothing */'
17449                                 if test "$cf_printf_attribute" != no ; then
17450                                         cf_value='__attribute__((format(printf,fmt,var)))'
17451
17452 cat >>confdefs.h <<\EOF
17453 #define GCC_PRINTF 1
17454 EOF
17455
17456                                 fi
17457
17458 cat >>confdefs.h <<EOF
17459 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17460 EOF
17461
17462                                 ;;
17463                         (scanf)
17464                                 cf_value='/* nothing */'
17465                                 if test "$cf_scanf_attribute" != no ; then
17466                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17467
17468 cat >>confdefs.h <<\EOF
17469 #define GCC_SCANF 1
17470 EOF
17471
17472                                 fi
17473
17474 cat >>confdefs.h <<EOF
17475 #define GCC_SCANFLIKE(fmt,var) $cf_value
17476 EOF
17477
17478                                 ;;
17479                         (unused)
17480
17481 cat >>confdefs.h <<EOF
17482 #define GCC_UNUSED $cf_directive
17483 EOF
17484
17485                                 ;;
17486                         esac
17487                 fi
17488         done
17489 else
17490         fgrep define conftest.i >>confdefs.h
17491 fi
17492 rm -rf conftest*
17493 fi
17494
17495 INTEL_COMPILER=no
17496
17497 if test "$GCC" = yes ; then
17498         case $host_os in
17499         (linux*|gnu*)
17500                 echo "$as_me:17500: checking if this is really Intel C compiler" >&5
17501 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17502                 cf_save_CFLAGS="$CFLAGS"
17503                 CFLAGS="$CFLAGS -no-gcc"
17504                 cat >conftest.$ac_ext <<_ACEOF
17505 #line 17505 "configure"
17506 #include "confdefs.h"
17507
17508 int
17509 main (void)
17510 {
17511
17512 #ifdef __INTEL_COMPILER
17513 #else
17514 make an error
17515 #endif
17516
17517   ;
17518   return 0;
17519 }
17520 _ACEOF
17521 rm -f conftest.$ac_objext
17522 if { (eval echo "$as_me:17522: \"$ac_compile\"") >&5
17523   (eval $ac_compile) 2>&5
17524   ac_status=$?
17525   echo "$as_me:17525: \$? = $ac_status" >&5
17526   (exit $ac_status); } &&
17527          { ac_try='test -s conftest.$ac_objext'
17528   { (eval echo "$as_me:17528: \"$ac_try\"") >&5
17529   (eval $ac_try) 2>&5
17530   ac_status=$?
17531   echo "$as_me:17531: \$? = $ac_status" >&5
17532   (exit $ac_status); }; }; then
17533   INTEL_COMPILER=yes
17534 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17535
17536 else
17537   echo "$as_me: failed program was:" >&5
17538 cat conftest.$ac_ext >&5
17539 fi
17540 rm -f conftest.$ac_objext conftest.$ac_ext
17541                 CFLAGS="$cf_save_CFLAGS"
17542                 echo "$as_me:17542: result: $INTEL_COMPILER" >&5
17543 echo "${ECHO_T}$INTEL_COMPILER" >&6
17544                 ;;
17545         esac
17546 fi
17547
17548 CLANG_COMPILER=no
17549
17550 if test "$GCC" = yes ; then
17551         echo "$as_me:17551: checking if this is really Clang C compiler" >&5
17552 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17553         cf_save_CFLAGS="$CFLAGS"
17554         CFLAGS="$CFLAGS -Qunused-arguments"
17555         cat >conftest.$ac_ext <<_ACEOF
17556 #line 17556 "configure"
17557 #include "confdefs.h"
17558
17559 int
17560 main (void)
17561 {
17562
17563 #ifdef __clang__
17564 #else
17565 make an error
17566 #endif
17567
17568   ;
17569   return 0;
17570 }
17571 _ACEOF
17572 rm -f conftest.$ac_objext
17573 if { (eval echo "$as_me:17573: \"$ac_compile\"") >&5
17574   (eval $ac_compile) 2>&5
17575   ac_status=$?
17576   echo "$as_me:17576: \$? = $ac_status" >&5
17577   (exit $ac_status); } &&
17578          { ac_try='test -s conftest.$ac_objext'
17579   { (eval echo "$as_me:17579: \"$ac_try\"") >&5
17580   (eval $ac_try) 2>&5
17581   ac_status=$?
17582   echo "$as_me:17582: \$? = $ac_status" >&5
17583   (exit $ac_status); }; }; then
17584   CLANG_COMPILER=yes
17585 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17586
17587 else
17588   echo "$as_me: failed program was:" >&5
17589 cat conftest.$ac_ext >&5
17590 fi
17591 rm -f conftest.$ac_objext conftest.$ac_ext
17592         CFLAGS="$cf_save_CFLAGS"
17593         echo "$as_me:17593: result: $CLANG_COMPILER" >&5
17594 echo "${ECHO_T}$CLANG_COMPILER" >&6
17595 fi
17596
17597 cat > conftest.$ac_ext <<EOF
17598 #line 17598 "${as_me:-configure}"
17599 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17600 EOF
17601
17602 if test "$INTEL_COMPILER" = yes
17603 then
17604 # The "-wdXXX" options suppress warnings:
17605 # remark #1419: external declaration in primary source file
17606 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17607 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17608 # remark #193: zero used for undefined preprocessing identifier
17609 # remark #593: variable "curs_sb_left_arrow" was set but never used
17610 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17611 # remark #869: parameter "tw" was never referenced
17612 # remark #981: operands are evaluated in unspecified order
17613 # warning #279: controlling expression is constant
17614
17615         { echo "$as_me:17615: checking for $CC warning options..." >&5
17616 echo "$as_me: checking for $CC warning options..." >&6;}
17617         cf_save_CFLAGS="$CFLAGS"
17618         EXTRA_CFLAGS="-Wall"
17619         for cf_opt in \
17620                 wd1419 \
17621                 wd1683 \
17622                 wd1684 \
17623                 wd193 \
17624                 wd593 \
17625                 wd279 \
17626                 wd810 \
17627                 wd869 \
17628                 wd981
17629         do
17630                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17631                 if { (eval echo "$as_me:17631: \"$ac_compile\"") >&5
17632   (eval $ac_compile) 2>&5
17633   ac_status=$?
17634   echo "$as_me:17634: \$? = $ac_status" >&5
17635   (exit $ac_status); }; then
17636                         test -n "$verbose" && echo "$as_me:17636: result: ... -$cf_opt" >&5
17637 echo "${ECHO_T}... -$cf_opt" >&6
17638                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17639                 fi
17640         done
17641         CFLAGS="$cf_save_CFLAGS"
17642
17643 elif test "$GCC" = yes
17644 then
17645         { echo "$as_me:17645: checking for $CC warning options..." >&5
17646 echo "$as_me: checking for $CC warning options..." >&6;}
17647         cf_save_CFLAGS="$CFLAGS"
17648         EXTRA_CFLAGS=
17649         cf_warn_CONST=""
17650         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17651         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17652         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17653         for cf_opt in W Wall \
17654                 Wbad-function-cast \
17655                 Wcast-align \
17656                 Wcast-qual \
17657                 Wdeclaration-after-statement \
17658                 Wextra \
17659                 Winline \
17660                 Wmissing-declarations \
17661                 Wmissing-prototypes \
17662                 Wnested-externs \
17663                 Wpointer-arith \
17664                 Wshadow \
17665                 Wstrict-prototypes \
17666                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
17667         do
17668                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17669                 if { (eval echo "$as_me:17669: \"$ac_compile\"") >&5
17670   (eval $ac_compile) 2>&5
17671   ac_status=$?
17672   echo "$as_me:17672: \$? = $ac_status" >&5
17673   (exit $ac_status); }; then
17674                         test -n "$verbose" && echo "$as_me:17674: result: ... -$cf_opt" >&5
17675 echo "${ECHO_T}... -$cf_opt" >&6
17676                         case $cf_opt in
17677                         (Wcast-qual)
17678                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17679                                 ;;
17680                         (Winline)
17681                                 case $GCC_VERSION in
17682                                 ([34].*)
17683                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17684
17685 echo "${as_me:-configure}:17685: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17686
17687                                         continue;;
17688                                 esac
17689                                 ;;
17690                         (Wpointer-arith)
17691                                 case $GCC_VERSION in
17692                                 ([12].*)
17693                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17694
17695 echo "${as_me:-configure}:17695: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17696
17697                                         continue;;
17698                                 esac
17699                                 ;;
17700                         esac
17701                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17702                 fi
17703         done
17704         CFLAGS="$cf_save_CFLAGS"
17705 fi
17706 rm -rf conftest*
17707
17708 fi
17709 fi
17710
17711 echo "$as_me:17711: checking if you want to use dmalloc for testing" >&5
17712 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17713
17714 # Check whether --with-dmalloc or --without-dmalloc was given.
17715 if test "${with_dmalloc+set}" = set; then
17716   withval="$with_dmalloc"
17717
17718 cat >>confdefs.h <<EOF
17719 #define USE_DMALLOC 1
17720 EOF
17721
17722         : ${with_cflags:=-g}
17723         : ${with_no_leaks:=yes}
17724          with_dmalloc=yes
17725 else
17726   with_dmalloc=
17727 fi;
17728 echo "$as_me:17728: result: ${with_dmalloc:-no}" >&5
17729 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17730
17731 case .$with_cflags in
17732 (.*-g*)
17733         case .$CFLAGS in
17734         (.*-g*)
17735                 ;;
17736         (*)
17737
17738 cf_fix_cppflags=no
17739 cf_new_cflags=
17740 cf_new_cppflags=
17741 cf_new_extra_cppflags=
17742
17743 for cf_add_cflags in -g
17744 do
17745 case $cf_fix_cppflags in
17746 (no)
17747         case $cf_add_cflags in
17748         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17749                 case $cf_add_cflags in
17750                 (-D*)
17751                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17752
17753                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17754                                 && test -z "${cf_tst_cflags}" \
17755                                 && cf_fix_cppflags=yes
17756
17757                         if test $cf_fix_cppflags = yes ; then
17758
17759         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17760         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17761
17762                                 continue
17763                         elif test "${cf_tst_cflags}" = "\"'" ; then
17764
17765         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17766         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17767
17768                                 continue
17769                         fi
17770                         ;;
17771                 esac
17772                 case "$CPPFLAGS" in
17773                 (*$cf_add_cflags)
17774                         ;;
17775                 (*)
17776                         case $cf_add_cflags in
17777                         (-D*)
17778                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17779
17780 CPPFLAGS=`echo "$CPPFLAGS" | \
17781         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17782                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17783
17784                                 ;;
17785                         esac
17786
17787         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17788         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17789
17790                         ;;
17791                 esac
17792                 ;;
17793         (*)
17794
17795         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17796         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17797
17798                 ;;
17799         esac
17800         ;;
17801 (yes)
17802
17803         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17804         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17805
17806         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17807
17808         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17809                 && test -z "${cf_tst_cflags}" \
17810                 && cf_fix_cppflags=no
17811         ;;
17812 esac
17813 done
17814
17815 if test -n "$cf_new_cflags" ; then
17816
17817         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17818         CFLAGS="${CFLAGS}$cf_new_cflags"
17819
17820 fi
17821
17822 if test -n "$cf_new_cppflags" ; then
17823
17824         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17825         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17826
17827 fi
17828
17829 if test -n "$cf_new_extra_cppflags" ; then
17830
17831         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17832         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17833
17834 fi
17835
17836                 ;;
17837         esac
17838         ;;
17839 esac
17840
17841 if test "$with_dmalloc" = yes ; then
17842         echo "$as_me:17842: checking for dmalloc.h" >&5
17843 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17844 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17845   echo $ECHO_N "(cached) $ECHO_C" >&6
17846 else
17847   cat >conftest.$ac_ext <<_ACEOF
17848 #line 17848 "configure"
17849 #include "confdefs.h"
17850 #include <dmalloc.h>
17851 _ACEOF
17852 if { (eval echo "$as_me:17852: \"$ac_cpp conftest.$ac_ext\"") >&5
17853   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17854   ac_status=$?
17855   egrep -v '^ *\+' conftest.er1 >conftest.err
17856   rm -f conftest.er1
17857   cat conftest.err >&5
17858   echo "$as_me:17858: \$? = $ac_status" >&5
17859   (exit $ac_status); } >/dev/null; then
17860   if test -s conftest.err; then
17861     ac_cpp_err=$ac_c_preproc_warn_flag
17862   else
17863     ac_cpp_err=
17864   fi
17865 else
17866   ac_cpp_err=yes
17867 fi
17868 if test -z "$ac_cpp_err"; then
17869   ac_cv_header_dmalloc_h=yes
17870 else
17871   echo "$as_me: failed program was:" >&5
17872   cat conftest.$ac_ext >&5
17873   ac_cv_header_dmalloc_h=no
17874 fi
17875 rm -f conftest.err conftest.$ac_ext
17876 fi
17877 echo "$as_me:17877: result: $ac_cv_header_dmalloc_h" >&5
17878 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17879 if test $ac_cv_header_dmalloc_h = yes; then
17880
17881 echo "$as_me:17881: checking for dmalloc_debug in -ldmalloc" >&5
17882 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17883 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17884   echo $ECHO_N "(cached) $ECHO_C" >&6
17885 else
17886   ac_check_lib_save_LIBS=$LIBS
17887 LIBS="-ldmalloc  $LIBS"
17888 cat >conftest.$ac_ext <<_ACEOF
17889 #line 17889 "configure"
17890 #include "confdefs.h"
17891
17892 /* Override any gcc2 internal prototype to avoid an error.  */
17893 #ifdef __cplusplus
17894 extern "C"
17895 #endif
17896 /* We use char because int might match the return type of a gcc2
17897    builtin and then its argument prototype would still apply.  */
17898 char dmalloc_debug ();
17899 int
17900 main (void)
17901 {
17902 dmalloc_debug ();
17903   ;
17904   return 0;
17905 }
17906 _ACEOF
17907 rm -f conftest.$ac_objext conftest$ac_exeext
17908 if { (eval echo "$as_me:17908: \"$ac_link\"") >&5
17909   (eval $ac_link) 2>&5
17910   ac_status=$?
17911   echo "$as_me:17911: \$? = $ac_status" >&5
17912   (exit $ac_status); } &&
17913          { ac_try='test -s 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   ac_cv_lib_dmalloc_dmalloc_debug=yes
17920 else
17921   echo "$as_me: failed program was:" >&5
17922 cat conftest.$ac_ext >&5
17923 ac_cv_lib_dmalloc_dmalloc_debug=no
17924 fi
17925 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17926 LIBS=$ac_check_lib_save_LIBS
17927 fi
17928 echo "$as_me:17928: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17929 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17930 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17931   cat >>confdefs.h <<EOF
17932 #define HAVE_LIBDMALLOC 1
17933 EOF
17934
17935   LIBS="-ldmalloc $LIBS"
17936
17937 fi
17938
17939 fi
17940
17941 fi
17942
17943 echo "$as_me:17943: checking if you want to use dbmalloc for testing" >&5
17944 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17945
17946 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17947 if test "${with_dbmalloc+set}" = set; then
17948   withval="$with_dbmalloc"
17949
17950 cat >>confdefs.h <<EOF
17951 #define USE_DBMALLOC 1
17952 EOF
17953
17954         : ${with_cflags:=-g}
17955         : ${with_no_leaks:=yes}
17956          with_dbmalloc=yes
17957 else
17958   with_dbmalloc=
17959 fi;
17960 echo "$as_me:17960: result: ${with_dbmalloc:-no}" >&5
17961 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17962
17963 case .$with_cflags in
17964 (.*-g*)
17965         case .$CFLAGS in
17966         (.*-g*)
17967                 ;;
17968         (*)
17969
17970 cf_fix_cppflags=no
17971 cf_new_cflags=
17972 cf_new_cppflags=
17973 cf_new_extra_cppflags=
17974
17975 for cf_add_cflags in -g
17976 do
17977 case $cf_fix_cppflags in
17978 (no)
17979         case $cf_add_cflags in
17980         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17981                 case $cf_add_cflags in
17982                 (-D*)
17983                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17984
17985                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17986                                 && test -z "${cf_tst_cflags}" \
17987                                 && cf_fix_cppflags=yes
17988
17989                         if test $cf_fix_cppflags = yes ; then
17990
17991         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17992         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17993
17994                                 continue
17995                         elif test "${cf_tst_cflags}" = "\"'" ; then
17996
17997         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17998         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17999
18000                                 continue
18001                         fi
18002                         ;;
18003                 esac
18004                 case "$CPPFLAGS" in
18005                 (*$cf_add_cflags)
18006                         ;;
18007                 (*)
18008                         case $cf_add_cflags in
18009                         (-D*)
18010                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18011
18012 CPPFLAGS=`echo "$CPPFLAGS" | \
18013         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18014                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18015
18016                                 ;;
18017                         esac
18018
18019         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18020         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18021
18022                         ;;
18023                 esac
18024                 ;;
18025         (*)
18026
18027         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18028         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18029
18030                 ;;
18031         esac
18032         ;;
18033 (yes)
18034
18035         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18036         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18037
18038         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18039
18040         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18041                 && test -z "${cf_tst_cflags}" \
18042                 && cf_fix_cppflags=no
18043         ;;
18044 esac
18045 done
18046
18047 if test -n "$cf_new_cflags" ; then
18048
18049         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18050         CFLAGS="${CFLAGS}$cf_new_cflags"
18051
18052 fi
18053
18054 if test -n "$cf_new_cppflags" ; then
18055
18056         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18057         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18058
18059 fi
18060
18061 if test -n "$cf_new_extra_cppflags" ; then
18062
18063         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18064         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18065
18066 fi
18067
18068                 ;;
18069         esac
18070         ;;
18071 esac
18072
18073 if test "$with_dbmalloc" = yes ; then
18074         echo "$as_me:18074: checking for dbmalloc.h" >&5
18075 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
18076 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
18077   echo $ECHO_N "(cached) $ECHO_C" >&6
18078 else
18079   cat >conftest.$ac_ext <<_ACEOF
18080 #line 18080 "configure"
18081 #include "confdefs.h"
18082 #include <dbmalloc.h>
18083 _ACEOF
18084 if { (eval echo "$as_me:18084: \"$ac_cpp conftest.$ac_ext\"") >&5
18085   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18086   ac_status=$?
18087   egrep -v '^ *\+' conftest.er1 >conftest.err
18088   rm -f conftest.er1
18089   cat conftest.err >&5
18090   echo "$as_me:18090: \$? = $ac_status" >&5
18091   (exit $ac_status); } >/dev/null; then
18092   if test -s conftest.err; then
18093     ac_cpp_err=$ac_c_preproc_warn_flag
18094   else
18095     ac_cpp_err=
18096   fi
18097 else
18098   ac_cpp_err=yes
18099 fi
18100 if test -z "$ac_cpp_err"; then
18101   ac_cv_header_dbmalloc_h=yes
18102 else
18103   echo "$as_me: failed program was:" >&5
18104   cat conftest.$ac_ext >&5
18105   ac_cv_header_dbmalloc_h=no
18106 fi
18107 rm -f conftest.err conftest.$ac_ext
18108 fi
18109 echo "$as_me:18109: result: $ac_cv_header_dbmalloc_h" >&5
18110 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
18111 if test $ac_cv_header_dbmalloc_h = yes; then
18112
18113 echo "$as_me:18113: checking for debug_malloc in -ldbmalloc" >&5
18114 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
18115 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
18116   echo $ECHO_N "(cached) $ECHO_C" >&6
18117 else
18118   ac_check_lib_save_LIBS=$LIBS
18119 LIBS="-ldbmalloc  $LIBS"
18120 cat >conftest.$ac_ext <<_ACEOF
18121 #line 18121 "configure"
18122 #include "confdefs.h"
18123
18124 /* Override any gcc2 internal prototype to avoid an error.  */
18125 #ifdef __cplusplus
18126 extern "C"
18127 #endif
18128 /* We use char because int might match the return type of a gcc2
18129    builtin and then its argument prototype would still apply.  */
18130 char debug_malloc ();
18131 int
18132 main (void)
18133 {
18134 debug_malloc ();
18135   ;
18136   return 0;
18137 }
18138 _ACEOF
18139 rm -f conftest.$ac_objext conftest$ac_exeext
18140 if { (eval echo "$as_me:18140: \"$ac_link\"") >&5
18141   (eval $ac_link) 2>&5
18142   ac_status=$?
18143   echo "$as_me:18143: \$? = $ac_status" >&5
18144   (exit $ac_status); } &&
18145          { ac_try='test -s conftest$ac_exeext'
18146   { (eval echo "$as_me:18146: \"$ac_try\"") >&5
18147   (eval $ac_try) 2>&5
18148   ac_status=$?
18149   echo "$as_me:18149: \$? = $ac_status" >&5
18150   (exit $ac_status); }; }; then
18151   ac_cv_lib_dbmalloc_debug_malloc=yes
18152 else
18153   echo "$as_me: failed program was:" >&5
18154 cat conftest.$ac_ext >&5
18155 ac_cv_lib_dbmalloc_debug_malloc=no
18156 fi
18157 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18158 LIBS=$ac_check_lib_save_LIBS
18159 fi
18160 echo "$as_me:18160: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
18161 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
18162 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
18163   cat >>confdefs.h <<EOF
18164 #define HAVE_LIBDBMALLOC 1
18165 EOF
18166
18167   LIBS="-ldbmalloc $LIBS"
18168
18169 fi
18170
18171 fi
18172
18173 fi
18174
18175 echo "$as_me:18175: checking if you want to use valgrind for testing" >&5
18176 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
18177
18178 # Check whether --with-valgrind or --without-valgrind was given.
18179 if test "${with_valgrind+set}" = set; then
18180   withval="$with_valgrind"
18181
18182 cat >>confdefs.h <<EOF
18183 #define USE_VALGRIND 1
18184 EOF
18185
18186         : ${with_cflags:=-g}
18187         : ${with_no_leaks:=yes}
18188          with_valgrind=yes
18189 else
18190   with_valgrind=
18191 fi;
18192 echo "$as_me:18192: result: ${with_valgrind:-no}" >&5
18193 echo "${ECHO_T}${with_valgrind:-no}" >&6
18194
18195 case .$with_cflags in
18196 (.*-g*)
18197         case .$CFLAGS in
18198         (.*-g*)
18199                 ;;
18200         (*)
18201
18202 cf_fix_cppflags=no
18203 cf_new_cflags=
18204 cf_new_cppflags=
18205 cf_new_extra_cppflags=
18206
18207 for cf_add_cflags in -g
18208 do
18209 case $cf_fix_cppflags in
18210 (no)
18211         case $cf_add_cflags in
18212         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18213                 case $cf_add_cflags in
18214                 (-D*)
18215                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18216
18217                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18218                                 && test -z "${cf_tst_cflags}" \
18219                                 && cf_fix_cppflags=yes
18220
18221                         if test $cf_fix_cppflags = yes ; then
18222
18223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18225
18226                                 continue
18227                         elif test "${cf_tst_cflags}" = "\"'" ; then
18228
18229         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18230         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18231
18232                                 continue
18233                         fi
18234                         ;;
18235                 esac
18236                 case "$CPPFLAGS" in
18237                 (*$cf_add_cflags)
18238                         ;;
18239                 (*)
18240                         case $cf_add_cflags in
18241                         (-D*)
18242                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18243
18244 CPPFLAGS=`echo "$CPPFLAGS" | \
18245         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18246                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18247
18248                                 ;;
18249                         esac
18250
18251         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18252         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18253
18254                         ;;
18255                 esac
18256                 ;;
18257         (*)
18258
18259         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18260         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18261
18262                 ;;
18263         esac
18264         ;;
18265 (yes)
18266
18267         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18268         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18269
18270         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18271
18272         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18273                 && test -z "${cf_tst_cflags}" \
18274                 && cf_fix_cppflags=no
18275         ;;
18276 esac
18277 done
18278
18279 if test -n "$cf_new_cflags" ; then
18280
18281         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18282         CFLAGS="${CFLAGS}$cf_new_cflags"
18283
18284 fi
18285
18286 if test -n "$cf_new_cppflags" ; then
18287
18288         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18289         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18290
18291 fi
18292
18293 if test -n "$cf_new_extra_cppflags" ; then
18294
18295         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18296         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18297
18298 fi
18299
18300                 ;;
18301         esac
18302         ;;
18303 esac
18304
18305 echo "$as_me:18305: checking if you want to perform memory-leak testing" >&5
18306 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
18307
18308 # Check whether --enable-leaks or --disable-leaks was given.
18309 if test "${enable_leaks+set}" = set; then
18310   enableval="$enable_leaks"
18311   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
18312 else
18313   : ${with_no_leaks:=no}
18314 fi;
18315 echo "$as_me:18315: result: $with_no_leaks" >&5
18316 echo "${ECHO_T}$with_no_leaks" >&6
18317
18318 if test "$with_no_leaks" = yes ; then
18319
18320 cat >>confdefs.h <<\EOF
18321 #define NO_LEAKS 1
18322 EOF
18323
18324 cat >>confdefs.h <<\EOF
18325 #define YY_NO_LEAKS 1
18326 EOF
18327
18328 fi
18329
18330 LD_RPATH_OPT=
18331 echo "$as_me:18331: checking for an rpath option" >&5
18332 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
18333 case $cf_cv_system_name in
18334 (irix*)
18335         if test "$GCC" = yes; then
18336                 LD_RPATH_OPT="-Wl,-rpath,"
18337         else
18338                 LD_RPATH_OPT="-rpath "
18339         fi
18340         ;;
18341 (linux*|gnu*|k*bsd*-gnu|freebsd*)
18342         LD_RPATH_OPT="-Wl,-rpath,"
18343         ;;
18344 (openbsd[2-9].*|mirbsd*)
18345         LD_RPATH_OPT="-Wl,-rpath,"
18346         ;;
18347 (dragonfly*)
18348         LD_RPATH_OPT="-rpath "
18349         ;;
18350 (netbsd*)
18351         LD_RPATH_OPT="-Wl,-rpath,"
18352         ;;
18353 (osf*|mls+*)
18354         LD_RPATH_OPT="-rpath "
18355         ;;
18356 (solaris2*)
18357         LD_RPATH_OPT="-R"
18358         ;;
18359 (*)
18360         ;;
18361 esac
18362 echo "$as_me:18362: result: $LD_RPATH_OPT" >&5
18363 echo "${ECHO_T}$LD_RPATH_OPT" >&6
18364
18365 case "x$LD_RPATH_OPT" in
18366 (x-R*)
18367         echo "$as_me:18367: checking if we need a space after rpath option" >&5
18368 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
18369         cf_save_LIBS="$LIBS"
18370
18371 cf_add_libs="${LD_RPATH_OPT}$libdir"
18372 # Filter out duplicates - this happens with badly-designed ".pc" files...
18373 for cf_add_1lib in $LIBS
18374 do
18375         for cf_add_2lib in $cf_add_libs
18376         do
18377                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18378                 then
18379                         cf_add_1lib=
18380                         break
18381                 fi
18382         done
18383         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18384 done
18385 LIBS="$cf_add_libs"
18386
18387         cat >conftest.$ac_ext <<_ACEOF
18388 #line 18388 "configure"
18389 #include "confdefs.h"
18390
18391 int
18392 main (void)
18393 {
18394
18395   ;
18396   return 0;
18397 }
18398 _ACEOF
18399 rm -f conftest.$ac_objext conftest$ac_exeext
18400 if { (eval echo "$as_me:18400: \"$ac_link\"") >&5
18401   (eval $ac_link) 2>&5
18402   ac_status=$?
18403   echo "$as_me:18403: \$? = $ac_status" >&5
18404   (exit $ac_status); } &&
18405          { ac_try='test -s conftest$ac_exeext'
18406   { (eval echo "$as_me:18406: \"$ac_try\"") >&5
18407   (eval $ac_try) 2>&5
18408   ac_status=$?
18409   echo "$as_me:18409: \$? = $ac_status" >&5
18410   (exit $ac_status); }; }; then
18411   cf_rpath_space=no
18412 else
18413   echo "$as_me: failed program was:" >&5
18414 cat conftest.$ac_ext >&5
18415 cf_rpath_space=yes
18416 fi
18417 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18418         LIBS="$cf_save_LIBS"
18419         echo "$as_me:18419: result: $cf_rpath_space" >&5
18420 echo "${ECHO_T}$cf_rpath_space" >&6
18421         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
18422         ;;
18423 esac
18424
18425 echo "$as_me:18425: checking if rpath-hack should be disabled" >&5
18426 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
18427
18428 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
18429 if test "${enable_rpath_hack+set}" = set; then
18430   enableval="$enable_rpath_hack"
18431   test "$enableval" != no && enableval=yes
18432         if test "$enableval" != "yes" ; then
18433     cf_disable_rpath_hack=yes
18434         else
18435                 cf_disable_rpath_hack=no
18436         fi
18437 else
18438   enableval=yes
18439         cf_disable_rpath_hack=no
18440
18441 fi;
18442 echo "$as_me:18442: result: $cf_disable_rpath_hack" >&5
18443 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
18444 if test "$cf_disable_rpath_hack" = no ; then
18445
18446 echo "$as_me:18446: checking for updated LDFLAGS" >&5
18447 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
18448 if test -n "$LD_RPATH_OPT" ; then
18449         echo "$as_me:18449: result: maybe" >&5
18450 echo "${ECHO_T}maybe" >&6
18451
18452         for ac_prog in ldd
18453 do
18454   # Extract the first word of "$ac_prog", so it can be a program name with args.
18455 set dummy $ac_prog; ac_word=$2
18456 echo "$as_me:18456: checking for $ac_word" >&5
18457 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
18458 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
18459   echo $ECHO_N "(cached) $ECHO_C" >&6
18460 else
18461   if test -n "$cf_ldd_prog"; then
18462   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
18463 else
18464   ac_save_IFS=$IFS; IFS=$ac_path_separator
18465 ac_dummy="$PATH"
18466 for ac_dir in $ac_dummy; do
18467   IFS=$ac_save_IFS
18468   test -z "$ac_dir" && ac_dir=.
18469   $as_executable_p "$ac_dir/$ac_word" || continue
18470 ac_cv_prog_cf_ldd_prog="$ac_prog"
18471 echo "$as_me:18471: found $ac_dir/$ac_word" >&5
18472 break
18473 done
18474
18475 fi
18476 fi
18477 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
18478 if test -n "$cf_ldd_prog"; then
18479   echo "$as_me:18479: result: $cf_ldd_prog" >&5
18480 echo "${ECHO_T}$cf_ldd_prog" >&6
18481 else
18482   echo "$as_me:18482: result: no" >&5
18483 echo "${ECHO_T}no" >&6
18484 fi
18485
18486   test -n "$cf_ldd_prog" && break
18487 done
18488 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
18489
18490         cf_rpath_list="/usr/lib /lib"
18491         if test "$cf_ldd_prog" != no
18492         then
18493                 cf_rpath_oops=
18494
18495 cat >conftest.$ac_ext <<_ACEOF
18496 #line 18496 "configure"
18497 #include "confdefs.h"
18498 #include <stdio.h>
18499 int
18500 main (void)
18501 {
18502 printf("Hello");
18503   ;
18504   return 0;
18505 }
18506 _ACEOF
18507 rm -f conftest.$ac_objext conftest$ac_exeext
18508 if { (eval echo "$as_me:18508: \"$ac_link\"") >&5
18509   (eval $ac_link) 2>&5
18510   ac_status=$?
18511   echo "$as_me:18511: \$? = $ac_status" >&5
18512   (exit $ac_status); } &&
18513          { ac_try='test -s conftest$ac_exeext'
18514   { (eval echo "$as_me:18514: \"$ac_try\"") >&5
18515   (eval $ac_try) 2>&5
18516   ac_status=$?
18517   echo "$as_me:18517: \$? = $ac_status" >&5
18518   (exit $ac_status); }; }; then
18519   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18520                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18521 else
18522   echo "$as_me: failed program was:" >&5
18523 cat conftest.$ac_ext >&5
18524 fi
18525 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18526
18527                 # If we passed the link-test, but get a "not found" on a given library,
18528                 # this could be due to inept reconfiguration of gcc to make it only
18529                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18530                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18531                 # /usr/local libraries.
18532                 if test -n "$cf_rpath_oops"
18533                 then
18534                         for cf_rpath_src in $cf_rpath_oops
18535                         do
18536                                 for cf_rpath_dir in \
18537                                         /usr/local \
18538                                         /usr/pkg \
18539                                         /opt/sfw
18540                                 do
18541                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18542                                         then
18543                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18544
18545 echo "${as_me:-configure}:18545: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18546
18547                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18548                                                 break
18549                                         fi
18550                                 done
18551                         done
18552                 fi
18553         fi
18554
18555         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18556
18557 echo "${as_me:-configure}:18557: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18558
18559 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18560
18561 echo "${as_me:-configure}:18561: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18562
18563 cf_rpath_dst=
18564 for cf_rpath_src in $LDFLAGS
18565 do
18566         case $cf_rpath_src in
18567         (-L*)
18568
18569                 # check if this refers to a directory which we will ignore
18570                 cf_rpath_skip=no
18571                 if test -n "$cf_rpath_list"
18572                 then
18573                         for cf_rpath_item in $cf_rpath_list
18574                         do
18575                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18576                                 then
18577                                         cf_rpath_skip=yes
18578                                         break
18579                                 fi
18580                         done
18581                 fi
18582
18583                 if test "$cf_rpath_skip" = no
18584                 then
18585                         # transform the option
18586                         if test "$LD_RPATH_OPT" = "-R " ; then
18587                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18588                         else
18589                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18590                         fi
18591
18592                         # if we have not already added this, add it now
18593                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18594                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18595                         then
18596                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18597
18598 echo "${as_me:-configure}:18598: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18599
18600                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18601                         fi
18602                 fi
18603                 ;;
18604         esac
18605         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18606 done
18607 LDFLAGS=$cf_rpath_dst
18608
18609 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18610
18611 echo "${as_me:-configure}:18611: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18612
18613 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18614
18615 echo "${as_me:-configure}:18615: testing ...checking LIBS $LIBS ..." 1>&5
18616
18617 cf_rpath_dst=
18618 for cf_rpath_src in $LIBS
18619 do
18620         case $cf_rpath_src in
18621         (-L*)
18622
18623                 # check if this refers to a directory which we will ignore
18624                 cf_rpath_skip=no
18625                 if test -n "$cf_rpath_list"
18626                 then
18627                         for cf_rpath_item in $cf_rpath_list
18628                         do
18629                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18630                                 then
18631                                         cf_rpath_skip=yes
18632                                         break
18633                                 fi
18634                         done
18635                 fi
18636
18637                 if test "$cf_rpath_skip" = no
18638                 then
18639                         # transform the option
18640                         if test "$LD_RPATH_OPT" = "-R " ; then
18641                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18642                         else
18643                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18644                         fi
18645
18646                         # if we have not already added this, add it now
18647                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18648                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18649                         then
18650                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18651
18652 echo "${as_me:-configure}:18652: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18653
18654                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18655                         fi
18656                 fi
18657                 ;;
18658         esac
18659         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18660 done
18661 LIBS=$cf_rpath_dst
18662
18663 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18664
18665 echo "${as_me:-configure}:18665: testing ...checked LIBS $LIBS ..." 1>&5
18666
18667         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18668
18669 echo "${as_me:-configure}:18669: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18670
18671 else
18672         echo "$as_me:18672: result: no" >&5
18673 echo "${ECHO_T}no" >&6
18674 fi
18675
18676 fi
18677
18678 TEST_ARGS="$LIBS"
18679 LIBS=
18680
18681 ac_config_files="$ac_config_files Makefile"
18682 ac_config_commands="$ac_config_commands default"
18683 cat >confcache <<\_ACEOF
18684 # This file is a shell script that caches the results of configure
18685 # tests run on this system so they can be shared between configure
18686 # scripts and configure runs, see configure's option --config-cache.
18687 # It is not useful on other systems.  If it contains results you don't
18688 # want to keep, you may remove or edit it.
18689 #
18690 # config.status only pays attention to the cache file if you give it
18691 # the --recheck option to rerun configure.
18692 #
18693 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18694 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18695 # following values.
18696
18697 _ACEOF
18698
18699 # The following way of writing the cache mishandles newlines in values,
18700 # but we know of no workaround that is simple, portable, and efficient.
18701 # So, don't put newlines in cache variables' values.
18702 # Ultrix sh set writes to stderr and can't be redirected directly,
18703 # and sets the high bit in the cache file unless we assign to the vars.
18704 {
18705   (set) 2>&1 |
18706     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18707     *ac_space=\ *)
18708       # `set' does not quote correctly, so add quotes (double-quote
18709       # substitution turns \\\\ into \\, and sed turns \\ into \).
18710       sed -n \
18711         "s/'/'\\\\''/g;
18712           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18713       ;;
18714     *)
18715       # `set' quotes correctly as required by POSIX, so do not add quotes.
18716       sed -n \
18717         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18718       ;;
18719     esac;
18720 } |
18721   sed '
18722      t clear
18723      : clear
18724      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18725      t end
18726      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18727      : end' >>confcache
18728 if cmp -s $cache_file confcache; then :; else
18729   if test -w $cache_file; then
18730     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18731     cat confcache >$cache_file
18732   else
18733     echo "not updating unwritable cache $cache_file"
18734   fi
18735 fi
18736 rm -f confcache
18737
18738 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18739 # Let make expand exec_prefix.
18740 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18741
18742 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18743 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18744 # trailing colons and then remove the whole line if VPATH becomes empty
18745 # (actually we leave an empty line to preserve line numbers).
18746 if test "x$srcdir" = x.; then
18747   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18748 s/:*\$(srcdir):*/:/;
18749 s/:*\${srcdir}:*/:/;
18750 s/:*@srcdir@:*/:/;
18751 s/^\([^=]*=[    ]*\):*/\1/;
18752 s/:*$//;
18753 s/^[^=]*=[      ]*$//;
18754 }'
18755 fi
18756
18757 DEFS=-DHAVE_CONFIG_H
18758
18759 : ${CONFIG_STATUS=./config.status}
18760 ac_clean_files_save=$ac_clean_files
18761 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18762 { echo "$as_me:18762: creating $CONFIG_STATUS" >&5
18763 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18764 cat >$CONFIG_STATUS <<_ACEOF
18765 #! $SHELL
18766 # Generated automatically by configure.
18767 # Run this file to recreate the current configuration.
18768 # Compiler output produced by configure, useful for debugging
18769 # configure, is in config.log if it exists.
18770
18771 debug=false
18772 SHELL=\${CONFIG_SHELL-$SHELL}
18773 ac_cs_invocation="\$0 \$@"
18774
18775 _ACEOF
18776
18777 cat >>$CONFIG_STATUS <<\_ACEOF
18778 # Be Bourne compatible
18779 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18780   emulate sh
18781   NULLCMD=:
18782 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18783   set -o posix
18784 fi
18785
18786 # Name of the executable.
18787 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18788
18789 if expr a : '\(a\)' >/dev/null 2>&1; then
18790   as_expr=expr
18791 else
18792   as_expr=false
18793 fi
18794
18795 rm -f conf$$ conf$$.exe conf$$.file
18796 echo >conf$$.file
18797 if ln -s conf$$.file conf$$ 2>/dev/null; then
18798   # We could just check for DJGPP; but this test a) works b) is more generic
18799   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18800   if test -f conf$$.exe; then
18801     # Don't use ln at all; we don't have any links
18802     as_ln_s='cp -p'
18803   else
18804     as_ln_s='ln -s'
18805   fi
18806 elif ln conf$$.file conf$$ 2>/dev/null; then
18807   as_ln_s=ln
18808 else
18809   as_ln_s='cp -p'
18810 fi
18811 rm -f conf$$ conf$$.exe conf$$.file
18812
18813 as_executable_p="test -f"
18814
18815 # Support unset when possible.
18816 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18817   as_unset=unset
18818 else
18819   as_unset=false
18820 fi
18821
18822 # NLS nuisances.
18823 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18824 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18825 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18826 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18827 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18828 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18829 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18830 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18831
18832 # IFS
18833 # We need space, tab and new line, in precisely that order.
18834 as_nl='
18835 '
18836 IFS="   $as_nl"
18837
18838 # CDPATH.
18839 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18840
18841 exec 6>&1
18842
18843 _ACEOF
18844
18845 # Files that config.status was made for.
18846 if test -n "$ac_config_files"; then
18847   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18848 fi
18849
18850 if test -n "$ac_config_headers"; then
18851   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18852 fi
18853
18854 if test -n "$ac_config_links"; then
18855   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18856 fi
18857
18858 if test -n "$ac_config_commands"; then
18859   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18860 fi
18861
18862 cat >>$CONFIG_STATUS <<\EOF
18863
18864 ac_cs_usage="\
18865 \`$as_me' instantiates files from templates according to the
18866 current configuration.
18867
18868 Usage: $0 [OPTIONS] [FILE]...
18869
18870   -h, --help       print this help, then exit
18871   -V, --version    print version number, then exit
18872   -d, --debug      don't remove temporary files
18873       --recheck    update $as_me by reconfiguring in the same conditions
18874   --file=FILE[:TEMPLATE]
18875                    instantiate the configuration file FILE
18876   --header=FILE[:TEMPLATE]
18877                    instantiate the configuration header FILE
18878
18879 Configuration files:
18880 $config_files
18881
18882 Configuration headers:
18883 $config_headers
18884
18885 Configuration commands:
18886 $config_commands
18887
18888 Report bugs to <dickey@invisible-island.net>."
18889 EOF
18890
18891 cat >>$CONFIG_STATUS <<EOF
18892 ac_cs_version="\\
18893 config.status
18894 configured by $0, generated by GNU Autoconf 2.52.20170501,
18895   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18896
18897 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18898 Free Software Foundation, Inc.
18899 This config.status script is free software; the Free Software Foundation
18900 gives unlimited permission to copy, distribute and modify it."
18901 srcdir=$srcdir
18902 INSTALL="$INSTALL"
18903 EOF
18904
18905 cat >>$CONFIG_STATUS <<\EOF
18906 # If no file are specified by the user, then we need to provide default
18907 # value.  By we need to know if files were specified by the user.
18908 ac_need_defaults=:
18909 while test $# != 0
18910 do
18911   case $1 in
18912   --*=*)
18913     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18914     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18915     shift
18916     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18917     shift
18918     ;;
18919   -*);;
18920   *) # This is not an option, so the user has probably given explicit
18921      # arguments.
18922      ac_need_defaults=false;;
18923   esac
18924
18925   case $1 in
18926   # Handling of the options.
18927 EOF
18928 cat >>$CONFIG_STATUS <<EOF
18929   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18930     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18931     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18932 EOF
18933 cat >>$CONFIG_STATUS <<\EOF
18934   --version | --vers* | -V )
18935     echo "$ac_cs_version"; exit 0 ;;
18936   --he | --h)
18937     # Conflict between --help and --header
18938     { { echo "$as_me:18938: error: ambiguous option: $1
18939 Try \`$0 --help' for more information." >&5
18940 echo "$as_me: error: ambiguous option: $1
18941 Try \`$0 --help' for more information." >&2;}
18942    { (exit 1); exit 1; }; };;
18943   --help | --hel | -h )
18944     echo "$ac_cs_usage"; exit 0 ;;
18945   --debug | --d* | -d )
18946     debug=: ;;
18947   --file | --fil | --fi | --f )
18948     shift
18949     CONFIG_FILES="$CONFIG_FILES $1"
18950     ac_need_defaults=false;;
18951   --header | --heade | --head | --hea )
18952     shift
18953     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18954     ac_need_defaults=false;;
18955
18956   # This is an error.
18957   -*) { { echo "$as_me:18957: error: unrecognized option: $1
18958 Try \`$0 --help' for more information." >&5
18959 echo "$as_me: error: unrecognized option: $1
18960 Try \`$0 --help' for more information." >&2;}
18961    { (exit 1); exit 1; }; } ;;
18962
18963   *) ac_config_targets="$ac_config_targets $1" ;;
18964
18965   esac
18966   shift
18967 done
18968
18969 exec 5>>config.log
18970 cat >&5 << _ACEOF
18971
18972 ## ----------------------- ##
18973 ## Running config.status.  ##
18974 ## ----------------------- ##
18975
18976 This file was extended by $as_me 2.52.20170501, executed with
18977   CONFIG_FILES    = $CONFIG_FILES
18978   CONFIG_HEADERS  = $CONFIG_HEADERS
18979   CONFIG_LINKS    = $CONFIG_LINKS
18980   CONFIG_COMMANDS = $CONFIG_COMMANDS
18981   > $ac_cs_invocation
18982 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18983
18984 _ACEOF
18985 EOF
18986
18987 cat >>$CONFIG_STATUS <<EOF
18988 #
18989 # INIT-COMMANDS section.
18990 #
18991
18992 AWK="$AWK"
18993 ECHO_CC="$ECHO_CC"
18994 ECHO_LD="$ECHO_LD"
18995 SHOW_CC="$SHOW_LD"
18996
18997 EOF
18998
18999 cat >>$CONFIG_STATUS <<\EOF
19000 for ac_config_target in $ac_config_targets
19001 do
19002   case "$ac_config_target" in
19003   # Handling of arguments.
19004   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
19005   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
19006   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
19007   *) { { echo "$as_me:19007: error: invalid argument: $ac_config_target" >&5
19008 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
19009    { (exit 1); exit 1; }; };;
19010   esac
19011 done
19012
19013 # If the user did not use the arguments to specify the items to instantiate,
19014 # then the envvar interface is used.  Set only those that are not.
19015 # We use the long form for the default assignment because of an extremely
19016 # bizarre bug on SunOS 4.1.3.
19017 if $ac_need_defaults; then
19018   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
19019   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
19020   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19021 fi
19022
19023 # Create a temporary directory, and hook for its removal unless debugging.
19024 $debug ||
19025 {
19026   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
19027   trap '{ (exit 1); exit 1; }' 1 2 13 15
19028 }
19029
19030 # Create a (secure) tmp directory for tmp files.
19031 : ${TMPDIR=/tmp}
19032 {
19033   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
19034   test -n "$tmp" && test -d "$tmp"
19035 }  ||
19036 {
19037   tmp=$TMPDIR/cs$$-$RANDOM
19038   (umask 077 && mkdir $tmp)
19039 } ||
19040 {
19041    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
19042    { (exit 1); exit 1; }
19043 }
19044
19045 EOF
19046
19047 cat >>$CONFIG_STATUS <<EOF
19048
19049 #
19050 # CONFIG_FILES section.
19051 #
19052
19053 # No need to generate the scripts if there are no CONFIG_FILES.
19054 # This happens for instance when ./config.status config.h
19055 if test -n "\$CONFIG_FILES"; then
19056   # Protect against being on the right side of a sed subst in config.status.
19057   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
19058    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
19059 s,@SHELL@,$SHELL,;t t
19060 s,@exec_prefix@,$exec_prefix,;t t
19061 s,@prefix@,$prefix,;t t
19062 s,@program_transform_name@,$program_transform_name,;t t
19063 s,@bindir@,$bindir,;t t
19064 s,@sbindir@,$sbindir,;t t
19065 s,@libexecdir@,$libexecdir,;t t
19066 s,@datarootdir@,$datarootdir,;t t
19067 s,@datadir@,$datadir,;t t
19068 s,@sysconfdir@,$sysconfdir,;t t
19069 s,@sharedstatedir@,$sharedstatedir,;t t
19070 s,@localstatedir@,$localstatedir,;t t
19071 s,@libdir@,$libdir,;t t
19072 s,@includedir@,$includedir,;t t
19073 s,@oldincludedir@,$oldincludedir,;t t
19074 s,@infodir@,$infodir,;t t
19075 s,@mandir@,$mandir,;t t
19076 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
19077 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
19078 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
19079 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
19080 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
19081 s,@build_alias@,$build_alias,;t t
19082 s,@host_alias@,$host_alias,;t t
19083 s,@target_alias@,$target_alias,;t t
19084 s,@ECHO_C@,$ECHO_C,;t t
19085 s,@ECHO_N@,$ECHO_N,;t t
19086 s,@ECHO_T@,$ECHO_T,;t t
19087 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
19088 s,@DEFS@,$DEFS,;t t
19089 s,@LIBS@,$LIBS,;t t
19090 s,@build@,$build,;t t
19091 s,@build_cpu@,$build_cpu,;t t
19092 s,@build_vendor@,$build_vendor,;t t
19093 s,@build_os@,$build_os,;t t
19094 s,@host@,$host,;t t
19095 s,@host_cpu@,$host_cpu,;t t
19096 s,@host_vendor@,$host_vendor,;t t
19097 s,@host_os@,$host_os,;t t
19098 s,@SET_MAKE@,$SET_MAKE,;t t
19099 s,@CC@,$CC,;t t
19100 s,@CFLAGS@,$CFLAGS,;t t
19101 s,@LDFLAGS@,$LDFLAGS,;t t
19102 s,@CPPFLAGS@,$CPPFLAGS,;t t
19103 s,@ac_ct_CC@,$ac_ct_CC,;t t
19104 s,@EXEEXT@,$EXEEXT,;t t
19105 s,@OBJEXT@,$OBJEXT,;t t
19106 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
19107 s,@CPP@,$CPP,;t t
19108 s,@AWK@,$AWK,;t t
19109 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
19110 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
19111 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
19112 s,@LINT@,$LINT,;t t
19113 s,@LINT_OPTS@,$LINT_OPTS,;t t
19114 s,@CTAGS@,$CTAGS,;t t
19115 s,@ETAGS@,$ETAGS,;t t
19116 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
19117 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
19118 s,@MATH_LIB@,$MATH_LIB,;t t
19119 s,@top_builddir@,$top_builddir,;t t
19120 s,@CC_G_OPT@,$CC_G_OPT,;t t
19121 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
19122 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19123 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
19124 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
19125 s,@LD@,$LD,;t t
19126 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
19127 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
19128 s,@LD_MODEL@,$LD_MODEL,;t t
19129 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
19130 s,@LIBTOOL@,$LIBTOOL,;t t
19131 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
19132 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
19133 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
19134 s,@LIB_LINK@,$LIB_LINK,;t t
19135 s,@LINK_TESTS@,$LINK_TESTS,;t t
19136 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
19137 s,@PACKAGE@,$PACKAGE,;t t
19138 s,@PTHREAD@,$PTHREAD,;t t
19139 s,@TEST_ARGS@,$TEST_ARGS,;t t
19140 s,@TEST_DEPS@,$TEST_DEPS,;t t
19141 s,@TEST_LIBS@,$TEST_LIBS,;t t
19142 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
19143 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19144 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
19145 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
19146 s,@includesubdir@,$includesubdir,;t t
19147 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
19148 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
19149 s,@ECHO_LT@,$ECHO_LT,;t t
19150 s,@ECHO_LD@,$ECHO_LD,;t t
19151 s,@RULE_CC@,$RULE_CC,;t t
19152 s,@SHOW_CC@,$SHOW_CC,;t t
19153 s,@ECHO_CC@,$ECHO_CC,;t t
19154 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19155 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
19156 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
19157 s,@X_CFLAGS@,$X_CFLAGS,;t t
19158 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
19159 s,@X_LIBS@,$X_LIBS,;t t
19160 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
19161 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
19162 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
19163 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
19164 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
19165 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
19166 CEOF
19167
19168 EOF
19169
19170   cat >>$CONFIG_STATUS <<\EOF
19171   # Split the substitutions into bite-sized pieces for seds with
19172   # small command number limits, like on Digital OSF/1 and HP-UX.
19173   ac_max_sed_lines=48
19174   ac_sed_frag=1 # Number of current file.
19175   ac_beg=1 # First line for current file.
19176   ac_end=$ac_max_sed_lines # Line after last line for current file.
19177   ac_more_lines=:
19178   ac_sed_cmds=
19179   while $ac_more_lines; do
19180     if test $ac_beg -gt 1; then
19181       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19182     else
19183       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19184     fi
19185     if test ! -s $tmp/subs.frag; then
19186       ac_more_lines=false
19187     else
19188       # The purpose of the label and of the branching condition is to
19189       # speed up the sed processing (if there are no `@' at all, there
19190       # is no need to browse any of the substitutions).
19191       # These are the two extra sed commands mentioned above.
19192       (echo ':t
19193   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
19194       # It is possible to make a multiline substitution using escaped newlines.
19195       # Ensure that we do not split the substitution between script fragments.
19196       ac_BEG=$ac_end
19197       ac_END=`expr $ac_end + $ac_max_sed_lines`
19198       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
19199       if test -s $tmp/subs.next; then
19200         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
19201         if test ! -s $tmp/subs.edit; then
19202           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
19203           if test ! -s $tmp/subs.edit; then
19204             if test $ac_beg -gt 1; then
19205               ac_end=`expr $ac_end - 1`
19206               continue
19207             fi
19208           fi
19209         fi
19210       fi
19211
19212       if test -z "$ac_sed_cmds"; then
19213         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
19214       else
19215         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
19216       fi
19217       ac_sed_frag=`expr $ac_sed_frag + 1`
19218       ac_beg=$ac_end
19219       ac_end=`expr $ac_end + $ac_max_sed_lines`
19220     fi
19221   done
19222   if test -z "$ac_sed_cmds"; then
19223     ac_sed_cmds=cat
19224   fi
19225 fi # test -n "$CONFIG_FILES"
19226
19227 EOF
19228 cat >>$CONFIG_STATUS <<\EOF
19229 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19230   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19231   case $ac_file in
19232   - | *:- | *:-:* ) # input from stdin
19233         cat >$tmp/stdin
19234         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19235         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19236   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19237         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19238   * )   ac_file_in=$ac_file.in ;;
19239   esac
19240
19241   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19242   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19243          X"$ac_file" : 'X\(//\)[^/]' \| \
19244          X"$ac_file" : 'X\(//\)$' \| \
19245          X"$ac_file" : 'X\(/\)' \| \
19246          .     : '\(.\)' 2>/dev/null ||
19247 echo X"$ac_file" |
19248     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19249           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19250           /^X\(\/\/\)$/{ s//\1/; q; }
19251           /^X\(\/\).*/{ s//\1/; q; }
19252           s/.*/./; q'`
19253   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19254     { case "$ac_dir" in
19255   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19256   *)                      as_incr_dir=.;;
19257 esac
19258 as_dummy="$ac_dir"
19259 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19260   case $as_mkdir_dir in
19261     # Skip DOS drivespec
19262     ?:) as_incr_dir=$as_mkdir_dir ;;
19263     *)
19264       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19265       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19266     ;;
19267   esac
19268 done; }
19269
19270     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
19271     # A "../" for each directory in $ac_dir_suffix.
19272     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19273   else
19274     ac_dir_suffix= ac_dots=
19275   fi
19276
19277   case $srcdir in
19278   .)  ac_srcdir=.
19279       if test -z "$ac_dots"; then
19280          ac_top_srcdir=.
19281       else
19282          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
19283       fi ;;
19284   [\\/]* | ?:[\\/]* )
19285       ac_srcdir=$srcdir$ac_dir_suffix;
19286       ac_top_srcdir=$srcdir ;;
19287   *) # Relative path.
19288     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
19289     ac_top_srcdir=$ac_dots$srcdir ;;
19290   esac
19291
19292   case $INSTALL in
19293   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19294   *) ac_INSTALL=$ac_dots$INSTALL ;;
19295   esac
19296
19297   if test x"$ac_file" != x-; then
19298     { echo "$as_me:19298: creating $ac_file" >&5
19299 echo "$as_me: creating $ac_file" >&6;}
19300     rm -f "$ac_file"
19301   fi
19302   # Let's still pretend it is `configure' which instantiates (i.e., don't
19303   # use $as_me), people would be surprised to read:
19304   #    /* config.h.  Generated automatically by config.status.  */
19305   configure_input="Generated automatically from `echo $ac_file_in |
19306                                                  sed 's,.*/,,'` by configure."
19307
19308   # First look for the input files in the build tree, otherwise in the
19309   # src tree.
19310   ac_file_inputs=`IFS=:
19311     for f in $ac_file_in; do
19312       case $f in
19313       -) echo $tmp/stdin ;;
19314       [\\/$]*)
19315          # Absolute (can't be DOS-style, as IFS=:)
19316          test -f "$f" || { { echo "$as_me:19316: error: cannot find input file: $f" >&5
19317 echo "$as_me: error: cannot find input file: $f" >&2;}
19318    { (exit 1); exit 1; }; }
19319          echo $f;;
19320       *) # Relative
19321          if test -f "$f"; then
19322            # Build tree
19323            echo $f
19324          elif test -f "$srcdir/$f"; then
19325            # Source tree
19326            echo $srcdir/$f
19327          else
19328            # /dev/null tree
19329            { { echo "$as_me:19329: error: cannot find input file: $f" >&5
19330 echo "$as_me: error: cannot find input file: $f" >&2;}
19331    { (exit 1); exit 1; }; }
19332          fi;;
19333       esac
19334     done` || { (exit 1); exit 1; }
19335 EOF
19336 cat >>$CONFIG_STATUS <<\EOF
19337   ac_warn_datarootdir=no
19338   if test x"$ac_file" != x-; then
19339     for ac_item in $ac_file_inputs
19340     do
19341       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
19342       if test -n "$ac_seen"; then
19343         ac_used=`grep '@datarootdir@' $ac_item`
19344         if test -z "$ac_used"; then
19345           { echo "$as_me:19345: WARNING: datarootdir was used implicitly but not set:
19346 $ac_seen" >&5
19347 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19348 $ac_seen" >&2;}
19349           ac_warn_datarootdir=yes
19350         fi
19351       fi
19352       ac_seen=`grep '${datarootdir}' $ac_item`
19353       if test -n "$ac_seen"; then
19354         { echo "$as_me:19354: WARNING: datarootdir was used explicitly but not set:
19355 $ac_seen" >&5
19356 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19357 $ac_seen" >&2;}
19358         ac_warn_datarootdir=yes
19359       fi
19360     done
19361   fi
19362
19363 if test "x$ac_warn_datarootdir" = xyes; then
19364   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19365 fi
19366
19367 EOF
19368 cat >>$CONFIG_STATUS <<EOF
19369   sed "$ac_vpsub
19370 $extrasub
19371 EOF
19372 cat >>$CONFIG_STATUS <<\EOF
19373 :t
19374 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19375 s,@configure_input@,$configure_input,;t t
19376 s,@srcdir@,$ac_srcdir,;t t
19377 s,@top_srcdir@,$ac_top_srcdir,;t t
19378 s,@INSTALL@,$ac_INSTALL,;t t
19379 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19380   rm -f $tmp/stdin
19381   if test x"$ac_file" != x-; then
19382     cp $tmp/out $ac_file
19383
19384     for ac_name in prefix exec_prefix datarootdir
19385     do
19386         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
19387         if test -n "$ac_seen"; then
19388             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
19389             if test -z "$ac_init"; then
19390               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19391               { echo "$as_me:19391: WARNING: Variable $ac_name is used but was not set:
19392 $ac_seen" >&5
19393 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19394 $ac_seen" >&2;}
19395             fi
19396         fi
19397     done
19398     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
19399     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
19400     if test -s $tmp/out; then
19401       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19402       { echo "$as_me:19402: WARNING: Some variables may not be substituted:
19403 $ac_seen" >&5
19404 echo "$as_me: WARNING: Some variables may not be substituted:
19405 $ac_seen" >&2;}
19406     fi
19407   else
19408     cat $tmp/out
19409   fi
19410   rm -f $tmp/out
19411
19412 done
19413 EOF
19414 cat >>$CONFIG_STATUS <<\EOF
19415
19416 #
19417 # CONFIG_HEADER section.
19418 #
19419
19420 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19421 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19422 #
19423 # ac_d sets the value in "#define NAME VALUE" lines.
19424 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19425 ac_dB='[        ].*$,\1#\2'
19426 ac_dC=' '
19427 ac_dD=',;t'
19428 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19429 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19430 ac_iB='\([      ]\),\1#\2define\3'
19431 ac_iC=' '
19432 ac_iD='\4,;t'
19433 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19434 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19435 ac_uB='$,\1#\2define\3'
19436 ac_uC=' '
19437 ac_uD=',;t'
19438
19439 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19440   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19441   case $ac_file in
19442   - | *:- | *:-:* ) # input from stdin
19443         cat >$tmp/stdin
19444         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19445         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19446   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19447         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19448   * )   ac_file_in=$ac_file.in ;;
19449   esac
19450
19451   test x"$ac_file" != x- && { echo "$as_me:19451: creating $ac_file" >&5
19452 echo "$as_me: creating $ac_file" >&6;}
19453
19454   # First look for the input files in the build tree, otherwise in the
19455   # src tree.
19456   ac_file_inputs=`IFS=:
19457     for f in $ac_file_in; do
19458       case $f in
19459       -) echo $tmp/stdin ;;
19460       [\\/$]*)
19461          # Absolute (can't be DOS-style, as IFS=:)
19462          test -f "$f" || { { echo "$as_me:19462: error: cannot find input file: $f" >&5
19463 echo "$as_me: error: cannot find input file: $f" >&2;}
19464    { (exit 1); exit 1; }; }
19465          echo $f;;
19466       *) # Relative
19467          if test -f "$f"; then
19468            # Build tree
19469            echo $f
19470          elif test -f "$srcdir/$f"; then
19471            # Source tree
19472            echo $srcdir/$f
19473          else
19474            # /dev/null tree
19475            { { echo "$as_me:19475: error: cannot find input file: $f" >&5
19476 echo "$as_me: error: cannot find input file: $f" >&2;}
19477    { (exit 1); exit 1; }; }
19478          fi;;
19479       esac
19480     done` || { (exit 1); exit 1; }
19481   # Remove the trailing spaces.
19482   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19483
19484 EOF
19485
19486 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19487 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19488 # be either 'cat' or 'sort'.
19489 cat confdefs.h | uniq >conftest.vals
19490
19491 # Break up conftest.vals because some shells have a limit on
19492 # the size of here documents, and old seds have small limits too.
19493
19494 rm -f conftest.tail
19495 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19496 while grep . conftest.vals >/dev/null
19497 do
19498   # Write chunks of a limited-size here document to conftest.frag.
19499   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19500   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19501   echo 'CEOF' >> $CONFIG_STATUS
19502   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19503   rm -f conftest.vals
19504   mv conftest.tail conftest.vals
19505 done
19506 rm -f conftest.vals
19507
19508 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19509 # marker @DEFS@.
19510 echo '  cat >> conftest.edit <<CEOF
19511 /@DEFS@/r conftest.frag
19512 /@DEFS@/d
19513 CEOF
19514 sed -f conftest.edit $tmp/in > $tmp/out
19515 rm -f $tmp/in
19516 mv $tmp/out $tmp/in
19517 rm -f conftest.edit conftest.frag
19518 ' >> $CONFIG_STATUS
19519
19520 cat >>$CONFIG_STATUS <<\EOF
19521   # Let's still pretend it is `configure' which instantiates (i.e., don't
19522   # use $as_me), people would be surprised to read:
19523   #    /* config.h.  Generated automatically by config.status.  */
19524   if test x"$ac_file" = x-; then
19525     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19526   else
19527     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19528   fi
19529   cat $tmp/in >>$tmp/config.h
19530   rm -f $tmp/in
19531   if test x"$ac_file" != x-; then
19532     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19533       { echo "$as_me:19533: $ac_file is unchanged" >&5
19534 echo "$as_me: $ac_file is unchanged" >&6;}
19535     else
19536       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19537          X"$ac_file" : 'X\(//\)[^/]' \| \
19538          X"$ac_file" : 'X\(//\)$' \| \
19539          X"$ac_file" : 'X\(/\)' \| \
19540          .     : '\(.\)' 2>/dev/null ||
19541 echo X"$ac_file" |
19542     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19543           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19544           /^X\(\/\/\)$/{ s//\1/; q; }
19545           /^X\(\/\).*/{ s//\1/; q; }
19546           s/.*/./; q'`
19547       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19548         { case "$ac_dir" in
19549   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19550   *)                      as_incr_dir=.;;
19551 esac
19552 as_dummy="$ac_dir"
19553 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19554   case $as_mkdir_dir in
19555     # Skip DOS drivespec
19556     ?:) as_incr_dir=$as_mkdir_dir ;;
19557     *)
19558       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19559       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19560     ;;
19561   esac
19562 done; }
19563
19564       fi
19565       rm -f $ac_file
19566       mv $tmp/config.h $ac_file
19567     fi
19568   else
19569     cat $tmp/config.h
19570     rm -f $tmp/config.h
19571   fi
19572 done
19573 EOF
19574 cat >>$CONFIG_STATUS <<\EOF
19575 #
19576 # CONFIG_COMMANDS section.
19577 #
19578 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19579   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19580   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19581
19582   case $ac_dest in
19583     default )
19584
19585 for cf_dir in .
19586 do
19587         if test ! -d $srcdir/$cf_dir; then
19588                 continue
19589         elif test -f $srcdir/$cf_dir/programs; then
19590                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19591         fi
19592 done
19593
19594         cat >>Makefile <<TEST_EOF
19595
19596 # These rules are generated so we do not rely on suffix rules, which do not
19597 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19598 # some, and the '\$x' confuses others).
19599 TEST_EOF
19600
19601 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19602 for N in $LIST
19603 do
19604         cat >>Makefile <<TEST_EOF
19605
19606 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19607         \$(srcdir)/test.priv.h \\
19608         ncurses_cfg.h
19609         $SHOW_CC
19610         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
19611 TEST_EOF
19612 done
19613
19614 if test -f ../config.guess && test -f ../config.sub
19615 then
19616         cat >>Makefile <<TEST_EOF
19617
19618 # if we used CF_INHERIT for getting these files, we can remove them
19619 distclean::
19620         rm -f config.guess config.sub
19621 TEST_EOF
19622 fi
19623  ;;
19624   esac
19625 done
19626 EOF
19627
19628 cat >>$CONFIG_STATUS <<\EOF
19629
19630 { (exit 0); exit 0; }
19631 EOF
19632 chmod +x $CONFIG_STATUS
19633 ac_clean_files=$ac_clean_files_save
19634
19635 # configure is writing to config.log, and then calls config.status.
19636 # config.status does its own redirection, appending to config.log.
19637 # Unfortunately, on DOS this fails, as config.log is still kept open
19638 # by configure, so config.status won't be able to write to it; its
19639 # output is simply discarded.  So we exec the FD to /dev/null,
19640 # effectively closing config.log, so it can be properly (re)opened and
19641 # appended to by config.status.  When coming back to configure, we
19642 # need to make the FD available again.
19643 if test "$no_create" != yes; then
19644   ac_cs_success=:
19645   exec 5>/dev/null
19646   $SHELL $CONFIG_STATUS || ac_cs_success=false
19647   exec 5>>config.log
19648   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19649   # would make configure fail if this is the last instruction.
19650   $ac_cs_success || { (exit 1); exit 1; }
19651 fi
19652