]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.1 - patch 20180825
[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 General Options:
658   --disable-stripping     do not strip (debug info) installed executables
659   --enable-string-hacks   work around bogus compiler/loader warnings
660   --with-pkg-config{=path} enable/disable use of pkg-config
661   --disable-echo          do not display "compiling" commands
662 Curses Version-dependent Options:
663   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
664   --disable-widec         disable checks for wide-character functions
665   --with-curses-dir=DIR   directory in which (n)curses is installed
666   --with-screen=XXX       use specified curses-libraries
667   --with-ncursesw         use wide ncurses-libraries
668   --with-ncurses          use ncurses-libraries
669   --with-pdcurses         compile/link with pdcurses X11 library
670   --with-curses-colr      compile/link with HPUX 10.x color-curses
671   --with-curses-5lib      compile/link with SunOS 5lib curses
672   --with-Xaw3d            link with Xaw 3d library
673   --with-Xaw3dxft         link with Xaw 3d xft library
674   --with-neXtaw           link with neXT Athena library
675   --with-XawPlus          link with Athena-Plus library
676   --with-x                use the X Window System
677   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
678   --disable-panel         disable checks for panel functions
679   --disable-menu          disable checks for menu functions
680   --disable-form          disable checks for form functions
681 Testing/development Options:
682   --enable-warnings       test: turn on gcc compiler warnings
683   --with-dmalloc          test: use Gray Watson's dmalloc library
684   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
685   --with-valgrind         test: use valgrind
686   --disable-leaks         test: free permanent memory, analyze leaks
687   --disable-rpath-hack    don't add rpath options for additional libraries
688
689 Some influential environment variables:
690   CC          C compiler command
691   CFLAGS      C compiler flags
692   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
693               nonstandard directory <lib dir>
694   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
695               headers in a nonstandard directory <include dir>
696   CPP         C preprocessor
697
698 Use these variables to override the choices made by `configure' or to help
699 it to find libraries and programs with nonstandard names/locations.
700
701 EOF
702 fi
703
704 if test "$ac_init_help" = "recursive"; then
705   # If there are subdirs, report their specific --help.
706   ac_popdir=`pwd`
707   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
708     cd $ac_subdir
709     # A "../" for each directory in /$ac_subdir.
710     ac_dots=`echo $ac_subdir |
711              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
712
713     case $srcdir in
714     .) # No --srcdir option.  We are building in place.
715       ac_sub_srcdir=$srcdir ;;
716     [\\/]* | ?:[\\/]* ) # Absolute path.
717       ac_sub_srcdir=$srcdir/$ac_subdir ;;
718     *) # Relative path.
719       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
720     esac
721
722     # Check for guested configure; otherwise get Cygnus style configure.
723     if test -f $ac_sub_srcdir/configure.gnu; then
724       echo
725       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
726     elif test -f $ac_sub_srcdir/configure; then
727       echo
728       $SHELL $ac_sub_srcdir/configure  --help=recursive
729     elif test -f $ac_sub_srcdir/configure.ac ||
730            test -f $ac_sub_srcdir/configure.in; then
731       echo
732       $ac_configure --help
733     else
734       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
735     fi
736     cd $ac_popdir
737   done
738 fi
739
740 test -n "$ac_init_help" && exit 0
741 if $ac_init_version; then
742   cat <<\EOF
743
744 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
745 Free Software Foundation, Inc.
746 This configure script is free software; the Free Software Foundation
747 gives unlimited permission to copy, distribute and modify it.
748 EOF
749   exit 0
750 fi
751 exec 5>config.log
752 cat >&5 <<EOF
753 This file contains any messages produced by compilers while
754 running configure, to aid debugging if configure makes a mistake.
755
756 It was created by $as_me, which was
757 generated by GNU Autoconf 2.52.20170501.  Invocation command line was
758
759   $ $0 $@
760
761 EOF
762 {
763 cat <<_ASUNAME
764 ## ---------- ##
765 ## Platform.  ##
766 ## ---------- ##
767
768 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
769 uname -m = `(uname -m) 2>/dev/null || echo unknown`
770 uname -r = `(uname -r) 2>/dev/null || echo unknown`
771 uname -s = `(uname -s) 2>/dev/null || echo unknown`
772 uname -v = `(uname -v) 2>/dev/null || echo unknown`
773
774 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
775 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
776
777 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
778 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
779 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
780 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
781 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
782 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
783 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
784
785 PATH = $PATH
786
787 _ASUNAME
788 } >&5
789
790 cat >&5 <<EOF
791 ## ------------ ##
792 ## Core tests.  ##
793 ## ------------ ##
794
795 EOF
796
797 # Keep a trace of the command line.
798 # Strip out --no-create and --no-recursion so they do not pile up.
799 # Also quote any args containing shell meta-characters.
800 ac_configure_args=
801 ac_sep=
802 for ac_arg
803 do
804   case $ac_arg in
805   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
806   | --no-cr | --no-c) ;;
807   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
808   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
809   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
810     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
811     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
812     ac_sep=" " ;;
813   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
814      ac_sep=" " ;;
815   esac
816   # Get rid of the leading space.
817 done
818
819 # When interrupted or exit'd, cleanup temporary files, and complete
820 # config.log.  We remove comments because anyway the quotes in there
821 # would cause problems or look ugly.
822 trap 'exit_status=$?
823   # Save into config.log some information that might help in debugging.
824   echo >&5
825   echo "## ----------------- ##" >&5
826   echo "## Cache variables.  ##" >&5
827   echo "## ----------------- ##" >&5
828   echo >&5
829   # The following way of writing the cache mishandles newlines in values,
830 {
831   (set) 2>&1 |
832     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
833     *ac_space=\ *)
834       sed -n \
835         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
836           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
837       ;;
838     *)
839       sed -n \
840         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
841       ;;
842     esac;
843 } >&5
844   sed "/^$/d" confdefs.h >conftest.log
845   if test -s conftest.log; then
846     echo >&5
847     echo "## ------------ ##" >&5
848     echo "## confdefs.h.  ##" >&5
849     echo "## ------------ ##" >&5
850     echo >&5
851     cat conftest.log >&5
852   fi
853   (echo; echo) >&5
854   test "$ac_signal" != 0 &&
855     echo "$as_me: caught signal $ac_signal" >&5
856   echo "$as_me: exit $exit_status" >&5
857   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
858     exit $exit_status
859      ' 0
860 for ac_signal in 1 2 13 15; do
861   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
862 done
863 ac_signal=0
864
865 # confdefs.h avoids OS command line length limits that DEFS can exceed.
866 rm -rf conftest* confdefs.h
867 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
868 echo >confdefs.h
869
870 # Let the site file select an alternate cache file if it wants to.
871 # Prefer explicitly selected file to automatically selected ones.
872 if test -z "$CONFIG_SITE"; then
873   if test "x$prefix" != xNONE; then
874     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
875   else
876     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
877   fi
878 fi
879 for ac_site_file in $CONFIG_SITE; do
880   if test -r "$ac_site_file"; then
881     { echo "$as_me:881: loading site script $ac_site_file" >&5
882 echo "$as_me: loading site script $ac_site_file" >&6;}
883     cat "$ac_site_file" >&5
884     . "$ac_site_file"
885   fi
886 done
887
888 if test -r "$cache_file"; then
889   # Some versions of bash will fail to source /dev/null (special
890   # files actually), so we avoid doing that.
891   if test -f "$cache_file"; then
892     { echo "$as_me:892: loading cache $cache_file" >&5
893 echo "$as_me: loading cache $cache_file" >&6;}
894     case $cache_file in
895       [\\/]* | ?:[\\/]* ) . $cache_file;;
896       *)                      . ./$cache_file;;
897     esac
898   fi
899 else
900   { echo "$as_me:900: creating cache $cache_file" >&5
901 echo "$as_me: creating cache $cache_file" >&6;}
902   >$cache_file
903 fi
904
905 # Check that the precious variables saved in the cache have kept the same
906 # value.
907 ac_cache_corrupted=false
908 for ac_var in `(set) 2>&1 |
909                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
910   eval ac_old_set=\$ac_cv_env_${ac_var}_set
911   eval ac_new_set=\$ac_env_${ac_var}_set
912   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
913   eval ac_new_val="\$ac_env_${ac_var}_value"
914   case $ac_old_set,$ac_new_set in
915     set,)
916       { echo "$as_me:916: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
917 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
918       ac_cache_corrupted=: ;;
919     ,set)
920       { echo "$as_me:920: error: \`$ac_var' was not set in the previous run" >&5
921 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
922       ac_cache_corrupted=: ;;
923     ,);;
924     *)
925       if test "x$ac_old_val" != "x$ac_new_val"; then
926         { echo "$as_me:926: error: \`$ac_var' has changed since the previous run:" >&5
927 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
928         { echo "$as_me:928:   former value:  $ac_old_val" >&5
929 echo "$as_me:   former value:  $ac_old_val" >&2;}
930         { echo "$as_me:930:   current value: $ac_new_val" >&5
931 echo "$as_me:   current value: $ac_new_val" >&2;}
932         ac_cache_corrupted=:
933       fi;;
934   esac
935   # Pass precious variables to config.status.  It doesn't matter if
936   # we pass some twice (in addition to the command line arguments).
937   if test "$ac_new_set" = set; then
938     case $ac_new_val in
939     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
940       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
941       ac_configure_args="$ac_configure_args '$ac_arg'"
942       ;;
943     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
944        ;;
945     esac
946   fi
947 done
948 if $ac_cache_corrupted; then
949   { echo "$as_me:949: error: changes in the environment can compromise the build" >&5
950 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
951   { { echo "$as_me:951: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
952 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
953    { (exit 1); exit 1; }; }
954 fi
955
956 ac_ext=c
957 ac_cpp='$CPP $CPPFLAGS'
958 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
959 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
960 ac_compiler_gnu=$ac_cv_c_compiler_gnu
961 ac_main_return=return
962
963 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
964   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
965                    ECHO_T='     ' ;;
966   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
967   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
968 esac
969 echo "#! $SHELL" >conftest.sh
970 echo  "exit 0"   >>conftest.sh
971 chmod +x conftest.sh
972 if { (echo "$as_me:972: PATH=\".;.\"; conftest.sh") >&5
973   (PATH=".;."; conftest.sh) 2>&5
974   ac_status=$?
975   echo "$as_me:975: \$? = $ac_status" >&5
976   (exit $ac_status); }; then
977   ac_path_separator=';'
978 else
979   ac_path_separator=:
980 fi
981 PATH_SEPARATOR="$ac_path_separator"
982 rm -f conftest.sh
983
984 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
985
986 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
987
988 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
989
990 ac_aux_dir=
991 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
992   if test -f $ac_dir/install-sh; then
993     ac_aux_dir=$ac_dir
994     ac_install_sh="$ac_aux_dir/install-sh -c"
995     break
996   elif test -f $ac_dir/install.sh; then
997     ac_aux_dir=$ac_dir
998     ac_install_sh="$ac_aux_dir/install.sh -c"
999     break
1000   elif test -f $ac_dir/shtool; then
1001     ac_aux_dir=$ac_dir
1002     ac_install_sh="$ac_aux_dir/shtool install -c"
1003     break
1004   fi
1005 done
1006 if test -z "$ac_aux_dir"; then
1007   { { echo "$as_me:1007: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1008 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1009    { (exit 1); exit 1; }; }
1010 fi
1011 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1012 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1013 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1014
1015 # Make sure we can run config.sub.
1016 $ac_config_sub sun4 >/dev/null 2>&1 ||
1017   { { echo "$as_me:1017: error: cannot run $ac_config_sub" >&5
1018 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1019    { (exit 1); exit 1; }; }
1020
1021 echo "$as_me:1021: checking build system type" >&5
1022 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1023 if test "${ac_cv_build+set}" = set; then
1024   echo $ECHO_N "(cached) $ECHO_C" >&6
1025 else
1026   ac_cv_build_alias=$build_alias
1027 test -z "$ac_cv_build_alias" &&
1028   ac_cv_build_alias=`$ac_config_guess`
1029 test -z "$ac_cv_build_alias" &&
1030   { { echo "$as_me:1030: error: cannot guess build type; you must specify one" >&5
1031 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1032    { (exit 1); exit 1; }; }
1033 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1034   { { echo "$as_me:1034: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1035 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1036    { (exit 1); exit 1; }; }
1037
1038 fi
1039 echo "$as_me:1039: result: $ac_cv_build" >&5
1040 echo "${ECHO_T}$ac_cv_build" >&6
1041 build=$ac_cv_build
1042 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1043 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1044 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1045
1046 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1047         echo "$as_me:1047: checking host system type" >&5
1048 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1049 if test "${ac_cv_host+set}" = set; then
1050   echo $ECHO_N "(cached) $ECHO_C" >&6
1051 else
1052   ac_cv_host_alias=$host_alias
1053 test -z "$ac_cv_host_alias" &&
1054   ac_cv_host_alias=$ac_cv_build_alias
1055 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1056   { { echo "$as_me:1056: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1057 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1058    { (exit 1); exit 1; }; }
1059
1060 fi
1061 echo "$as_me:1061: result: $ac_cv_host" >&5
1062 echo "${ECHO_T}$ac_cv_host" >&6
1063 host=$ac_cv_host
1064 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1065 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1066 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1067
1068         system_name="$host_os"
1069 else
1070         system_name="`(uname -s -r) 2>/dev/null`"
1071         if test -z "$system_name" ; then
1072                 system_name="`(hostname) 2>/dev/null`"
1073         fi
1074 fi
1075 test -n "$system_name" &&
1076 cat >>confdefs.h <<EOF
1077 #define SYSTEM_NAME "$system_name"
1078 EOF
1079
1080 if test "${cf_cv_system_name+set}" = set; then
1081   echo $ECHO_N "(cached) $ECHO_C" >&6
1082 else
1083   cf_cv_system_name="$system_name"
1084 fi
1085
1086 test -z "$system_name" && system_name="$cf_cv_system_name"
1087 test -n "$cf_cv_system_name" && echo "$as_me:1087: result: Configuring for $cf_cv_system_name" >&5
1088 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1089
1090 if test ".$system_name" != ".$cf_cv_system_name" ; then
1091         echo "$as_me:1091: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1092 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1093         { { echo "$as_me:1093: error: \"Please remove config.cache and try again.\"" >&5
1094 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1095    { (exit 1); exit 1; }; }
1096 fi
1097
1098 test "$program_prefix" != NONE &&
1099   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1100 # Use a double $ so make ignores it.
1101 test "$program_suffix" != NONE &&
1102   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1103 # Double any \ or $.  echo might interpret backslashes.
1104 # By default was `s,x,x', remove it if useless.
1105 cat <<\_ACEOF >conftest.sed
1106 s/[\\$]/&&/g;s/;s,x,x,$//
1107 _ACEOF
1108 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1109 rm conftest.sed
1110
1111 echo "$as_me:1111: checking whether ${MAKE-make} sets \${MAKE}" >&5
1112 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1113 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1114 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1115   echo $ECHO_N "(cached) $ECHO_C" >&6
1116 else
1117   cat >conftest.make <<\EOF
1118 all:
1119         @echo 'ac_maketemp="${MAKE}"'
1120 EOF
1121 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1122 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1123 if test -n "$ac_maketemp"; then
1124   eval ac_cv_prog_make_${ac_make}_set=yes
1125 else
1126   eval ac_cv_prog_make_${ac_make}_set=no
1127 fi
1128 rm -f conftest.make
1129 fi
1130 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1131   echo "$as_me:1131: result: yes" >&5
1132 echo "${ECHO_T}yes" >&6
1133   SET_MAKE=
1134 else
1135   echo "$as_me:1135: result: no" >&5
1136 echo "${ECHO_T}no" >&6
1137   SET_MAKE="MAKE=${MAKE-make}"
1138 fi
1139
1140 ac_ext=c
1141 ac_cpp='$CPP $CPPFLAGS'
1142 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1143 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1144 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1145 ac_main_return=return
1146 if test -n "$ac_tool_prefix"; then
1147   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1148 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1149 echo "$as_me:1149: checking for $ac_word" >&5
1150 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1151 if test "${ac_cv_prog_CC+set}" = set; then
1152   echo $ECHO_N "(cached) $ECHO_C" >&6
1153 else
1154   if test -n "$CC"; then
1155   ac_cv_prog_CC="$CC" # Let the user override the test.
1156 else
1157   ac_save_IFS=$IFS; IFS=$ac_path_separator
1158 ac_dummy="$PATH"
1159 for ac_dir in $ac_dummy; do
1160   IFS=$ac_save_IFS
1161   test -z "$ac_dir" && ac_dir=.
1162   $as_executable_p "$ac_dir/$ac_word" || continue
1163 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1164 echo "$as_me:1164: found $ac_dir/$ac_word" >&5
1165 break
1166 done
1167
1168 fi
1169 fi
1170 CC=$ac_cv_prog_CC
1171 if test -n "$CC"; then
1172   echo "$as_me:1172: result: $CC" >&5
1173 echo "${ECHO_T}$CC" >&6
1174 else
1175   echo "$as_me:1175: result: no" >&5
1176 echo "${ECHO_T}no" >&6
1177 fi
1178
1179 fi
1180 if test -z "$ac_cv_prog_CC"; then
1181   ac_ct_CC=$CC
1182   # Extract the first word of "gcc", so it can be a program name with args.
1183 set dummy gcc; ac_word=$2
1184 echo "$as_me:1184: checking for $ac_word" >&5
1185 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1186 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1187   echo $ECHO_N "(cached) $ECHO_C" >&6
1188 else
1189   if test -n "$ac_ct_CC"; then
1190   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1191 else
1192   ac_save_IFS=$IFS; IFS=$ac_path_separator
1193 ac_dummy="$PATH"
1194 for ac_dir in $ac_dummy; do
1195   IFS=$ac_save_IFS
1196   test -z "$ac_dir" && ac_dir=.
1197   $as_executable_p "$ac_dir/$ac_word" || continue
1198 ac_cv_prog_ac_ct_CC="gcc"
1199 echo "$as_me:1199: found $ac_dir/$ac_word" >&5
1200 break
1201 done
1202
1203 fi
1204 fi
1205 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1206 if test -n "$ac_ct_CC"; then
1207   echo "$as_me:1207: result: $ac_ct_CC" >&5
1208 echo "${ECHO_T}$ac_ct_CC" >&6
1209 else
1210   echo "$as_me:1210: result: no" >&5
1211 echo "${ECHO_T}no" >&6
1212 fi
1213
1214   CC=$ac_ct_CC
1215 else
1216   CC="$ac_cv_prog_CC"
1217 fi
1218
1219 if test -z "$CC"; then
1220   if test -n "$ac_tool_prefix"; then
1221   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1222 set dummy ${ac_tool_prefix}cc; ac_word=$2
1223 echo "$as_me:1223: checking for $ac_word" >&5
1224 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1225 if test "${ac_cv_prog_CC+set}" = set; then
1226   echo $ECHO_N "(cached) $ECHO_C" >&6
1227 else
1228   if test -n "$CC"; then
1229   ac_cv_prog_CC="$CC" # Let the user override the test.
1230 else
1231   ac_save_IFS=$IFS; IFS=$ac_path_separator
1232 ac_dummy="$PATH"
1233 for ac_dir in $ac_dummy; do
1234   IFS=$ac_save_IFS
1235   test -z "$ac_dir" && ac_dir=.
1236   $as_executable_p "$ac_dir/$ac_word" || continue
1237 ac_cv_prog_CC="${ac_tool_prefix}cc"
1238 echo "$as_me:1238: found $ac_dir/$ac_word" >&5
1239 break
1240 done
1241
1242 fi
1243 fi
1244 CC=$ac_cv_prog_CC
1245 if test -n "$CC"; then
1246   echo "$as_me:1246: result: $CC" >&5
1247 echo "${ECHO_T}$CC" >&6
1248 else
1249   echo "$as_me:1249: result: no" >&5
1250 echo "${ECHO_T}no" >&6
1251 fi
1252
1253 fi
1254 if test -z "$ac_cv_prog_CC"; then
1255   ac_ct_CC=$CC
1256   # Extract the first word of "cc", so it can be a program name with args.
1257 set dummy cc; ac_word=$2
1258 echo "$as_me:1258: checking for $ac_word" >&5
1259 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1260 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1261   echo $ECHO_N "(cached) $ECHO_C" >&6
1262 else
1263   if test -n "$ac_ct_CC"; then
1264   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1265 else
1266   ac_save_IFS=$IFS; IFS=$ac_path_separator
1267 ac_dummy="$PATH"
1268 for ac_dir in $ac_dummy; do
1269   IFS=$ac_save_IFS
1270   test -z "$ac_dir" && ac_dir=.
1271   $as_executable_p "$ac_dir/$ac_word" || continue
1272 ac_cv_prog_ac_ct_CC="cc"
1273 echo "$as_me:1273: found $ac_dir/$ac_word" >&5
1274 break
1275 done
1276
1277 fi
1278 fi
1279 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1280 if test -n "$ac_ct_CC"; then
1281   echo "$as_me:1281: result: $ac_ct_CC" >&5
1282 echo "${ECHO_T}$ac_ct_CC" >&6
1283 else
1284   echo "$as_me:1284: result: no" >&5
1285 echo "${ECHO_T}no" >&6
1286 fi
1287
1288   CC=$ac_ct_CC
1289 else
1290   CC="$ac_cv_prog_CC"
1291 fi
1292
1293 fi
1294 if test -z "$CC"; then
1295   # Extract the first word of "cc", so it can be a program name with args.
1296 set dummy cc; ac_word=$2
1297 echo "$as_me:1297: checking for $ac_word" >&5
1298 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1299 if test "${ac_cv_prog_CC+set}" = set; then
1300   echo $ECHO_N "(cached) $ECHO_C" >&6
1301 else
1302   if test -n "$CC"; then
1303   ac_cv_prog_CC="$CC" # Let the user override the test.
1304 else
1305   ac_prog_rejected=no
1306   ac_save_IFS=$IFS; IFS=$ac_path_separator
1307 ac_dummy="$PATH"
1308 for ac_dir in $ac_dummy; do
1309   IFS=$ac_save_IFS
1310   test -z "$ac_dir" && ac_dir=.
1311   $as_executable_p "$ac_dir/$ac_word" || continue
1312 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1313   ac_prog_rejected=yes
1314   continue
1315 fi
1316 ac_cv_prog_CC="cc"
1317 echo "$as_me:1317: found $ac_dir/$ac_word" >&5
1318 break
1319 done
1320
1321 if test $ac_prog_rejected = yes; then
1322   # We found a bogon in the path, so make sure we never use it.
1323   set dummy $ac_cv_prog_CC
1324   shift
1325   if test $# != 0; then
1326     # We chose a different compiler from the bogus one.
1327     # However, it has the same basename, so the bogon will be chosen
1328     # first if we set CC to just the basename; use the full file name.
1329     shift
1330     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1331     shift
1332     ac_cv_prog_CC="$@"
1333   fi
1334 fi
1335 fi
1336 fi
1337 CC=$ac_cv_prog_CC
1338 if test -n "$CC"; then
1339   echo "$as_me:1339: result: $CC" >&5
1340 echo "${ECHO_T}$CC" >&6
1341 else
1342   echo "$as_me:1342: result: no" >&5
1343 echo "${ECHO_T}no" >&6
1344 fi
1345
1346 fi
1347 if test -z "$CC"; then
1348   if test -n "$ac_tool_prefix"; then
1349   for ac_prog in cl
1350   do
1351     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1352 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1353 echo "$as_me:1353: checking for $ac_word" >&5
1354 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1355 if test "${ac_cv_prog_CC+set}" = set; then
1356   echo $ECHO_N "(cached) $ECHO_C" >&6
1357 else
1358   if test -n "$CC"; then
1359   ac_cv_prog_CC="$CC" # Let the user override the test.
1360 else
1361   ac_save_IFS=$IFS; IFS=$ac_path_separator
1362 ac_dummy="$PATH"
1363 for ac_dir in $ac_dummy; do
1364   IFS=$ac_save_IFS
1365   test -z "$ac_dir" && ac_dir=.
1366   $as_executable_p "$ac_dir/$ac_word" || continue
1367 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1368 echo "$as_me:1368: found $ac_dir/$ac_word" >&5
1369 break
1370 done
1371
1372 fi
1373 fi
1374 CC=$ac_cv_prog_CC
1375 if test -n "$CC"; then
1376   echo "$as_me:1376: result: $CC" >&5
1377 echo "${ECHO_T}$CC" >&6
1378 else
1379   echo "$as_me:1379: result: no" >&5
1380 echo "${ECHO_T}no" >&6
1381 fi
1382
1383     test -n "$CC" && break
1384   done
1385 fi
1386 if test -z "$CC"; then
1387   ac_ct_CC=$CC
1388   for ac_prog in cl
1389 do
1390   # Extract the first word of "$ac_prog", so it can be a program name with args.
1391 set dummy $ac_prog; ac_word=$2
1392 echo "$as_me:1392: checking for $ac_word" >&5
1393 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1394 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1395   echo $ECHO_N "(cached) $ECHO_C" >&6
1396 else
1397   if test -n "$ac_ct_CC"; then
1398   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1399 else
1400   ac_save_IFS=$IFS; IFS=$ac_path_separator
1401 ac_dummy="$PATH"
1402 for ac_dir in $ac_dummy; do
1403   IFS=$ac_save_IFS
1404   test -z "$ac_dir" && ac_dir=.
1405   $as_executable_p "$ac_dir/$ac_word" || continue
1406 ac_cv_prog_ac_ct_CC="$ac_prog"
1407 echo "$as_me:1407: found $ac_dir/$ac_word" >&5
1408 break
1409 done
1410
1411 fi
1412 fi
1413 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1414 if test -n "$ac_ct_CC"; then
1415   echo "$as_me:1415: result: $ac_ct_CC" >&5
1416 echo "${ECHO_T}$ac_ct_CC" >&6
1417 else
1418   echo "$as_me:1418: result: no" >&5
1419 echo "${ECHO_T}no" >&6
1420 fi
1421
1422   test -n "$ac_ct_CC" && break
1423 done
1424
1425   CC=$ac_ct_CC
1426 fi
1427
1428 fi
1429
1430 test -z "$CC" && { { echo "$as_me:1430: error: no acceptable cc found in \$PATH" >&5
1431 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1432    { (exit 1); exit 1; }; }
1433
1434 # Provide some information about the compiler.
1435 echo "$as_me:1435:" \
1436      "checking for C compiler version" >&5
1437 ac_compiler=`set X $ac_compile; echo $2`
1438 { (eval echo "$as_me:1438: \"$ac_compiler --version </dev/null >&5\"") >&5
1439   (eval $ac_compiler --version </dev/null >&5) 2>&5
1440   ac_status=$?
1441   echo "$as_me:1441: \$? = $ac_status" >&5
1442   (exit $ac_status); }
1443 { (eval echo "$as_me:1443: \"$ac_compiler -v </dev/null >&5\"") >&5
1444   (eval $ac_compiler -v </dev/null >&5) 2>&5
1445   ac_status=$?
1446   echo "$as_me:1446: \$? = $ac_status" >&5
1447   (exit $ac_status); }
1448 { (eval echo "$as_me:1448: \"$ac_compiler -V </dev/null >&5\"") >&5
1449   (eval $ac_compiler -V </dev/null >&5) 2>&5
1450   ac_status=$?
1451   echo "$as_me:1451: \$? = $ac_status" >&5
1452   (exit $ac_status); }
1453
1454 cat >conftest.$ac_ext <<_ACEOF
1455 #line 1455 "configure"
1456 #include "confdefs.h"
1457
1458 int
1459 main (void)
1460 {
1461
1462   ;
1463   return 0;
1464 }
1465 _ACEOF
1466 ac_clean_files_save=$ac_clean_files
1467 ac_clean_files="$ac_clean_files a.out a.exe"
1468 # Try to create an executable without -o first, disregard a.out.
1469 # It will help us diagnose broken compilers, and finding out an intuition
1470 # of exeext.
1471 echo "$as_me:1471: checking for C compiler default output" >&5
1472 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1473 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1474 if { (eval echo "$as_me:1474: \"$ac_link_default\"") >&5
1475   (eval $ac_link_default) 2>&5
1476   ac_status=$?
1477   echo "$as_me:1477: \$? = $ac_status" >&5
1478   (exit $ac_status); }; then
1479   # Find the output, starting from the most likely.  This scheme is
1480 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1481 # resort.
1482 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1483                 ls a.out conftest 2>/dev/null;
1484                 ls a.* conftest.* 2>/dev/null`; do
1485   case $ac_file in
1486     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1487     a.out ) # We found the default executable, but exeext='' is most
1488             # certainly right.
1489             break;;
1490     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1491           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1492           export ac_cv_exeext
1493           break;;
1494     * ) break;;
1495   esac
1496 done
1497 else
1498   echo "$as_me: failed program was:" >&5
1499 cat conftest.$ac_ext >&5
1500 { { echo "$as_me:1500: error: C compiler cannot create executables" >&5
1501 echo "$as_me: error: C compiler cannot create executables" >&2;}
1502    { (exit 77); exit 77; }; }
1503 fi
1504
1505 ac_exeext=$ac_cv_exeext
1506 echo "$as_me:1506: result: $ac_file" >&5
1507 echo "${ECHO_T}$ac_file" >&6
1508
1509 # Check the compiler produces executables we can run.  If not, either
1510 # the compiler is broken, or we cross compile.
1511 echo "$as_me:1511: checking whether the C compiler works" >&5
1512 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1513 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1514 # If not cross compiling, check that we can run a simple program.
1515 if test "$cross_compiling" != yes; then
1516   if { ac_try='./$ac_file'
1517   { (eval echo "$as_me:1517: \"$ac_try\"") >&5
1518   (eval $ac_try) 2>&5
1519   ac_status=$?
1520   echo "$as_me:1520: \$? = $ac_status" >&5
1521   (exit $ac_status); }; }; then
1522     cross_compiling=no
1523   else
1524     if test "$cross_compiling" = maybe; then
1525         cross_compiling=yes
1526     else
1527         { { echo "$as_me:1527: error: cannot run C compiled programs.
1528 If you meant to cross compile, use \`--host'." >&5
1529 echo "$as_me: error: cannot run C compiled programs.
1530 If you meant to cross compile, use \`--host'." >&2;}
1531    { (exit 1); exit 1; }; }
1532     fi
1533   fi
1534 fi
1535 echo "$as_me:1535: result: yes" >&5
1536 echo "${ECHO_T}yes" >&6
1537
1538 rm -f a.out a.exe conftest$ac_cv_exeext
1539 ac_clean_files=$ac_clean_files_save
1540 # Check the compiler produces executables we can run.  If not, either
1541 # the compiler is broken, or we cross compile.
1542 echo "$as_me:1542: checking whether we are cross compiling" >&5
1543 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1544 echo "$as_me:1544: result: $cross_compiling" >&5
1545 echo "${ECHO_T}$cross_compiling" >&6
1546
1547 echo "$as_me:1547: checking for executable suffix" >&5
1548 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1549 if { (eval echo "$as_me:1549: \"$ac_link\"") >&5
1550   (eval $ac_link) 2>&5
1551   ac_status=$?
1552   echo "$as_me:1552: \$? = $ac_status" >&5
1553   (exit $ac_status); }; then
1554   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1555 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1556 # work properly (i.e., refer to `conftest.exe'), while it won't with
1557 # `rm'.
1558 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1559   case $ac_file in
1560     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1561     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1562           export ac_cv_exeext
1563           break;;
1564     * ) break;;
1565   esac
1566 done
1567 else
1568   { { echo "$as_me:1568: error: cannot compute EXEEXT: cannot compile and link" >&5
1569 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1570    { (exit 1); exit 1; }; }
1571 fi
1572
1573 rm -f conftest$ac_cv_exeext
1574 echo "$as_me:1574: result: $ac_cv_exeext" >&5
1575 echo "${ECHO_T}$ac_cv_exeext" >&6
1576
1577 rm -f conftest.$ac_ext
1578 EXEEXT=$ac_cv_exeext
1579 ac_exeext=$EXEEXT
1580 echo "$as_me:1580: checking for object suffix" >&5
1581 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1582 if test "${ac_cv_objext+set}" = set; then
1583   echo $ECHO_N "(cached) $ECHO_C" >&6
1584 else
1585   cat >conftest.$ac_ext <<_ACEOF
1586 #line 1586 "configure"
1587 #include "confdefs.h"
1588
1589 int
1590 main (void)
1591 {
1592
1593   ;
1594   return 0;
1595 }
1596 _ACEOF
1597 rm -f conftest.o conftest.obj
1598 if { (eval echo "$as_me:1598: \"$ac_compile\"") >&5
1599   (eval $ac_compile) 2>&5
1600   ac_status=$?
1601   echo "$as_me:1601: \$? = $ac_status" >&5
1602   (exit $ac_status); }; then
1603   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1604   case $ac_file in
1605     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1606     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1607        break;;
1608   esac
1609 done
1610 else
1611   echo "$as_me: failed program was:" >&5
1612 cat conftest.$ac_ext >&5
1613 { { echo "$as_me:1613: error: cannot compute OBJEXT: cannot compile" >&5
1614 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1615    { (exit 1); exit 1; }; }
1616 fi
1617
1618 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1619 fi
1620 echo "$as_me:1620: result: $ac_cv_objext" >&5
1621 echo "${ECHO_T}$ac_cv_objext" >&6
1622 OBJEXT=$ac_cv_objext
1623 ac_objext=$OBJEXT
1624 echo "$as_me:1624: checking whether we are using the GNU C compiler" >&5
1625 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1626 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1627   echo $ECHO_N "(cached) $ECHO_C" >&6
1628 else
1629   cat >conftest.$ac_ext <<_ACEOF
1630 #line 1630 "configure"
1631 #include "confdefs.h"
1632
1633 int
1634 main (void)
1635 {
1636 #ifndef __GNUC__
1637        choke me
1638 #endif
1639
1640   ;
1641   return 0;
1642 }
1643 _ACEOF
1644 rm -f conftest.$ac_objext
1645 if { (eval echo "$as_me:1645: \"$ac_compile\"") >&5
1646   (eval $ac_compile) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); } &&
1650          { ac_try='test -s conftest.$ac_objext'
1651   { (eval echo "$as_me:1651: \"$ac_try\"") >&5
1652   (eval $ac_try) 2>&5
1653   ac_status=$?
1654   echo "$as_me:1654: \$? = $ac_status" >&5
1655   (exit $ac_status); }; }; then
1656   ac_compiler_gnu=yes
1657 else
1658   echo "$as_me: failed program was:" >&5
1659 cat conftest.$ac_ext >&5
1660 ac_compiler_gnu=no
1661 fi
1662 rm -f conftest.$ac_objext conftest.$ac_ext
1663 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1664
1665 fi
1666 echo "$as_me:1666: result: $ac_cv_c_compiler_gnu" >&5
1667 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1668 GCC=`test $ac_compiler_gnu = yes && echo yes`
1669 ac_test_CFLAGS=${CFLAGS+set}
1670 ac_save_CFLAGS=$CFLAGS
1671 CFLAGS="-g"
1672 echo "$as_me:1672: checking whether $CC accepts -g" >&5
1673 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1674 if test "${ac_cv_prog_cc_g+set}" = set; then
1675   echo $ECHO_N "(cached) $ECHO_C" >&6
1676 else
1677   cat >conftest.$ac_ext <<_ACEOF
1678 #line 1678 "configure"
1679 #include "confdefs.h"
1680
1681 int
1682 main (void)
1683 {
1684
1685   ;
1686   return 0;
1687 }
1688 _ACEOF
1689 rm -f conftest.$ac_objext
1690 if { (eval echo "$as_me:1690: \"$ac_compile\"") >&5
1691   (eval $ac_compile) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); } &&
1695          { ac_try='test -s conftest.$ac_objext'
1696   { (eval echo "$as_me:1696: \"$ac_try\"") >&5
1697   (eval $ac_try) 2>&5
1698   ac_status=$?
1699   echo "$as_me:1699: \$? = $ac_status" >&5
1700   (exit $ac_status); }; }; then
1701   ac_cv_prog_cc_g=yes
1702 else
1703   echo "$as_me: failed program was:" >&5
1704 cat conftest.$ac_ext >&5
1705 ac_cv_prog_cc_g=no
1706 fi
1707 rm -f conftest.$ac_objext conftest.$ac_ext
1708 fi
1709 echo "$as_me:1709: result: $ac_cv_prog_cc_g" >&5
1710 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1711 if test "$ac_test_CFLAGS" = set; then
1712   CFLAGS=$ac_save_CFLAGS
1713 elif test $ac_cv_prog_cc_g = yes; then
1714   if test "$GCC" = yes; then
1715     CFLAGS="-g -O2"
1716   else
1717     CFLAGS="-g"
1718   fi
1719 else
1720   if test "$GCC" = yes; then
1721     CFLAGS="-O2"
1722   else
1723     CFLAGS=
1724   fi
1725 fi
1726 # Some people use a C++ compiler to compile C.  Since we use `exit',
1727 # in C++ we need to declare it.  In case someone uses the same compiler
1728 # for both compiling C and C++ we need to have the C++ compiler decide
1729 # the declaration of exit, since it's the most demanding environment.
1730 cat >conftest.$ac_ext <<_ACEOF
1731 #ifndef __cplusplus
1732   choke me
1733 #endif
1734 _ACEOF
1735 rm -f conftest.$ac_objext
1736 if { (eval echo "$as_me:1736: \"$ac_compile\"") >&5
1737   (eval $ac_compile) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); } &&
1741          { ac_try='test -s conftest.$ac_objext'
1742   { (eval echo "$as_me:1742: \"$ac_try\"") >&5
1743   (eval $ac_try) 2>&5
1744   ac_status=$?
1745   echo "$as_me:1745: \$? = $ac_status" >&5
1746   (exit $ac_status); }; }; then
1747   for ac_declaration in \
1748    ''\
1749    '#include <stdlib.h>' \
1750    'extern "C" void std::exit (int) throw (); using std::exit;' \
1751    'extern "C" void std::exit (int); using std::exit;' \
1752    'extern "C" void exit (int) throw ();' \
1753    'extern "C" void exit (int);' \
1754    'void exit (int);'
1755 do
1756   cat >conftest.$ac_ext <<_ACEOF
1757 #line 1757 "configure"
1758 #include "confdefs.h"
1759 #include <stdlib.h>
1760 $ac_declaration
1761 int
1762 main (void)
1763 {
1764 exit (42);
1765   ;
1766   return 0;
1767 }
1768 _ACEOF
1769 rm -f conftest.$ac_objext
1770 if { (eval echo "$as_me:1770: \"$ac_compile\"") >&5
1771   (eval $ac_compile) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); } &&
1775          { ac_try='test -s conftest.$ac_objext'
1776   { (eval echo "$as_me:1776: \"$ac_try\"") >&5
1777   (eval $ac_try) 2>&5
1778   ac_status=$?
1779   echo "$as_me:1779: \$? = $ac_status" >&5
1780   (exit $ac_status); }; }; then
1781   :
1782 else
1783   echo "$as_me: failed program was:" >&5
1784 cat conftest.$ac_ext >&5
1785 continue
1786 fi
1787 rm -f conftest.$ac_objext conftest.$ac_ext
1788   cat >conftest.$ac_ext <<_ACEOF
1789 #line 1789 "configure"
1790 #include "confdefs.h"
1791 $ac_declaration
1792 int
1793 main (void)
1794 {
1795 exit (42);
1796   ;
1797   return 0;
1798 }
1799 _ACEOF
1800 rm -f conftest.$ac_objext
1801 if { (eval echo "$as_me:1801: \"$ac_compile\"") >&5
1802   (eval $ac_compile) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); } &&
1806          { ac_try='test -s conftest.$ac_objext'
1807   { (eval echo "$as_me:1807: \"$ac_try\"") >&5
1808   (eval $ac_try) 2>&5
1809   ac_status=$?
1810   echo "$as_me:1810: \$? = $ac_status" >&5
1811   (exit $ac_status); }; }; then
1812   break
1813 else
1814   echo "$as_me: failed program was:" >&5
1815 cat conftest.$ac_ext >&5
1816 fi
1817 rm -f conftest.$ac_objext conftest.$ac_ext
1818 done
1819 rm -rf conftest*
1820 if test -n "$ac_declaration"; then
1821   echo '#ifdef __cplusplus' >>confdefs.h
1822   echo $ac_declaration      >>confdefs.h
1823   echo '#endif'             >>confdefs.h
1824 fi
1825
1826 else
1827   echo "$as_me: failed program was:" >&5
1828 cat conftest.$ac_ext >&5
1829 fi
1830 rm -f conftest.$ac_objext conftest.$ac_ext
1831 ac_ext=c
1832 ac_cpp='$CPP $CPPFLAGS'
1833 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1834 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1835 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1836 ac_main_return=return
1837
1838 GCC_VERSION=none
1839 if test "$GCC" = yes ; then
1840         echo "$as_me:1840: checking version of $CC" >&5
1841 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1842         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.].*//'`"
1843         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1844         echo "$as_me:1844: result: $GCC_VERSION" >&5
1845 echo "${ECHO_T}$GCC_VERSION" >&6
1846 fi
1847
1848 echo "$as_me:1848: checking for $CC option to accept ANSI C" >&5
1849 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1850 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1851   echo $ECHO_N "(cached) $ECHO_C" >&6
1852 else
1853   ac_cv_prog_cc_stdc=no
1854 ac_save_CC=$CC
1855 cat >conftest.$ac_ext <<_ACEOF
1856 #line 1856 "configure"
1857 #include "confdefs.h"
1858 #include <stdarg.h>
1859 #include <stdio.h>
1860 #include <sys/types.h>
1861 #include <sys/stat.h>
1862 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1863 struct buf { int x; };
1864 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1865 static char *e (p, i)
1866      char **p;
1867      int i;
1868 {
1869   return p[i];
1870 }
1871 static char *f (char * (*g) (char **, int), char **p, ...)
1872 {
1873   char *s;
1874   va_list v;
1875   va_start (v,p);
1876   s = g (p, va_arg (v,int));
1877   va_end (v);
1878   return s;
1879 }
1880 int test (int i, double x);
1881 struct s1 {int (*f) (int a);};
1882 struct s2 {int (*f) (double a);};
1883 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1884 int argc;
1885 char **argv;
1886 int
1887 main (void)
1888 {
1889 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1890   ;
1891   return 0;
1892 }
1893 _ACEOF
1894 # Don't try gcc -ansi; that turns off useful extensions and
1895 # breaks some systems' header files.
1896 # AIX                   -qlanglvl=ansi
1897 # Ultrix and OSF/1      -std1
1898 # HP-UX 10.20 and later -Ae
1899 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1900 # SVR4                  -Xc -D__EXTENSIONS__
1901 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1902 do
1903   CC="$ac_save_CC $ac_arg"
1904   rm -f conftest.$ac_objext
1905 if { (eval echo "$as_me:1905: \"$ac_compile\"") >&5
1906   (eval $ac_compile) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); } &&
1910          { ac_try='test -s conftest.$ac_objext'
1911   { (eval echo "$as_me:1911: \"$ac_try\"") >&5
1912   (eval $ac_try) 2>&5
1913   ac_status=$?
1914   echo "$as_me:1914: \$? = $ac_status" >&5
1915   (exit $ac_status); }; }; then
1916   ac_cv_prog_cc_stdc=$ac_arg
1917 break
1918 else
1919   echo "$as_me: failed program was:" >&5
1920 cat conftest.$ac_ext >&5
1921 fi
1922 rm -f conftest.$ac_objext
1923 done
1924 rm -f conftest.$ac_ext conftest.$ac_objext
1925 CC=$ac_save_CC
1926
1927 fi
1928
1929 case "x$ac_cv_prog_cc_stdc" in
1930   x|xno)
1931     echo "$as_me:1931: result: none needed" >&5
1932 echo "${ECHO_T}none needed" >&6 ;;
1933   *)
1934     echo "$as_me:1934: result: $ac_cv_prog_cc_stdc" >&5
1935 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1936     CC="$CC $ac_cv_prog_cc_stdc" ;;
1937 esac
1938
1939 # This should have been defined by AC_PROG_CC
1940 : ${CC:=cc}
1941
1942 echo "$as_me:1942: checking \$CFLAGS variable" >&5
1943 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
1944 case "x$CFLAGS" in
1945 (*-[IUD]*)
1946         echo "$as_me:1946: result: broken" >&5
1947 echo "${ECHO_T}broken" >&6
1948         { echo "$as_me:1948: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
1949 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
1950         cf_flags="$CFLAGS"
1951         CFLAGS=
1952         for cf_arg in $cf_flags
1953         do
1954
1955 cf_fix_cppflags=no
1956 cf_new_cflags=
1957 cf_new_cppflags=
1958 cf_new_extra_cppflags=
1959
1960 for cf_add_cflags in $cf_arg
1961 do
1962 case $cf_fix_cppflags in
1963 (no)
1964         case $cf_add_cflags in
1965         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1966                 case $cf_add_cflags in
1967                 (-D*)
1968                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1969
1970                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1971                                 && test -z "${cf_tst_cflags}" \
1972                                 && cf_fix_cppflags=yes
1973
1974                         if test $cf_fix_cppflags = yes ; then
1975
1976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1978
1979                                 continue
1980                         elif test "${cf_tst_cflags}" = "\"'" ; then
1981
1982         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1983         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1984
1985                                 continue
1986                         fi
1987                         ;;
1988                 esac
1989                 case "$CPPFLAGS" in
1990                 (*$cf_add_cflags)
1991                         ;;
1992                 (*)
1993                         case $cf_add_cflags in
1994                         (-D*)
1995                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1996
1997 CPPFLAGS=`echo "$CPPFLAGS" | \
1998         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1999                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2000
2001                                 ;;
2002                         esac
2003
2004         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2005         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2006
2007                         ;;
2008                 esac
2009                 ;;
2010         (*)
2011
2012         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2013         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2014
2015                 ;;
2016         esac
2017         ;;
2018 (yes)
2019
2020         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2021         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2022
2023         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2024
2025         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2026                 && test -z "${cf_tst_cflags}" \
2027                 && cf_fix_cppflags=no
2028         ;;
2029 esac
2030 done
2031
2032 if test -n "$cf_new_cflags" ; then
2033
2034         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2035         CFLAGS="${CFLAGS}$cf_new_cflags"
2036
2037 fi
2038
2039 if test -n "$cf_new_cppflags" ; then
2040
2041         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2042         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2043
2044 fi
2045
2046 if test -n "$cf_new_extra_cppflags" ; then
2047
2048         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2049         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2050
2051 fi
2052
2053         done
2054         ;;
2055 (*)
2056         echo "$as_me:2056: result: ok" >&5
2057 echo "${ECHO_T}ok" >&6
2058         ;;
2059 esac
2060
2061 echo "$as_me:2061: checking \$CC variable" >&5
2062 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2063 case "$CC" in
2064 (*[\ \  ]-*)
2065         echo "$as_me:2065: result: broken" >&5
2066 echo "${ECHO_T}broken" >&6
2067         { echo "$as_me:2067: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2068 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2069         # humor him...
2070         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2071         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2072         CC="$cf_prog"
2073         for cf_arg in $cf_flags
2074         do
2075                 case "x$cf_arg" in
2076                 (x-[IUDfgOW]*)
2077
2078 cf_fix_cppflags=no
2079 cf_new_cflags=
2080 cf_new_cppflags=
2081 cf_new_extra_cppflags=
2082
2083 for cf_add_cflags in $cf_arg
2084 do
2085 case $cf_fix_cppflags in
2086 (no)
2087         case $cf_add_cflags in
2088         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2089                 case $cf_add_cflags in
2090                 (-D*)
2091                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2092
2093                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2094                                 && test -z "${cf_tst_cflags}" \
2095                                 && cf_fix_cppflags=yes
2096
2097                         if test $cf_fix_cppflags = yes ; then
2098
2099         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2100         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2101
2102                                 continue
2103                         elif test "${cf_tst_cflags}" = "\"'" ; then
2104
2105         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2106         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2107
2108                                 continue
2109                         fi
2110                         ;;
2111                 esac
2112                 case "$CPPFLAGS" in
2113                 (*$cf_add_cflags)
2114                         ;;
2115                 (*)
2116                         case $cf_add_cflags in
2117                         (-D*)
2118                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2119
2120 CPPFLAGS=`echo "$CPPFLAGS" | \
2121         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2122                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2123
2124                                 ;;
2125                         esac
2126
2127         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2128         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2129
2130                         ;;
2131                 esac
2132                 ;;
2133         (*)
2134
2135         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2136         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2137
2138                 ;;
2139         esac
2140         ;;
2141 (yes)
2142
2143         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2144         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2145
2146         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2147
2148         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2149                 && test -z "${cf_tst_cflags}" \
2150                 && cf_fix_cppflags=no
2151         ;;
2152 esac
2153 done
2154
2155 if test -n "$cf_new_cflags" ; then
2156
2157         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2158         CFLAGS="${CFLAGS}$cf_new_cflags"
2159
2160 fi
2161
2162 if test -n "$cf_new_cppflags" ; then
2163
2164         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2165         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2166
2167 fi
2168
2169 if test -n "$cf_new_extra_cppflags" ; then
2170
2171         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2172         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2173
2174 fi
2175
2176                         ;;
2177                 (*)
2178                         CC="$CC $cf_arg"
2179                         ;;
2180                 esac
2181         done
2182         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2183
2184 echo "${as_me:-configure}:2184: testing resulting CC: '$CC' ..." 1>&5
2185
2186         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2187
2188 echo "${as_me:-configure}:2188: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2189
2190         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2191
2192 echo "${as_me:-configure}:2192: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2193
2194         ;;
2195 (*)
2196         echo "$as_me:2196: result: ok" >&5
2197 echo "${ECHO_T}ok" >&6
2198         ;;
2199 esac
2200
2201 echo "$as_me:2201: checking for inline" >&5
2202 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2203 if test "${ac_cv_c_inline+set}" = set; then
2204   echo $ECHO_N "(cached) $ECHO_C" >&6
2205 else
2206   ac_cv_c_inline=no
2207 for ac_kw in inline __inline__ __inline; do
2208   cat >conftest.$ac_ext <<_ACEOF
2209 #line 2209 "configure"
2210 #include "confdefs.h"
2211 #ifndef __cplusplus
2212 static $ac_kw int static_foo () {return 0; }
2213 $ac_kw int foo () {return 0; }
2214 #endif
2215
2216 _ACEOF
2217 rm -f conftest.$ac_objext
2218 if { (eval echo "$as_me:2218: \"$ac_compile\"") >&5
2219   (eval $ac_compile) 2>&5
2220   ac_status=$?
2221   echo "$as_me:2221: \$? = $ac_status" >&5
2222   (exit $ac_status); } &&
2223          { ac_try='test -s conftest.$ac_objext'
2224   { (eval echo "$as_me:2224: \"$ac_try\"") >&5
2225   (eval $ac_try) 2>&5
2226   ac_status=$?
2227   echo "$as_me:2227: \$? = $ac_status" >&5
2228   (exit $ac_status); }; }; then
2229   ac_cv_c_inline=$ac_kw; break
2230 else
2231   echo "$as_me: failed program was:" >&5
2232 cat conftest.$ac_ext >&5
2233 fi
2234 rm -f conftest.$ac_objext conftest.$ac_ext
2235 done
2236
2237 fi
2238 echo "$as_me:2238: result: $ac_cv_c_inline" >&5
2239 echo "${ECHO_T}$ac_cv_c_inline" >&6
2240 case $ac_cv_c_inline in
2241   inline | yes) ;;
2242   no)
2243 cat >>confdefs.h <<\EOF
2244 #define inline
2245 EOF
2246  ;;
2247   *)  cat >>confdefs.h <<EOF
2248 #define inline $ac_cv_c_inline
2249 EOF
2250  ;;
2251 esac
2252
2253 ac_ext=c
2254 ac_cpp='$CPP $CPPFLAGS'
2255 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2256 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2257 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2258 ac_main_return=return
2259 echo "$as_me:2259: checking how to run the C preprocessor" >&5
2260 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2261 # On Suns, sometimes $CPP names a directory.
2262 if test -n "$CPP" && test -d "$CPP"; then
2263   CPP=
2264 fi
2265 if test -z "$CPP"; then
2266   if test "${ac_cv_prog_CPP+set}" = set; then
2267   echo $ECHO_N "(cached) $ECHO_C" >&6
2268 else
2269       # Double quotes because CPP needs to be expanded
2270     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2271     do
2272       ac_preproc_ok=false
2273 for ac_c_preproc_warn_flag in '' yes
2274 do
2275   # Use a header file that comes with gcc, so configuring glibc
2276   # with a fresh cross-compiler works.
2277   # On the NeXT, cc -E runs the code through the compiler's parser,
2278   # not just through cpp. "Syntax error" is here to catch this case.
2279   cat >conftest.$ac_ext <<_ACEOF
2280 #line 2280 "configure"
2281 #include "confdefs.h"
2282 #include <assert.h>
2283                      Syntax error
2284 _ACEOF
2285 if { (eval echo "$as_me:2285: \"$ac_cpp conftest.$ac_ext\"") >&5
2286   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2287   ac_status=$?
2288   egrep -v '^ *\+' conftest.er1 >conftest.err
2289   rm -f conftest.er1
2290   cat conftest.err >&5
2291   echo "$as_me:2291: \$? = $ac_status" >&5
2292   (exit $ac_status); } >/dev/null; then
2293   if test -s conftest.err; then
2294     ac_cpp_err=$ac_c_preproc_warn_flag
2295   else
2296     ac_cpp_err=
2297   fi
2298 else
2299   ac_cpp_err=yes
2300 fi
2301 if test -z "$ac_cpp_err"; then
2302   :
2303 else
2304   echo "$as_me: failed program was:" >&5
2305   cat conftest.$ac_ext >&5
2306   # Broken: fails on valid input.
2307 continue
2308 fi
2309 rm -f conftest.err conftest.$ac_ext
2310
2311   # OK, works on sane cases.  Now check whether non-existent headers
2312   # can be detected and how.
2313   cat >conftest.$ac_ext <<_ACEOF
2314 #line 2314 "configure"
2315 #include "confdefs.h"
2316 #include <ac_nonexistent.h>
2317 _ACEOF
2318 if { (eval echo "$as_me:2318: \"$ac_cpp conftest.$ac_ext\"") >&5
2319   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2320   ac_status=$?
2321   egrep -v '^ *\+' conftest.er1 >conftest.err
2322   rm -f conftest.er1
2323   cat conftest.err >&5
2324   echo "$as_me:2324: \$? = $ac_status" >&5
2325   (exit $ac_status); } >/dev/null; then
2326   if test -s conftest.err; then
2327     ac_cpp_err=$ac_c_preproc_warn_flag
2328   else
2329     ac_cpp_err=
2330   fi
2331 else
2332   ac_cpp_err=yes
2333 fi
2334 if test -z "$ac_cpp_err"; then
2335   # Broken: success on invalid input.
2336 continue
2337 else
2338   echo "$as_me: failed program was:" >&5
2339   cat conftest.$ac_ext >&5
2340   # Passes both tests.
2341 ac_preproc_ok=:
2342 break
2343 fi
2344 rm -f conftest.err conftest.$ac_ext
2345
2346 done
2347 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2348 rm -f conftest.err conftest.$ac_ext
2349 if $ac_preproc_ok; then
2350   break
2351 fi
2352
2353     done
2354     ac_cv_prog_CPP=$CPP
2355
2356 fi
2357   CPP=$ac_cv_prog_CPP
2358 else
2359   ac_cv_prog_CPP=$CPP
2360 fi
2361 echo "$as_me:2361: result: $CPP" >&5
2362 echo "${ECHO_T}$CPP" >&6
2363 ac_preproc_ok=false
2364 for ac_c_preproc_warn_flag in '' yes
2365 do
2366   # Use a header file that comes with gcc, so configuring glibc
2367   # with a fresh cross-compiler works.
2368   # On the NeXT, cc -E runs the code through the compiler's parser,
2369   # not just through cpp. "Syntax error" is here to catch this case.
2370   cat >conftest.$ac_ext <<_ACEOF
2371 #line 2371 "configure"
2372 #include "confdefs.h"
2373 #include <assert.h>
2374                      Syntax error
2375 _ACEOF
2376 if { (eval echo "$as_me:2376: \"$ac_cpp conftest.$ac_ext\"") >&5
2377   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2378   ac_status=$?
2379   egrep -v '^ *\+' conftest.er1 >conftest.err
2380   rm -f conftest.er1
2381   cat conftest.err >&5
2382   echo "$as_me:2382: \$? = $ac_status" >&5
2383   (exit $ac_status); } >/dev/null; then
2384   if test -s conftest.err; then
2385     ac_cpp_err=$ac_c_preproc_warn_flag
2386   else
2387     ac_cpp_err=
2388   fi
2389 else
2390   ac_cpp_err=yes
2391 fi
2392 if test -z "$ac_cpp_err"; then
2393   :
2394 else
2395   echo "$as_me: failed program was:" >&5
2396   cat conftest.$ac_ext >&5
2397   # Broken: fails on valid input.
2398 continue
2399 fi
2400 rm -f conftest.err conftest.$ac_ext
2401
2402   # OK, works on sane cases.  Now check whether non-existent headers
2403   # can be detected and how.
2404   cat >conftest.$ac_ext <<_ACEOF
2405 #line 2405 "configure"
2406 #include "confdefs.h"
2407 #include <ac_nonexistent.h>
2408 _ACEOF
2409 if { (eval echo "$as_me:2409: \"$ac_cpp conftest.$ac_ext\"") >&5
2410   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2411   ac_status=$?
2412   egrep -v '^ *\+' conftest.er1 >conftest.err
2413   rm -f conftest.er1
2414   cat conftest.err >&5
2415   echo "$as_me:2415: \$? = $ac_status" >&5
2416   (exit $ac_status); } >/dev/null; then
2417   if test -s conftest.err; then
2418     ac_cpp_err=$ac_c_preproc_warn_flag
2419   else
2420     ac_cpp_err=
2421   fi
2422 else
2423   ac_cpp_err=yes
2424 fi
2425 if test -z "$ac_cpp_err"; then
2426   # Broken: success on invalid input.
2427 continue
2428 else
2429   echo "$as_me: failed program was:" >&5
2430   cat conftest.$ac_ext >&5
2431   # Passes both tests.
2432 ac_preproc_ok=:
2433 break
2434 fi
2435 rm -f conftest.err conftest.$ac_ext
2436
2437 done
2438 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2439 rm -f conftest.err conftest.$ac_ext
2440 if $ac_preproc_ok; then
2441   :
2442 else
2443   { { echo "$as_me:2443: error: C preprocessor \"$CPP\" fails sanity check" >&5
2444 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2445    { (exit 1); exit 1; }; }
2446 fi
2447
2448 ac_ext=c
2449 ac_cpp='$CPP $CPPFLAGS'
2450 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2451 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2452 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2453 ac_main_return=return
2454
2455 for ac_prog in mawk gawk nawk awk
2456 do
2457   # Extract the first word of "$ac_prog", so it can be a program name with args.
2458 set dummy $ac_prog; ac_word=$2
2459 echo "$as_me:2459: checking for $ac_word" >&5
2460 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2461 if test "${ac_cv_prog_AWK+set}" = set; then
2462   echo $ECHO_N "(cached) $ECHO_C" >&6
2463 else
2464   if test -n "$AWK"; then
2465   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2466 else
2467   ac_save_IFS=$IFS; IFS=$ac_path_separator
2468 ac_dummy="$PATH"
2469 for ac_dir in $ac_dummy; do
2470   IFS=$ac_save_IFS
2471   test -z "$ac_dir" && ac_dir=.
2472   $as_executable_p "$ac_dir/$ac_word" || continue
2473 ac_cv_prog_AWK="$ac_prog"
2474 echo "$as_me:2474: found $ac_dir/$ac_word" >&5
2475 break
2476 done
2477
2478 fi
2479 fi
2480 AWK=$ac_cv_prog_AWK
2481 if test -n "$AWK"; then
2482   echo "$as_me:2482: result: $AWK" >&5
2483 echo "${ECHO_T}$AWK" >&6
2484 else
2485   echo "$as_me:2485: result: no" >&5
2486 echo "${ECHO_T}no" >&6
2487 fi
2488
2489   test -n "$AWK" && break
2490 done
2491
2492 # Find a good install program.  We prefer a C program (faster),
2493 # so one script is as good as another.  But avoid the broken or
2494 # incompatible versions:
2495 # SysV /etc/install, /usr/sbin/install
2496 # SunOS /usr/etc/install
2497 # IRIX /sbin/install
2498 # AIX /bin/install
2499 # AmigaOS /C/install, which installs bootblocks on floppy discs
2500 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2501 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2502 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2503 # ./install, which can be erroneously created by make from ./install.sh.
2504 echo "$as_me:2504: checking for a BSD compatible install" >&5
2505 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2506 if test -z "$INSTALL"; then
2507 if test "${ac_cv_path_install+set}" = set; then
2508   echo $ECHO_N "(cached) $ECHO_C" >&6
2509 else
2510     ac_save_IFS=$IFS; IFS=$ac_path_separator
2511   for ac_dir in $PATH; do
2512     IFS=$ac_save_IFS
2513     # Account for people who put trailing slashes in PATH elements.
2514     case $ac_dir/ in
2515     / | ./ | .// | /cC/* \
2516     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2517     | /usr/ucb/* ) ;;
2518     *)
2519       # OSF1 and SCO ODT 3.0 have their own names for install.
2520       # Don't use installbsd from OSF since it installs stuff as root
2521       # by default.
2522       for ac_prog in ginstall scoinst install; do
2523         if $as_executable_p "$ac_dir/$ac_prog"; then
2524           if test $ac_prog = install &&
2525             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2526             # AIX install.  It has an incompatible calling convention.
2527             :
2528           elif test $ac_prog = install &&
2529             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2530             # program-specific install script used by HP pwplus--don't use.
2531             :
2532           else
2533             ac_cv_path_install="$ac_dir/$ac_prog -c"
2534             break 2
2535           fi
2536         fi
2537       done
2538       ;;
2539     esac
2540   done
2541
2542 fi
2543   if test "${ac_cv_path_install+set}" = set; then
2544     INSTALL=$ac_cv_path_install
2545   else
2546     # As a last resort, use the slow shell script.  We don't cache a
2547     # path for INSTALL within a source directory, because that will
2548     # break other packages using the cache if that directory is
2549     # removed, or if the path is relative.
2550     INSTALL=$ac_install_sh
2551   fi
2552 fi
2553 echo "$as_me:2553: result: $INSTALL" >&5
2554 echo "${ECHO_T}$INSTALL" >&6
2555
2556 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2557 # It thinks the first close brace ends the variable substitution.
2558 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2559
2560 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2561
2562 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2563
2564 case $INSTALL in
2565 (/*)
2566         ;;
2567 (*)
2568         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2569         test -z "$cf_dir" && cf_dir=.
2570         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2571         ;;
2572 esac
2573
2574 echo "$as_me:2574: checking if you want to install stripped executables" >&5
2575 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2576
2577 # Check whether --enable-stripping or --disable-stripping was given.
2578 if test "${enable_stripping+set}" = set; then
2579   enableval="$enable_stripping"
2580   test "$enableval" != no && enableval=yes
2581         if test "$enableval" != "yes" ; then
2582     with_stripping=no
2583         else
2584                 with_stripping=yes
2585         fi
2586 else
2587   enableval=yes
2588         with_stripping=yes
2589
2590 fi;
2591 echo "$as_me:2591: result: $with_stripping" >&5
2592 echo "${ECHO_T}$with_stripping" >&6
2593
2594 if test "$with_stripping" = yes
2595 then
2596         INSTALL_OPT_S="-s"
2597 else
2598         INSTALL_OPT_S=
2599 fi
2600
2601 : ${INSTALL:=install}
2602 echo "$as_me:2602: checking if install accepts -p option" >&5
2603 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2604 if test "${cf_cv_install_p+set}" = set; then
2605   echo $ECHO_N "(cached) $ECHO_C" >&6
2606 else
2607
2608         rm -rf conftest*
2609         date >conftest.in
2610         mkdir conftest.out
2611         sleep 3
2612         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2613         then
2614                 if test -f conftest.out/conftest.in
2615                 then
2616                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2617                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2618                         if test -s conftest.err
2619                         then
2620                                 cf_cv_install_p=no
2621                         else
2622                                 cf_cv_install_p=yes
2623                         fi
2624                 else
2625                         cf_cv_install_p=no
2626                 fi
2627         else
2628                 cf_cv_install_p=no
2629         fi
2630         rm -rf conftest*
2631
2632 fi
2633 echo "$as_me:2633: result: $cf_cv_install_p" >&5
2634 echo "${ECHO_T}$cf_cv_install_p" >&6
2635
2636 echo "$as_me:2636: checking if install needs to be told about ownership" >&5
2637 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2638 case `$ac_config_guess` in
2639 (*minix)
2640         with_install_o=yes
2641         ;;
2642 (*)
2643         with_install_o=no
2644         ;;
2645 esac
2646
2647 echo "$as_me:2647: result: $with_install_o" >&5
2648 echo "${ECHO_T}$with_install_o" >&6
2649 if test "x$with_install_o" = xyes
2650 then
2651         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2652 else
2653         INSTALL_OPT_O=
2654 fi
2655
2656 for ac_prog in lint cppcheck splint
2657 do
2658   # Extract the first word of "$ac_prog", so it can be a program name with args.
2659 set dummy $ac_prog; ac_word=$2
2660 echo "$as_me:2660: checking for $ac_word" >&5
2661 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2662 if test "${ac_cv_prog_LINT+set}" = set; then
2663   echo $ECHO_N "(cached) $ECHO_C" >&6
2664 else
2665   if test -n "$LINT"; then
2666   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2667 else
2668   ac_save_IFS=$IFS; IFS=$ac_path_separator
2669 ac_dummy="$PATH"
2670 for ac_dir in $ac_dummy; do
2671   IFS=$ac_save_IFS
2672   test -z "$ac_dir" && ac_dir=.
2673   $as_executable_p "$ac_dir/$ac_word" || continue
2674 ac_cv_prog_LINT="$ac_prog"
2675 echo "$as_me:2675: found $ac_dir/$ac_word" >&5
2676 break
2677 done
2678
2679 fi
2680 fi
2681 LINT=$ac_cv_prog_LINT
2682 if test -n "$LINT"; then
2683   echo "$as_me:2683: result: $LINT" >&5
2684 echo "${ECHO_T}$LINT" >&6
2685 else
2686   echo "$as_me:2686: result: no" >&5
2687 echo "${ECHO_T}no" >&6
2688 fi
2689
2690   test -n "$LINT" && break
2691 done
2692
2693 echo "$as_me:2693: checking if filesystem supports mixed-case filenames" >&5
2694 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2695 if test "${cf_cv_mixedcase+set}" = set; then
2696   echo $ECHO_N "(cached) $ECHO_C" >&6
2697 else
2698
2699 if test "$cross_compiling" = yes ; then
2700         case $target_alias in
2701         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2702                 cf_cv_mixedcase=no
2703                 ;;
2704         (*)
2705                 cf_cv_mixedcase=yes
2706                 ;;
2707         esac
2708 else
2709         rm -f conftest CONFTEST
2710         echo test >conftest
2711         if test -f CONFTEST ; then
2712                 cf_cv_mixedcase=no
2713         else
2714                 cf_cv_mixedcase=yes
2715         fi
2716         rm -f conftest CONFTEST
2717 fi
2718
2719 fi
2720 echo "$as_me:2720: result: $cf_cv_mixedcase" >&5
2721 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2722 test "$cf_cv_mixedcase" = yes &&
2723 cat >>confdefs.h <<\EOF
2724 #define MIXEDCASE_FILENAMES 1
2725 EOF
2726
2727 for ac_prog in exctags ctags
2728 do
2729   # Extract the first word of "$ac_prog", so it can be a program name with args.
2730 set dummy $ac_prog; ac_word=$2
2731 echo "$as_me:2731: checking for $ac_word" >&5
2732 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2733 if test "${ac_cv_prog_CTAGS+set}" = set; then
2734   echo $ECHO_N "(cached) $ECHO_C" >&6
2735 else
2736   if test -n "$CTAGS"; then
2737   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2738 else
2739   ac_save_IFS=$IFS; IFS=$ac_path_separator
2740 ac_dummy="$PATH"
2741 for ac_dir in $ac_dummy; do
2742   IFS=$ac_save_IFS
2743   test -z "$ac_dir" && ac_dir=.
2744   $as_executable_p "$ac_dir/$ac_word" || continue
2745 ac_cv_prog_CTAGS="$ac_prog"
2746 echo "$as_me:2746: found $ac_dir/$ac_word" >&5
2747 break
2748 done
2749
2750 fi
2751 fi
2752 CTAGS=$ac_cv_prog_CTAGS
2753 if test -n "$CTAGS"; then
2754   echo "$as_me:2754: result: $CTAGS" >&5
2755 echo "${ECHO_T}$CTAGS" >&6
2756 else
2757   echo "$as_me:2757: result: no" >&5
2758 echo "${ECHO_T}no" >&6
2759 fi
2760
2761   test -n "$CTAGS" && break
2762 done
2763
2764 for ac_prog in exetags etags
2765 do
2766   # Extract the first word of "$ac_prog", so it can be a program name with args.
2767 set dummy $ac_prog; ac_word=$2
2768 echo "$as_me:2768: checking for $ac_word" >&5
2769 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2770 if test "${ac_cv_prog_ETAGS+set}" = set; then
2771   echo $ECHO_N "(cached) $ECHO_C" >&6
2772 else
2773   if test -n "$ETAGS"; then
2774   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2775 else
2776   ac_save_IFS=$IFS; IFS=$ac_path_separator
2777 ac_dummy="$PATH"
2778 for ac_dir in $ac_dummy; do
2779   IFS=$ac_save_IFS
2780   test -z "$ac_dir" && ac_dir=.
2781   $as_executable_p "$ac_dir/$ac_word" || continue
2782 ac_cv_prog_ETAGS="$ac_prog"
2783 echo "$as_me:2783: found $ac_dir/$ac_word" >&5
2784 break
2785 done
2786
2787 fi
2788 fi
2789 ETAGS=$ac_cv_prog_ETAGS
2790 if test -n "$ETAGS"; then
2791   echo "$as_me:2791: result: $ETAGS" >&5
2792 echo "${ECHO_T}$ETAGS" >&6
2793 else
2794   echo "$as_me:2794: result: no" >&5
2795 echo "${ECHO_T}no" >&6
2796 fi
2797
2798   test -n "$ETAGS" && break
2799 done
2800
2801 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2802 set dummy ${CTAGS:-ctags}; ac_word=$2
2803 echo "$as_me:2803: checking for $ac_word" >&5
2804 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2805 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2806   echo $ECHO_N "(cached) $ECHO_C" >&6
2807 else
2808   if test -n "$MAKE_LOWER_TAGS"; then
2809   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2810 else
2811   ac_save_IFS=$IFS; IFS=$ac_path_separator
2812 ac_dummy="$PATH"
2813 for ac_dir in $ac_dummy; do
2814   IFS=$ac_save_IFS
2815   test -z "$ac_dir" && ac_dir=.
2816   $as_executable_p "$ac_dir/$ac_word" || continue
2817 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2818 echo "$as_me:2818: found $ac_dir/$ac_word" >&5
2819 break
2820 done
2821
2822   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2823 fi
2824 fi
2825 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2826 if test -n "$MAKE_LOWER_TAGS"; then
2827   echo "$as_me:2827: result: $MAKE_LOWER_TAGS" >&5
2828 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2829 else
2830   echo "$as_me:2830: result: no" >&5
2831 echo "${ECHO_T}no" >&6
2832 fi
2833
2834 if test "$cf_cv_mixedcase" = yes ; then
2835         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2836 set dummy ${ETAGS:-etags}; ac_word=$2
2837 echo "$as_me:2837: checking for $ac_word" >&5
2838 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2839 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2840   echo $ECHO_N "(cached) $ECHO_C" >&6
2841 else
2842   if test -n "$MAKE_UPPER_TAGS"; then
2843   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2844 else
2845   ac_save_IFS=$IFS; IFS=$ac_path_separator
2846 ac_dummy="$PATH"
2847 for ac_dir in $ac_dummy; do
2848   IFS=$ac_save_IFS
2849   test -z "$ac_dir" && ac_dir=.
2850   $as_executable_p "$ac_dir/$ac_word" || continue
2851 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2852 echo "$as_me:2852: found $ac_dir/$ac_word" >&5
2853 break
2854 done
2855
2856   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2857 fi
2858 fi
2859 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2860 if test -n "$MAKE_UPPER_TAGS"; then
2861   echo "$as_me:2861: result: $MAKE_UPPER_TAGS" >&5
2862 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2863 else
2864   echo "$as_me:2864: result: no" >&5
2865 echo "${ECHO_T}no" >&6
2866 fi
2867
2868 else
2869         MAKE_UPPER_TAGS=no
2870 fi
2871
2872 if test "$MAKE_UPPER_TAGS" = yes ; then
2873         MAKE_UPPER_TAGS=
2874 else
2875         MAKE_UPPER_TAGS="#"
2876 fi
2877
2878 if test "$MAKE_LOWER_TAGS" = yes ; then
2879         MAKE_LOWER_TAGS=
2880 else
2881         MAKE_LOWER_TAGS="#"
2882 fi
2883
2884 echo "$as_me:2884: checking if -lm needed for math functions" >&5
2885 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2886 if test "${cf_cv_need_libm+set}" = set; then
2887   echo $ECHO_N "(cached) $ECHO_C" >&6
2888 else
2889
2890         cat >conftest.$ac_ext <<_ACEOF
2891 #line 2891 "configure"
2892 #include "confdefs.h"
2893
2894         #include <stdio.h>
2895         #include <stdlib.h>
2896         #include <math.h>
2897
2898 int
2899 main (void)
2900 {
2901 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2902   ;
2903   return 0;
2904 }
2905 _ACEOF
2906 rm -f conftest.$ac_objext conftest$ac_exeext
2907 if { (eval echo "$as_me:2907: \"$ac_link\"") >&5
2908   (eval $ac_link) 2>&5
2909   ac_status=$?
2910   echo "$as_me:2910: \$? = $ac_status" >&5
2911   (exit $ac_status); } &&
2912          { ac_try='test -s conftest$ac_exeext'
2913   { (eval echo "$as_me:2913: \"$ac_try\"") >&5
2914   (eval $ac_try) 2>&5
2915   ac_status=$?
2916   echo "$as_me:2916: \$? = $ac_status" >&5
2917   (exit $ac_status); }; }; then
2918   cf_cv_need_libm=no
2919 else
2920   echo "$as_me: failed program was:" >&5
2921 cat conftest.$ac_ext >&5
2922 cf_cv_need_libm=yes
2923 fi
2924 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2925 fi
2926 echo "$as_me:2926: result: $cf_cv_need_libm" >&5
2927 echo "${ECHO_T}$cf_cv_need_libm" >&6
2928 if test "$cf_cv_need_libm" = yes
2929 then
2930 MATH_LIB=-lm
2931 fi
2932
2933 top_builddir=`pwd`
2934
2935 CC_G_OPT="-g"
2936 CC_SHARED_OPTS=unknown
2937 CPPFLAGS="$CPPFLAGS"
2938 DFT_DEP_SUFFIX=""
2939 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2940 DFT_UPR_MODEL="NORMAL"
2941 LD="ld"
2942 LDFLAGS_SHARED=""
2943 LDFLAGS_STATIC=""
2944 LD_MODEL=""
2945 LD_SHARED_OPTS=""
2946 LIBTOOL=""
2947 LIBTOOL_OPTS=""
2948 LIB_CLEAN=""
2949 LIB_COMPILE=""
2950 LIB_LINK='${CC}'
2951 LINK_TESTS=""
2952 LOCAL_LDFLAGS=""
2953 PACKAGE="ncurses-examples"
2954 PTHREAD="-lm"
2955 TEST_ARGS=""
2956 TEST_DEPS=""
2957 TEST_LIBS=""
2958 TINFO_LDFLAGS=''
2959 TINFO_LIBS='$(LIBS_CURSES)'
2960 cf_cv_abi_version=""
2961 cf_cv_rel_version=""
2962 includesubdir=""
2963
2964 cf_cv_screen=curses
2965 cf_cv_libtype=
2966
2967 if test "$GCC" = yes
2968 then
2969 cat > conftest.i <<EOF
2970 #ifndef GCC_PRINTF
2971 #define GCC_PRINTF 0
2972 #endif
2973 #ifndef GCC_SCANF
2974 #define GCC_SCANF 0
2975 #endif
2976 #ifndef GCC_NORETURN
2977 #define GCC_NORETURN /* nothing */
2978 #endif
2979 #ifndef GCC_UNUSED
2980 #define GCC_UNUSED /* nothing */
2981 #endif
2982 EOF
2983 if test "$GCC" = yes
2984 then
2985         { echo "$as_me:2985: checking for $CC __attribute__ directives..." >&5
2986 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2987 cat > conftest.$ac_ext <<EOF
2988 #line 2988 "${as_me:-configure}"
2989 #include "confdefs.h"
2990 #include "conftest.h"
2991 #include "conftest.i"
2992 #if     GCC_PRINTF
2993 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2994 #else
2995 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2996 #endif
2997 #if     GCC_SCANF
2998 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2999 #else
3000 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3001 #endif
3002 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3003 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3004 extern void foo(void) GCC_NORETURN;
3005 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3006 EOF
3007         cf_printf_attribute=no
3008         cf_scanf_attribute=no
3009         for cf_attribute in scanf printf unused noreturn
3010         do
3011
3012 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3013
3014                 cf_directive="__attribute__(($cf_attribute))"
3015                 echo "checking for $CC $cf_directive" 1>&5
3016
3017                 case $cf_attribute in
3018                 (printf)
3019                         cf_printf_attribute=yes
3020                         cat >conftest.h <<EOF
3021 #define GCC_$cf_ATTRIBUTE 1
3022 EOF
3023                         ;;
3024                 (scanf)
3025                         cf_scanf_attribute=yes
3026                         cat >conftest.h <<EOF
3027 #define GCC_$cf_ATTRIBUTE 1
3028 EOF
3029                         ;;
3030                 (*)
3031                         cat >conftest.h <<EOF
3032 #define GCC_$cf_ATTRIBUTE $cf_directive
3033 EOF
3034                         ;;
3035                 esac
3036
3037                 if { (eval echo "$as_me:3037: \"$ac_compile\"") >&5
3038   (eval $ac_compile) 2>&5
3039   ac_status=$?
3040   echo "$as_me:3040: \$? = $ac_status" >&5
3041   (exit $ac_status); }; then
3042                         test -n "$verbose" && echo "$as_me:3042: result: ... $cf_attribute" >&5
3043 echo "${ECHO_T}... $cf_attribute" >&6
3044                         cat conftest.h >>confdefs.h
3045                         case $cf_attribute in
3046                         (noreturn)
3047
3048 cat >>confdefs.h <<EOF
3049 #define GCC_NORETURN $cf_directive
3050 EOF
3051
3052                                 ;;
3053                         (printf)
3054                                 cf_value='/* nothing */'
3055                                 if test "$cf_printf_attribute" != no ; then
3056                                         cf_value='__attribute__((format(printf,fmt,var)))'
3057
3058 cat >>confdefs.h <<\EOF
3059 #define GCC_PRINTF 1
3060 EOF
3061
3062                                 fi
3063
3064 cat >>confdefs.h <<EOF
3065 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3066 EOF
3067
3068                                 ;;
3069                         (scanf)
3070                                 cf_value='/* nothing */'
3071                                 if test "$cf_scanf_attribute" != no ; then
3072                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3073
3074 cat >>confdefs.h <<\EOF
3075 #define GCC_SCANF 1
3076 EOF
3077
3078                                 fi
3079
3080 cat >>confdefs.h <<EOF
3081 #define GCC_SCANFLIKE(fmt,var) $cf_value
3082 EOF
3083
3084                                 ;;
3085                         (unused)
3086
3087 cat >>confdefs.h <<EOF
3088 #define GCC_UNUSED $cf_directive
3089 EOF
3090
3091                                 ;;
3092                         esac
3093                 fi
3094         done
3095 else
3096         fgrep define conftest.i >>confdefs.h
3097 fi
3098 rm -rf conftest*
3099 fi
3100
3101 echo "$as_me:3101: checking if you want to work around bogus compiler/loader warnings" >&5
3102 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3103
3104 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3105 if test "${enable_string_hacks+set}" = set; then
3106   enableval="$enable_string_hacks"
3107   with_string_hacks=$enableval
3108 else
3109   with_string_hacks=no
3110 fi;
3111 echo "$as_me:3111: result: $with_string_hacks" >&5
3112 echo "${ECHO_T}$with_string_hacks" >&6
3113
3114 if test "x$with_string_hacks" = "xyes"; then
3115
3116 cat >>confdefs.h <<\EOF
3117 #define USE_STRING_HACKS 1
3118 EOF
3119
3120         { echo "$as_me:3120: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3121 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3122         echo "$as_me:3122: checking for strlcat" >&5
3123 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3124 if test "${ac_cv_func_strlcat+set}" = set; then
3125   echo $ECHO_N "(cached) $ECHO_C" >&6
3126 else
3127   cat >conftest.$ac_ext <<_ACEOF
3128 #line 3128 "configure"
3129 #include "confdefs.h"
3130 /* System header to define __stub macros and hopefully few prototypes,
3131     which can conflict with char strlcat (); below.  */
3132 #include <assert.h>
3133 /* Override any gcc2 internal prototype to avoid an error.  */
3134 #ifdef __cplusplus
3135 extern "C"
3136 #endif
3137 /* We use char because int might match the return type of a gcc2
3138    builtin and then its argument prototype would still apply.  */
3139 char strlcat ();
3140 char (*f) ();
3141
3142 int
3143 main (void)
3144 {
3145 /* The GNU C library defines this for functions which it implements
3146     to always fail with ENOSYS.  Some functions are actually named
3147     something starting with __ and the normal name is an alias.  */
3148 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3149 choke me
3150 #else
3151 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3152 #endif
3153
3154   ;
3155   return 0;
3156 }
3157 _ACEOF
3158 rm -f conftest.$ac_objext conftest$ac_exeext
3159 if { (eval echo "$as_me:3159: \"$ac_link\"") >&5
3160   (eval $ac_link) 2>&5
3161   ac_status=$?
3162   echo "$as_me:3162: \$? = $ac_status" >&5
3163   (exit $ac_status); } &&
3164          { ac_try='test -s conftest$ac_exeext'
3165   { (eval echo "$as_me:3165: \"$ac_try\"") >&5
3166   (eval $ac_try) 2>&5
3167   ac_status=$?
3168   echo "$as_me:3168: \$? = $ac_status" >&5
3169   (exit $ac_status); }; }; then
3170   ac_cv_func_strlcat=yes
3171 else
3172   echo "$as_me: failed program was:" >&5
3173 cat conftest.$ac_ext >&5
3174 ac_cv_func_strlcat=no
3175 fi
3176 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3177 fi
3178 echo "$as_me:3178: result: $ac_cv_func_strlcat" >&5
3179 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3180 if test $ac_cv_func_strlcat = yes; then
3181
3182 cat >>confdefs.h <<\EOF
3183 #define HAVE_STRLCAT 1
3184 EOF
3185
3186 else
3187
3188                 echo "$as_me:3188: checking for strlcat in -lbsd" >&5
3189 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3190 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3191   echo $ECHO_N "(cached) $ECHO_C" >&6
3192 else
3193   ac_check_lib_save_LIBS=$LIBS
3194 LIBS="-lbsd  $LIBS"
3195 cat >conftest.$ac_ext <<_ACEOF
3196 #line 3196 "configure"
3197 #include "confdefs.h"
3198
3199 /* Override any gcc2 internal prototype to avoid an error.  */
3200 #ifdef __cplusplus
3201 extern "C"
3202 #endif
3203 /* We use char because int might match the return type of a gcc2
3204    builtin and then its argument prototype would still apply.  */
3205 char strlcat ();
3206 int
3207 main (void)
3208 {
3209 strlcat ();
3210   ;
3211   return 0;
3212 }
3213 _ACEOF
3214 rm -f conftest.$ac_objext conftest$ac_exeext
3215 if { (eval echo "$as_me:3215: \"$ac_link\"") >&5
3216   (eval $ac_link) 2>&5
3217   ac_status=$?
3218   echo "$as_me:3218: \$? = $ac_status" >&5
3219   (exit $ac_status); } &&
3220          { ac_try='test -s conftest$ac_exeext'
3221   { (eval echo "$as_me:3221: \"$ac_try\"") >&5
3222   (eval $ac_try) 2>&5
3223   ac_status=$?
3224   echo "$as_me:3224: \$? = $ac_status" >&5
3225   (exit $ac_status); }; }; then
3226   ac_cv_lib_bsd_strlcat=yes
3227 else
3228   echo "$as_me: failed program was:" >&5
3229 cat conftest.$ac_ext >&5
3230 ac_cv_lib_bsd_strlcat=no
3231 fi
3232 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3233 LIBS=$ac_check_lib_save_LIBS
3234 fi
3235 echo "$as_me:3235: result: $ac_cv_lib_bsd_strlcat" >&5
3236 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3237 if test $ac_cv_lib_bsd_strlcat = yes; then
3238
3239 cf_add_libs="-lbsd"
3240 # Filter out duplicates - this happens with badly-designed ".pc" files...
3241 for cf_add_1lib in $LIBS
3242 do
3243         for cf_add_2lib in $cf_add_libs
3244         do
3245                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3246                 then
3247                         cf_add_1lib=
3248                         break
3249                 fi
3250         done
3251         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3252 done
3253 LIBS="$cf_add_libs"
3254
3255 for ac_header in bsd/string.h
3256 do
3257 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3258 echo "$as_me:3258: checking for $ac_header" >&5
3259 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3260 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3261   echo $ECHO_N "(cached) $ECHO_C" >&6
3262 else
3263   cat >conftest.$ac_ext <<_ACEOF
3264 #line 3264 "configure"
3265 #include "confdefs.h"
3266 #include <$ac_header>
3267 _ACEOF
3268 if { (eval echo "$as_me:3268: \"$ac_cpp conftest.$ac_ext\"") >&5
3269   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3270   ac_status=$?
3271   egrep -v '^ *\+' conftest.er1 >conftest.err
3272   rm -f conftest.er1
3273   cat conftest.err >&5
3274   echo "$as_me:3274: \$? = $ac_status" >&5
3275   (exit $ac_status); } >/dev/null; then
3276   if test -s conftest.err; then
3277     ac_cpp_err=$ac_c_preproc_warn_flag
3278   else
3279     ac_cpp_err=
3280   fi
3281 else
3282   ac_cpp_err=yes
3283 fi
3284 if test -z "$ac_cpp_err"; then
3285   eval "$as_ac_Header=yes"
3286 else
3287   echo "$as_me: failed program was:" >&5
3288   cat conftest.$ac_ext >&5
3289   eval "$as_ac_Header=no"
3290 fi
3291 rm -f conftest.err conftest.$ac_ext
3292 fi
3293 echo "$as_me:3293: result: `eval echo '${'$as_ac_Header'}'`" >&5
3294 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3295 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3296   cat >>confdefs.h <<EOF
3297 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3298 EOF
3299
3300 fi
3301 done
3302
3303 cat >>confdefs.h <<\EOF
3304 #define HAVE_STRLCAT 1
3305 EOF
3306
3307 fi
3308
3309 fi
3310
3311 for ac_func in strlcpy snprintf
3312 do
3313 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3314 echo "$as_me:3314: checking for $ac_func" >&5
3315 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3316 if eval "test \"\${$as_ac_var+set}\" = set"; then
3317   echo $ECHO_N "(cached) $ECHO_C" >&6
3318 else
3319   cat >conftest.$ac_ext <<_ACEOF
3320 #line 3320 "configure"
3321 #include "confdefs.h"
3322 /* System header to define __stub macros and hopefully few prototypes,
3323     which can conflict with char $ac_func (); below.  */
3324 #include <assert.h>
3325 /* Override any gcc2 internal prototype to avoid an error.  */
3326 #ifdef __cplusplus
3327 extern "C"
3328 #endif
3329 /* We use char because int might match the return type of a gcc2
3330    builtin and then its argument prototype would still apply.  */
3331 char $ac_func ();
3332 char (*f) ();
3333
3334 int
3335 main (void)
3336 {
3337 /* The GNU C library defines this for functions which it implements
3338     to always fail with ENOSYS.  Some functions are actually named
3339     something starting with __ and the normal name is an alias.  */
3340 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3341 choke me
3342 #else
3343 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3344 #endif
3345
3346   ;
3347   return 0;
3348 }
3349 _ACEOF
3350 rm -f conftest.$ac_objext conftest$ac_exeext
3351 if { (eval echo "$as_me:3351: \"$ac_link\"") >&5
3352   (eval $ac_link) 2>&5
3353   ac_status=$?
3354   echo "$as_me:3354: \$? = $ac_status" >&5
3355   (exit $ac_status); } &&
3356          { ac_try='test -s conftest$ac_exeext'
3357   { (eval echo "$as_me:3357: \"$ac_try\"") >&5
3358   (eval $ac_try) 2>&5
3359   ac_status=$?
3360   echo "$as_me:3360: \$? = $ac_status" >&5
3361   (exit $ac_status); }; }; then
3362   eval "$as_ac_var=yes"
3363 else
3364   echo "$as_me: failed program was:" >&5
3365 cat conftest.$ac_ext >&5
3366 eval "$as_ac_var=no"
3367 fi
3368 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3369 fi
3370 echo "$as_me:3370: result: `eval echo '${'$as_ac_var'}'`" >&5
3371 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3372 if test `eval echo '${'$as_ac_var'}'` = yes; then
3373   cat >>confdefs.h <<EOF
3374 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3375 EOF
3376
3377 fi
3378 done
3379
3380 fi
3381
3382 cf_XOPEN_SOURCE=600
3383 cf_POSIX_C_SOURCE=199506L
3384 cf_xopen_source=
3385
3386 case $host_os in
3387 (aix[4-7]*)
3388         cf_xopen_source="-D_ALL_SOURCE"
3389         ;;
3390 (msys)
3391         cf_XOPEN_SOURCE=600
3392         ;;
3393 (darwin[0-8].*)
3394         cf_xopen_source="-D_APPLE_C_SOURCE"
3395         ;;
3396 (darwin*)
3397         cf_xopen_source="-D_DARWIN_C_SOURCE"
3398         cf_XOPEN_SOURCE=
3399         ;;
3400 (freebsd*|dragonfly*)
3401         # 5.x headers associate
3402         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3403         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3404         cf_POSIX_C_SOURCE=200112L
3405         cf_XOPEN_SOURCE=600
3406         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3407         ;;
3408 (hpux11*)
3409         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3410         ;;
3411 (hpux*)
3412         cf_xopen_source="-D_HPUX_SOURCE"
3413         ;;
3414 (irix[56].*)
3415         cf_xopen_source="-D_SGI_SOURCE"
3416         cf_XOPEN_SOURCE=
3417         ;;
3418 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3419
3420 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3421
3422 echo "$as_me:3422: checking if this is the GNU C library" >&5
3423 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3424 if test "${cf_cv_gnu_library+set}" = set; then
3425   echo $ECHO_N "(cached) $ECHO_C" >&6
3426 else
3427
3428 cat >conftest.$ac_ext <<_ACEOF
3429 #line 3429 "configure"
3430 #include "confdefs.h"
3431 #include <sys/types.h>
3432 int
3433 main (void)
3434 {
3435
3436         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3437                 return 0;
3438         #else
3439         #       error not GNU C library
3440         #endif
3441   ;
3442   return 0;
3443 }
3444 _ACEOF
3445 rm -f conftest.$ac_objext
3446 if { (eval echo "$as_me:3446: \"$ac_compile\"") >&5
3447   (eval $ac_compile) 2>&5
3448   ac_status=$?
3449   echo "$as_me:3449: \$? = $ac_status" >&5
3450   (exit $ac_status); } &&
3451          { ac_try='test -s conftest.$ac_objext'
3452   { (eval echo "$as_me:3452: \"$ac_try\"") >&5
3453   (eval $ac_try) 2>&5
3454   ac_status=$?
3455   echo "$as_me:3455: \$? = $ac_status" >&5
3456   (exit $ac_status); }; }; then
3457   cf_cv_gnu_library=yes
3458 else
3459   echo "$as_me: failed program was:" >&5
3460 cat conftest.$ac_ext >&5
3461 cf_cv_gnu_library=no
3462 fi
3463 rm -f conftest.$ac_objext conftest.$ac_ext
3464
3465 fi
3466 echo "$as_me:3466: result: $cf_cv_gnu_library" >&5
3467 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3468
3469 if test x$cf_cv_gnu_library = xyes; then
3470
3471         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3472         # was changed to help a little...
3473         echo "$as_me:3473: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3474 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3475 if test "${cf_cv_gnu_library_219+set}" = set; then
3476   echo $ECHO_N "(cached) $ECHO_C" >&6
3477 else
3478
3479                 cf_save="$CPPFLAGS"
3480
3481         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3482         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3483
3484                 cat >conftest.$ac_ext <<_ACEOF
3485 #line 3485 "configure"
3486 #include "confdefs.h"
3487 #include <sys/types.h>
3488 int
3489 main (void)
3490 {
3491
3492                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3493                                 return 0;
3494                         #else
3495                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3496                         #endif
3497   ;
3498   return 0;
3499 }
3500 _ACEOF
3501 rm -f conftest.$ac_objext
3502 if { (eval echo "$as_me:3502: \"$ac_compile\"") >&5
3503   (eval $ac_compile) 2>&5
3504   ac_status=$?
3505   echo "$as_me:3505: \$? = $ac_status" >&5
3506   (exit $ac_status); } &&
3507          { ac_try='test -s conftest.$ac_objext'
3508   { (eval echo "$as_me:3508: \"$ac_try\"") >&5
3509   (eval $ac_try) 2>&5
3510   ac_status=$?
3511   echo "$as_me:3511: \$? = $ac_status" >&5
3512   (exit $ac_status); }; }; then
3513   cf_cv_gnu_library_219=yes
3514 else
3515   echo "$as_me: failed program was:" >&5
3516 cat conftest.$ac_ext >&5
3517 cf_cv_gnu_library_219=no
3518 fi
3519 rm -f conftest.$ac_objext conftest.$ac_ext
3520                 CPPFLAGS="$cf_save"
3521
3522 fi
3523 echo "$as_me:3523: result: $cf_cv_gnu_library_219" >&5
3524 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3525
3526         if test "x$cf_cv_gnu_library_219" = xyes; then
3527                 cf_save="$CPPFLAGS"
3528                 echo "$as_me:3528: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3529 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3530 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3531   echo $ECHO_N "(cached) $ECHO_C" >&6
3532 else
3533
3534 cf_fix_cppflags=no
3535 cf_new_cflags=
3536 cf_new_cppflags=
3537 cf_new_extra_cppflags=
3538
3539 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3540 do
3541 case $cf_fix_cppflags in
3542 (no)
3543         case $cf_add_cflags in
3544         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3545                 case $cf_add_cflags in
3546                 (-D*)
3547                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3548
3549                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3550                                 && test -z "${cf_tst_cflags}" \
3551                                 && cf_fix_cppflags=yes
3552
3553                         if test $cf_fix_cppflags = yes ; then
3554
3555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3557
3558                                 continue
3559                         elif test "${cf_tst_cflags}" = "\"'" ; then
3560
3561         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3562         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3563
3564                                 continue
3565                         fi
3566                         ;;
3567                 esac
3568                 case "$CPPFLAGS" in
3569                 (*$cf_add_cflags)
3570                         ;;
3571                 (*)
3572                         case $cf_add_cflags in
3573                         (-D*)
3574                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3575
3576 CPPFLAGS=`echo "$CPPFLAGS" | \
3577         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3578                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3579
3580                                 ;;
3581                         esac
3582
3583         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3584         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3585
3586                         ;;
3587                 esac
3588                 ;;
3589         (*)
3590
3591         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3592         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3593
3594                 ;;
3595         esac
3596         ;;
3597 (yes)
3598
3599         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3600         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3601
3602         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3603
3604         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3605                 && test -z "${cf_tst_cflags}" \
3606                 && cf_fix_cppflags=no
3607         ;;
3608 esac
3609 done
3610
3611 if test -n "$cf_new_cflags" ; then
3612
3613         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3614         CFLAGS="${CFLAGS}$cf_new_cflags"
3615
3616 fi
3617
3618 if test -n "$cf_new_cppflags" ; then
3619
3620         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3621         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3622
3623 fi
3624
3625 if test -n "$cf_new_extra_cppflags" ; then
3626
3627         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3628         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3629
3630 fi
3631
3632                         cat >conftest.$ac_ext <<_ACEOF
3633 #line 3633 "configure"
3634 #include "confdefs.h"
3635
3636                                 #include <limits.h>
3637                                 #include <sys/types.h>
3638
3639 int
3640 main (void)
3641 {
3642
3643                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3644                                         return 0;
3645                                 #else
3646                                 #       error GNU C library is too old
3647                                 #endif
3648   ;
3649   return 0;
3650 }
3651 _ACEOF
3652 rm -f conftest.$ac_objext
3653 if { (eval echo "$as_me:3653: \"$ac_compile\"") >&5
3654   (eval $ac_compile) 2>&5
3655   ac_status=$?
3656   echo "$as_me:3656: \$? = $ac_status" >&5
3657   (exit $ac_status); } &&
3658          { ac_try='test -s conftest.$ac_objext'
3659   { (eval echo "$as_me:3659: \"$ac_try\"") >&5
3660   (eval $ac_try) 2>&5
3661   ac_status=$?
3662   echo "$as_me:3662: \$? = $ac_status" >&5
3663   (exit $ac_status); }; }; then
3664   cf_cv_gnu_dftsrc_219=yes
3665 else
3666   echo "$as_me: failed program was:" >&5
3667 cat conftest.$ac_ext >&5
3668 cf_cv_gnu_dftsrc_219=no
3669 fi
3670 rm -f conftest.$ac_objext conftest.$ac_ext
3671
3672 fi
3673 echo "$as_me:3673: result: $cf_cv_gnu_dftsrc_219" >&5
3674 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3675                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3676         else
3677                 cf_cv_gnu_dftsrc_219=maybe
3678         fi
3679
3680         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3681
3682                 echo "$as_me:3682: checking if we must define _GNU_SOURCE" >&5
3683 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3684 if test "${cf_cv_gnu_source+set}" = set; then
3685   echo $ECHO_N "(cached) $ECHO_C" >&6
3686 else
3687
3688                 cat >conftest.$ac_ext <<_ACEOF
3689 #line 3689 "configure"
3690 #include "confdefs.h"
3691 #include <sys/types.h>
3692 int
3693 main (void)
3694 {
3695
3696                         #ifndef _XOPEN_SOURCE
3697                         #error  expected _XOPEN_SOURCE to be defined
3698                         #endif
3699   ;
3700   return 0;
3701 }
3702 _ACEOF
3703 rm -f conftest.$ac_objext
3704 if { (eval echo "$as_me:3704: \"$ac_compile\"") >&5
3705   (eval $ac_compile) 2>&5
3706   ac_status=$?
3707   echo "$as_me:3707: \$? = $ac_status" >&5
3708   (exit $ac_status); } &&
3709          { ac_try='test -s conftest.$ac_objext'
3710   { (eval echo "$as_me:3710: \"$ac_try\"") >&5
3711   (eval $ac_try) 2>&5
3712   ac_status=$?
3713   echo "$as_me:3713: \$? = $ac_status" >&5
3714   (exit $ac_status); }; }; then
3715   cf_cv_gnu_source=no
3716 else
3717   echo "$as_me: failed program was:" >&5
3718 cat conftest.$ac_ext >&5
3719 cf_save="$CPPFLAGS"
3720
3721 cf_fix_cppflags=no
3722 cf_new_cflags=
3723 cf_new_cppflags=
3724 cf_new_extra_cppflags=
3725
3726 for cf_add_cflags in -D_GNU_SOURCE
3727 do
3728 case $cf_fix_cppflags in
3729 (no)
3730         case $cf_add_cflags in
3731         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3732                 case $cf_add_cflags in
3733                 (-D*)
3734                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3735
3736                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3737                                 && test -z "${cf_tst_cflags}" \
3738                                 && cf_fix_cppflags=yes
3739
3740                         if test $cf_fix_cppflags = yes ; then
3741
3742         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3743         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3744
3745                                 continue
3746                         elif test "${cf_tst_cflags}" = "\"'" ; then
3747
3748         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3749         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3750
3751                                 continue
3752                         fi
3753                         ;;
3754                 esac
3755                 case "$CPPFLAGS" in
3756                 (*$cf_add_cflags)
3757                         ;;
3758                 (*)
3759                         case $cf_add_cflags in
3760                         (-D*)
3761                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3762
3763 CPPFLAGS=`echo "$CPPFLAGS" | \
3764         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3765                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3766
3767                                 ;;
3768                         esac
3769
3770         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3771         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3772
3773                         ;;
3774                 esac
3775                 ;;
3776         (*)
3777
3778         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3779         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3780
3781                 ;;
3782         esac
3783         ;;
3784 (yes)
3785
3786         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3787         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3788
3789         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3790
3791         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3792                 && test -z "${cf_tst_cflags}" \
3793                 && cf_fix_cppflags=no
3794         ;;
3795 esac
3796 done
3797
3798 if test -n "$cf_new_cflags" ; then
3799
3800         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3801         CFLAGS="${CFLAGS}$cf_new_cflags"
3802
3803 fi
3804
3805 if test -n "$cf_new_cppflags" ; then
3806
3807         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3808         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3809
3810 fi
3811
3812 if test -n "$cf_new_extra_cppflags" ; then
3813
3814         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3815         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3816
3817 fi
3818
3819                          cat >conftest.$ac_ext <<_ACEOF
3820 #line 3820 "configure"
3821 #include "confdefs.h"
3822 #include <sys/types.h>
3823 int
3824 main (void)
3825 {
3826
3827                                 #ifdef _XOPEN_SOURCE
3828                                 #error  expected _XOPEN_SOURCE to be undefined
3829                                 #endif
3830   ;
3831   return 0;
3832 }
3833 _ACEOF
3834 rm -f conftest.$ac_objext
3835 if { (eval echo "$as_me:3835: \"$ac_compile\"") >&5
3836   (eval $ac_compile) 2>&5
3837   ac_status=$?
3838   echo "$as_me:3838: \$? = $ac_status" >&5
3839   (exit $ac_status); } &&
3840          { ac_try='test -s conftest.$ac_objext'
3841   { (eval echo "$as_me:3841: \"$ac_try\"") >&5
3842   (eval $ac_try) 2>&5
3843   ac_status=$?
3844   echo "$as_me:3844: \$? = $ac_status" >&5
3845   (exit $ac_status); }; }; then
3846   cf_cv_gnu_source=no
3847 else
3848   echo "$as_me: failed program was:" >&5
3849 cat conftest.$ac_ext >&5
3850 cf_cv_gnu_source=yes
3851 fi
3852 rm -f conftest.$ac_objext conftest.$ac_ext
3853                         CPPFLAGS="$cf_save"
3854
3855 fi
3856 rm -f conftest.$ac_objext conftest.$ac_ext
3857
3858 fi
3859 echo "$as_me:3859: result: $cf_cv_gnu_source" >&5
3860 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3861
3862                 if test "$cf_cv_gnu_source" = yes
3863                 then
3864                 echo "$as_me:3864: checking if we should also define _DEFAULT_SOURCE" >&5
3865 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3866 if test "${cf_cv_default_source+set}" = set; then
3867   echo $ECHO_N "(cached) $ECHO_C" >&6
3868 else
3869
3870         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3871         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
3872
3873                         cat >conftest.$ac_ext <<_ACEOF
3874 #line 3874 "configure"
3875 #include "confdefs.h"
3876 #include <sys/types.h>
3877 int
3878 main (void)
3879 {
3880
3881                                 #ifdef _DEFAULT_SOURCE
3882                                 #error  expected _DEFAULT_SOURCE to be undefined
3883                                 #endif
3884   ;
3885   return 0;
3886 }
3887 _ACEOF
3888 rm -f conftest.$ac_objext
3889 if { (eval echo "$as_me:3889: \"$ac_compile\"") >&5
3890   (eval $ac_compile) 2>&5
3891   ac_status=$?
3892   echo "$as_me:3892: \$? = $ac_status" >&5
3893   (exit $ac_status); } &&
3894          { ac_try='test -s conftest.$ac_objext'
3895   { (eval echo "$as_me:3895: \"$ac_try\"") >&5
3896   (eval $ac_try) 2>&5
3897   ac_status=$?
3898   echo "$as_me:3898: \$? = $ac_status" >&5
3899   (exit $ac_status); }; }; then
3900   cf_cv_default_source=no
3901 else
3902   echo "$as_me: failed program was:" >&5
3903 cat conftest.$ac_ext >&5
3904 cf_cv_default_source=yes
3905 fi
3906 rm -f conftest.$ac_objext conftest.$ac_ext
3907
3908 fi
3909 echo "$as_me:3909: result: $cf_cv_default_source" >&5
3910 echo "${ECHO_T}$cf_cv_default_source" >&6
3911                         if test "$cf_cv_default_source" = yes
3912                         then
3913
3914         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3915         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3916
3917                         fi
3918                 fi
3919         fi
3920
3921 fi
3922
3923         ;;
3924 (minix*)
3925         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3926         ;;
3927 (mirbsd*)
3928         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3929         cf_XOPEN_SOURCE=
3930
3931 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3932
3933 cf_save_CFLAGS="$CFLAGS"
3934 cf_save_CPPFLAGS="$CPPFLAGS"
3935
3936 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3937         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3938                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3939
3940 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3941         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3942                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3943
3944 echo "$as_me:3944: checking if we should define _POSIX_C_SOURCE" >&5
3945 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3946 if test "${cf_cv_posix_c_source+set}" = set; then
3947   echo $ECHO_N "(cached) $ECHO_C" >&6
3948 else
3949
3950 echo "${as_me:-configure}:3950: testing if the symbol is already defined go no further ..." 1>&5
3951
3952         cat >conftest.$ac_ext <<_ACEOF
3953 #line 3953 "configure"
3954 #include "confdefs.h"
3955 #include <sys/types.h>
3956 int
3957 main (void)
3958 {
3959
3960 #ifndef _POSIX_C_SOURCE
3961 make an error
3962 #endif
3963   ;
3964   return 0;
3965 }
3966 _ACEOF
3967 rm -f conftest.$ac_objext
3968 if { (eval echo "$as_me:3968: \"$ac_compile\"") >&5
3969   (eval $ac_compile) 2>&5
3970   ac_status=$?
3971   echo "$as_me:3971: \$? = $ac_status" >&5
3972   (exit $ac_status); } &&
3973          { ac_try='test -s conftest.$ac_objext'
3974   { (eval echo "$as_me:3974: \"$ac_try\"") >&5
3975   (eval $ac_try) 2>&5
3976   ac_status=$?
3977   echo "$as_me:3977: \$? = $ac_status" >&5
3978   (exit $ac_status); }; }; then
3979   cf_cv_posix_c_source=no
3980 else
3981   echo "$as_me: failed program was:" >&5
3982 cat conftest.$ac_ext >&5
3983 cf_want_posix_source=no
3984          case .$cf_POSIX_C_SOURCE in
3985          (.[12]??*)
3986                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3987                 ;;
3988          (.2)
3989                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3990                 cf_want_posix_source=yes
3991                 ;;
3992          (.*)
3993                 cf_want_posix_source=yes
3994                 ;;
3995          esac
3996          if test "$cf_want_posix_source" = yes ; then
3997                 cat >conftest.$ac_ext <<_ACEOF
3998 #line 3998 "configure"
3999 #include "confdefs.h"
4000 #include <sys/types.h>
4001 int
4002 main (void)
4003 {
4004
4005 #ifdef _POSIX_SOURCE
4006 make an error
4007 #endif
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f conftest.$ac_objext
4013 if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
4014   (eval $ac_compile) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); } &&
4018          { ac_try='test -s conftest.$ac_objext'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit $ac_status); }; }; then
4024   :
4025 else
4026   echo "$as_me: failed program was:" >&5
4027 cat conftest.$ac_ext >&5
4028 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4029 fi
4030 rm -f conftest.$ac_objext conftest.$ac_ext
4031          fi
4032
4033 echo "${as_me:-configure}:4033: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4034
4035          CFLAGS="$cf_trim_CFLAGS"
4036          CPPFLAGS="$cf_trim_CPPFLAGS"
4037
4038         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4039         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4040
4041 echo "${as_me:-configure}:4041: testing if the second compile does not leave our definition intact error ..." 1>&5
4042
4043          cat >conftest.$ac_ext <<_ACEOF
4044 #line 4044 "configure"
4045 #include "confdefs.h"
4046 #include <sys/types.h>
4047 int
4048 main (void)
4049 {
4050
4051 #ifndef _POSIX_C_SOURCE
4052 make an error
4053 #endif
4054   ;
4055   return 0;
4056 }
4057 _ACEOF
4058 rm -f conftest.$ac_objext
4059 if { (eval echo "$as_me:4059: \"$ac_compile\"") >&5
4060   (eval $ac_compile) 2>&5
4061   ac_status=$?
4062   echo "$as_me:4062: \$? = $ac_status" >&5
4063   (exit $ac_status); } &&
4064          { ac_try='test -s conftest.$ac_objext'
4065   { (eval echo "$as_me:4065: \"$ac_try\"") >&5
4066   (eval $ac_try) 2>&5
4067   ac_status=$?
4068   echo "$as_me:4068: \$? = $ac_status" >&5
4069   (exit $ac_status); }; }; then
4070   :
4071 else
4072   echo "$as_me: failed program was:" >&5
4073 cat conftest.$ac_ext >&5
4074 cf_cv_posix_c_source=no
4075 fi
4076 rm -f conftest.$ac_objext conftest.$ac_ext
4077          CFLAGS="$cf_save_CFLAGS"
4078          CPPFLAGS="$cf_save_CPPFLAGS"
4079
4080 fi
4081 rm -f conftest.$ac_objext conftest.$ac_ext
4082
4083 fi
4084 echo "$as_me:4084: result: $cf_cv_posix_c_source" >&5
4085 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4086
4087 if test "$cf_cv_posix_c_source" != no ; then
4088         CFLAGS="$cf_trim_CFLAGS"
4089         CPPFLAGS="$cf_trim_CPPFLAGS"
4090
4091 cf_fix_cppflags=no
4092 cf_new_cflags=
4093 cf_new_cppflags=
4094 cf_new_extra_cppflags=
4095
4096 for cf_add_cflags in $cf_cv_posix_c_source
4097 do
4098 case $cf_fix_cppflags in
4099 (no)
4100         case $cf_add_cflags in
4101         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4102                 case $cf_add_cflags in
4103                 (-D*)
4104                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4105
4106                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4107                                 && test -z "${cf_tst_cflags}" \
4108                                 && cf_fix_cppflags=yes
4109
4110                         if test $cf_fix_cppflags = yes ; then
4111
4112         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4113         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4114
4115                                 continue
4116                         elif test "${cf_tst_cflags}" = "\"'" ; then
4117
4118         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4119         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4120
4121                                 continue
4122                         fi
4123                         ;;
4124                 esac
4125                 case "$CPPFLAGS" in
4126                 (*$cf_add_cflags)
4127                         ;;
4128                 (*)
4129                         case $cf_add_cflags in
4130                         (-D*)
4131                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4132
4133 CPPFLAGS=`echo "$CPPFLAGS" | \
4134         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4135                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4136
4137                                 ;;
4138                         esac
4139
4140         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4141         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4142
4143                         ;;
4144                 esac
4145                 ;;
4146         (*)
4147
4148         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4149         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4150
4151                 ;;
4152         esac
4153         ;;
4154 (yes)
4155
4156         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4157         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4158
4159         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4160
4161         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4162                 && test -z "${cf_tst_cflags}" \
4163                 && cf_fix_cppflags=no
4164         ;;
4165 esac
4166 done
4167
4168 if test -n "$cf_new_cflags" ; then
4169
4170         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4171         CFLAGS="${CFLAGS}$cf_new_cflags"
4172
4173 fi
4174
4175 if test -n "$cf_new_cppflags" ; then
4176
4177         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4178         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4179
4180 fi
4181
4182 if test -n "$cf_new_extra_cppflags" ; then
4183
4184         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4185         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4186
4187 fi
4188
4189 fi
4190
4191         ;;
4192 (netbsd*)
4193         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4194         ;;
4195 (openbsd[4-9]*)
4196         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4197         cf_xopen_source="-D_BSD_SOURCE"
4198         cf_XOPEN_SOURCE=600
4199         ;;
4200 (openbsd*)
4201         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4202         ;;
4203 (osf[45]*)
4204         cf_xopen_source="-D_OSF_SOURCE"
4205         ;;
4206 (nto-qnx*)
4207         cf_xopen_source="-D_QNX_SOURCE"
4208         ;;
4209 (sco*)
4210         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4211         ;;
4212 (solaris2.*)
4213         cf_xopen_source="-D__EXTENSIONS__"
4214         cf_cv_xopen_source=broken
4215         ;;
4216 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4217         cf_XOPEN_SOURCE=
4218         cf_POSIX_C_SOURCE=
4219         ;;
4220 (*)
4221
4222 echo "$as_me:4222: checking if we should define _XOPEN_SOURCE" >&5
4223 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4224 if test "${cf_cv_xopen_source+set}" = set; then
4225   echo $ECHO_N "(cached) $ECHO_C" >&6
4226 else
4227
4228         cat >conftest.$ac_ext <<_ACEOF
4229 #line 4229 "configure"
4230 #include "confdefs.h"
4231
4232 #include <stdlib.h>
4233 #include <string.h>
4234 #include <sys/types.h>
4235
4236 int
4237 main (void)
4238 {
4239
4240 #ifndef _XOPEN_SOURCE
4241 make an error
4242 #endif
4243   ;
4244   return 0;
4245 }
4246 _ACEOF
4247 rm -f conftest.$ac_objext
4248 if { (eval echo "$as_me:4248: \"$ac_compile\"") >&5
4249   (eval $ac_compile) 2>&5
4250   ac_status=$?
4251   echo "$as_me:4251: \$? = $ac_status" >&5
4252   (exit $ac_status); } &&
4253          { ac_try='test -s conftest.$ac_objext'
4254   { (eval echo "$as_me:4254: \"$ac_try\"") >&5
4255   (eval $ac_try) 2>&5
4256   ac_status=$?
4257   echo "$as_me:4257: \$? = $ac_status" >&5
4258   (exit $ac_status); }; }; then
4259   cf_cv_xopen_source=no
4260 else
4261   echo "$as_me: failed program was:" >&5
4262 cat conftest.$ac_ext >&5
4263 cf_save="$CPPFLAGS"
4264
4265         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4266         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4267
4268          cat >conftest.$ac_ext <<_ACEOF
4269 #line 4269 "configure"
4270 #include "confdefs.h"
4271
4272 #include <stdlib.h>
4273 #include <string.h>
4274 #include <sys/types.h>
4275
4276 int
4277 main (void)
4278 {
4279
4280 #ifdef _XOPEN_SOURCE
4281 make an error
4282 #endif
4283   ;
4284   return 0;
4285 }
4286 _ACEOF
4287 rm -f conftest.$ac_objext
4288 if { (eval echo "$as_me:4288: \"$ac_compile\"") >&5
4289   (eval $ac_compile) 2>&5
4290   ac_status=$?
4291   echo "$as_me:4291: \$? = $ac_status" >&5
4292   (exit $ac_status); } &&
4293          { ac_try='test -s conftest.$ac_objext'
4294   { (eval echo "$as_me:4294: \"$ac_try\"") >&5
4295   (eval $ac_try) 2>&5
4296   ac_status=$?
4297   echo "$as_me:4297: \$? = $ac_status" >&5
4298   (exit $ac_status); }; }; then
4299   cf_cv_xopen_source=no
4300 else
4301   echo "$as_me: failed program was:" >&5
4302 cat conftest.$ac_ext >&5
4303 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4304 fi
4305 rm -f conftest.$ac_objext conftest.$ac_ext
4306         CPPFLAGS="$cf_save"
4307
4308 fi
4309 rm -f conftest.$ac_objext conftest.$ac_ext
4310
4311 fi
4312 echo "$as_me:4312: result: $cf_cv_xopen_source" >&5
4313 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4314
4315 if test "$cf_cv_xopen_source" != no ; then
4316
4317 CFLAGS=`echo "$CFLAGS" | \
4318         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4319                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4320
4321 CPPFLAGS=`echo "$CPPFLAGS" | \
4322         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4323                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4324
4325         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4326
4327 cf_fix_cppflags=no
4328 cf_new_cflags=
4329 cf_new_cppflags=
4330 cf_new_extra_cppflags=
4331
4332 for cf_add_cflags in $cf_temp_xopen_source
4333 do
4334 case $cf_fix_cppflags in
4335 (no)
4336         case $cf_add_cflags in
4337         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4338                 case $cf_add_cflags in
4339                 (-D*)
4340                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4341
4342                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4343                                 && test -z "${cf_tst_cflags}" \
4344                                 && cf_fix_cppflags=yes
4345
4346                         if test $cf_fix_cppflags = yes ; then
4347
4348         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4349         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4350
4351                                 continue
4352                         elif test "${cf_tst_cflags}" = "\"'" ; then
4353
4354         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4355         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4356
4357                                 continue
4358                         fi
4359                         ;;
4360                 esac
4361                 case "$CPPFLAGS" in
4362                 (*$cf_add_cflags)
4363                         ;;
4364                 (*)
4365                         case $cf_add_cflags in
4366                         (-D*)
4367                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4368
4369 CPPFLAGS=`echo "$CPPFLAGS" | \
4370         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4371                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4372
4373                                 ;;
4374                         esac
4375
4376         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4377         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4378
4379                         ;;
4380                 esac
4381                 ;;
4382         (*)
4383
4384         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4385         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4386
4387                 ;;
4388         esac
4389         ;;
4390 (yes)
4391
4392         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4393         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4394
4395         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4396
4397         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4398                 && test -z "${cf_tst_cflags}" \
4399                 && cf_fix_cppflags=no
4400         ;;
4401 esac
4402 done
4403
4404 if test -n "$cf_new_cflags" ; then
4405
4406         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4407         CFLAGS="${CFLAGS}$cf_new_cflags"
4408
4409 fi
4410
4411 if test -n "$cf_new_cppflags" ; then
4412
4413         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4414         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4415
4416 fi
4417
4418 if test -n "$cf_new_extra_cppflags" ; then
4419
4420         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4421         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4422
4423 fi
4424
4425 fi
4426
4427 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4428
4429 cf_save_CFLAGS="$CFLAGS"
4430 cf_save_CPPFLAGS="$CPPFLAGS"
4431
4432 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4433         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4434                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4435
4436 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4437         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4438                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4439
4440 echo "$as_me:4440: checking if we should define _POSIX_C_SOURCE" >&5
4441 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4442 if test "${cf_cv_posix_c_source+set}" = set; then
4443   echo $ECHO_N "(cached) $ECHO_C" >&6
4444 else
4445
4446 echo "${as_me:-configure}:4446: testing if the symbol is already defined go no further ..." 1>&5
4447
4448         cat >conftest.$ac_ext <<_ACEOF
4449 #line 4449 "configure"
4450 #include "confdefs.h"
4451 #include <sys/types.h>
4452 int
4453 main (void)
4454 {
4455
4456 #ifndef _POSIX_C_SOURCE
4457 make an error
4458 #endif
4459   ;
4460   return 0;
4461 }
4462 _ACEOF
4463 rm -f conftest.$ac_objext
4464 if { (eval echo "$as_me:4464: \"$ac_compile\"") >&5
4465   (eval $ac_compile) 2>&5
4466   ac_status=$?
4467   echo "$as_me:4467: \$? = $ac_status" >&5
4468   (exit $ac_status); } &&
4469          { ac_try='test -s conftest.$ac_objext'
4470   { (eval echo "$as_me:4470: \"$ac_try\"") >&5
4471   (eval $ac_try) 2>&5
4472   ac_status=$?
4473   echo "$as_me:4473: \$? = $ac_status" >&5
4474   (exit $ac_status); }; }; then
4475   cf_cv_posix_c_source=no
4476 else
4477   echo "$as_me: failed program was:" >&5
4478 cat conftest.$ac_ext >&5
4479 cf_want_posix_source=no
4480          case .$cf_POSIX_C_SOURCE in
4481          (.[12]??*)
4482                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4483                 ;;
4484          (.2)
4485                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4486                 cf_want_posix_source=yes
4487                 ;;
4488          (.*)
4489                 cf_want_posix_source=yes
4490                 ;;
4491          esac
4492          if test "$cf_want_posix_source" = yes ; then
4493                 cat >conftest.$ac_ext <<_ACEOF
4494 #line 4494 "configure"
4495 #include "confdefs.h"
4496 #include <sys/types.h>
4497 int
4498 main (void)
4499 {
4500
4501 #ifdef _POSIX_SOURCE
4502 make an error
4503 #endif
4504   ;
4505   return 0;
4506 }
4507 _ACEOF
4508 rm -f conftest.$ac_objext
4509 if { (eval echo "$as_me:4509: \"$ac_compile\"") >&5
4510   (eval $ac_compile) 2>&5
4511   ac_status=$?
4512   echo "$as_me:4512: \$? = $ac_status" >&5
4513   (exit $ac_status); } &&
4514          { ac_try='test -s conftest.$ac_objext'
4515   { (eval echo "$as_me:4515: \"$ac_try\"") >&5
4516   (eval $ac_try) 2>&5
4517   ac_status=$?
4518   echo "$as_me:4518: \$? = $ac_status" >&5
4519   (exit $ac_status); }; }; then
4520   :
4521 else
4522   echo "$as_me: failed program was:" >&5
4523 cat conftest.$ac_ext >&5
4524 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4525 fi
4526 rm -f conftest.$ac_objext conftest.$ac_ext
4527          fi
4528
4529 echo "${as_me:-configure}:4529: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4530
4531          CFLAGS="$cf_trim_CFLAGS"
4532          CPPFLAGS="$cf_trim_CPPFLAGS"
4533
4534         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4535         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4536
4537 echo "${as_me:-configure}:4537: testing if the second compile does not leave our definition intact error ..." 1>&5
4538
4539          cat >conftest.$ac_ext <<_ACEOF
4540 #line 4540 "configure"
4541 #include "confdefs.h"
4542 #include <sys/types.h>
4543 int
4544 main (void)
4545 {
4546
4547 #ifndef _POSIX_C_SOURCE
4548 make an error
4549 #endif
4550   ;
4551   return 0;
4552 }
4553 _ACEOF
4554 rm -f conftest.$ac_objext
4555 if { (eval echo "$as_me:4555: \"$ac_compile\"") >&5
4556   (eval $ac_compile) 2>&5
4557   ac_status=$?
4558   echo "$as_me:4558: \$? = $ac_status" >&5
4559   (exit $ac_status); } &&
4560          { ac_try='test -s conftest.$ac_objext'
4561   { (eval echo "$as_me:4561: \"$ac_try\"") >&5
4562   (eval $ac_try) 2>&5
4563   ac_status=$?
4564   echo "$as_me:4564: \$? = $ac_status" >&5
4565   (exit $ac_status); }; }; then
4566   :
4567 else
4568   echo "$as_me: failed program was:" >&5
4569 cat conftest.$ac_ext >&5
4570 cf_cv_posix_c_source=no
4571 fi
4572 rm -f conftest.$ac_objext conftest.$ac_ext
4573          CFLAGS="$cf_save_CFLAGS"
4574          CPPFLAGS="$cf_save_CPPFLAGS"
4575
4576 fi
4577 rm -f conftest.$ac_objext conftest.$ac_ext
4578
4579 fi
4580 echo "$as_me:4580: result: $cf_cv_posix_c_source" >&5
4581 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4582
4583 if test "$cf_cv_posix_c_source" != no ; then
4584         CFLAGS="$cf_trim_CFLAGS"
4585         CPPFLAGS="$cf_trim_CPPFLAGS"
4586
4587 cf_fix_cppflags=no
4588 cf_new_cflags=
4589 cf_new_cppflags=
4590 cf_new_extra_cppflags=
4591
4592 for cf_add_cflags in $cf_cv_posix_c_source
4593 do
4594 case $cf_fix_cppflags in
4595 (no)
4596         case $cf_add_cflags in
4597         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4598                 case $cf_add_cflags in
4599                 (-D*)
4600                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4601
4602                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4603                                 && test -z "${cf_tst_cflags}" \
4604                                 && cf_fix_cppflags=yes
4605
4606                         if test $cf_fix_cppflags = yes ; then
4607
4608         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4609         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4610
4611                                 continue
4612                         elif test "${cf_tst_cflags}" = "\"'" ; then
4613
4614         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4615         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4616
4617                                 continue
4618                         fi
4619                         ;;
4620                 esac
4621                 case "$CPPFLAGS" in
4622                 (*$cf_add_cflags)
4623                         ;;
4624                 (*)
4625                         case $cf_add_cflags in
4626                         (-D*)
4627                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4628
4629 CPPFLAGS=`echo "$CPPFLAGS" | \
4630         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4631                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4632
4633                                 ;;
4634                         esac
4635
4636         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4637         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4638
4639                         ;;
4640                 esac
4641                 ;;
4642         (*)
4643
4644         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4645         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4646
4647                 ;;
4648         esac
4649         ;;
4650 (yes)
4651
4652         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4653         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4654
4655         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4656
4657         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4658                 && test -z "${cf_tst_cflags}" \
4659                 && cf_fix_cppflags=no
4660         ;;
4661 esac
4662 done
4663
4664 if test -n "$cf_new_cflags" ; then
4665
4666         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4667         CFLAGS="${CFLAGS}$cf_new_cflags"
4668
4669 fi
4670
4671 if test -n "$cf_new_cppflags" ; then
4672
4673         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4674         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4675
4676 fi
4677
4678 if test -n "$cf_new_extra_cppflags" ; then
4679
4680         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4681         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4682
4683 fi
4684
4685 fi
4686
4687         ;;
4688 esac
4689
4690 if test -n "$cf_xopen_source" ; then
4691
4692 cf_fix_cppflags=no
4693 cf_new_cflags=
4694 cf_new_cppflags=
4695 cf_new_extra_cppflags=
4696
4697 for cf_add_cflags in $cf_xopen_source
4698 do
4699 case $cf_fix_cppflags in
4700 (no)
4701         case $cf_add_cflags in
4702         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4703                 case $cf_add_cflags in
4704                 (-D*)
4705                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4706
4707                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4708                                 && test -z "${cf_tst_cflags}" \
4709                                 && cf_fix_cppflags=yes
4710
4711                         if test $cf_fix_cppflags = yes ; then
4712
4713         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4714         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4715
4716                                 continue
4717                         elif test "${cf_tst_cflags}" = "\"'" ; then
4718
4719         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4720         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4721
4722                                 continue
4723                         fi
4724                         ;;
4725                 esac
4726                 case "$CPPFLAGS" in
4727                 (*$cf_add_cflags)
4728                         ;;
4729                 (*)
4730                         case $cf_add_cflags in
4731                         (-D*)
4732                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4733
4734 CPPFLAGS=`echo "$CPPFLAGS" | \
4735         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4736                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4737
4738                                 ;;
4739                         esac
4740
4741         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4742         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4743
4744                         ;;
4745                 esac
4746                 ;;
4747         (*)
4748
4749         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4750         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4751
4752                 ;;
4753         esac
4754         ;;
4755 (yes)
4756
4757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4759
4760         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4761
4762         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4763                 && test -z "${cf_tst_cflags}" \
4764                 && cf_fix_cppflags=no
4765         ;;
4766 esac
4767 done
4768
4769 if test -n "$cf_new_cflags" ; then
4770         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4771
4772 echo "${as_me:-configure}:4772: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4773
4774         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4775         CFLAGS="${CFLAGS}$cf_new_cflags"
4776
4777 fi
4778
4779 if test -n "$cf_new_cppflags" ; then
4780         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4781
4782 echo "${as_me:-configure}:4782: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4783
4784         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4785         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4786
4787 fi
4788
4789 if test -n "$cf_new_extra_cppflags" ; then
4790         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4791
4792 echo "${as_me:-configure}:4792: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4793
4794         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4795         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4796
4797 fi
4798
4799 fi
4800
4801 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4802         echo "$as_me:4802: checking if _XOPEN_SOURCE really is set" >&5
4803 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4804         cat >conftest.$ac_ext <<_ACEOF
4805 #line 4805 "configure"
4806 #include "confdefs.h"
4807 #include <stdlib.h>
4808 int
4809 main (void)
4810 {
4811
4812 #ifndef _XOPEN_SOURCE
4813 make an error
4814 #endif
4815   ;
4816   return 0;
4817 }
4818 _ACEOF
4819 rm -f conftest.$ac_objext
4820 if { (eval echo "$as_me:4820: \"$ac_compile\"") >&5
4821   (eval $ac_compile) 2>&5
4822   ac_status=$?
4823   echo "$as_me:4823: \$? = $ac_status" >&5
4824   (exit $ac_status); } &&
4825          { ac_try='test -s conftest.$ac_objext'
4826   { (eval echo "$as_me:4826: \"$ac_try\"") >&5
4827   (eval $ac_try) 2>&5
4828   ac_status=$?
4829   echo "$as_me:4829: \$? = $ac_status" >&5
4830   (exit $ac_status); }; }; then
4831   cf_XOPEN_SOURCE_set=yes
4832 else
4833   echo "$as_me: failed program was:" >&5
4834 cat conftest.$ac_ext >&5
4835 cf_XOPEN_SOURCE_set=no
4836 fi
4837 rm -f conftest.$ac_objext conftest.$ac_ext
4838         echo "$as_me:4838: result: $cf_XOPEN_SOURCE_set" >&5
4839 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4840         if test $cf_XOPEN_SOURCE_set = yes
4841         then
4842                 cat >conftest.$ac_ext <<_ACEOF
4843 #line 4843 "configure"
4844 #include "confdefs.h"
4845 #include <stdlib.h>
4846 int
4847 main (void)
4848 {
4849
4850 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4851 make an error
4852 #endif
4853   ;
4854   return 0;
4855 }
4856 _ACEOF
4857 rm -f conftest.$ac_objext
4858 if { (eval echo "$as_me:4858: \"$ac_compile\"") >&5
4859   (eval $ac_compile) 2>&5
4860   ac_status=$?
4861   echo "$as_me:4861: \$? = $ac_status" >&5
4862   (exit $ac_status); } &&
4863          { ac_try='test -s conftest.$ac_objext'
4864   { (eval echo "$as_me:4864: \"$ac_try\"") >&5
4865   (eval $ac_try) 2>&5
4866   ac_status=$?
4867   echo "$as_me:4867: \$? = $ac_status" >&5
4868   (exit $ac_status); }; }; then
4869   cf_XOPEN_SOURCE_set_ok=yes
4870 else
4871   echo "$as_me: failed program was:" >&5
4872 cat conftest.$ac_ext >&5
4873 cf_XOPEN_SOURCE_set_ok=no
4874 fi
4875 rm -f conftest.$ac_objext conftest.$ac_ext
4876                 if test $cf_XOPEN_SOURCE_set_ok = no
4877                 then
4878                         { echo "$as_me:4878: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4879 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4880                 fi
4881         else
4882
4883 echo "$as_me:4883: checking if we should define _XOPEN_SOURCE" >&5
4884 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4885 if test "${cf_cv_xopen_source+set}" = set; then
4886   echo $ECHO_N "(cached) $ECHO_C" >&6
4887 else
4888
4889         cat >conftest.$ac_ext <<_ACEOF
4890 #line 4890 "configure"
4891 #include "confdefs.h"
4892
4893 #include <stdlib.h>
4894 #include <string.h>
4895 #include <sys/types.h>
4896
4897 int
4898 main (void)
4899 {
4900
4901 #ifndef _XOPEN_SOURCE
4902 make an error
4903 #endif
4904   ;
4905   return 0;
4906 }
4907 _ACEOF
4908 rm -f conftest.$ac_objext
4909 if { (eval echo "$as_me:4909: \"$ac_compile\"") >&5
4910   (eval $ac_compile) 2>&5
4911   ac_status=$?
4912   echo "$as_me:4912: \$? = $ac_status" >&5
4913   (exit $ac_status); } &&
4914          { ac_try='test -s conftest.$ac_objext'
4915   { (eval echo "$as_me:4915: \"$ac_try\"") >&5
4916   (eval $ac_try) 2>&5
4917   ac_status=$?
4918   echo "$as_me:4918: \$? = $ac_status" >&5
4919   (exit $ac_status); }; }; then
4920   cf_cv_xopen_source=no
4921 else
4922   echo "$as_me: failed program was:" >&5
4923 cat conftest.$ac_ext >&5
4924 cf_save="$CPPFLAGS"
4925
4926         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4927         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4928
4929          cat >conftest.$ac_ext <<_ACEOF
4930 #line 4930 "configure"
4931 #include "confdefs.h"
4932
4933 #include <stdlib.h>
4934 #include <string.h>
4935 #include <sys/types.h>
4936
4937 int
4938 main (void)
4939 {
4940
4941 #ifdef _XOPEN_SOURCE
4942 make an error
4943 #endif
4944   ;
4945   return 0;
4946 }
4947 _ACEOF
4948 rm -f conftest.$ac_objext
4949 if { (eval echo "$as_me:4949: \"$ac_compile\"") >&5
4950   (eval $ac_compile) 2>&5
4951   ac_status=$?
4952   echo "$as_me:4952: \$? = $ac_status" >&5
4953   (exit $ac_status); } &&
4954          { ac_try='test -s conftest.$ac_objext'
4955   { (eval echo "$as_me:4955: \"$ac_try\"") >&5
4956   (eval $ac_try) 2>&5
4957   ac_status=$?
4958   echo "$as_me:4958: \$? = $ac_status" >&5
4959   (exit $ac_status); }; }; then
4960   cf_cv_xopen_source=no
4961 else
4962   echo "$as_me: failed program was:" >&5
4963 cat conftest.$ac_ext >&5
4964 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4965 fi
4966 rm -f conftest.$ac_objext conftest.$ac_ext
4967         CPPFLAGS="$cf_save"
4968
4969 fi
4970 rm -f conftest.$ac_objext conftest.$ac_ext
4971
4972 fi
4973 echo "$as_me:4973: result: $cf_cv_xopen_source" >&5
4974 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4975
4976 if test "$cf_cv_xopen_source" != no ; then
4977
4978 CFLAGS=`echo "$CFLAGS" | \
4979         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4980                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4981
4982 CPPFLAGS=`echo "$CPPFLAGS" | \
4983         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4984                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4985
4986         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4987
4988 cf_fix_cppflags=no
4989 cf_new_cflags=
4990 cf_new_cppflags=
4991 cf_new_extra_cppflags=
4992
4993 for cf_add_cflags in $cf_temp_xopen_source
4994 do
4995 case $cf_fix_cppflags in
4996 (no)
4997         case $cf_add_cflags in
4998         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4999                 case $cf_add_cflags in
5000                 (-D*)
5001                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5002
5003                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5004                                 && test -z "${cf_tst_cflags}" \
5005                                 && cf_fix_cppflags=yes
5006
5007                         if test $cf_fix_cppflags = yes ; then
5008
5009         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5010         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5011
5012                                 continue
5013                         elif test "${cf_tst_cflags}" = "\"'" ; then
5014
5015         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5016         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5017
5018                                 continue
5019                         fi
5020                         ;;
5021                 esac
5022                 case "$CPPFLAGS" in
5023                 (*$cf_add_cflags)
5024                         ;;
5025                 (*)
5026                         case $cf_add_cflags in
5027                         (-D*)
5028                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5029
5030 CPPFLAGS=`echo "$CPPFLAGS" | \
5031         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5032                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5033
5034                                 ;;
5035                         esac
5036
5037         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5038         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5039
5040                         ;;
5041                 esac
5042                 ;;
5043         (*)
5044
5045         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5046         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5047
5048                 ;;
5049         esac
5050         ;;
5051 (yes)
5052
5053         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5054         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5055
5056         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5057
5058         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5059                 && test -z "${cf_tst_cflags}" \
5060                 && cf_fix_cppflags=no
5061         ;;
5062 esac
5063 done
5064
5065 if test -n "$cf_new_cflags" ; then
5066
5067         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5068         CFLAGS="${CFLAGS}$cf_new_cflags"
5069
5070 fi
5071
5072 if test -n "$cf_new_cppflags" ; then
5073
5074         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5075         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5076
5077 fi
5078
5079 if test -n "$cf_new_extra_cppflags" ; then
5080
5081         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5082         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5083
5084 fi
5085
5086 fi
5087
5088         fi
5089 fi
5090
5091 echo "$as_me:5091: checking for signal global datatype" >&5
5092 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5093 if test "${cf_cv_sig_atomic_t+set}" = set; then
5094   echo $ECHO_N "(cached) $ECHO_C" >&6
5095 else
5096
5097         for cf_type in \
5098                 "volatile sig_atomic_t" \
5099                 "sig_atomic_t" \
5100                 "int"
5101         do
5102         cat >conftest.$ac_ext <<_ACEOF
5103 #line 5103 "configure"
5104 #include "confdefs.h"
5105
5106 #include <sys/types.h>
5107 #include <signal.h>
5108 #include <stdio.h>
5109
5110 extern $cf_type x;
5111 $cf_type x;
5112 static void handler(int sig)
5113 {
5114         x = 5;
5115 }
5116 int
5117 main (void)
5118 {
5119 signal(SIGINT, handler);
5120                  x = 1
5121   ;
5122   return 0;
5123 }
5124 _ACEOF
5125 rm -f conftest.$ac_objext
5126 if { (eval echo "$as_me:5126: \"$ac_compile\"") >&5
5127   (eval $ac_compile) 2>&5
5128   ac_status=$?
5129   echo "$as_me:5129: \$? = $ac_status" >&5
5130   (exit $ac_status); } &&
5131          { ac_try='test -s conftest.$ac_objext'
5132   { (eval echo "$as_me:5132: \"$ac_try\"") >&5
5133   (eval $ac_try) 2>&5
5134   ac_status=$?
5135   echo "$as_me:5135: \$? = $ac_status" >&5
5136   (exit $ac_status); }; }; then
5137   cf_cv_sig_atomic_t=$cf_type
5138 else
5139   echo "$as_me: failed program was:" >&5
5140 cat conftest.$ac_ext >&5
5141 cf_cv_sig_atomic_t=no
5142 fi
5143 rm -f conftest.$ac_objext conftest.$ac_ext
5144                 test "$cf_cv_sig_atomic_t" != no && break
5145         done
5146
5147 fi
5148
5149 echo "$as_me:5149: result: $cf_cv_sig_atomic_t" >&5
5150 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5151 test "$cf_cv_sig_atomic_t" != no &&
5152 cat >>confdefs.h <<EOF
5153 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5154 EOF
5155
5156 # Work around breakage on OS X
5157
5158 echo "$as_me:5158: checking if SIGWINCH is defined" >&5
5159 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5160 if test "${cf_cv_define_sigwinch+set}" = set; then
5161   echo $ECHO_N "(cached) $ECHO_C" >&6
5162 else
5163
5164         cat >conftest.$ac_ext <<_ACEOF
5165 #line 5165 "configure"
5166 #include "confdefs.h"
5167
5168 #include <sys/types.h>
5169 #include <sys/signal.h>
5170
5171 int
5172 main (void)
5173 {
5174 int x = SIGWINCH
5175   ;
5176   return 0;
5177 }
5178 _ACEOF
5179 rm -f conftest.$ac_objext
5180 if { (eval echo "$as_me:5180: \"$ac_compile\"") >&5
5181   (eval $ac_compile) 2>&5
5182   ac_status=$?
5183   echo "$as_me:5183: \$? = $ac_status" >&5
5184   (exit $ac_status); } &&
5185          { ac_try='test -s conftest.$ac_objext'
5186   { (eval echo "$as_me:5186: \"$ac_try\"") >&5
5187   (eval $ac_try) 2>&5
5188   ac_status=$?
5189   echo "$as_me:5189: \$? = $ac_status" >&5
5190   (exit $ac_status); }; }; then
5191   cf_cv_define_sigwinch=yes
5192 else
5193   echo "$as_me: failed program was:" >&5
5194 cat conftest.$ac_ext >&5
5195 cat >conftest.$ac_ext <<_ACEOF
5196 #line 5196 "configure"
5197 #include "confdefs.h"
5198
5199 #undef _XOPEN_SOURCE
5200 #undef _POSIX_SOURCE
5201 #undef _POSIX_C_SOURCE
5202 #include <sys/types.h>
5203 #include <sys/signal.h>
5204
5205 int
5206 main (void)
5207 {
5208 int x = SIGWINCH
5209   ;
5210   return 0;
5211 }
5212 _ACEOF
5213 rm -f conftest.$ac_objext
5214 if { (eval echo "$as_me:5214: \"$ac_compile\"") >&5
5215   (eval $ac_compile) 2>&5
5216   ac_status=$?
5217   echo "$as_me:5217: \$? = $ac_status" >&5
5218   (exit $ac_status); } &&
5219          { ac_try='test -s conftest.$ac_objext'
5220   { (eval echo "$as_me:5220: \"$ac_try\"") >&5
5221   (eval $ac_try) 2>&5
5222   ac_status=$?
5223   echo "$as_me:5223: \$? = $ac_status" >&5
5224   (exit $ac_status); }; }; then
5225   cf_cv_define_sigwinch=maybe
5226 else
5227   echo "$as_me: failed program was:" >&5
5228 cat conftest.$ac_ext >&5
5229 cf_cv_define_sigwinch=no
5230 fi
5231 rm -f conftest.$ac_objext conftest.$ac_ext
5232
5233 fi
5234 rm -f conftest.$ac_objext conftest.$ac_ext
5235
5236 fi
5237 echo "$as_me:5237: result: $cf_cv_define_sigwinch" >&5
5238 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5239
5240 if test "$cf_cv_define_sigwinch" = maybe ; then
5241 echo "$as_me:5241: checking for actual SIGWINCH definition" >&5
5242 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5243 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5244   echo $ECHO_N "(cached) $ECHO_C" >&6
5245 else
5246
5247 cf_cv_fixup_sigwinch=unknown
5248 cf_sigwinch=32
5249 while test $cf_sigwinch != 1
5250 do
5251         cat >conftest.$ac_ext <<_ACEOF
5252 #line 5252 "configure"
5253 #include "confdefs.h"
5254
5255 #undef _XOPEN_SOURCE
5256 #undef _POSIX_SOURCE
5257 #undef _POSIX_C_SOURCE
5258 #include <sys/types.h>
5259 #include <sys/signal.h>
5260
5261 int
5262 main (void)
5263 {
5264
5265 #if SIGWINCH != $cf_sigwinch
5266 make an error
5267 #endif
5268 int x = SIGWINCH
5269   ;
5270   return 0;
5271 }
5272 _ACEOF
5273 rm -f conftest.$ac_objext
5274 if { (eval echo "$as_me:5274: \"$ac_compile\"") >&5
5275   (eval $ac_compile) 2>&5
5276   ac_status=$?
5277   echo "$as_me:5277: \$? = $ac_status" >&5
5278   (exit $ac_status); } &&
5279          { ac_try='test -s conftest.$ac_objext'
5280   { (eval echo "$as_me:5280: \"$ac_try\"") >&5
5281   (eval $ac_try) 2>&5
5282   ac_status=$?
5283   echo "$as_me:5283: \$? = $ac_status" >&5
5284   (exit $ac_status); }; }; then
5285   cf_cv_fixup_sigwinch=$cf_sigwinch
5286          break
5287 else
5288   echo "$as_me: failed program was:" >&5
5289 cat conftest.$ac_ext >&5
5290 fi
5291 rm -f conftest.$ac_objext conftest.$ac_ext
5292
5293 cf_sigwinch=`expr $cf_sigwinch - 1`
5294 done
5295
5296 fi
5297 echo "$as_me:5297: result: $cf_cv_fixup_sigwinch" >&5
5298 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5299
5300         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5301                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5302         fi
5303 fi
5304
5305 # Checks for CODESET support.
5306
5307 echo "$as_me:5307: checking for nl_langinfo and CODESET" >&5
5308 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5309 if test "${am_cv_langinfo_codeset+set}" = set; then
5310   echo $ECHO_N "(cached) $ECHO_C" >&6
5311 else
5312   cat >conftest.$ac_ext <<_ACEOF
5313 #line 5313 "configure"
5314 #include "confdefs.h"
5315 #include <langinfo.h>
5316 int
5317 main (void)
5318 {
5319 char* cs = nl_langinfo(CODESET);
5320   ;
5321   return 0;
5322 }
5323 _ACEOF
5324 rm -f conftest.$ac_objext conftest$ac_exeext
5325 if { (eval echo "$as_me:5325: \"$ac_link\"") >&5
5326   (eval $ac_link) 2>&5
5327   ac_status=$?
5328   echo "$as_me:5328: \$? = $ac_status" >&5
5329   (exit $ac_status); } &&
5330          { ac_try='test -s conftest$ac_exeext'
5331   { (eval echo "$as_me:5331: \"$ac_try\"") >&5
5332   (eval $ac_try) 2>&5
5333   ac_status=$?
5334   echo "$as_me:5334: \$? = $ac_status" >&5
5335   (exit $ac_status); }; }; then
5336   am_cv_langinfo_codeset=yes
5337 else
5338   echo "$as_me: failed program was:" >&5
5339 cat conftest.$ac_ext >&5
5340 am_cv_langinfo_codeset=no
5341 fi
5342 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5343
5344 fi
5345 echo "$as_me:5345: result: $am_cv_langinfo_codeset" >&5
5346 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5347         if test $am_cv_langinfo_codeset = yes; then
5348
5349 cat >>confdefs.h <<\EOF
5350 #define HAVE_LANGINFO_CODESET 1
5351 EOF
5352
5353         fi
5354
5355 echo "$as_me:5355: checking if you want to use pkg-config" >&5
5356 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5357
5358 # Check whether --with-pkg-config or --without-pkg-config was given.
5359 if test "${with_pkg_config+set}" = set; then
5360   withval="$with_pkg_config"
5361   cf_pkg_config=$withval
5362 else
5363   cf_pkg_config=yes
5364 fi;
5365 echo "$as_me:5365: result: $cf_pkg_config" >&5
5366 echo "${ECHO_T}$cf_pkg_config" >&6
5367
5368 case $cf_pkg_config in
5369 (no)
5370         PKG_CONFIG=none
5371         ;;
5372 (yes)
5373
5374 if test -n "$ac_tool_prefix"; then
5375   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5376 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5377 echo "$as_me:5377: checking for $ac_word" >&5
5378 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5379 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5380   echo $ECHO_N "(cached) $ECHO_C" >&6
5381 else
5382   case $PKG_CONFIG in
5383   [\\/]* | ?:[\\/]*)
5384   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5385   ;;
5386   *)
5387   ac_save_IFS=$IFS; IFS=$ac_path_separator
5388 ac_dummy="$PATH"
5389 for ac_dir in $ac_dummy; do
5390   IFS=$ac_save_IFS
5391   test -z "$ac_dir" && ac_dir=.
5392   if $as_executable_p "$ac_dir/$ac_word"; then
5393    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5394    echo "$as_me:5394: found $ac_dir/$ac_word" >&5
5395    break
5396 fi
5397 done
5398
5399   ;;
5400 esac
5401 fi
5402 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5403
5404 if test -n "$PKG_CONFIG"; then
5405   echo "$as_me:5405: result: $PKG_CONFIG" >&5
5406 echo "${ECHO_T}$PKG_CONFIG" >&6
5407 else
5408   echo "$as_me:5408: result: no" >&5
5409 echo "${ECHO_T}no" >&6
5410 fi
5411
5412 fi
5413 if test -z "$ac_cv_path_PKG_CONFIG"; then
5414   ac_pt_PKG_CONFIG=$PKG_CONFIG
5415   # Extract the first word of "pkg-config", so it can be a program name with args.
5416 set dummy pkg-config; ac_word=$2
5417 echo "$as_me:5417: checking for $ac_word" >&5
5418 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5419 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5420   echo $ECHO_N "(cached) $ECHO_C" >&6
5421 else
5422   case $ac_pt_PKG_CONFIG in
5423   [\\/]* | ?:[\\/]*)
5424   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5425   ;;
5426   *)
5427   ac_save_IFS=$IFS; IFS=$ac_path_separator
5428 ac_dummy="$PATH"
5429 for ac_dir in $ac_dummy; do
5430   IFS=$ac_save_IFS
5431   test -z "$ac_dir" && ac_dir=.
5432   if $as_executable_p "$ac_dir/$ac_word"; then
5433    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5434    echo "$as_me:5434: found $ac_dir/$ac_word" >&5
5435    break
5436 fi
5437 done
5438
5439   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5440   ;;
5441 esac
5442 fi
5443 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5444
5445 if test -n "$ac_pt_PKG_CONFIG"; then
5446   echo "$as_me:5446: result: $ac_pt_PKG_CONFIG" >&5
5447 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5448 else
5449   echo "$as_me:5449: result: no" >&5
5450 echo "${ECHO_T}no" >&6
5451 fi
5452
5453   PKG_CONFIG=$ac_pt_PKG_CONFIG
5454 else
5455   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5456 fi
5457
5458         ;;
5459 (*)
5460         PKG_CONFIG=$withval
5461         ;;
5462 esac
5463
5464 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5465 if test "$PKG_CONFIG" != none ; then
5466
5467 if test "x$prefix" != xNONE; then
5468         cf_path_syntax="$prefix"
5469 else
5470         cf_path_syntax="$ac_default_prefix"
5471 fi
5472
5473 case ".$PKG_CONFIG" in
5474 (.\$\(*\)*|.\'*\'*)
5475         ;;
5476 (..|./*|.\\*)
5477         ;;
5478 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5479         ;;
5480 (.\${*prefix}*|.\${*dir}*)
5481         eval PKG_CONFIG="$PKG_CONFIG"
5482         case ".$PKG_CONFIG" in
5483         (.NONE/*)
5484                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5485                 ;;
5486         esac
5487         ;;
5488 (.no|.NONE/*)
5489         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5490         ;;
5491 (*)
5492         { { echo "$as_me:5492: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5493 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5494    { (exit 1); exit 1; }; }
5495         ;;
5496 esac
5497
5498 elif test "x$cf_pkg_config" != xno ; then
5499         { echo "$as_me:5499: WARNING: pkg-config is not installed" >&5
5500 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5501 fi
5502
5503 echo "$as_me:5503: checking if you want to see long compiling messages" >&5
5504 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5505
5506 # Check whether --enable-echo or --disable-echo was given.
5507 if test "${enable_echo+set}" = set; then
5508   enableval="$enable_echo"
5509   test "$enableval" != no && enableval=yes
5510         if test "$enableval" != "yes" ; then
5511
5512         ECHO_LT='--silent'
5513         ECHO_LD='@echo linking $@;'
5514         RULE_CC='@echo compiling $<'
5515         SHOW_CC='@echo compiling $@'
5516         ECHO_CC='@'
5517
5518         else
5519
5520         ECHO_LT=''
5521         ECHO_LD=''
5522         RULE_CC=''
5523         SHOW_CC=''
5524         ECHO_CC=''
5525
5526         fi
5527 else
5528   enableval=yes
5529
5530         ECHO_LT=''
5531         ECHO_LD=''
5532         RULE_CC=''
5533         SHOW_CC=''
5534         ECHO_CC=''
5535
5536 fi;
5537 echo "$as_me:5537: result: $enableval" >&5
5538 echo "${ECHO_T}$enableval" >&6
5539
5540 echo "$as_me:5540: checking for ncurses wrap-prefix" >&5
5541 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5542
5543 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5544 if test "${with_ncurses_wrap_prefix+set}" = set; then
5545   withval="$with_ncurses_wrap_prefix"
5546   NCURSES_WRAP_PREFIX=$withval
5547 else
5548   NCURSES_WRAP_PREFIX=_nc_
5549 fi;
5550 echo "$as_me:5550: result: $NCURSES_WRAP_PREFIX" >&5
5551 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5552
5553 echo "$as_me:5553: checking if you want to check for wide-character functions" >&5
5554 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5555
5556 # Check whether --enable-widec or --disable-widec was given.
5557 if test "${enable_widec+set}" = set; then
5558   enableval="$enable_widec"
5559   test "$enableval" != no && enableval=yes
5560         if test "$enableval" != "yes" ; then
5561     cf_enable_widec=no
5562         else
5563                 cf_enable_widec=yes
5564         fi
5565 else
5566   enableval=yes
5567         cf_enable_widec=yes
5568
5569 fi;
5570 echo "$as_me:5570: result: $cf_enable_widec" >&5
5571 echo "${ECHO_T}$cf_enable_widec" >&6
5572
5573 echo "$as_me:5573: checking for specific curses-directory" >&5
5574 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5575
5576 # Check whether --with-curses-dir or --without-curses-dir was given.
5577 if test "${with_curses_dir+set}" = set; then
5578   withval="$with_curses_dir"
5579   cf_cv_curses_dir=$withval
5580 else
5581   cf_cv_curses_dir=no
5582 fi;
5583 echo "$as_me:5583: result: $cf_cv_curses_dir" >&5
5584 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5585
5586 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5587 then
5588
5589 if test "x$prefix" != xNONE; then
5590         cf_path_syntax="$prefix"
5591 else
5592         cf_path_syntax="$ac_default_prefix"
5593 fi
5594
5595 case ".$withval" in
5596 (.\$\(*\)*|.\'*\'*)
5597         ;;
5598 (..|./*|.\\*)
5599         ;;
5600 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5601         ;;
5602 (.\${*prefix}*|.\${*dir}*)
5603         eval withval="$withval"
5604         case ".$withval" in
5605         (.NONE/*)
5606                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5607                 ;;
5608         esac
5609         ;;
5610 (.no|.NONE/*)
5611         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5612         ;;
5613 (*)
5614         { { echo "$as_me:5614: error: expected a pathname, not \"$withval\"" >&5
5615 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5616    { (exit 1); exit 1; }; }
5617         ;;
5618 esac
5619
5620         if test -d "$cf_cv_curses_dir"
5621         then
5622
5623 if test -n "$cf_cv_curses_dir/include" ; then
5624   for cf_add_incdir in $cf_cv_curses_dir/include
5625   do
5626         while test $cf_add_incdir != /usr/include
5627         do
5628           if test -d $cf_add_incdir
5629           then
5630                 cf_have_incdir=no
5631                 if test -n "$CFLAGS$CPPFLAGS" ; then
5632                   # a loop is needed to ensure we can add subdirs of existing dirs
5633                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5634                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5635                           cf_have_incdir=yes; break
5636                         fi
5637                   done
5638                 fi
5639
5640                 if test "$cf_have_incdir" = no ; then
5641                   if test "$cf_add_incdir" = /usr/local/include ; then
5642                         if test "$GCC" = yes
5643                         then
5644                           cf_save_CPPFLAGS=$CPPFLAGS
5645
5646         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5647         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5648
5649                           cat >conftest.$ac_ext <<_ACEOF
5650 #line 5650 "configure"
5651 #include "confdefs.h"
5652 #include <stdio.h>
5653 int
5654 main (void)
5655 {
5656 printf("Hello")
5657   ;
5658   return 0;
5659 }
5660 _ACEOF
5661 rm -f conftest.$ac_objext
5662 if { (eval echo "$as_me:5662: \"$ac_compile\"") >&5
5663   (eval $ac_compile) 2>&5
5664   ac_status=$?
5665   echo "$as_me:5665: \$? = $ac_status" >&5
5666   (exit $ac_status); } &&
5667          { ac_try='test -s conftest.$ac_objext'
5668   { (eval echo "$as_me:5668: \"$ac_try\"") >&5
5669   (eval $ac_try) 2>&5
5670   ac_status=$?
5671   echo "$as_me:5671: \$? = $ac_status" >&5
5672   (exit $ac_status); }; }; then
5673   :
5674 else
5675   echo "$as_me: failed program was:" >&5
5676 cat conftest.$ac_ext >&5
5677 cf_have_incdir=yes
5678 fi
5679 rm -f conftest.$ac_objext conftest.$ac_ext
5680                           CPPFLAGS=$cf_save_CPPFLAGS
5681                         fi
5682                   fi
5683                 fi
5684
5685                 if test "$cf_have_incdir" = no ; then
5686                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5687
5688 echo "${as_me:-configure}:5688: testing adding $cf_add_incdir to include-path ..." 1>&5
5689
5690                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5691
5692                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5693                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5694                   cf_add_incdir="$cf_top_incdir"
5695                 else
5696                   break
5697                 fi
5698           else
5699                 break
5700           fi
5701         done
5702   done
5703 fi
5704
5705 if test -n "$cf_cv_curses_dir/lib" ; then
5706         for cf_add_libdir in $cf_cv_curses_dir/lib
5707         do
5708                 if test $cf_add_libdir = /usr/lib ; then
5709                         :
5710                 elif test -d $cf_add_libdir
5711                 then
5712                         cf_have_libdir=no
5713                         if test -n "$LDFLAGS$LIBS" ; then
5714                                 # a loop is needed to ensure we can add subdirs of existing dirs
5715                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5716                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5717                                                 cf_have_libdir=yes; break
5718                                         fi
5719                                 done
5720                         fi
5721                         if test "$cf_have_libdir" = no ; then
5722                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5723
5724 echo "${as_me:-configure}:5724: testing adding $cf_add_libdir to library-path ..." 1>&5
5725
5726                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5727                         fi
5728                 fi
5729         done
5730 fi
5731
5732         fi
5733 fi
5734
5735 cf_cv_screen=curses
5736
5737 echo "$as_me:5737: checking for specified curses library type" >&5
5738 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5739
5740 # Check whether --with-screen or --without-screen was given.
5741 if test "${with_screen+set}" = set; then
5742   withval="$with_screen"
5743   cf_cv_screen=$withval
5744 else
5745
5746 # Check whether --with-ncursesw or --without-ncursesw was given.
5747 if test "${with_ncursesw+set}" = set; then
5748   withval="$with_ncursesw"
5749   cf_cv_screen=ncursesw
5750 else
5751
5752 # Check whether --with-ncurses or --without-ncurses was given.
5753 if test "${with_ncurses+set}" = set; then
5754   withval="$with_ncurses"
5755   cf_cv_screen=ncurses
5756 else
5757
5758 # Check whether --with-pdcurses or --without-pdcurses was given.
5759 if test "${with_pdcurses+set}" = set; then
5760   withval="$with_pdcurses"
5761   cf_cv_screen=pdcurses
5762 else
5763
5764 # Check whether --with-curses-colr or --without-curses-colr was given.
5765 if test "${with_curses_colr+set}" = set; then
5766   withval="$with_curses_colr"
5767   cf_cv_screen=curses_colr
5768 else
5769
5770 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5771 if test "${with_curses_5lib+set}" = set; then
5772   withval="$with_curses_5lib"
5773   cf_cv_screen=curses_5lib
5774 fi;
5775 fi;
5776 fi;
5777 fi;
5778 fi;
5779 fi;
5780
5781 echo "$as_me:5781: result: $cf_cv_screen" >&5
5782 echo "${ECHO_T}$cf_cv_screen" >&6
5783
5784 case $cf_cv_screen in
5785 (curses|curses_*)
5786
5787 echo "$as_me:5787: checking for extra include directories" >&5
5788 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5789 if test "${cf_cv_curses_incdir+set}" = set; then
5790   echo $ECHO_N "(cached) $ECHO_C" >&6
5791 else
5792
5793 cf_cv_curses_incdir=no
5794 case $host_os in
5795 (hpux10.*)
5796         if test "x$cf_cv_screen" = "xcurses_colr"
5797         then
5798                 test -d /usr/include/curses_colr && \
5799                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5800         fi
5801         ;;
5802 (sunos3*|sunos4*)
5803         if test "x$cf_cv_screen" = "xcurses_5lib"
5804         then
5805                 test -d /usr/5lib && \
5806                 test -d /usr/5include && \
5807                 cf_cv_curses_incdir="-I/usr/5include"
5808         fi
5809         ;;
5810 esac
5811
5812 fi
5813 echo "$as_me:5813: result: $cf_cv_curses_incdir" >&5
5814 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5815 if test "$cf_cv_curses_incdir" != no
5816 then
5817
5818         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5819         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
5820
5821 fi
5822
5823 echo "$as_me:5823: checking if we have identified curses headers" >&5
5824 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5825 if test "${cf_cv_ncurses_header+set}" = set; then
5826   echo $ECHO_N "(cached) $ECHO_C" >&6
5827 else
5828
5829 cf_cv_ncurses_header=none
5830 for cf_header in \
5831         ncurses.h  \
5832         curses.h  ncurses/ncurses.h ncurses/curses.h
5833 do
5834 cat >conftest.$ac_ext <<_ACEOF
5835 #line 5835 "configure"
5836 #include "confdefs.h"
5837 #include <${cf_header}>
5838 int
5839 main (void)
5840 {
5841 initscr(); tgoto("?", 0,0)
5842   ;
5843   return 0;
5844 }
5845 _ACEOF
5846 rm -f conftest.$ac_objext
5847 if { (eval echo "$as_me:5847: \"$ac_compile\"") >&5
5848   (eval $ac_compile) 2>&5
5849   ac_status=$?
5850   echo "$as_me:5850: \$? = $ac_status" >&5
5851   (exit $ac_status); } &&
5852          { ac_try='test -s conftest.$ac_objext'
5853   { (eval echo "$as_me:5853: \"$ac_try\"") >&5
5854   (eval $ac_try) 2>&5
5855   ac_status=$?
5856   echo "$as_me:5856: \$? = $ac_status" >&5
5857   (exit $ac_status); }; }; then
5858   cf_cv_ncurses_header=$cf_header; break
5859 else
5860   echo "$as_me: failed program was:" >&5
5861 cat conftest.$ac_ext >&5
5862 fi
5863 rm -f conftest.$ac_objext conftest.$ac_ext
5864 done
5865
5866 fi
5867 echo "$as_me:5867: result: $cf_cv_ncurses_header" >&5
5868 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5869
5870 if test "$cf_cv_ncurses_header" = none ; then
5871         { { echo "$as_me:5871: error: No curses header-files found" >&5
5872 echo "$as_me: error: No curses header-files found" >&2;}
5873    { (exit 1); exit 1; }; }
5874 fi
5875
5876 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5877
5878 for ac_header in $cf_cv_ncurses_header
5879 do
5880 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5881 echo "$as_me:5881: checking for $ac_header" >&5
5882 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5883 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5884   echo $ECHO_N "(cached) $ECHO_C" >&6
5885 else
5886   cat >conftest.$ac_ext <<_ACEOF
5887 #line 5887 "configure"
5888 #include "confdefs.h"
5889 #include <$ac_header>
5890 _ACEOF
5891 if { (eval echo "$as_me:5891: \"$ac_cpp conftest.$ac_ext\"") >&5
5892   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5893   ac_status=$?
5894   egrep -v '^ *\+' conftest.er1 >conftest.err
5895   rm -f conftest.er1
5896   cat conftest.err >&5
5897   echo "$as_me:5897: \$? = $ac_status" >&5
5898   (exit $ac_status); } >/dev/null; then
5899   if test -s conftest.err; then
5900     ac_cpp_err=$ac_c_preproc_warn_flag
5901   else
5902     ac_cpp_err=
5903   fi
5904 else
5905   ac_cpp_err=yes
5906 fi
5907 if test -z "$ac_cpp_err"; then
5908   eval "$as_ac_Header=yes"
5909 else
5910   echo "$as_me: failed program was:" >&5
5911   cat conftest.$ac_ext >&5
5912   eval "$as_ac_Header=no"
5913 fi
5914 rm -f conftest.err conftest.$ac_ext
5915 fi
5916 echo "$as_me:5916: result: `eval echo '${'$as_ac_Header'}'`" >&5
5917 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5918 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5919   cat >>confdefs.h <<EOF
5920 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5921 EOF
5922
5923 fi
5924 done
5925
5926 echo "$as_me:5926: checking for terminfo header" >&5
5927 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5928 if test "${cf_cv_term_header+set}" = set; then
5929   echo $ECHO_N "(cached) $ECHO_C" >&6
5930 else
5931
5932 case ${cf_cv_ncurses_header} in
5933 (*/ncurses.h|*/ncursesw.h)
5934         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5935         ;;
5936 (*)
5937         cf_term_header=term.h
5938         ;;
5939 esac
5940
5941 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5942 do
5943 cat >conftest.$ac_ext <<_ACEOF
5944 #line 5944 "configure"
5945 #include "confdefs.h"
5946 #include <stdio.h>
5947 #include <${cf_cv_ncurses_header:-curses.h}>
5948 #include <$cf_test>
5949
5950 int
5951 main (void)
5952 {
5953 int x = auto_left_margin
5954   ;
5955   return 0;
5956 }
5957 _ACEOF
5958 rm -f conftest.$ac_objext
5959 if { (eval echo "$as_me:5959: \"$ac_compile\"") >&5
5960   (eval $ac_compile) 2>&5
5961   ac_status=$?
5962   echo "$as_me:5962: \$? = $ac_status" >&5
5963   (exit $ac_status); } &&
5964          { ac_try='test -s conftest.$ac_objext'
5965   { (eval echo "$as_me:5965: \"$ac_try\"") >&5
5966   (eval $ac_try) 2>&5
5967   ac_status=$?
5968   echo "$as_me:5968: \$? = $ac_status" >&5
5969   (exit $ac_status); }; }; then
5970
5971         cf_cv_term_header="$cf_test"
5972 else
5973   echo "$as_me: failed program was:" >&5
5974 cat conftest.$ac_ext >&5
5975
5976         cf_cv_term_header=unknown
5977
5978 fi
5979 rm -f conftest.$ac_objext conftest.$ac_ext
5980         test "$cf_cv_term_header" != unknown && break
5981 done
5982
5983 fi
5984 echo "$as_me:5984: result: $cf_cv_term_header" >&5
5985 echo "${ECHO_T}$cf_cv_term_header" >&6
5986
5987 # Set definitions to allow ifdef'ing to accommodate subdirectories
5988
5989 case $cf_cv_term_header in
5990 (*term.h)
5991
5992 cat >>confdefs.h <<\EOF
5993 #define HAVE_TERM_H 1
5994 EOF
5995
5996         ;;
5997 esac
5998
5999 case $cf_cv_term_header in
6000 (ncurses/term.h)
6001
6002 cat >>confdefs.h <<\EOF
6003 #define HAVE_NCURSES_TERM_H 1
6004 EOF
6005
6006         ;;
6007 (ncursesw/term.h)
6008
6009 cat >>confdefs.h <<\EOF
6010 #define HAVE_NCURSESW_TERM_H 1
6011 EOF
6012
6013         ;;
6014 esac
6015
6016 echo "$as_me:6016: checking for ncurses version" >&5
6017 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6018 if test "${cf_cv_ncurses_version+set}" = set; then
6019   echo $ECHO_N "(cached) $ECHO_C" >&6
6020 else
6021
6022         cf_cv_ncurses_version=no
6023         cf_tempfile=out$$
6024         rm -f $cf_tempfile
6025         if test "$cross_compiling" = yes; then
6026
6027         # This will not work if the preprocessor splits the line after the
6028         # Autoconf token.  The 'unproto' program does that.
6029         cat > conftest.$ac_ext <<EOF
6030 #include <${cf_cv_ncurses_header:-curses.h}>
6031 #undef Autoconf
6032 #ifdef NCURSES_VERSION
6033 Autoconf NCURSES_VERSION
6034 #else
6035 #ifdef __NCURSES_H
6036 Autoconf "old"
6037 #endif
6038 ;
6039 #endif
6040 EOF
6041         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6042         { (eval echo "$as_me:6042: \"$cf_try\"") >&5
6043   (eval $cf_try) 2>&5
6044   ac_status=$?
6045   echo "$as_me:6045: \$? = $ac_status" >&5
6046   (exit $ac_status); }
6047         if test -f conftest.out ; then
6048                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6049                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6050                 rm -f conftest.out
6051         fi
6052
6053 else
6054   cat >conftest.$ac_ext <<_ACEOF
6055 #line 6055 "configure"
6056 #include "confdefs.h"
6057
6058 #include <${cf_cv_ncurses_header:-curses.h}>
6059 #include <stdio.h>
6060 int main(void)
6061 {
6062         FILE *fp = fopen("$cf_tempfile", "w");
6063 #ifdef NCURSES_VERSION
6064 # ifdef NCURSES_VERSION_PATCH
6065         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6066 # else
6067         fprintf(fp, "%s\n", NCURSES_VERSION);
6068 # endif
6069 #else
6070 # ifdef __NCURSES_H
6071         fprintf(fp, "old\n");
6072 # else
6073         make an error
6074 # endif
6075 #endif
6076         ${cf_cv_main_return:-return}(0);
6077 }
6078 _ACEOF
6079 rm -f conftest$ac_exeext
6080 if { (eval echo "$as_me:6080: \"$ac_link\"") >&5
6081   (eval $ac_link) 2>&5
6082   ac_status=$?
6083   echo "$as_me:6083: \$? = $ac_status" >&5
6084   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6085   { (eval echo "$as_me:6085: \"$ac_try\"") >&5
6086   (eval $ac_try) 2>&5
6087   ac_status=$?
6088   echo "$as_me:6088: \$? = $ac_status" >&5
6089   (exit $ac_status); }; }; then
6090
6091         cf_cv_ncurses_version=`cat $cf_tempfile`
6092 else
6093   echo "$as_me: program exited with status $ac_status" >&5
6094 echo "$as_me: failed program was:" >&5
6095 cat conftest.$ac_ext >&5
6096 fi
6097 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6098 fi
6099         rm -f $cf_tempfile
6100
6101 fi
6102 echo "$as_me:6102: result: $cf_cv_ncurses_version" >&5
6103 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6104 test "$cf_cv_ncurses_version" = no ||
6105 cat >>confdefs.h <<\EOF
6106 #define NCURSES 1
6107 EOF
6108
6109 echo "$as_me:6109: checking if we have identified curses libraries" >&5
6110 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6111 cat >conftest.$ac_ext <<_ACEOF
6112 #line 6112 "configure"
6113 #include "confdefs.h"
6114 #include <${cf_cv_ncurses_header:-curses.h}>
6115 int
6116 main (void)
6117 {
6118 initscr(); tgoto("?", 0,0)
6119   ;
6120   return 0;
6121 }
6122 _ACEOF
6123 rm -f conftest.$ac_objext conftest$ac_exeext
6124 if { (eval echo "$as_me:6124: \"$ac_link\"") >&5
6125   (eval $ac_link) 2>&5
6126   ac_status=$?
6127   echo "$as_me:6127: \$? = $ac_status" >&5
6128   (exit $ac_status); } &&
6129          { ac_try='test -s conftest$ac_exeext'
6130   { (eval echo "$as_me:6130: \"$ac_try\"") >&5
6131   (eval $ac_try) 2>&5
6132   ac_status=$?
6133   echo "$as_me:6133: \$? = $ac_status" >&5
6134   (exit $ac_status); }; }; then
6135   cf_result=yes
6136 else
6137   echo "$as_me: failed program was:" >&5
6138 cat conftest.$ac_ext >&5
6139 cf_result=no
6140 fi
6141 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6142 echo "$as_me:6142: result: $cf_result" >&5
6143 echo "${ECHO_T}$cf_result" >&6
6144
6145 if test "$cf_result" = no ; then
6146 case $host_os in
6147 (freebsd*)
6148         echo "$as_me:6148: checking for tgoto in -lmytinfo" >&5
6149 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6150 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6151   echo $ECHO_N "(cached) $ECHO_C" >&6
6152 else
6153   ac_check_lib_save_LIBS=$LIBS
6154 LIBS="-lmytinfo  $LIBS"
6155 cat >conftest.$ac_ext <<_ACEOF
6156 #line 6156 "configure"
6157 #include "confdefs.h"
6158
6159 /* Override any gcc2 internal prototype to avoid an error.  */
6160 #ifdef __cplusplus
6161 extern "C"
6162 #endif
6163 /* We use char because int might match the return type of a gcc2
6164    builtin and then its argument prototype would still apply.  */
6165 char tgoto ();
6166 int
6167 main (void)
6168 {
6169 tgoto ();
6170   ;
6171   return 0;
6172 }
6173 _ACEOF
6174 rm -f conftest.$ac_objext conftest$ac_exeext
6175 if { (eval echo "$as_me:6175: \"$ac_link\"") >&5
6176   (eval $ac_link) 2>&5
6177   ac_status=$?
6178   echo "$as_me:6178: \$? = $ac_status" >&5
6179   (exit $ac_status); } &&
6180          { ac_try='test -s conftest$ac_exeext'
6181   { (eval echo "$as_me:6181: \"$ac_try\"") >&5
6182   (eval $ac_try) 2>&5
6183   ac_status=$?
6184   echo "$as_me:6184: \$? = $ac_status" >&5
6185   (exit $ac_status); }; }; then
6186   ac_cv_lib_mytinfo_tgoto=yes
6187 else
6188   echo "$as_me: failed program was:" >&5
6189 cat conftest.$ac_ext >&5
6190 ac_cv_lib_mytinfo_tgoto=no
6191 fi
6192 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6193 LIBS=$ac_check_lib_save_LIBS
6194 fi
6195 echo "$as_me:6195: result: $ac_cv_lib_mytinfo_tgoto" >&5
6196 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6197 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6198
6199 cf_add_libs="-lmytinfo"
6200 # Filter out duplicates - this happens with badly-designed ".pc" files...
6201 for cf_add_1lib in $LIBS
6202 do
6203         for cf_add_2lib in $cf_add_libs
6204         do
6205                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6206                 then
6207                         cf_add_1lib=
6208                         break
6209                 fi
6210         done
6211         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6212 done
6213 LIBS="$cf_add_libs"
6214
6215 fi
6216
6217         ;;
6218 (hpux10.*)
6219         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6220         # next (1998), and xcurses "newer" (2000).  There is no header file for
6221         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6222         # term.h) for cur_colr
6223         if test "x$cf_cv_screen" = "xcurses_colr"
6224         then
6225                 echo "$as_me:6225: checking for initscr in -lcur_colr" >&5
6226 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6227 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6228   echo $ECHO_N "(cached) $ECHO_C" >&6
6229 else
6230   ac_check_lib_save_LIBS=$LIBS
6231 LIBS="-lcur_colr  $LIBS"
6232 cat >conftest.$ac_ext <<_ACEOF
6233 #line 6233 "configure"
6234 #include "confdefs.h"
6235
6236 /* Override any gcc2 internal prototype to avoid an error.  */
6237 #ifdef __cplusplus
6238 extern "C"
6239 #endif
6240 /* We use char because int might match the return type of a gcc2
6241    builtin and then its argument prototype would still apply.  */
6242 char initscr ();
6243 int
6244 main (void)
6245 {
6246 initscr ();
6247   ;
6248   return 0;
6249 }
6250 _ACEOF
6251 rm -f conftest.$ac_objext conftest$ac_exeext
6252 if { (eval echo "$as_me:6252: \"$ac_link\"") >&5
6253   (eval $ac_link) 2>&5
6254   ac_status=$?
6255   echo "$as_me:6255: \$? = $ac_status" >&5
6256   (exit $ac_status); } &&
6257          { ac_try='test -s conftest$ac_exeext'
6258   { (eval echo "$as_me:6258: \"$ac_try\"") >&5
6259   (eval $ac_try) 2>&5
6260   ac_status=$?
6261   echo "$as_me:6261: \$? = $ac_status" >&5
6262   (exit $ac_status); }; }; then
6263   ac_cv_lib_cur_colr_initscr=yes
6264 else
6265   echo "$as_me: failed program was:" >&5
6266 cat conftest.$ac_ext >&5
6267 ac_cv_lib_cur_colr_initscr=no
6268 fi
6269 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6270 LIBS=$ac_check_lib_save_LIBS
6271 fi
6272 echo "$as_me:6272: result: $ac_cv_lib_cur_colr_initscr" >&5
6273 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6274 if test $ac_cv_lib_cur_colr_initscr = yes; then
6275
6276 cf_add_libs="-lcur_colr"
6277 # Filter out duplicates - this happens with badly-designed ".pc" files...
6278 for cf_add_1lib in $LIBS
6279 do
6280         for cf_add_2lib in $cf_add_libs
6281         do
6282                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6283                 then
6284                         cf_add_1lib=
6285                         break
6286                 fi
6287         done
6288         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6289 done
6290 LIBS="$cf_add_libs"
6291
6292                         ac_cv_func_initscr=yes
6293
6294 else
6295
6296                 echo "$as_me:6296: checking for initscr in -lHcurses" >&5
6297 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6298 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6299   echo $ECHO_N "(cached) $ECHO_C" >&6
6300 else
6301   ac_check_lib_save_LIBS=$LIBS
6302 LIBS="-lHcurses  $LIBS"
6303 cat >conftest.$ac_ext <<_ACEOF
6304 #line 6304 "configure"
6305 #include "confdefs.h"
6306
6307 /* Override any gcc2 internal prototype to avoid an error.  */
6308 #ifdef __cplusplus
6309 extern "C"
6310 #endif
6311 /* We use char because int might match the return type of a gcc2
6312    builtin and then its argument prototype would still apply.  */
6313 char initscr ();
6314 int
6315 main (void)
6316 {
6317 initscr ();
6318   ;
6319   return 0;
6320 }
6321 _ACEOF
6322 rm -f conftest.$ac_objext conftest$ac_exeext
6323 if { (eval echo "$as_me:6323: \"$ac_link\"") >&5
6324   (eval $ac_link) 2>&5
6325   ac_status=$?
6326   echo "$as_me:6326: \$? = $ac_status" >&5
6327   (exit $ac_status); } &&
6328          { ac_try='test -s conftest$ac_exeext'
6329   { (eval echo "$as_me:6329: \"$ac_try\"") >&5
6330   (eval $ac_try) 2>&5
6331   ac_status=$?
6332   echo "$as_me:6332: \$? = $ac_status" >&5
6333   (exit $ac_status); }; }; then
6334   ac_cv_lib_Hcurses_initscr=yes
6335 else
6336   echo "$as_me: failed program was:" >&5
6337 cat conftest.$ac_ext >&5
6338 ac_cv_lib_Hcurses_initscr=no
6339 fi
6340 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6341 LIBS=$ac_check_lib_save_LIBS
6342 fi
6343 echo "$as_me:6343: result: $ac_cv_lib_Hcurses_initscr" >&5
6344 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6345 if test $ac_cv_lib_Hcurses_initscr = yes; then
6346
6347                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6348
6349 cf_add_libs="-lHcurses"
6350 # Filter out duplicates - this happens with badly-designed ".pc" files...
6351 for cf_add_1lib in $LIBS
6352 do
6353         for cf_add_2lib in $cf_add_libs
6354         do
6355                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6356                 then
6357                         cf_add_1lib=
6358                         break
6359                 fi
6360         done
6361         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6362 done
6363 LIBS="$cf_add_libs"
6364
6365         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6366         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6367
6368                         ac_cv_func_initscr=yes
6369
6370 fi
6371
6372 fi
6373
6374         fi
6375         ;;
6376 (linux*)
6377         case `arch 2>/dev/null` in
6378         (x86_64)
6379                 if test -d /lib64
6380                 then
6381
6382 if test -n "/lib64" ; then
6383         for cf_add_libdir in /lib64
6384         do
6385                 if test $cf_add_libdir = /usr/lib ; then
6386                         :
6387                 elif test -d $cf_add_libdir
6388                 then
6389                         cf_have_libdir=no
6390                         if test -n "$LDFLAGS$LIBS" ; then
6391                                 # a loop is needed to ensure we can add subdirs of existing dirs
6392                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6393                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6394                                                 cf_have_libdir=yes; break
6395                                         fi
6396                                 done
6397                         fi
6398                         if test "$cf_have_libdir" = no ; then
6399                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6400
6401 echo "${as_me:-configure}:6401: testing adding $cf_add_libdir to library-path ..." 1>&5
6402
6403                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6404                         fi
6405                 fi
6406         done
6407 fi
6408
6409                 else
6410
6411 if test -n "/lib" ; then
6412         for cf_add_libdir in /lib
6413         do
6414                 if test $cf_add_libdir = /usr/lib ; then
6415                         :
6416                 elif test -d $cf_add_libdir
6417                 then
6418                         cf_have_libdir=no
6419                         if test -n "$LDFLAGS$LIBS" ; then
6420                                 # a loop is needed to ensure we can add subdirs of existing dirs
6421                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6422                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6423                                                 cf_have_libdir=yes; break
6424                                         fi
6425                                 done
6426                         fi
6427                         if test "$cf_have_libdir" = no ; then
6428                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6429
6430 echo "${as_me:-configure}:6430: testing adding $cf_add_libdir to library-path ..." 1>&5
6431
6432                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6433                         fi
6434                 fi
6435         done
6436 fi
6437
6438                 fi
6439                 ;;
6440         (*)
6441
6442 if test -n "/lib" ; then
6443         for cf_add_libdir in /lib
6444         do
6445                 if test $cf_add_libdir = /usr/lib ; then
6446                         :
6447                 elif test -d $cf_add_libdir
6448                 then
6449                         cf_have_libdir=no
6450                         if test -n "$LDFLAGS$LIBS" ; then
6451                                 # a loop is needed to ensure we can add subdirs of existing dirs
6452                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6453                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6454                                                 cf_have_libdir=yes; break
6455                                         fi
6456                                 done
6457                         fi
6458                         if test "$cf_have_libdir" = no ; then
6459                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6460
6461 echo "${as_me:-configure}:6461: testing adding $cf_add_libdir to library-path ..." 1>&5
6462
6463                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6464                         fi
6465                 fi
6466         done
6467 fi
6468
6469                 ;;
6470         esac
6471         ;;
6472 (sunos3*|sunos4*)
6473         if test "x$cf_cv_screen" = "xcurses_5lib"
6474         then
6475                 if test -d /usr/5lib ; then
6476
6477 if test -n "/usr/5lib" ; then
6478         for cf_add_libdir in /usr/5lib
6479         do
6480                 if test $cf_add_libdir = /usr/lib ; then
6481                         :
6482                 elif test -d $cf_add_libdir
6483                 then
6484                         cf_have_libdir=no
6485                         if test -n "$LDFLAGS$LIBS" ; then
6486                                 # a loop is needed to ensure we can add subdirs of existing dirs
6487                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6488                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6489                                                 cf_have_libdir=yes; break
6490                                         fi
6491                                 done
6492                         fi
6493                         if test "$cf_have_libdir" = no ; then
6494                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6495
6496 echo "${as_me:-configure}:6496: testing adding $cf_add_libdir to library-path ..." 1>&5
6497
6498                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6499                         fi
6500                 fi
6501         done
6502 fi
6503
6504 cf_add_libs="-lcurses -ltermcap"
6505 # Filter out duplicates - this happens with badly-designed ".pc" files...
6506 for cf_add_1lib in $LIBS
6507 do
6508         for cf_add_2lib in $cf_add_libs
6509         do
6510                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6511                 then
6512                         cf_add_1lib=
6513                         break
6514                 fi
6515         done
6516         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6517 done
6518 LIBS="$cf_add_libs"
6519
6520                 fi
6521         fi
6522         ac_cv_func_initscr=yes
6523         ;;
6524 esac
6525
6526 if test ".$ac_cv_func_initscr" != .yes ; then
6527         cf_save_LIBS="$LIBS"
6528
6529         if test ".${cf_cv_ncurses_version:-no}" != .no
6530         then
6531                 cf_check_list="ncurses curses cursesX"
6532         else
6533                 cf_check_list="cursesX curses ncurses"
6534         fi
6535
6536         # Check for library containing tgoto.  Do this before curses library
6537         # because it may be needed to link the test-case for initscr.
6538         if test "x$cf_term_lib" = x
6539         then
6540                 echo "$as_me:6540: checking for tgoto" >&5
6541 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6542 if test "${ac_cv_func_tgoto+set}" = set; then
6543   echo $ECHO_N "(cached) $ECHO_C" >&6
6544 else
6545   cat >conftest.$ac_ext <<_ACEOF
6546 #line 6546 "configure"
6547 #include "confdefs.h"
6548 /* System header to define __stub macros and hopefully few prototypes,
6549     which can conflict with char tgoto (); below.  */
6550 #include <assert.h>
6551 /* Override any gcc2 internal prototype to avoid an error.  */
6552 #ifdef __cplusplus
6553 extern "C"
6554 #endif
6555 /* We use char because int might match the return type of a gcc2
6556    builtin and then its argument prototype would still apply.  */
6557 char tgoto ();
6558 char (*f) ();
6559
6560 int
6561 main (void)
6562 {
6563 /* The GNU C library defines this for functions which it implements
6564     to always fail with ENOSYS.  Some functions are actually named
6565     something starting with __ and the normal name is an alias.  */
6566 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6567 choke me
6568 #else
6569 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6570 #endif
6571
6572   ;
6573   return 0;
6574 }
6575 _ACEOF
6576 rm -f conftest.$ac_objext conftest$ac_exeext
6577 if { (eval echo "$as_me:6577: \"$ac_link\"") >&5
6578   (eval $ac_link) 2>&5
6579   ac_status=$?
6580   echo "$as_me:6580: \$? = $ac_status" >&5
6581   (exit $ac_status); } &&
6582          { ac_try='test -s conftest$ac_exeext'
6583   { (eval echo "$as_me:6583: \"$ac_try\"") >&5
6584   (eval $ac_try) 2>&5
6585   ac_status=$?
6586   echo "$as_me:6586: \$? = $ac_status" >&5
6587   (exit $ac_status); }; }; then
6588   ac_cv_func_tgoto=yes
6589 else
6590   echo "$as_me: failed program was:" >&5
6591 cat conftest.$ac_ext >&5
6592 ac_cv_func_tgoto=no
6593 fi
6594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6595 fi
6596 echo "$as_me:6596: result: $ac_cv_func_tgoto" >&5
6597 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6598 if test $ac_cv_func_tgoto = yes; then
6599   cf_term_lib=predefined
6600 else
6601
6602                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6603                         do
6604                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6605 echo "$as_me:6605: checking for tgoto in -l$cf_term_lib" >&5
6606 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6607 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6608   echo $ECHO_N "(cached) $ECHO_C" >&6
6609 else
6610   ac_check_lib_save_LIBS=$LIBS
6611 LIBS="-l$cf_term_lib  $LIBS"
6612 cat >conftest.$ac_ext <<_ACEOF
6613 #line 6613 "configure"
6614 #include "confdefs.h"
6615
6616 /* Override any gcc2 internal prototype to avoid an error.  */
6617 #ifdef __cplusplus
6618 extern "C"
6619 #endif
6620 /* We use char because int might match the return type of a gcc2
6621    builtin and then its argument prototype would still apply.  */
6622 char tgoto ();
6623 int
6624 main (void)
6625 {
6626 tgoto ();
6627   ;
6628   return 0;
6629 }
6630 _ACEOF
6631 rm -f conftest.$ac_objext conftest$ac_exeext
6632 if { (eval echo "$as_me:6632: \"$ac_link\"") >&5
6633   (eval $ac_link) 2>&5
6634   ac_status=$?
6635   echo "$as_me:6635: \$? = $ac_status" >&5
6636   (exit $ac_status); } &&
6637          { ac_try='test -s conftest$ac_exeext'
6638   { (eval echo "$as_me:6638: \"$ac_try\"") >&5
6639   (eval $ac_try) 2>&5
6640   ac_status=$?
6641   echo "$as_me:6641: \$? = $ac_status" >&5
6642   (exit $ac_status); }; }; then
6643   eval "$as_ac_Lib=yes"
6644 else
6645   echo "$as_me: failed program was:" >&5
6646 cat conftest.$ac_ext >&5
6647 eval "$as_ac_Lib=no"
6648 fi
6649 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6650 LIBS=$ac_check_lib_save_LIBS
6651 fi
6652 echo "$as_me:6652: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6653 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6654 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6655
6656                                         : ${cf_nculib_root:=$cf_term_lib}
6657                                         break
6658
6659 fi
6660
6661                         done
6662
6663 fi
6664
6665         fi
6666
6667         # Check for library containing initscr
6668         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6669         if test "x$cf_curs_lib" = x
6670         then
6671                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6672                 do
6673                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6674                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6675                                 echo "$as_me:6675: checking if we can link with $cf_curs_lib library" >&5
6676 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6677                                 cat >conftest.$ac_ext <<_ACEOF
6678 #line 6678 "configure"
6679 #include "confdefs.h"
6680 #include <${cf_cv_ncurses_header:-curses.h}>
6681 int
6682 main (void)
6683 {
6684 initscr()
6685   ;
6686   return 0;
6687 }
6688 _ACEOF
6689 rm -f conftest.$ac_objext conftest$ac_exeext
6690 if { (eval echo "$as_me:6690: \"$ac_link\"") >&5
6691   (eval $ac_link) 2>&5
6692   ac_status=$?
6693   echo "$as_me:6693: \$? = $ac_status" >&5
6694   (exit $ac_status); } &&
6695          { ac_try='test -s conftest$ac_exeext'
6696   { (eval echo "$as_me:6696: \"$ac_try\"") >&5
6697   (eval $ac_try) 2>&5
6698   ac_status=$?
6699   echo "$as_me:6699: \$? = $ac_status" >&5
6700   (exit $ac_status); }; }; then
6701   cf_result=yes
6702 else
6703   echo "$as_me: failed program was:" >&5
6704 cat conftest.$ac_ext >&5
6705 cf_result=no
6706 fi
6707 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6708                                 echo "$as_me:6708: result: $cf_result" >&5
6709 echo "${ECHO_T}$cf_result" >&6
6710                                 test $cf_result = yes && break
6711                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6712                                 cf_result=no
6713                         elif test "$cf_term_lib" != predefined ; then
6714                                 echo "$as_me:6714: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6715 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6716                                 cat >conftest.$ac_ext <<_ACEOF
6717 #line 6717 "configure"
6718 #include "confdefs.h"
6719 #include <${cf_cv_ncurses_header:-curses.h}>
6720 int
6721 main (void)
6722 {
6723 initscr(); tgoto((char *)0, 0, 0);
6724   ;
6725   return 0;
6726 }
6727 _ACEOF
6728 rm -f conftest.$ac_objext conftest$ac_exeext
6729 if { (eval echo "$as_me:6729: \"$ac_link\"") >&5
6730   (eval $ac_link) 2>&5
6731   ac_status=$?
6732   echo "$as_me:6732: \$? = $ac_status" >&5
6733   (exit $ac_status); } &&
6734          { ac_try='test -s conftest$ac_exeext'
6735   { (eval echo "$as_me:6735: \"$ac_try\"") >&5
6736   (eval $ac_try) 2>&5
6737   ac_status=$?
6738   echo "$as_me:6738: \$? = $ac_status" >&5
6739   (exit $ac_status); }; }; then
6740   cf_result=no
6741 else
6742   echo "$as_me: failed program was:" >&5
6743 cat conftest.$ac_ext >&5
6744
6745                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6746                                         cat >conftest.$ac_ext <<_ACEOF
6747 #line 6747 "configure"
6748 #include "confdefs.h"
6749 #include <${cf_cv_ncurses_header:-curses.h}>
6750 int
6751 main (void)
6752 {
6753 initscr()
6754   ;
6755   return 0;
6756 }
6757 _ACEOF
6758 rm -f conftest.$ac_objext conftest$ac_exeext
6759 if { (eval echo "$as_me:6759: \"$ac_link\"") >&5
6760   (eval $ac_link) 2>&5
6761   ac_status=$?
6762   echo "$as_me:6762: \$? = $ac_status" >&5
6763   (exit $ac_status); } &&
6764          { ac_try='test -s conftest$ac_exeext'
6765   { (eval echo "$as_me:6765: \"$ac_try\"") >&5
6766   (eval $ac_try) 2>&5
6767   ac_status=$?
6768   echo "$as_me:6768: \$? = $ac_status" >&5
6769   (exit $ac_status); }; }; then
6770   cf_result=yes
6771 else
6772   echo "$as_me: failed program was:" >&5
6773 cat conftest.$ac_ext >&5
6774 cf_result=error
6775 fi
6776 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6777
6778 fi
6779 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6780                                 echo "$as_me:6780: result: $cf_result" >&5
6781 echo "${ECHO_T}$cf_result" >&6
6782                                 test $cf_result != error && break
6783                         fi
6784                 done
6785         fi
6786         test $cf_curs_lib = unknown && { { echo "$as_me:6786: error: no curses library found" >&5
6787 echo "$as_me: error: no curses library found" >&2;}
6788    { (exit 1); exit 1; }; }
6789 fi
6790 fi
6791
6792         ;;
6793 (ncursesw*)
6794
6795 echo "$as_me:6795: checking for multibyte character support" >&5
6796 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6797 if test "${cf_cv_utf8_lib+set}" = set; then
6798   echo $ECHO_N "(cached) $ECHO_C" >&6
6799 else
6800
6801         cf_save_LIBS="$LIBS"
6802         cat >conftest.$ac_ext <<_ACEOF
6803 #line 6803 "configure"
6804 #include "confdefs.h"
6805
6806 #include <stdlib.h>
6807 int
6808 main (void)
6809 {
6810 putwc(0,0);
6811   ;
6812   return 0;
6813 }
6814 _ACEOF
6815 rm -f conftest.$ac_objext conftest$ac_exeext
6816 if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
6817   (eval $ac_link) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit $ac_status); } &&
6821          { ac_try='test -s conftest$ac_exeext'
6822   { (eval echo "$as_me:6822: \"$ac_try\"") >&5
6823   (eval $ac_try) 2>&5
6824   ac_status=$?
6825   echo "$as_me:6825: \$? = $ac_status" >&5
6826   (exit $ac_status); }; }; then
6827   cf_cv_utf8_lib=yes
6828 else
6829   echo "$as_me: failed program was:" >&5
6830 cat conftest.$ac_ext >&5
6831
6832 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6833 # will be set on completion of the AC_TRY_LINK below.
6834 cf_cv_header_path_utf8=
6835 cf_cv_library_path_utf8=
6836
6837 echo "${as_me:-configure}:6837: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6838
6839 cf_save_LIBS="$LIBS"
6840
6841 cat >conftest.$ac_ext <<_ACEOF
6842 #line 6842 "configure"
6843 #include "confdefs.h"
6844
6845 #include <libutf8.h>
6846 int
6847 main (void)
6848 {
6849 putwc(0,0);
6850   ;
6851   return 0;
6852 }
6853 _ACEOF
6854 rm -f conftest.$ac_objext conftest$ac_exeext
6855 if { (eval echo "$as_me:6855: \"$ac_link\"") >&5
6856   (eval $ac_link) 2>&5
6857   ac_status=$?
6858   echo "$as_me:6858: \$? = $ac_status" >&5
6859   (exit $ac_status); } &&
6860          { ac_try='test -s conftest$ac_exeext'
6861   { (eval echo "$as_me:6861: \"$ac_try\"") >&5
6862   (eval $ac_try) 2>&5
6863   ac_status=$?
6864   echo "$as_me:6864: \$? = $ac_status" >&5
6865   (exit $ac_status); }; }; then
6866
6867         cf_cv_find_linkage_utf8=yes
6868         cf_cv_header_path_utf8=/usr/include
6869         cf_cv_library_path_utf8=/usr/lib
6870
6871 else
6872   echo "$as_me: failed program was:" >&5
6873 cat conftest.$ac_ext >&5
6874
6875 LIBS="-lutf8  $cf_save_LIBS"
6876
6877 cat >conftest.$ac_ext <<_ACEOF
6878 #line 6878 "configure"
6879 #include "confdefs.h"
6880
6881 #include <libutf8.h>
6882 int
6883 main (void)
6884 {
6885 putwc(0,0);
6886   ;
6887   return 0;
6888 }
6889 _ACEOF
6890 rm -f conftest.$ac_objext conftest$ac_exeext
6891 if { (eval echo "$as_me:6891: \"$ac_link\"") >&5
6892   (eval $ac_link) 2>&5
6893   ac_status=$?
6894   echo "$as_me:6894: \$? = $ac_status" >&5
6895   (exit $ac_status); } &&
6896          { ac_try='test -s conftest$ac_exeext'
6897   { (eval echo "$as_me:6897: \"$ac_try\"") >&5
6898   (eval $ac_try) 2>&5
6899   ac_status=$?
6900   echo "$as_me:6900: \$? = $ac_status" >&5
6901   (exit $ac_status); }; }; then
6902
6903         cf_cv_find_linkage_utf8=yes
6904         cf_cv_header_path_utf8=/usr/include
6905         cf_cv_library_path_utf8=/usr/lib
6906         cf_cv_library_file_utf8="-lutf8"
6907
6908 else
6909   echo "$as_me: failed program was:" >&5
6910 cat conftest.$ac_ext >&5
6911
6912         cf_cv_find_linkage_utf8=no
6913         LIBS="$cf_save_LIBS"
6914
6915         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6916
6917 echo "${as_me:-configure}:6917: testing find linkage for utf8 library ..." 1>&5
6918
6919 echo "${as_me:-configure}:6919: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6920
6921         cf_save_CPPFLAGS="$CPPFLAGS"
6922         cf_test_CPPFLAGS="$CPPFLAGS"
6923
6924 cf_search=
6925
6926 # collect the current set of include-directories from compiler flags
6927 cf_header_path_list=""
6928 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6929         for cf_header_path in $CPPFLAGS $CFLAGS
6930         do
6931                 case $cf_header_path in
6932                 (-I*)
6933                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6934
6935 test "x$cf_header_path" != "xNONE" && \
6936 test -d "$cf_header_path" && \
6937  {
6938         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6939         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6940         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6941         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6942         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6943         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6944 }
6945
6946                         cf_header_path_list="$cf_header_path_list $cf_search"
6947                         ;;
6948                 esac
6949         done
6950 fi
6951
6952 # add the variations for the package we are looking for
6953
6954 cf_search=
6955
6956 test "x$prefix" != "xNONE" && \
6957 test -d "$prefix" && \
6958  {
6959         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6960         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6961         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6962         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6963         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6964         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6965 }
6966
6967 for cf_subdir_prefix in \
6968         /usr \
6969         /usr/local \
6970         /usr/pkg \
6971         /opt \
6972         /opt/local \
6973         $HOME
6974 do
6975
6976 test "x$cf_subdir_prefix" != "x$prefix" && \
6977 test -d "$cf_subdir_prefix" && \
6978 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6979         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6980         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6981         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6982         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6983         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6984         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6985 }
6986
6987 done
6988
6989 test "$includedir" != NONE && \
6990 test "$includedir" != "/usr/include" && \
6991 test -d "$includedir" && {
6992         test -d $includedir &&    cf_search="$cf_search $includedir"
6993         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6994 }
6995
6996 test "$oldincludedir" != NONE && \
6997 test "$oldincludedir" != "/usr/include" && \
6998 test -d "$oldincludedir" && {
6999         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7000         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7001 }
7002
7003 cf_search="$cf_search $cf_header_path_list"
7004
7005         for cf_cv_header_path_utf8 in $cf_search
7006         do
7007                 if test -d $cf_cv_header_path_utf8 ; then
7008                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7009
7010 echo "${as_me:-configure}:7010: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7011
7012                         CPPFLAGS="$cf_save_CPPFLAGS"
7013
7014         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7015         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7016
7017                         cat >conftest.$ac_ext <<_ACEOF
7018 #line 7018 "configure"
7019 #include "confdefs.h"
7020
7021 #include <libutf8.h>
7022 int
7023 main (void)
7024 {
7025 putwc(0,0);
7026   ;
7027   return 0;
7028 }
7029 _ACEOF
7030 rm -f conftest.$ac_objext
7031 if { (eval echo "$as_me:7031: \"$ac_compile\"") >&5
7032   (eval $ac_compile) 2>&5
7033   ac_status=$?
7034   echo "$as_me:7034: \$? = $ac_status" >&5
7035   (exit $ac_status); } &&
7036          { ac_try='test -s conftest.$ac_objext'
7037   { (eval echo "$as_me:7037: \"$ac_try\"") >&5
7038   (eval $ac_try) 2>&5
7039   ac_status=$?
7040   echo "$as_me:7040: \$? = $ac_status" >&5
7041   (exit $ac_status); }; }; then
7042
7043                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7044
7045 echo "${as_me:-configure}:7045: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7046
7047                                 cf_cv_find_linkage_utf8=maybe
7048                                 cf_test_CPPFLAGS="$CPPFLAGS"
7049                                 break
7050 else
7051   echo "$as_me: failed program was:" >&5
7052 cat conftest.$ac_ext >&5
7053
7054                                 CPPFLAGS="$cf_save_CPPFLAGS"
7055
7056 fi
7057 rm -f conftest.$ac_objext conftest.$ac_ext
7058                 fi
7059         done
7060
7061         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7062
7063 echo "${as_me:-configure}:7063: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7064
7065                 cf_save_LIBS="$LIBS"
7066                 cf_save_LDFLAGS="$LDFLAGS"
7067
7068                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7069
7070 cf_search=
7071 cf_library_path_list=""
7072 if test -n "${LDFLAGS}${LIBS}" ; then
7073         for cf_library_path in $LDFLAGS $LIBS
7074         do
7075                 case $cf_library_path in
7076                 (-L*)
7077                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7078
7079 test "x$cf_library_path" != "xNONE" && \
7080 test -d "$cf_library_path" && \
7081  {
7082         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7083         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7084         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7085         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7086         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7087         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7088 }
7089
7090                         cf_library_path_list="$cf_library_path_list $cf_search"
7091                         ;;
7092                 esac
7093         done
7094 fi
7095
7096 cf_search=
7097
7098 test "x$prefix" != "xNONE" && \
7099 test -d "$prefix" && \
7100  {
7101         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7102         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7103         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7104         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7105         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7106         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7107 }
7108
7109 for cf_subdir_prefix in \
7110         /usr \
7111         /usr/local \
7112         /usr/pkg \
7113         /opt \
7114         /opt/local \
7115         $HOME
7116 do
7117
7118 test "x$cf_subdir_prefix" != "x$prefix" && \
7119 test -d "$cf_subdir_prefix" && \
7120 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7121         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7122         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7123         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7124         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7125         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7126         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7127 }
7128
7129 done
7130
7131 cf_search="$cf_library_path_list $cf_search"
7132
7133                         for cf_cv_library_path_utf8 in $cf_search
7134                         do
7135                                 if test -d $cf_cv_library_path_utf8 ; then
7136                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7137
7138 echo "${as_me:-configure}:7138: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7139
7140                                         CPPFLAGS="$cf_test_CPPFLAGS"
7141                                         LIBS="-lutf8  $cf_save_LIBS"
7142                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7143                                         cat >conftest.$ac_ext <<_ACEOF
7144 #line 7144 "configure"
7145 #include "confdefs.h"
7146
7147 #include <libutf8.h>
7148 int
7149 main (void)
7150 {
7151 putwc(0,0);
7152   ;
7153   return 0;
7154 }
7155 _ACEOF
7156 rm -f conftest.$ac_objext conftest$ac_exeext
7157 if { (eval echo "$as_me:7157: \"$ac_link\"") >&5
7158   (eval $ac_link) 2>&5
7159   ac_status=$?
7160   echo "$as_me:7160: \$? = $ac_status" >&5
7161   (exit $ac_status); } &&
7162          { ac_try='test -s conftest$ac_exeext'
7163   { (eval echo "$as_me:7163: \"$ac_try\"") >&5
7164   (eval $ac_try) 2>&5
7165   ac_status=$?
7166   echo "$as_me:7166: \$? = $ac_status" >&5
7167   (exit $ac_status); }; }; then
7168
7169                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7170
7171 echo "${as_me:-configure}:7171: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7172
7173                                         cf_cv_find_linkage_utf8=yes
7174                                         cf_cv_library_file_utf8="-lutf8"
7175                                         break
7176 else
7177   echo "$as_me: failed program was:" >&5
7178 cat conftest.$ac_ext >&5
7179
7180                                         CPPFLAGS="$cf_save_CPPFLAGS"
7181                                         LIBS="$cf_save_LIBS"
7182                                         LDFLAGS="$cf_save_LDFLAGS"
7183
7184 fi
7185 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7186                                 fi
7187                         done
7188                         CPPFLAGS="$cf_save_CPPFLAGS"
7189                         LDFLAGS="$cf_save_LDFLAGS"
7190                 fi
7191
7192         else
7193                 cf_cv_find_linkage_utf8=no
7194         fi
7195
7196 fi
7197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7198
7199 fi
7200 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7201
7202 LIBS="$cf_save_LIBS"
7203
7204 if test "$cf_cv_find_linkage_utf8" = yes ; then
7205 cf_cv_utf8_lib=add-on
7206 else
7207 cf_cv_utf8_lib=no
7208 fi
7209
7210 fi
7211 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7212 fi
7213 echo "$as_me:7213: result: $cf_cv_utf8_lib" >&5
7214 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7215
7216 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7217 # ncurses/ncursesw:
7218 if test "$cf_cv_utf8_lib" = "add-on" ; then
7219
7220 cat >>confdefs.h <<\EOF
7221 #define HAVE_LIBUTF8_H 1
7222 EOF
7223
7224 if test -n "$cf_cv_header_path_utf8" ; then
7225   for cf_add_incdir in $cf_cv_header_path_utf8
7226   do
7227         while test $cf_add_incdir != /usr/include
7228         do
7229           if test -d $cf_add_incdir
7230           then
7231                 cf_have_incdir=no
7232                 if test -n "$CFLAGS$CPPFLAGS" ; then
7233                   # a loop is needed to ensure we can add subdirs of existing dirs
7234                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7235                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7236                           cf_have_incdir=yes; break
7237                         fi
7238                   done
7239                 fi
7240
7241                 if test "$cf_have_incdir" = no ; then
7242                   if test "$cf_add_incdir" = /usr/local/include ; then
7243                         if test "$GCC" = yes
7244                         then
7245                           cf_save_CPPFLAGS=$CPPFLAGS
7246
7247         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7248         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7249
7250                           cat >conftest.$ac_ext <<_ACEOF
7251 #line 7251 "configure"
7252 #include "confdefs.h"
7253 #include <stdio.h>
7254 int
7255 main (void)
7256 {
7257 printf("Hello")
7258   ;
7259   return 0;
7260 }
7261 _ACEOF
7262 rm -f conftest.$ac_objext
7263 if { (eval echo "$as_me:7263: \"$ac_compile\"") >&5
7264   (eval $ac_compile) 2>&5
7265   ac_status=$?
7266   echo "$as_me:7266: \$? = $ac_status" >&5
7267   (exit $ac_status); } &&
7268          { ac_try='test -s conftest.$ac_objext'
7269   { (eval echo "$as_me:7269: \"$ac_try\"") >&5
7270   (eval $ac_try) 2>&5
7271   ac_status=$?
7272   echo "$as_me:7272: \$? = $ac_status" >&5
7273   (exit $ac_status); }; }; then
7274   :
7275 else
7276   echo "$as_me: failed program was:" >&5
7277 cat conftest.$ac_ext >&5
7278 cf_have_incdir=yes
7279 fi
7280 rm -f conftest.$ac_objext conftest.$ac_ext
7281                           CPPFLAGS=$cf_save_CPPFLAGS
7282                         fi
7283                   fi
7284                 fi
7285
7286                 if test "$cf_have_incdir" = no ; then
7287                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7288
7289 echo "${as_me:-configure}:7289: testing adding $cf_add_incdir to include-path ..." 1>&5
7290
7291                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7292
7293                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7294                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7295                   cf_add_incdir="$cf_top_incdir"
7296                 else
7297                   break
7298                 fi
7299           else
7300                 break
7301           fi
7302         done
7303   done
7304 fi
7305
7306 if test -n "$cf_cv_library_path_utf8" ; then
7307         for cf_add_libdir in $cf_cv_library_path_utf8
7308         do
7309                 if test $cf_add_libdir = /usr/lib ; then
7310                         :
7311                 elif test -d $cf_add_libdir
7312                 then
7313                         cf_have_libdir=no
7314                         if test -n "$LDFLAGS$LIBS" ; then
7315                                 # a loop is needed to ensure we can add subdirs of existing dirs
7316                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7317                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7318                                                 cf_have_libdir=yes; break
7319                                         fi
7320                                 done
7321                         fi
7322                         if test "$cf_have_libdir" = no ; then
7323                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7324
7325 echo "${as_me:-configure}:7325: testing adding $cf_add_libdir to library-path ..." 1>&5
7326
7327                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7328                         fi
7329                 fi
7330         done
7331 fi
7332
7333 cf_add_libs="$cf_cv_library_file_utf8"
7334 # Filter out duplicates - this happens with badly-designed ".pc" files...
7335 for cf_add_1lib in $LIBS
7336 do
7337         for cf_add_2lib in $cf_add_libs
7338         do
7339                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7340                 then
7341                         cf_add_1lib=
7342                         break
7343                 fi
7344         done
7345         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7346 done
7347 LIBS="$cf_add_libs"
7348
7349 fi
7350
7351 cf_ncuconfig_root=$cf_cv_screen
7352 cf_have_ncuconfig=no
7353
7354 if test "x${PKG_CONFIG:=none}" != xnone; then
7355         echo "$as_me:7355: checking pkg-config for $cf_ncuconfig_root" >&5
7356 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7357         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7358                 echo "$as_me:7358: result: yes" >&5
7359 echo "${ECHO_T}yes" >&6
7360
7361                 echo "$as_me:7361: checking if the $cf_ncuconfig_root package files work" >&5
7362 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7363                 cf_have_ncuconfig=unknown
7364
7365                 cf_save_CPPFLAGS="$CPPFLAGS"
7366                 cf_save_LIBS="$LIBS"
7367
7368 cf_fix_cppflags=no
7369 cf_new_cflags=
7370 cf_new_cppflags=
7371 cf_new_extra_cppflags=
7372
7373 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
7374 do
7375 case $cf_fix_cppflags in
7376 (no)
7377         case $cf_add_cflags in
7378         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7379                 case $cf_add_cflags in
7380                 (-D*)
7381                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7382
7383                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7384                                 && test -z "${cf_tst_cflags}" \
7385                                 && cf_fix_cppflags=yes
7386
7387                         if test $cf_fix_cppflags = yes ; then
7388
7389         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7390         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7391
7392                                 continue
7393                         elif test "${cf_tst_cflags}" = "\"'" ; then
7394
7395         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7396         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7397
7398                                 continue
7399                         fi
7400                         ;;
7401                 esac
7402                 case "$CPPFLAGS" in
7403                 (*$cf_add_cflags)
7404                         ;;
7405                 (*)
7406                         case $cf_add_cflags in
7407                         (-D*)
7408                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7409
7410 CPPFLAGS=`echo "$CPPFLAGS" | \
7411         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7412                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7413
7414                                 ;;
7415                         esac
7416
7417         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7418         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7419
7420                         ;;
7421                 esac
7422                 ;;
7423         (*)
7424
7425         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7426         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7427
7428                 ;;
7429         esac
7430         ;;
7431 (yes)
7432
7433         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7434         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7435
7436         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7437
7438         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7439                 && test -z "${cf_tst_cflags}" \
7440                 && cf_fix_cppflags=no
7441         ;;
7442 esac
7443 done
7444
7445 if test -n "$cf_new_cflags" ; then
7446
7447         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7448         CFLAGS="${CFLAGS}$cf_new_cflags"
7449
7450 fi
7451
7452 if test -n "$cf_new_cppflags" ; then
7453
7454         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7455         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7456
7457 fi
7458
7459 if test -n "$cf_new_extra_cppflags" ; then
7460
7461         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7462         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7463
7464 fi
7465
7466 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7467 # Filter out duplicates - this happens with badly-designed ".pc" files...
7468 for cf_add_1lib in $LIBS
7469 do
7470         for cf_add_2lib in $cf_add_libs
7471         do
7472                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7473                 then
7474                         cf_add_1lib=
7475                         break
7476                 fi
7477         done
7478         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7479 done
7480 LIBS="$cf_add_libs"
7481
7482                 cat >conftest.$ac_ext <<_ACEOF
7483 #line 7483 "configure"
7484 #include "confdefs.h"
7485 #include <${cf_cv_ncurses_header:-curses.h}>
7486 int
7487 main (void)
7488 {
7489 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7490   ;
7491   return 0;
7492 }
7493 _ACEOF
7494 rm -f conftest.$ac_objext conftest$ac_exeext
7495 if { (eval echo "$as_me:7495: \"$ac_link\"") >&5
7496   (eval $ac_link) 2>&5
7497   ac_status=$?
7498   echo "$as_me:7498: \$? = $ac_status" >&5
7499   (exit $ac_status); } &&
7500          { ac_try='test -s conftest$ac_exeext'
7501   { (eval echo "$as_me:7501: \"$ac_try\"") >&5
7502   (eval $ac_try) 2>&5
7503   ac_status=$?
7504   echo "$as_me:7504: \$? = $ac_status" >&5
7505   (exit $ac_status); }; }; then
7506   if test "$cross_compiling" = yes; then
7507   cf_have_ncuconfig=maybe
7508 else
7509   cat >conftest.$ac_ext <<_ACEOF
7510 #line 7510 "configure"
7511 #include "confdefs.h"
7512 #include <${cf_cv_ncurses_header:-curses.h}>
7513                                 int main(void)
7514                                 { char *xx = curses_version(); return (xx == 0); }
7515 _ACEOF
7516 rm -f conftest$ac_exeext
7517 if { (eval echo "$as_me:7517: \"$ac_link\"") >&5
7518   (eval $ac_link) 2>&5
7519   ac_status=$?
7520   echo "$as_me:7520: \$? = $ac_status" >&5
7521   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7522   { (eval echo "$as_me:7522: \"$ac_try\"") >&5
7523   (eval $ac_try) 2>&5
7524   ac_status=$?
7525   echo "$as_me:7525: \$? = $ac_status" >&5
7526   (exit $ac_status); }; }; then
7527   cf_have_ncuconfig=yes
7528 else
7529   echo "$as_me: program exited with status $ac_status" >&5
7530 echo "$as_me: failed program was:" >&5
7531 cat conftest.$ac_ext >&5
7532 cf_have_ncuconfig=no
7533 fi
7534 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7535 fi
7536 else
7537   echo "$as_me: failed program was:" >&5
7538 cat conftest.$ac_ext >&5
7539 cf_have_ncuconfig=no
7540 fi
7541 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7542                 echo "$as_me:7542: result: $cf_have_ncuconfig" >&5
7543 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7544                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7545                 if test "$cf_have_ncuconfig" != "yes"
7546                 then
7547                         CPPFLAGS="$cf_save_CPPFLAGS"
7548                         LIBS="$cf_save_LIBS"
7549                         NCURSES_CONFIG_PKG=none
7550                 else
7551
7552 cat >>confdefs.h <<\EOF
7553 #define NCURSES 1
7554 EOF
7555
7556                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7557
7558 echo "$as_me:7558: checking for terminfo header" >&5
7559 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7560 if test "${cf_cv_term_header+set}" = set; then
7561   echo $ECHO_N "(cached) $ECHO_C" >&6
7562 else
7563
7564 case ${cf_cv_ncurses_header} in
7565 (*/ncurses.h|*/ncursesw.h)
7566         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7567         ;;
7568 (*)
7569         cf_term_header=term.h
7570         ;;
7571 esac
7572
7573 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7574 do
7575 cat >conftest.$ac_ext <<_ACEOF
7576 #line 7576 "configure"
7577 #include "confdefs.h"
7578 #include <stdio.h>
7579 #include <${cf_cv_ncurses_header:-curses.h}>
7580 #include <$cf_test>
7581
7582 int
7583 main (void)
7584 {
7585 int x = auto_left_margin
7586   ;
7587   return 0;
7588 }
7589 _ACEOF
7590 rm -f conftest.$ac_objext
7591 if { (eval echo "$as_me:7591: \"$ac_compile\"") >&5
7592   (eval $ac_compile) 2>&5
7593   ac_status=$?
7594   echo "$as_me:7594: \$? = $ac_status" >&5
7595   (exit $ac_status); } &&
7596          { ac_try='test -s conftest.$ac_objext'
7597   { (eval echo "$as_me:7597: \"$ac_try\"") >&5
7598   (eval $ac_try) 2>&5
7599   ac_status=$?
7600   echo "$as_me:7600: \$? = $ac_status" >&5
7601   (exit $ac_status); }; }; then
7602
7603         cf_cv_term_header="$cf_test"
7604 else
7605   echo "$as_me: failed program was:" >&5
7606 cat conftest.$ac_ext >&5
7607
7608         cf_cv_term_header=unknown
7609
7610 fi
7611 rm -f conftest.$ac_objext conftest.$ac_ext
7612         test "$cf_cv_term_header" != unknown && break
7613 done
7614
7615 fi
7616 echo "$as_me:7616: result: $cf_cv_term_header" >&5
7617 echo "${ECHO_T}$cf_cv_term_header" >&6
7618
7619 # Set definitions to allow ifdef'ing to accommodate subdirectories
7620
7621 case $cf_cv_term_header in
7622 (*term.h)
7623
7624 cat >>confdefs.h <<\EOF
7625 #define HAVE_TERM_H 1
7626 EOF
7627
7628         ;;
7629 esac
7630
7631 case $cf_cv_term_header in
7632 (ncurses/term.h)
7633
7634 cat >>confdefs.h <<\EOF
7635 #define HAVE_NCURSES_TERM_H 1
7636 EOF
7637
7638         ;;
7639 (ncursesw/term.h)
7640
7641 cat >>confdefs.h <<\EOF
7642 #define HAVE_NCURSESW_TERM_H 1
7643 EOF
7644
7645         ;;
7646 esac
7647
7648                 fi
7649
7650         else
7651                 echo "$as_me:7651: result: no" >&5
7652 echo "${ECHO_T}no" >&6
7653                 NCURSES_CONFIG_PKG=none
7654         fi
7655 else
7656         NCURSES_CONFIG_PKG=none
7657 fi
7658
7659 if test "x$cf_have_ncuconfig" = "xno"; then
7660         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7661
7662 if test -n "$ac_tool_prefix"; then
7663   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7664   do
7665     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7666 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7667 echo "$as_me:7667: checking for $ac_word" >&5
7668 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7669 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7670   echo $ECHO_N "(cached) $ECHO_C" >&6
7671 else
7672   if test -n "$NCURSES_CONFIG"; then
7673   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7674 else
7675   ac_save_IFS=$IFS; IFS=$ac_path_separator
7676 ac_dummy="$PATH"
7677 for ac_dir in $ac_dummy; do
7678   IFS=$ac_save_IFS
7679   test -z "$ac_dir" && ac_dir=.
7680   $as_executable_p "$ac_dir/$ac_word" || continue
7681 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7682 echo "$as_me:7682: found $ac_dir/$ac_word" >&5
7683 break
7684 done
7685
7686 fi
7687 fi
7688 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7689 if test -n "$NCURSES_CONFIG"; then
7690   echo "$as_me:7690: result: $NCURSES_CONFIG" >&5
7691 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7692 else
7693   echo "$as_me:7693: result: no" >&5
7694 echo "${ECHO_T}no" >&6
7695 fi
7696
7697     test -n "$NCURSES_CONFIG" && break
7698   done
7699 fi
7700 if test -z "$NCURSES_CONFIG"; then
7701   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7702   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7703 do
7704   # Extract the first word of "$ac_prog", so it can be a program name with args.
7705 set dummy $ac_prog; ac_word=$2
7706 echo "$as_me:7706: checking for $ac_word" >&5
7707 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7708 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7709   echo $ECHO_N "(cached) $ECHO_C" >&6
7710 else
7711   if test -n "$ac_ct_NCURSES_CONFIG"; then
7712   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7713 else
7714   ac_save_IFS=$IFS; IFS=$ac_path_separator
7715 ac_dummy="$PATH"
7716 for ac_dir in $ac_dummy; do
7717   IFS=$ac_save_IFS
7718   test -z "$ac_dir" && ac_dir=.
7719   $as_executable_p "$ac_dir/$ac_word" || continue
7720 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7721 echo "$as_me:7721: found $ac_dir/$ac_word" >&5
7722 break
7723 done
7724
7725 fi
7726 fi
7727 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7728 if test -n "$ac_ct_NCURSES_CONFIG"; then
7729   echo "$as_me:7729: result: $ac_ct_NCURSES_CONFIG" >&5
7730 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7731 else
7732   echo "$as_me:7732: result: no" >&5
7733 echo "${ECHO_T}no" >&6
7734 fi
7735
7736   test -n "$ac_ct_NCURSES_CONFIG" && break
7737 done
7738 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7739
7740   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7741 fi
7742
7743         if test "$NCURSES_CONFIG" != none ; then
7744
7745 cf_fix_cppflags=no
7746 cf_new_cflags=
7747 cf_new_cppflags=
7748 cf_new_extra_cppflags=
7749
7750 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7751 do
7752 case $cf_fix_cppflags in
7753 (no)
7754         case $cf_add_cflags in
7755         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7756                 case $cf_add_cflags in
7757                 (-D*)
7758                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7759
7760                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7761                                 && test -z "${cf_tst_cflags}" \
7762                                 && cf_fix_cppflags=yes
7763
7764                         if test $cf_fix_cppflags = yes ; then
7765
7766         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7767         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7768
7769                                 continue
7770                         elif test "${cf_tst_cflags}" = "\"'" ; then
7771
7772         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7773         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7774
7775                                 continue
7776                         fi
7777                         ;;
7778                 esac
7779                 case "$CPPFLAGS" in
7780                 (*$cf_add_cflags)
7781                         ;;
7782                 (*)
7783                         case $cf_add_cflags in
7784                         (-D*)
7785                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7786
7787 CPPFLAGS=`echo "$CPPFLAGS" | \
7788         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7789                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7790
7791                                 ;;
7792                         esac
7793
7794         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7795         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7796
7797                         ;;
7798                 esac
7799                 ;;
7800         (*)
7801
7802         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7803         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7804
7805                 ;;
7806         esac
7807         ;;
7808 (yes)
7809
7810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7812
7813         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7814
7815         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7816                 && test -z "${cf_tst_cflags}" \
7817                 && cf_fix_cppflags=no
7818         ;;
7819 esac
7820 done
7821
7822 if test -n "$cf_new_cflags" ; then
7823
7824         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7825         CFLAGS="${CFLAGS}$cf_new_cflags"
7826
7827 fi
7828
7829 if test -n "$cf_new_cppflags" ; then
7830
7831         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7832         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7833
7834 fi
7835
7836 if test -n "$cf_new_extra_cppflags" ; then
7837
7838         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7839         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7840
7841 fi
7842
7843 cf_add_libs="`$NCURSES_CONFIG --libs`"
7844 # Filter out duplicates - this happens with badly-designed ".pc" files...
7845 for cf_add_1lib in $LIBS
7846 do
7847         for cf_add_2lib in $cf_add_libs
7848         do
7849                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7850                 then
7851                         cf_add_1lib=
7852                         break
7853                 fi
7854         done
7855         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7856 done
7857 LIBS="$cf_add_libs"
7858
7859                 # even with config script, some packages use no-override for curses.h
7860
7861 echo "$as_me:7861: checking if we have identified curses headers" >&5
7862 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7863 if test "${cf_cv_ncurses_header+set}" = set; then
7864   echo $ECHO_N "(cached) $ECHO_C" >&6
7865 else
7866
7867 cf_cv_ncurses_header=none
7868 for cf_header in \
7869         ncurses.h $cf_cv_screen/ncurses.h \
7870         curses.h $cf_cv_screen/curses.h
7871 do
7872 cat >conftest.$ac_ext <<_ACEOF
7873 #line 7873 "configure"
7874 #include "confdefs.h"
7875 #include <${cf_header}>
7876 int
7877 main (void)
7878 {
7879 initscr(); tgoto("?", 0,0)
7880   ;
7881   return 0;
7882 }
7883 _ACEOF
7884 rm -f conftest.$ac_objext
7885 if { (eval echo "$as_me:7885: \"$ac_compile\"") >&5
7886   (eval $ac_compile) 2>&5
7887   ac_status=$?
7888   echo "$as_me:7888: \$? = $ac_status" >&5
7889   (exit $ac_status); } &&
7890          { ac_try='test -s conftest.$ac_objext'
7891   { (eval echo "$as_me:7891: \"$ac_try\"") >&5
7892   (eval $ac_try) 2>&5
7893   ac_status=$?
7894   echo "$as_me:7894: \$? = $ac_status" >&5
7895   (exit $ac_status); }; }; then
7896   cf_cv_ncurses_header=$cf_header; break
7897 else
7898   echo "$as_me: failed program was:" >&5
7899 cat conftest.$ac_ext >&5
7900 fi
7901 rm -f conftest.$ac_objext conftest.$ac_ext
7902 done
7903
7904 fi
7905 echo "$as_me:7905: result: $cf_cv_ncurses_header" >&5
7906 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7907
7908 if test "$cf_cv_ncurses_header" = none ; then
7909         { { echo "$as_me:7909: error: No curses header-files found" >&5
7910 echo "$as_me: error: No curses header-files found" >&2;}
7911    { (exit 1); exit 1; }; }
7912 fi
7913
7914 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7915
7916 for ac_header in $cf_cv_ncurses_header
7917 do
7918 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7919 echo "$as_me:7919: checking for $ac_header" >&5
7920 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7921 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7922   echo $ECHO_N "(cached) $ECHO_C" >&6
7923 else
7924   cat >conftest.$ac_ext <<_ACEOF
7925 #line 7925 "configure"
7926 #include "confdefs.h"
7927 #include <$ac_header>
7928 _ACEOF
7929 if { (eval echo "$as_me:7929: \"$ac_cpp conftest.$ac_ext\"") >&5
7930   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7931   ac_status=$?
7932   egrep -v '^ *\+' conftest.er1 >conftest.err
7933   rm -f conftest.er1
7934   cat conftest.err >&5
7935   echo "$as_me:7935: \$? = $ac_status" >&5
7936   (exit $ac_status); } >/dev/null; then
7937   if test -s conftest.err; then
7938     ac_cpp_err=$ac_c_preproc_warn_flag
7939   else
7940     ac_cpp_err=
7941   fi
7942 else
7943   ac_cpp_err=yes
7944 fi
7945 if test -z "$ac_cpp_err"; then
7946   eval "$as_ac_Header=yes"
7947 else
7948   echo "$as_me: failed program was:" >&5
7949   cat conftest.$ac_ext >&5
7950   eval "$as_ac_Header=no"
7951 fi
7952 rm -f conftest.err conftest.$ac_ext
7953 fi
7954 echo "$as_me:7954: result: `eval echo '${'$as_ac_Header'}'`" >&5
7955 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7956 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7957   cat >>confdefs.h <<EOF
7958 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7959 EOF
7960
7961 fi
7962 done
7963
7964 cat >>confdefs.h <<\EOF
7965 #define NCURSES 1
7966 EOF
7967
7968 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7969
7970                 cat >>confdefs.h <<EOF
7971 #define $cf_nculib_ROOT 1
7972 EOF
7973
7974                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7975
7976         else
7977
7978 cf_ncuhdr_root=$cf_cv_screen
7979
7980 test -n "$cf_cv_curses_dir" && \
7981 test "$cf_cv_curses_dir" != "no" && { \
7982
7983 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7984   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7985   do
7986         while test $cf_add_incdir != /usr/include
7987         do
7988           if test -d $cf_add_incdir
7989           then
7990                 cf_have_incdir=no
7991                 if test -n "$CFLAGS$CPPFLAGS" ; then
7992                   # a loop is needed to ensure we can add subdirs of existing dirs
7993                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7994                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7995                           cf_have_incdir=yes; break
7996                         fi
7997                   done
7998                 fi
7999
8000                 if test "$cf_have_incdir" = no ; then
8001                   if test "$cf_add_incdir" = /usr/local/include ; then
8002                         if test "$GCC" = yes
8003                         then
8004                           cf_save_CPPFLAGS=$CPPFLAGS
8005
8006         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8007         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8008
8009                           cat >conftest.$ac_ext <<_ACEOF
8010 #line 8010 "configure"
8011 #include "confdefs.h"
8012 #include <stdio.h>
8013 int
8014 main (void)
8015 {
8016 printf("Hello")
8017   ;
8018   return 0;
8019 }
8020 _ACEOF
8021 rm -f conftest.$ac_objext
8022 if { (eval echo "$as_me:8022: \"$ac_compile\"") >&5
8023   (eval $ac_compile) 2>&5
8024   ac_status=$?
8025   echo "$as_me:8025: \$? = $ac_status" >&5
8026   (exit $ac_status); } &&
8027          { ac_try='test -s conftest.$ac_objext'
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   :
8034 else
8035   echo "$as_me: failed program was:" >&5
8036 cat conftest.$ac_ext >&5
8037 cf_have_incdir=yes
8038 fi
8039 rm -f conftest.$ac_objext conftest.$ac_ext
8040                           CPPFLAGS=$cf_save_CPPFLAGS
8041                         fi
8042                   fi
8043                 fi
8044
8045                 if test "$cf_have_incdir" = no ; then
8046                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8047
8048 echo "${as_me:-configure}:8048: testing adding $cf_add_incdir to include-path ..." 1>&5
8049
8050                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8051
8052                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8053                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8054                   cf_add_incdir="$cf_top_incdir"
8055                 else
8056                   break
8057                 fi
8058           else
8059                 break
8060           fi
8061         done
8062   done
8063 fi
8064
8065 }
8066
8067 echo "$as_me:8067: checking for $cf_ncuhdr_root header in include-path" >&5
8068 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8069 if test "${cf_cv_ncurses_h+set}" = set; then
8070   echo $ECHO_N "(cached) $ECHO_C" >&6
8071 else
8072
8073         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8074         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8075         for cf_header in $cf_header_list
8076         do
8077
8078         cat >conftest.$ac_ext <<_ACEOF
8079 #line 8079 "configure"
8080 #include "confdefs.h"
8081
8082 #include <$cf_header>
8083 int
8084 main (void)
8085 {
8086
8087 #ifdef NCURSES_VERSION
8088
8089 printf("%s\n", NCURSES_VERSION);
8090 #else
8091 #ifdef __NCURSES_H
8092 printf("old\n");
8093 #else
8094         make an error
8095 #endif
8096 #endif
8097
8098   ;
8099   return 0;
8100 }
8101 _ACEOF
8102 rm -f conftest.$ac_objext
8103 if { (eval echo "$as_me:8103: \"$ac_compile\"") >&5
8104   (eval $ac_compile) 2>&5
8105   ac_status=$?
8106   echo "$as_me:8106: \$? = $ac_status" >&5
8107   (exit $ac_status); } &&
8108          { ac_try='test -s conftest.$ac_objext'
8109   { (eval echo "$as_me:8109: \"$ac_try\"") >&5
8110   (eval $ac_try) 2>&5
8111   ac_status=$?
8112   echo "$as_me:8112: \$? = $ac_status" >&5
8113   (exit $ac_status); }; }; then
8114   cf_cv_ncurses_h=$cf_header
8115
8116 else
8117   echo "$as_me: failed program was:" >&5
8118 cat conftest.$ac_ext >&5
8119 cf_cv_ncurses_h=no
8120 fi
8121 rm -f conftest.$ac_objext conftest.$ac_ext
8122
8123                 test "$cf_cv_ncurses_h" != no && break
8124         done
8125
8126 fi
8127 echo "$as_me:8127: result: $cf_cv_ncurses_h" >&5
8128 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8129
8130 if test "$cf_cv_ncurses_h" != no ; then
8131         cf_cv_ncurses_header=$cf_cv_ncurses_h
8132 else
8133
8134 echo "$as_me:8134: checking for $cf_ncuhdr_root include-path" >&5
8135 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8136 if test "${cf_cv_ncurses_h2+set}" = set; then
8137   echo $ECHO_N "(cached) $ECHO_C" >&6
8138 else
8139
8140         test -n "$verbose" && echo
8141
8142 cf_search=
8143
8144 # collect the current set of include-directories from compiler flags
8145 cf_header_path_list=""
8146 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8147         for cf_header_path in $CPPFLAGS $CFLAGS
8148         do
8149                 case $cf_header_path in
8150                 (-I*)
8151                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8152
8153 test "x$cf_header_path" != "xNONE" && \
8154 test -d "$cf_header_path" && \
8155  {
8156         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8157         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8158         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8159         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8160         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8161         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"
8162 }
8163
8164                         cf_header_path_list="$cf_header_path_list $cf_search"
8165                         ;;
8166                 esac
8167         done
8168 fi
8169
8170 # add the variations for the package we are looking for
8171
8172 cf_search=
8173
8174 test "x$prefix" != "xNONE" && \
8175 test -d "$prefix" && \
8176  {
8177         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8178         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8179         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8180         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8181         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8182         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8183 }
8184
8185 for cf_subdir_prefix in \
8186         /usr \
8187         /usr/local \
8188         /usr/pkg \
8189         /opt \
8190         /opt/local \
8191         $HOME
8192 do
8193
8194 test "x$cf_subdir_prefix" != "x$prefix" && \
8195 test -d "$cf_subdir_prefix" && \
8196 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8197         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8198         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8199         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8200         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8201         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8202         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"
8203 }
8204
8205 done
8206
8207 test "$includedir" != NONE && \
8208 test "$includedir" != "/usr/include" && \
8209 test -d "$includedir" && {
8210         test -d $includedir &&    cf_search="$cf_search $includedir"
8211         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8212 }
8213
8214 test "$oldincludedir" != NONE && \
8215 test "$oldincludedir" != "/usr/include" && \
8216 test -d "$oldincludedir" && {
8217         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8218         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8219 }
8220
8221 cf_search="$cf_search $cf_header_path_list"
8222
8223         test -n "$verbose" && echo search path $cf_search
8224         cf_save2_CPPFLAGS="$CPPFLAGS"
8225         for cf_incdir in $cf_search
8226         do
8227
8228 if test -n "$cf_incdir" ; then
8229   for cf_add_incdir in $cf_incdir
8230   do
8231         while test $cf_add_incdir != /usr/include
8232         do
8233           if test -d $cf_add_incdir
8234           then
8235                 cf_have_incdir=no
8236                 if test -n "$CFLAGS$CPPFLAGS" ; then
8237                   # a loop is needed to ensure we can add subdirs of existing dirs
8238                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8239                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8240                           cf_have_incdir=yes; break
8241                         fi
8242                   done
8243                 fi
8244
8245                 if test "$cf_have_incdir" = no ; then
8246                   if test "$cf_add_incdir" = /usr/local/include ; then
8247                         if test "$GCC" = yes
8248                         then
8249                           cf_save_CPPFLAGS=$CPPFLAGS
8250
8251         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8252         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8253
8254                           cat >conftest.$ac_ext <<_ACEOF
8255 #line 8255 "configure"
8256 #include "confdefs.h"
8257 #include <stdio.h>
8258 int
8259 main (void)
8260 {
8261 printf("Hello")
8262   ;
8263   return 0;
8264 }
8265 _ACEOF
8266 rm -f conftest.$ac_objext
8267 if { (eval echo "$as_me:8267: \"$ac_compile\"") >&5
8268   (eval $ac_compile) 2>&5
8269   ac_status=$?
8270   echo "$as_me:8270: \$? = $ac_status" >&5
8271   (exit $ac_status); } &&
8272          { ac_try='test -s conftest.$ac_objext'
8273   { (eval echo "$as_me:8273: \"$ac_try\"") >&5
8274   (eval $ac_try) 2>&5
8275   ac_status=$?
8276   echo "$as_me:8276: \$? = $ac_status" >&5
8277   (exit $ac_status); }; }; then
8278   :
8279 else
8280   echo "$as_me: failed program was:" >&5
8281 cat conftest.$ac_ext >&5
8282 cf_have_incdir=yes
8283 fi
8284 rm -f conftest.$ac_objext conftest.$ac_ext
8285                           CPPFLAGS=$cf_save_CPPFLAGS
8286                         fi
8287                   fi
8288                 fi
8289
8290                 if test "$cf_have_incdir" = no ; then
8291                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8292
8293 echo "${as_me:-configure}:8293: testing adding $cf_add_incdir to include-path ..." 1>&5
8294
8295                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8296
8297                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8298                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8299                   cf_add_incdir="$cf_top_incdir"
8300                 else
8301                   break
8302                 fi
8303           else
8304                 break
8305           fi
8306         done
8307   done
8308 fi
8309
8310                 for cf_header in \
8311                         ncurses.h \
8312                         curses.h
8313                 do
8314
8315         cat >conftest.$ac_ext <<_ACEOF
8316 #line 8316 "configure"
8317 #include "confdefs.h"
8318
8319 #include <$cf_header>
8320 int
8321 main (void)
8322 {
8323
8324 #ifdef NCURSES_VERSION
8325
8326 printf("%s\n", NCURSES_VERSION);
8327 #else
8328 #ifdef __NCURSES_H
8329 printf("old\n");
8330 #else
8331         make an error
8332 #endif
8333 #endif
8334
8335   ;
8336   return 0;
8337 }
8338 _ACEOF
8339 rm -f conftest.$ac_objext
8340 if { (eval echo "$as_me:8340: \"$ac_compile\"") >&5
8341   (eval $ac_compile) 2>&5
8342   ac_status=$?
8343   echo "$as_me:8343: \$? = $ac_status" >&5
8344   (exit $ac_status); } &&
8345          { ac_try='test -s conftest.$ac_objext'
8346   { (eval echo "$as_me:8346: \"$ac_try\"") >&5
8347   (eval $ac_try) 2>&5
8348   ac_status=$?
8349   echo "$as_me:8349: \$? = $ac_status" >&5
8350   (exit $ac_status); }; }; then
8351   cf_cv_ncurses_h2=$cf_header
8352
8353 else
8354   echo "$as_me: failed program was:" >&5
8355 cat conftest.$ac_ext >&5
8356 cf_cv_ncurses_h2=no
8357 fi
8358 rm -f conftest.$ac_objext conftest.$ac_ext
8359
8360                         if test "$cf_cv_ncurses_h2" != no ; then
8361                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8362                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8363                                 break
8364                         fi
8365                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8366                 done
8367                 CPPFLAGS="$cf_save2_CPPFLAGS"
8368                 test "$cf_cv_ncurses_h2" != no && break
8369         done
8370         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8370: error: not found" >&5
8371 echo "$as_me: error: not found" >&2;}
8372    { (exit 1); exit 1; }; }
8373
8374 fi
8375 echo "$as_me:8375: result: $cf_cv_ncurses_h2" >&5
8376 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8377
8378         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8379         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8380         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8381                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8382         fi
8383
8384 if test -n "$cf_1st_incdir" ; then
8385   for cf_add_incdir in $cf_1st_incdir
8386   do
8387         while test $cf_add_incdir != /usr/include
8388         do
8389           if test -d $cf_add_incdir
8390           then
8391                 cf_have_incdir=no
8392                 if test -n "$CFLAGS$CPPFLAGS" ; then
8393                   # a loop is needed to ensure we can add subdirs of existing dirs
8394                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8395                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8396                           cf_have_incdir=yes; break
8397                         fi
8398                   done
8399                 fi
8400
8401                 if test "$cf_have_incdir" = no ; then
8402                   if test "$cf_add_incdir" = /usr/local/include ; then
8403                         if test "$GCC" = yes
8404                         then
8405                           cf_save_CPPFLAGS=$CPPFLAGS
8406
8407         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8408         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8409
8410                           cat >conftest.$ac_ext <<_ACEOF
8411 #line 8411 "configure"
8412 #include "confdefs.h"
8413 #include <stdio.h>
8414 int
8415 main (void)
8416 {
8417 printf("Hello")
8418   ;
8419   return 0;
8420 }
8421 _ACEOF
8422 rm -f conftest.$ac_objext
8423 if { (eval echo "$as_me:8423: \"$ac_compile\"") >&5
8424   (eval $ac_compile) 2>&5
8425   ac_status=$?
8426   echo "$as_me:8426: \$? = $ac_status" >&5
8427   (exit $ac_status); } &&
8428          { ac_try='test -s conftest.$ac_objext'
8429   { (eval echo "$as_me:8429: \"$ac_try\"") >&5
8430   (eval $ac_try) 2>&5
8431   ac_status=$?
8432   echo "$as_me:8432: \$? = $ac_status" >&5
8433   (exit $ac_status); }; }; then
8434   :
8435 else
8436   echo "$as_me: failed program was:" >&5
8437 cat conftest.$ac_ext >&5
8438 cf_have_incdir=yes
8439 fi
8440 rm -f conftest.$ac_objext conftest.$ac_ext
8441                           CPPFLAGS=$cf_save_CPPFLAGS
8442                         fi
8443                   fi
8444                 fi
8445
8446                 if test "$cf_have_incdir" = no ; then
8447                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8448
8449 echo "${as_me:-configure}:8449: testing adding $cf_add_incdir to include-path ..." 1>&5
8450
8451                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8452
8453                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8454                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8455                   cf_add_incdir="$cf_top_incdir"
8456                 else
8457                   break
8458                 fi
8459           else
8460                 break
8461           fi
8462         done
8463   done
8464 fi
8465
8466 fi
8467
8468 # Set definitions to allow ifdef'ing for ncurses.h
8469
8470 case $cf_cv_ncurses_header in
8471 (*ncurses.h)
8472
8473 cat >>confdefs.h <<\EOF
8474 #define HAVE_NCURSES_H 1
8475 EOF
8476
8477         ;;
8478 esac
8479
8480 case $cf_cv_ncurses_header in
8481 (ncurses/curses.h|ncurses/ncurses.h)
8482
8483 cat >>confdefs.h <<\EOF
8484 #define HAVE_NCURSES_NCURSES_H 1
8485 EOF
8486
8487         ;;
8488 (ncursesw/curses.h|ncursesw/ncurses.h)
8489
8490 cat >>confdefs.h <<\EOF
8491 #define HAVE_NCURSESW_NCURSES_H 1
8492 EOF
8493
8494         ;;
8495 esac
8496
8497 echo "$as_me:8497: checking for terminfo header" >&5
8498 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8499 if test "${cf_cv_term_header+set}" = set; then
8500   echo $ECHO_N "(cached) $ECHO_C" >&6
8501 else
8502
8503 case ${cf_cv_ncurses_header} in
8504 (*/ncurses.h|*/ncursesw.h)
8505         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8506         ;;
8507 (*)
8508         cf_term_header=term.h
8509         ;;
8510 esac
8511
8512 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8513 do
8514 cat >conftest.$ac_ext <<_ACEOF
8515 #line 8515 "configure"
8516 #include "confdefs.h"
8517 #include <stdio.h>
8518 #include <${cf_cv_ncurses_header:-curses.h}>
8519 #include <$cf_test>
8520
8521 int
8522 main (void)
8523 {
8524 int x = auto_left_margin
8525   ;
8526   return 0;
8527 }
8528 _ACEOF
8529 rm -f conftest.$ac_objext
8530 if { (eval echo "$as_me:8530: \"$ac_compile\"") >&5
8531   (eval $ac_compile) 2>&5
8532   ac_status=$?
8533   echo "$as_me:8533: \$? = $ac_status" >&5
8534   (exit $ac_status); } &&
8535          { ac_try='test -s conftest.$ac_objext'
8536   { (eval echo "$as_me:8536: \"$ac_try\"") >&5
8537   (eval $ac_try) 2>&5
8538   ac_status=$?
8539   echo "$as_me:8539: \$? = $ac_status" >&5
8540   (exit $ac_status); }; }; then
8541
8542         cf_cv_term_header="$cf_test"
8543 else
8544   echo "$as_me: failed program was:" >&5
8545 cat conftest.$ac_ext >&5
8546
8547         cf_cv_term_header=unknown
8548
8549 fi
8550 rm -f conftest.$ac_objext conftest.$ac_ext
8551         test "$cf_cv_term_header" != unknown && break
8552 done
8553
8554 fi
8555 echo "$as_me:8555: result: $cf_cv_term_header" >&5
8556 echo "${ECHO_T}$cf_cv_term_header" >&6
8557
8558 # Set definitions to allow ifdef'ing to accommodate subdirectories
8559
8560 case $cf_cv_term_header in
8561 (*term.h)
8562
8563 cat >>confdefs.h <<\EOF
8564 #define HAVE_TERM_H 1
8565 EOF
8566
8567         ;;
8568 esac
8569
8570 case $cf_cv_term_header in
8571 (ncurses/term.h)
8572
8573 cat >>confdefs.h <<\EOF
8574 #define HAVE_NCURSES_TERM_H 1
8575 EOF
8576
8577         ;;
8578 (ncursesw/term.h)
8579
8580 cat >>confdefs.h <<\EOF
8581 #define HAVE_NCURSESW_TERM_H 1
8582 EOF
8583
8584         ;;
8585 esac
8586
8587 # some applications need this, but should check for NCURSES_VERSION
8588
8589 cat >>confdefs.h <<\EOF
8590 #define NCURSES 1
8591 EOF
8592
8593 echo "$as_me:8593: checking for ncurses version" >&5
8594 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8595 if test "${cf_cv_ncurses_version+set}" = set; then
8596   echo $ECHO_N "(cached) $ECHO_C" >&6
8597 else
8598
8599         cf_cv_ncurses_version=no
8600         cf_tempfile=out$$
8601         rm -f $cf_tempfile
8602         if test "$cross_compiling" = yes; then
8603
8604         # This will not work if the preprocessor splits the line after the
8605         # Autoconf token.  The 'unproto' program does that.
8606         cat > conftest.$ac_ext <<EOF
8607 #include <${cf_cv_ncurses_header:-curses.h}>
8608 #undef Autoconf
8609 #ifdef NCURSES_VERSION
8610 Autoconf NCURSES_VERSION
8611 #else
8612 #ifdef __NCURSES_H
8613 Autoconf "old"
8614 #endif
8615 ;
8616 #endif
8617 EOF
8618         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8619         { (eval echo "$as_me:8619: \"$cf_try\"") >&5
8620   (eval $cf_try) 2>&5
8621   ac_status=$?
8622   echo "$as_me:8622: \$? = $ac_status" >&5
8623   (exit $ac_status); }
8624         if test -f conftest.out ; then
8625                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8626                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8627                 rm -f conftest.out
8628         fi
8629
8630 else
8631   cat >conftest.$ac_ext <<_ACEOF
8632 #line 8632 "configure"
8633 #include "confdefs.h"
8634
8635 #include <${cf_cv_ncurses_header:-curses.h}>
8636 #include <stdio.h>
8637 int main(void)
8638 {
8639         FILE *fp = fopen("$cf_tempfile", "w");
8640 #ifdef NCURSES_VERSION
8641 # ifdef NCURSES_VERSION_PATCH
8642         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8643 # else
8644         fprintf(fp, "%s\n", NCURSES_VERSION);
8645 # endif
8646 #else
8647 # ifdef __NCURSES_H
8648         fprintf(fp, "old\n");
8649 # else
8650         make an error
8651 # endif
8652 #endif
8653         ${cf_cv_main_return:-return}(0);
8654 }
8655 _ACEOF
8656 rm -f conftest$ac_exeext
8657 if { (eval echo "$as_me:8657: \"$ac_link\"") >&5
8658   (eval $ac_link) 2>&5
8659   ac_status=$?
8660   echo "$as_me:8660: \$? = $ac_status" >&5
8661   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8662   { (eval echo "$as_me:8662: \"$ac_try\"") >&5
8663   (eval $ac_try) 2>&5
8664   ac_status=$?
8665   echo "$as_me:8665: \$? = $ac_status" >&5
8666   (exit $ac_status); }; }; then
8667
8668         cf_cv_ncurses_version=`cat $cf_tempfile`
8669 else
8670   echo "$as_me: program exited with status $ac_status" >&5
8671 echo "$as_me: failed program was:" >&5
8672 cat conftest.$ac_ext >&5
8673 fi
8674 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8675 fi
8676         rm -f $cf_tempfile
8677
8678 fi
8679 echo "$as_me:8679: result: $cf_cv_ncurses_version" >&5
8680 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8681 test "$cf_cv_ncurses_version" = no ||
8682 cat >>confdefs.h <<\EOF
8683 #define NCURSES 1
8684 EOF
8685
8686 cf_nculib_root=$cf_cv_screen
8687         # This works, except for the special case where we find gpm, but
8688         # ncurses is in a nonstandard location via $LIBS, and we really want
8689         # to link gpm.
8690 cf_ncurses_LIBS=""
8691 cf_ncurses_SAVE="$LIBS"
8692 echo "$as_me:8692: checking for Gpm_Open in -lgpm" >&5
8693 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8694 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8695   echo $ECHO_N "(cached) $ECHO_C" >&6
8696 else
8697   ac_check_lib_save_LIBS=$LIBS
8698 LIBS="-lgpm  $LIBS"
8699 cat >conftest.$ac_ext <<_ACEOF
8700 #line 8700 "configure"
8701 #include "confdefs.h"
8702
8703 /* Override any gcc2 internal prototype to avoid an error.  */
8704 #ifdef __cplusplus
8705 extern "C"
8706 #endif
8707 /* We use char because int might match the return type of a gcc2
8708    builtin and then its argument prototype would still apply.  */
8709 char Gpm_Open ();
8710 int
8711 main (void)
8712 {
8713 Gpm_Open ();
8714   ;
8715   return 0;
8716 }
8717 _ACEOF
8718 rm -f conftest.$ac_objext conftest$ac_exeext
8719 if { (eval echo "$as_me:8719: \"$ac_link\"") >&5
8720   (eval $ac_link) 2>&5
8721   ac_status=$?
8722   echo "$as_me:8722: \$? = $ac_status" >&5
8723   (exit $ac_status); } &&
8724          { ac_try='test -s conftest$ac_exeext'
8725   { (eval echo "$as_me:8725: \"$ac_try\"") >&5
8726   (eval $ac_try) 2>&5
8727   ac_status=$?
8728   echo "$as_me:8728: \$? = $ac_status" >&5
8729   (exit $ac_status); }; }; then
8730   ac_cv_lib_gpm_Gpm_Open=yes
8731 else
8732   echo "$as_me: failed program was:" >&5
8733 cat conftest.$ac_ext >&5
8734 ac_cv_lib_gpm_Gpm_Open=no
8735 fi
8736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8737 LIBS=$ac_check_lib_save_LIBS
8738 fi
8739 echo "$as_me:8739: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8740 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8741 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8742   echo "$as_me:8742: checking for initscr in -lgpm" >&5
8743 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8744 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8745   echo $ECHO_N "(cached) $ECHO_C" >&6
8746 else
8747   ac_check_lib_save_LIBS=$LIBS
8748 LIBS="-lgpm  $LIBS"
8749 cat >conftest.$ac_ext <<_ACEOF
8750 #line 8750 "configure"
8751 #include "confdefs.h"
8752
8753 /* Override any gcc2 internal prototype to avoid an error.  */
8754 #ifdef __cplusplus
8755 extern "C"
8756 #endif
8757 /* We use char because int might match the return type of a gcc2
8758    builtin and then its argument prototype would still apply.  */
8759 char initscr ();
8760 int
8761 main (void)
8762 {
8763 initscr ();
8764   ;
8765   return 0;
8766 }
8767 _ACEOF
8768 rm -f conftest.$ac_objext conftest$ac_exeext
8769 if { (eval echo "$as_me:8769: \"$ac_link\"") >&5
8770   (eval $ac_link) 2>&5
8771   ac_status=$?
8772   echo "$as_me:8772: \$? = $ac_status" >&5
8773   (exit $ac_status); } &&
8774          { ac_try='test -s conftest$ac_exeext'
8775   { (eval echo "$as_me:8775: \"$ac_try\"") >&5
8776   (eval $ac_try) 2>&5
8777   ac_status=$?
8778   echo "$as_me:8778: \$? = $ac_status" >&5
8779   (exit $ac_status); }; }; then
8780   ac_cv_lib_gpm_initscr=yes
8781 else
8782   echo "$as_me: failed program was:" >&5
8783 cat conftest.$ac_ext >&5
8784 ac_cv_lib_gpm_initscr=no
8785 fi
8786 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8787 LIBS=$ac_check_lib_save_LIBS
8788 fi
8789 echo "$as_me:8789: result: $ac_cv_lib_gpm_initscr" >&5
8790 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8791 if test $ac_cv_lib_gpm_initscr = yes; then
8792   LIBS="$cf_ncurses_SAVE"
8793 else
8794   cf_ncurses_LIBS="-lgpm"
8795 fi
8796
8797 fi
8798
8799 case $host_os in
8800 (freebsd*)
8801         # This is only necessary if you are linking against an obsolete
8802         # version of ncurses (but it should do no harm, since it's static).
8803         if test "$cf_nculib_root" = ncurses ; then
8804                 echo "$as_me:8804: checking for tgoto in -lmytinfo" >&5
8805 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8806 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8807   echo $ECHO_N "(cached) $ECHO_C" >&6
8808 else
8809   ac_check_lib_save_LIBS=$LIBS
8810 LIBS="-lmytinfo  $LIBS"
8811 cat >conftest.$ac_ext <<_ACEOF
8812 #line 8812 "configure"
8813 #include "confdefs.h"
8814
8815 /* Override any gcc2 internal prototype to avoid an error.  */
8816 #ifdef __cplusplus
8817 extern "C"
8818 #endif
8819 /* We use char because int might match the return type of a gcc2
8820    builtin and then its argument prototype would still apply.  */
8821 char tgoto ();
8822 int
8823 main (void)
8824 {
8825 tgoto ();
8826   ;
8827   return 0;
8828 }
8829 _ACEOF
8830 rm -f conftest.$ac_objext conftest$ac_exeext
8831 if { (eval echo "$as_me:8831: \"$ac_link\"") >&5
8832   (eval $ac_link) 2>&5
8833   ac_status=$?
8834   echo "$as_me:8834: \$? = $ac_status" >&5
8835   (exit $ac_status); } &&
8836          { ac_try='test -s conftest$ac_exeext'
8837   { (eval echo "$as_me:8837: \"$ac_try\"") >&5
8838   (eval $ac_try) 2>&5
8839   ac_status=$?
8840   echo "$as_me:8840: \$? = $ac_status" >&5
8841   (exit $ac_status); }; }; then
8842   ac_cv_lib_mytinfo_tgoto=yes
8843 else
8844   echo "$as_me: failed program was:" >&5
8845 cat conftest.$ac_ext >&5
8846 ac_cv_lib_mytinfo_tgoto=no
8847 fi
8848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8849 LIBS=$ac_check_lib_save_LIBS
8850 fi
8851 echo "$as_me:8851: result: $ac_cv_lib_mytinfo_tgoto" >&5
8852 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8853 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8854   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8855 fi
8856
8857         fi
8858         ;;
8859 esac
8860
8861 cf_add_libs="$cf_ncurses_LIBS"
8862 # Filter out duplicates - this happens with badly-designed ".pc" files...
8863 for cf_add_1lib in $LIBS
8864 do
8865         for cf_add_2lib in $cf_add_libs
8866         do
8867                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8868                 then
8869                         cf_add_1lib=
8870                         break
8871                 fi
8872         done
8873         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8874 done
8875 LIBS="$cf_add_libs"
8876
8877 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8878 then
8879
8880 cf_add_libs="-l$cf_nculib_root"
8881 # Filter out duplicates - this happens with badly-designed ".pc" files...
8882 for cf_add_1lib in $LIBS
8883 do
8884         for cf_add_2lib in $cf_add_libs
8885         do
8886                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8887                 then
8888                         cf_add_1lib=
8889                         break
8890                 fi
8891         done
8892         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8893 done
8894 LIBS="$cf_add_libs"
8895
8896 else
8897
8898         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8899         cf_libdir=""
8900         echo "$as_me:8900: checking for initscr" >&5
8901 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8902 if test "${ac_cv_func_initscr+set}" = set; then
8903   echo $ECHO_N "(cached) $ECHO_C" >&6
8904 else
8905   cat >conftest.$ac_ext <<_ACEOF
8906 #line 8906 "configure"
8907 #include "confdefs.h"
8908 /* System header to define __stub macros and hopefully few prototypes,
8909     which can conflict with char initscr (); below.  */
8910 #include <assert.h>
8911 /* Override any gcc2 internal prototype to avoid an error.  */
8912 #ifdef __cplusplus
8913 extern "C"
8914 #endif
8915 /* We use char because int might match the return type of a gcc2
8916    builtin and then its argument prototype would still apply.  */
8917 char initscr ();
8918 char (*f) ();
8919
8920 int
8921 main (void)
8922 {
8923 /* The GNU C library defines this for functions which it implements
8924     to always fail with ENOSYS.  Some functions are actually named
8925     something starting with __ and the normal name is an alias.  */
8926 #if defined (__stub_initscr) || defined (__stub___initscr)
8927 choke me
8928 #else
8929 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8930 #endif
8931
8932   ;
8933   return 0;
8934 }
8935 _ACEOF
8936 rm -f conftest.$ac_objext conftest$ac_exeext
8937 if { (eval echo "$as_me:8937: \"$ac_link\"") >&5
8938   (eval $ac_link) 2>&5
8939   ac_status=$?
8940   echo "$as_me:8940: \$? = $ac_status" >&5
8941   (exit $ac_status); } &&
8942          { ac_try='test -s conftest$ac_exeext'
8943   { (eval echo "$as_me:8943: \"$ac_try\"") >&5
8944   (eval $ac_try) 2>&5
8945   ac_status=$?
8946   echo "$as_me:8946: \$? = $ac_status" >&5
8947   (exit $ac_status); }; }; then
8948   ac_cv_func_initscr=yes
8949 else
8950   echo "$as_me: failed program was:" >&5
8951 cat conftest.$ac_ext >&5
8952 ac_cv_func_initscr=no
8953 fi
8954 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8955 fi
8956 echo "$as_me:8956: result: $ac_cv_func_initscr" >&5
8957 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8958 if test $ac_cv_func_initscr = yes; then
8959   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8960 else
8961
8962                 cf_save_LIBS="$LIBS"
8963                 echo "$as_me:8963: checking for initscr in -l$cf_nculib_root" >&5
8964 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8965                 LIBS="-l$cf_nculib_root $LIBS"
8966                 cat >conftest.$ac_ext <<_ACEOF
8967 #line 8967 "configure"
8968 #include "confdefs.h"
8969 #include <${cf_cv_ncurses_header:-curses.h}>
8970 int
8971 main (void)
8972 {
8973 initscr()
8974   ;
8975   return 0;
8976 }
8977 _ACEOF
8978 rm -f conftest.$ac_objext conftest$ac_exeext
8979 if { (eval echo "$as_me:8979: \"$ac_link\"") >&5
8980   (eval $ac_link) 2>&5
8981   ac_status=$?
8982   echo "$as_me:8982: \$? = $ac_status" >&5
8983   (exit $ac_status); } &&
8984          { ac_try='test -s conftest$ac_exeext'
8985   { (eval echo "$as_me:8985: \"$ac_try\"") >&5
8986   (eval $ac_try) 2>&5
8987   ac_status=$?
8988   echo "$as_me:8988: \$? = $ac_status" >&5
8989   (exit $ac_status); }; }; then
8990   echo "$as_me:8990: result: yes" >&5
8991 echo "${ECHO_T}yes" >&6
8992                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8993
8994 else
8995   echo "$as_me: failed program was:" >&5
8996 cat conftest.$ac_ext >&5
8997 echo "$as_me:8997: result: no" >&5
8998 echo "${ECHO_T}no" >&6
8999
9000 cf_search=
9001 cf_library_path_list=""
9002 if test -n "${LDFLAGS}${LIBS}" ; then
9003         for cf_library_path in $LDFLAGS $LIBS
9004         do
9005                 case $cf_library_path in
9006                 (-L*)
9007                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9008
9009 test "x$cf_library_path" != "xNONE" && \
9010 test -d "$cf_library_path" && \
9011  {
9012         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9013         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9014         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9015         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9016         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9017         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"
9018 }
9019
9020                         cf_library_path_list="$cf_library_path_list $cf_search"
9021                         ;;
9022                 esac
9023         done
9024 fi
9025
9026 cf_search=
9027
9028 test "x$prefix" != "xNONE" && \
9029 test -d "$prefix" && \
9030  {
9031         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9032         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9033         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9034         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9035         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9036         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9037 }
9038
9039 for cf_subdir_prefix in \
9040         /usr \
9041         /usr/local \
9042         /usr/pkg \
9043         /opt \
9044         /opt/local \
9045         $HOME
9046 do
9047
9048 test "x$cf_subdir_prefix" != "x$prefix" && \
9049 test -d "$cf_subdir_prefix" && \
9050 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9051         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9052         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9053         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9054         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9055         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9056         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"
9057 }
9058
9059 done
9060
9061 cf_search="$cf_library_path_list $cf_search"
9062
9063                         for cf_libdir in $cf_search
9064                         do
9065                                 echo "$as_me:9065: checking for -l$cf_nculib_root in $cf_libdir" >&5
9066 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9067                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9068                                 cat >conftest.$ac_ext <<_ACEOF
9069 #line 9069 "configure"
9070 #include "confdefs.h"
9071 #include <${cf_cv_ncurses_header:-curses.h}>
9072 int
9073 main (void)
9074 {
9075 initscr()
9076   ;
9077   return 0;
9078 }
9079 _ACEOF
9080 rm -f conftest.$ac_objext conftest$ac_exeext
9081 if { (eval echo "$as_me:9081: \"$ac_link\"") >&5
9082   (eval $ac_link) 2>&5
9083   ac_status=$?
9084   echo "$as_me:9084: \$? = $ac_status" >&5
9085   (exit $ac_status); } &&
9086          { ac_try='test -s conftest$ac_exeext'
9087   { (eval echo "$as_me:9087: \"$ac_try\"") >&5
9088   (eval $ac_try) 2>&5
9089   ac_status=$?
9090   echo "$as_me:9090: \$? = $ac_status" >&5
9091   (exit $ac_status); }; }; then
9092   echo "$as_me:9092: result: yes" >&5
9093 echo "${ECHO_T}yes" >&6
9094                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9095                                          break
9096 else
9097   echo "$as_me: failed program was:" >&5
9098 cat conftest.$ac_ext >&5
9099 echo "$as_me:9099: result: no" >&5
9100 echo "${ECHO_T}no" >&6
9101                                          LIBS="$cf_save_LIBS"
9102 fi
9103 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9104                         done
9105
9106 fi
9107 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9108
9109 fi
9110
9111 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9112
9113 if test $cf_found_library = no ; then
9114         { { echo "$as_me:9114: error: Cannot link $cf_nculib_root library" >&5
9115 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9116    { (exit 1); exit 1; }; }
9117 fi
9118
9119 fi
9120
9121 if test -n "$cf_ncurses_LIBS" ; then
9122         echo "$as_me:9122: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9123 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9124         cf_ncurses_SAVE="$LIBS"
9125         for p in $cf_ncurses_LIBS ; do
9126                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9127                 if test "$q" != "$LIBS" ; then
9128                         LIBS="$q"
9129                 fi
9130         done
9131         cat >conftest.$ac_ext <<_ACEOF
9132 #line 9132 "configure"
9133 #include "confdefs.h"
9134 #include <${cf_cv_ncurses_header:-curses.h}>
9135 int
9136 main (void)
9137 {
9138 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9139   ;
9140   return 0;
9141 }
9142 _ACEOF
9143 rm -f conftest.$ac_objext conftest$ac_exeext
9144 if { (eval echo "$as_me:9144: \"$ac_link\"") >&5
9145   (eval $ac_link) 2>&5
9146   ac_status=$?
9147   echo "$as_me:9147: \$? = $ac_status" >&5
9148   (exit $ac_status); } &&
9149          { ac_try='test -s conftest$ac_exeext'
9150   { (eval echo "$as_me:9150: \"$ac_try\"") >&5
9151   (eval $ac_try) 2>&5
9152   ac_status=$?
9153   echo "$as_me:9153: \$? = $ac_status" >&5
9154   (exit $ac_status); }; }; then
9155   echo "$as_me:9155: result: yes" >&5
9156 echo "${ECHO_T}yes" >&6
9157 else
9158   echo "$as_me: failed program was:" >&5
9159 cat conftest.$ac_ext >&5
9160 echo "$as_me:9160: result: no" >&5
9161 echo "${ECHO_T}no" >&6
9162                  LIBS="$cf_ncurses_SAVE"
9163 fi
9164 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9165 fi
9166
9167 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9168
9169 cat >>confdefs.h <<EOF
9170 #define $cf_nculib_ROOT 1
9171 EOF
9172
9173         fi
9174 else
9175         NCURSES_CONFIG=none
9176 fi
9177
9178         ;;
9179 (ncurses*)
9180
9181 cf_ncuconfig_root=$cf_cv_screen
9182 cf_have_ncuconfig=no
9183
9184 if test "x${PKG_CONFIG:=none}" != xnone; then
9185         echo "$as_me:9185: checking pkg-config for $cf_ncuconfig_root" >&5
9186 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9187         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9188                 echo "$as_me:9188: result: yes" >&5
9189 echo "${ECHO_T}yes" >&6
9190
9191                 echo "$as_me:9191: checking if the $cf_ncuconfig_root package files work" >&5
9192 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9193                 cf_have_ncuconfig=unknown
9194
9195                 cf_save_CPPFLAGS="$CPPFLAGS"
9196                 cf_save_LIBS="$LIBS"
9197
9198 cf_fix_cppflags=no
9199 cf_new_cflags=
9200 cf_new_cppflags=
9201 cf_new_extra_cppflags=
9202
9203 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
9204 do
9205 case $cf_fix_cppflags in
9206 (no)
9207         case $cf_add_cflags in
9208         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9209                 case $cf_add_cflags in
9210                 (-D*)
9211                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9212
9213                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9214                                 && test -z "${cf_tst_cflags}" \
9215                                 && cf_fix_cppflags=yes
9216
9217                         if test $cf_fix_cppflags = yes ; then
9218
9219         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9220         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9221
9222                                 continue
9223                         elif test "${cf_tst_cflags}" = "\"'" ; then
9224
9225         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9226         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9227
9228                                 continue
9229                         fi
9230                         ;;
9231                 esac
9232                 case "$CPPFLAGS" in
9233                 (*$cf_add_cflags)
9234                         ;;
9235                 (*)
9236                         case $cf_add_cflags in
9237                         (-D*)
9238                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9239
9240 CPPFLAGS=`echo "$CPPFLAGS" | \
9241         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9242                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9243
9244                                 ;;
9245                         esac
9246
9247         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9248         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9249
9250                         ;;
9251                 esac
9252                 ;;
9253         (*)
9254
9255         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9256         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9257
9258                 ;;
9259         esac
9260         ;;
9261 (yes)
9262
9263         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9264         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9265
9266         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9267
9268         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9269                 && test -z "${cf_tst_cflags}" \
9270                 && cf_fix_cppflags=no
9271         ;;
9272 esac
9273 done
9274
9275 if test -n "$cf_new_cflags" ; then
9276
9277         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9278         CFLAGS="${CFLAGS}$cf_new_cflags"
9279
9280 fi
9281
9282 if test -n "$cf_new_cppflags" ; then
9283
9284         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9285         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9286
9287 fi
9288
9289 if test -n "$cf_new_extra_cppflags" ; then
9290
9291         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9292         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9293
9294 fi
9295
9296 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9297 # Filter out duplicates - this happens with badly-designed ".pc" files...
9298 for cf_add_1lib in $LIBS
9299 do
9300         for cf_add_2lib in $cf_add_libs
9301         do
9302                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9303                 then
9304                         cf_add_1lib=
9305                         break
9306                 fi
9307         done
9308         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9309 done
9310 LIBS="$cf_add_libs"
9311
9312                 cat >conftest.$ac_ext <<_ACEOF
9313 #line 9313 "configure"
9314 #include "confdefs.h"
9315 #include <${cf_cv_ncurses_header:-curses.h}>
9316 int
9317 main (void)
9318 {
9319 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9320   ;
9321   return 0;
9322 }
9323 _ACEOF
9324 rm -f conftest.$ac_objext conftest$ac_exeext
9325 if { (eval echo "$as_me:9325: \"$ac_link\"") >&5
9326   (eval $ac_link) 2>&5
9327   ac_status=$?
9328   echo "$as_me:9328: \$? = $ac_status" >&5
9329   (exit $ac_status); } &&
9330          { ac_try='test -s conftest$ac_exeext'
9331   { (eval echo "$as_me:9331: \"$ac_try\"") >&5
9332   (eval $ac_try) 2>&5
9333   ac_status=$?
9334   echo "$as_me:9334: \$? = $ac_status" >&5
9335   (exit $ac_status); }; }; then
9336   if test "$cross_compiling" = yes; then
9337   cf_have_ncuconfig=maybe
9338 else
9339   cat >conftest.$ac_ext <<_ACEOF
9340 #line 9340 "configure"
9341 #include "confdefs.h"
9342 #include <${cf_cv_ncurses_header:-curses.h}>
9343                                 int main(void)
9344                                 { char *xx = curses_version(); return (xx == 0); }
9345 _ACEOF
9346 rm -f conftest$ac_exeext
9347 if { (eval echo "$as_me:9347: \"$ac_link\"") >&5
9348   (eval $ac_link) 2>&5
9349   ac_status=$?
9350   echo "$as_me:9350: \$? = $ac_status" >&5
9351   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9352   { (eval echo "$as_me:9352: \"$ac_try\"") >&5
9353   (eval $ac_try) 2>&5
9354   ac_status=$?
9355   echo "$as_me:9355: \$? = $ac_status" >&5
9356   (exit $ac_status); }; }; then
9357   cf_have_ncuconfig=yes
9358 else
9359   echo "$as_me: program exited with status $ac_status" >&5
9360 echo "$as_me: failed program was:" >&5
9361 cat conftest.$ac_ext >&5
9362 cf_have_ncuconfig=no
9363 fi
9364 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9365 fi
9366 else
9367   echo "$as_me: failed program was:" >&5
9368 cat conftest.$ac_ext >&5
9369 cf_have_ncuconfig=no
9370 fi
9371 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9372                 echo "$as_me:9372: result: $cf_have_ncuconfig" >&5
9373 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9374                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9375                 if test "$cf_have_ncuconfig" != "yes"
9376                 then
9377                         CPPFLAGS="$cf_save_CPPFLAGS"
9378                         LIBS="$cf_save_LIBS"
9379                         NCURSES_CONFIG_PKG=none
9380                 else
9381
9382 cat >>confdefs.h <<\EOF
9383 #define NCURSES 1
9384 EOF
9385
9386                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9387
9388 echo "$as_me:9388: checking for terminfo header" >&5
9389 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9390 if test "${cf_cv_term_header+set}" = set; then
9391   echo $ECHO_N "(cached) $ECHO_C" >&6
9392 else
9393
9394 case ${cf_cv_ncurses_header} in
9395 (*/ncurses.h|*/ncursesw.h)
9396         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9397         ;;
9398 (*)
9399         cf_term_header=term.h
9400         ;;
9401 esac
9402
9403 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9404 do
9405 cat >conftest.$ac_ext <<_ACEOF
9406 #line 9406 "configure"
9407 #include "confdefs.h"
9408 #include <stdio.h>
9409 #include <${cf_cv_ncurses_header:-curses.h}>
9410 #include <$cf_test>
9411
9412 int
9413 main (void)
9414 {
9415 int x = auto_left_margin
9416   ;
9417   return 0;
9418 }
9419 _ACEOF
9420 rm -f conftest.$ac_objext
9421 if { (eval echo "$as_me:9421: \"$ac_compile\"") >&5
9422   (eval $ac_compile) 2>&5
9423   ac_status=$?
9424   echo "$as_me:9424: \$? = $ac_status" >&5
9425   (exit $ac_status); } &&
9426          { ac_try='test -s conftest.$ac_objext'
9427   { (eval echo "$as_me:9427: \"$ac_try\"") >&5
9428   (eval $ac_try) 2>&5
9429   ac_status=$?
9430   echo "$as_me:9430: \$? = $ac_status" >&5
9431   (exit $ac_status); }; }; then
9432
9433         cf_cv_term_header="$cf_test"
9434 else
9435   echo "$as_me: failed program was:" >&5
9436 cat conftest.$ac_ext >&5
9437
9438         cf_cv_term_header=unknown
9439
9440 fi
9441 rm -f conftest.$ac_objext conftest.$ac_ext
9442         test "$cf_cv_term_header" != unknown && break
9443 done
9444
9445 fi
9446 echo "$as_me:9446: result: $cf_cv_term_header" >&5
9447 echo "${ECHO_T}$cf_cv_term_header" >&6
9448
9449 # Set definitions to allow ifdef'ing to accommodate subdirectories
9450
9451 case $cf_cv_term_header in
9452 (*term.h)
9453
9454 cat >>confdefs.h <<\EOF
9455 #define HAVE_TERM_H 1
9456 EOF
9457
9458         ;;
9459 esac
9460
9461 case $cf_cv_term_header in
9462 (ncurses/term.h)
9463
9464 cat >>confdefs.h <<\EOF
9465 #define HAVE_NCURSES_TERM_H 1
9466 EOF
9467
9468         ;;
9469 (ncursesw/term.h)
9470
9471 cat >>confdefs.h <<\EOF
9472 #define HAVE_NCURSESW_TERM_H 1
9473 EOF
9474
9475         ;;
9476 esac
9477
9478                 fi
9479
9480         else
9481                 echo "$as_me:9481: result: no" >&5
9482 echo "${ECHO_T}no" >&6
9483                 NCURSES_CONFIG_PKG=none
9484         fi
9485 else
9486         NCURSES_CONFIG_PKG=none
9487 fi
9488
9489 if test "x$cf_have_ncuconfig" = "xno"; then
9490         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9491
9492 if test -n "$ac_tool_prefix"; then
9493   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9494   do
9495     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9496 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9497 echo "$as_me:9497: checking for $ac_word" >&5
9498 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9499 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9500   echo $ECHO_N "(cached) $ECHO_C" >&6
9501 else
9502   if test -n "$NCURSES_CONFIG"; then
9503   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9504 else
9505   ac_save_IFS=$IFS; IFS=$ac_path_separator
9506 ac_dummy="$PATH"
9507 for ac_dir in $ac_dummy; do
9508   IFS=$ac_save_IFS
9509   test -z "$ac_dir" && ac_dir=.
9510   $as_executable_p "$ac_dir/$ac_word" || continue
9511 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9512 echo "$as_me:9512: found $ac_dir/$ac_word" >&5
9513 break
9514 done
9515
9516 fi
9517 fi
9518 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9519 if test -n "$NCURSES_CONFIG"; then
9520   echo "$as_me:9520: result: $NCURSES_CONFIG" >&5
9521 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9522 else
9523   echo "$as_me:9523: result: no" >&5
9524 echo "${ECHO_T}no" >&6
9525 fi
9526
9527     test -n "$NCURSES_CONFIG" && break
9528   done
9529 fi
9530 if test -z "$NCURSES_CONFIG"; then
9531   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9532   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9533 do
9534   # Extract the first word of "$ac_prog", so it can be a program name with args.
9535 set dummy $ac_prog; ac_word=$2
9536 echo "$as_me:9536: checking for $ac_word" >&5
9537 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9538 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9539   echo $ECHO_N "(cached) $ECHO_C" >&6
9540 else
9541   if test -n "$ac_ct_NCURSES_CONFIG"; then
9542   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9543 else
9544   ac_save_IFS=$IFS; IFS=$ac_path_separator
9545 ac_dummy="$PATH"
9546 for ac_dir in $ac_dummy; do
9547   IFS=$ac_save_IFS
9548   test -z "$ac_dir" && ac_dir=.
9549   $as_executable_p "$ac_dir/$ac_word" || continue
9550 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9551 echo "$as_me:9551: found $ac_dir/$ac_word" >&5
9552 break
9553 done
9554
9555 fi
9556 fi
9557 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9558 if test -n "$ac_ct_NCURSES_CONFIG"; then
9559   echo "$as_me:9559: result: $ac_ct_NCURSES_CONFIG" >&5
9560 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9561 else
9562   echo "$as_me:9562: result: no" >&5
9563 echo "${ECHO_T}no" >&6
9564 fi
9565
9566   test -n "$ac_ct_NCURSES_CONFIG" && break
9567 done
9568 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9569
9570   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9571 fi
9572
9573         if test "$NCURSES_CONFIG" != none ; then
9574
9575 cf_fix_cppflags=no
9576 cf_new_cflags=
9577 cf_new_cppflags=
9578 cf_new_extra_cppflags=
9579
9580 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9581 do
9582 case $cf_fix_cppflags in
9583 (no)
9584         case $cf_add_cflags in
9585         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9586                 case $cf_add_cflags in
9587                 (-D*)
9588                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9589
9590                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9591                                 && test -z "${cf_tst_cflags}" \
9592                                 && cf_fix_cppflags=yes
9593
9594                         if test $cf_fix_cppflags = yes ; then
9595
9596         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9597         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9598
9599                                 continue
9600                         elif test "${cf_tst_cflags}" = "\"'" ; then
9601
9602         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9603         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9604
9605                                 continue
9606                         fi
9607                         ;;
9608                 esac
9609                 case "$CPPFLAGS" in
9610                 (*$cf_add_cflags)
9611                         ;;
9612                 (*)
9613                         case $cf_add_cflags in
9614                         (-D*)
9615                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9616
9617 CPPFLAGS=`echo "$CPPFLAGS" | \
9618         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9619                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9620
9621                                 ;;
9622                         esac
9623
9624         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9625         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9626
9627                         ;;
9628                 esac
9629                 ;;
9630         (*)
9631
9632         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9633         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9634
9635                 ;;
9636         esac
9637         ;;
9638 (yes)
9639
9640         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9641         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9642
9643         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9644
9645         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9646                 && test -z "${cf_tst_cflags}" \
9647                 && cf_fix_cppflags=no
9648         ;;
9649 esac
9650 done
9651
9652 if test -n "$cf_new_cflags" ; then
9653
9654         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9655         CFLAGS="${CFLAGS}$cf_new_cflags"
9656
9657 fi
9658
9659 if test -n "$cf_new_cppflags" ; then
9660
9661         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9662         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9663
9664 fi
9665
9666 if test -n "$cf_new_extra_cppflags" ; then
9667
9668         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9669         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9670
9671 fi
9672
9673 cf_add_libs="`$NCURSES_CONFIG --libs`"
9674 # Filter out duplicates - this happens with badly-designed ".pc" files...
9675 for cf_add_1lib in $LIBS
9676 do
9677         for cf_add_2lib in $cf_add_libs
9678         do
9679                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9680                 then
9681                         cf_add_1lib=
9682                         break
9683                 fi
9684         done
9685         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9686 done
9687 LIBS="$cf_add_libs"
9688
9689                 # even with config script, some packages use no-override for curses.h
9690
9691 echo "$as_me:9691: checking if we have identified curses headers" >&5
9692 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9693 if test "${cf_cv_ncurses_header+set}" = set; then
9694   echo $ECHO_N "(cached) $ECHO_C" >&6
9695 else
9696
9697 cf_cv_ncurses_header=none
9698 for cf_header in \
9699         ncurses.h $cf_cv_screen/ncurses.h \
9700         curses.h $cf_cv_screen/curses.h
9701 do
9702 cat >conftest.$ac_ext <<_ACEOF
9703 #line 9703 "configure"
9704 #include "confdefs.h"
9705 #include <${cf_header}>
9706 int
9707 main (void)
9708 {
9709 initscr(); tgoto("?", 0,0)
9710   ;
9711   return 0;
9712 }
9713 _ACEOF
9714 rm -f conftest.$ac_objext
9715 if { (eval echo "$as_me:9715: \"$ac_compile\"") >&5
9716   (eval $ac_compile) 2>&5
9717   ac_status=$?
9718   echo "$as_me:9718: \$? = $ac_status" >&5
9719   (exit $ac_status); } &&
9720          { ac_try='test -s conftest.$ac_objext'
9721   { (eval echo "$as_me:9721: \"$ac_try\"") >&5
9722   (eval $ac_try) 2>&5
9723   ac_status=$?
9724   echo "$as_me:9724: \$? = $ac_status" >&5
9725   (exit $ac_status); }; }; then
9726   cf_cv_ncurses_header=$cf_header; break
9727 else
9728   echo "$as_me: failed program was:" >&5
9729 cat conftest.$ac_ext >&5
9730 fi
9731 rm -f conftest.$ac_objext conftest.$ac_ext
9732 done
9733
9734 fi
9735 echo "$as_me:9735: result: $cf_cv_ncurses_header" >&5
9736 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9737
9738 if test "$cf_cv_ncurses_header" = none ; then
9739         { { echo "$as_me:9739: error: No curses header-files found" >&5
9740 echo "$as_me: error: No curses header-files found" >&2;}
9741    { (exit 1); exit 1; }; }
9742 fi
9743
9744 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9745
9746 for ac_header in $cf_cv_ncurses_header
9747 do
9748 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9749 echo "$as_me:9749: checking for $ac_header" >&5
9750 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9751 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9752   echo $ECHO_N "(cached) $ECHO_C" >&6
9753 else
9754   cat >conftest.$ac_ext <<_ACEOF
9755 #line 9755 "configure"
9756 #include "confdefs.h"
9757 #include <$ac_header>
9758 _ACEOF
9759 if { (eval echo "$as_me:9759: \"$ac_cpp conftest.$ac_ext\"") >&5
9760   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9761   ac_status=$?
9762   egrep -v '^ *\+' conftest.er1 >conftest.err
9763   rm -f conftest.er1
9764   cat conftest.err >&5
9765   echo "$as_me:9765: \$? = $ac_status" >&5
9766   (exit $ac_status); } >/dev/null; then
9767   if test -s conftest.err; then
9768     ac_cpp_err=$ac_c_preproc_warn_flag
9769   else
9770     ac_cpp_err=
9771   fi
9772 else
9773   ac_cpp_err=yes
9774 fi
9775 if test -z "$ac_cpp_err"; then
9776   eval "$as_ac_Header=yes"
9777 else
9778   echo "$as_me: failed program was:" >&5
9779   cat conftest.$ac_ext >&5
9780   eval "$as_ac_Header=no"
9781 fi
9782 rm -f conftest.err conftest.$ac_ext
9783 fi
9784 echo "$as_me:9784: result: `eval echo '${'$as_ac_Header'}'`" >&5
9785 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9786 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9787   cat >>confdefs.h <<EOF
9788 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9789 EOF
9790
9791 fi
9792 done
9793
9794 cat >>confdefs.h <<\EOF
9795 #define NCURSES 1
9796 EOF
9797
9798 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9799
9800                 cat >>confdefs.h <<EOF
9801 #define $cf_nculib_ROOT 1
9802 EOF
9803
9804                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9805
9806         else
9807
9808 cf_ncuhdr_root=$cf_cv_screen
9809
9810 test -n "$cf_cv_curses_dir" && \
9811 test "$cf_cv_curses_dir" != "no" && { \
9812
9813 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9814   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9815   do
9816         while test $cf_add_incdir != /usr/include
9817         do
9818           if test -d $cf_add_incdir
9819           then
9820                 cf_have_incdir=no
9821                 if test -n "$CFLAGS$CPPFLAGS" ; then
9822                   # a loop is needed to ensure we can add subdirs of existing dirs
9823                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9824                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9825                           cf_have_incdir=yes; break
9826                         fi
9827                   done
9828                 fi
9829
9830                 if test "$cf_have_incdir" = no ; then
9831                   if test "$cf_add_incdir" = /usr/local/include ; then
9832                         if test "$GCC" = yes
9833                         then
9834                           cf_save_CPPFLAGS=$CPPFLAGS
9835
9836         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9837         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9838
9839                           cat >conftest.$ac_ext <<_ACEOF
9840 #line 9840 "configure"
9841 #include "confdefs.h"
9842 #include <stdio.h>
9843 int
9844 main (void)
9845 {
9846 printf("Hello")
9847   ;
9848   return 0;
9849 }
9850 _ACEOF
9851 rm -f conftest.$ac_objext
9852 if { (eval echo "$as_me:9852: \"$ac_compile\"") >&5
9853   (eval $ac_compile) 2>&5
9854   ac_status=$?
9855   echo "$as_me:9855: \$? = $ac_status" >&5
9856   (exit $ac_status); } &&
9857          { ac_try='test -s conftest.$ac_objext'
9858   { (eval echo "$as_me:9858: \"$ac_try\"") >&5
9859   (eval $ac_try) 2>&5
9860   ac_status=$?
9861   echo "$as_me:9861: \$? = $ac_status" >&5
9862   (exit $ac_status); }; }; then
9863   :
9864 else
9865   echo "$as_me: failed program was:" >&5
9866 cat conftest.$ac_ext >&5
9867 cf_have_incdir=yes
9868 fi
9869 rm -f conftest.$ac_objext conftest.$ac_ext
9870                           CPPFLAGS=$cf_save_CPPFLAGS
9871                         fi
9872                   fi
9873                 fi
9874
9875                 if test "$cf_have_incdir" = no ; then
9876                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9877
9878 echo "${as_me:-configure}:9878: testing adding $cf_add_incdir to include-path ..." 1>&5
9879
9880                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9881
9882                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9883                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9884                   cf_add_incdir="$cf_top_incdir"
9885                 else
9886                   break
9887                 fi
9888           else
9889                 break
9890           fi
9891         done
9892   done
9893 fi
9894
9895 }
9896
9897 echo "$as_me:9897: checking for $cf_ncuhdr_root header in include-path" >&5
9898 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9899 if test "${cf_cv_ncurses_h+set}" = set; then
9900   echo $ECHO_N "(cached) $ECHO_C" >&6
9901 else
9902
9903         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9904         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9905         for cf_header in $cf_header_list
9906         do
9907
9908         cat >conftest.$ac_ext <<_ACEOF
9909 #line 9909 "configure"
9910 #include "confdefs.h"
9911
9912 #include <$cf_header>
9913 int
9914 main (void)
9915 {
9916
9917 #ifdef NCURSES_VERSION
9918
9919 printf("%s\n", NCURSES_VERSION);
9920 #else
9921 #ifdef __NCURSES_H
9922 printf("old\n");
9923 #else
9924         make an error
9925 #endif
9926 #endif
9927
9928   ;
9929   return 0;
9930 }
9931 _ACEOF
9932 rm -f conftest.$ac_objext
9933 if { (eval echo "$as_me:9933: \"$ac_compile\"") >&5
9934   (eval $ac_compile) 2>&5
9935   ac_status=$?
9936   echo "$as_me:9936: \$? = $ac_status" >&5
9937   (exit $ac_status); } &&
9938          { ac_try='test -s conftest.$ac_objext'
9939   { (eval echo "$as_me:9939: \"$ac_try\"") >&5
9940   (eval $ac_try) 2>&5
9941   ac_status=$?
9942   echo "$as_me:9942: \$? = $ac_status" >&5
9943   (exit $ac_status); }; }; then
9944   cf_cv_ncurses_h=$cf_header
9945
9946 else
9947   echo "$as_me: failed program was:" >&5
9948 cat conftest.$ac_ext >&5
9949 cf_cv_ncurses_h=no
9950 fi
9951 rm -f conftest.$ac_objext conftest.$ac_ext
9952
9953                 test "$cf_cv_ncurses_h" != no && break
9954         done
9955
9956 fi
9957 echo "$as_me:9957: result: $cf_cv_ncurses_h" >&5
9958 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9959
9960 if test "$cf_cv_ncurses_h" != no ; then
9961         cf_cv_ncurses_header=$cf_cv_ncurses_h
9962 else
9963
9964 echo "$as_me:9964: checking for $cf_ncuhdr_root include-path" >&5
9965 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9966 if test "${cf_cv_ncurses_h2+set}" = set; then
9967   echo $ECHO_N "(cached) $ECHO_C" >&6
9968 else
9969
9970         test -n "$verbose" && echo
9971
9972 cf_search=
9973
9974 # collect the current set of include-directories from compiler flags
9975 cf_header_path_list=""
9976 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9977         for cf_header_path in $CPPFLAGS $CFLAGS
9978         do
9979                 case $cf_header_path in
9980                 (-I*)
9981                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9982
9983 test "x$cf_header_path" != "xNONE" && \
9984 test -d "$cf_header_path" && \
9985  {
9986         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9987         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9988         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9989         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9990         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9991         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"
9992 }
9993
9994                         cf_header_path_list="$cf_header_path_list $cf_search"
9995                         ;;
9996                 esac
9997         done
9998 fi
9999
10000 # add the variations for the package we are looking for
10001
10002 cf_search=
10003
10004 test "x$prefix" != "xNONE" && \
10005 test -d "$prefix" && \
10006  {
10007         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10008         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10009         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10010         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10011         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10012         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10013 }
10014
10015 for cf_subdir_prefix in \
10016         /usr \
10017         /usr/local \
10018         /usr/pkg \
10019         /opt \
10020         /opt/local \
10021         $HOME
10022 do
10023
10024 test "x$cf_subdir_prefix" != "x$prefix" && \
10025 test -d "$cf_subdir_prefix" && \
10026 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10027         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10028         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10029         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10030         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10031         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10032         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"
10033 }
10034
10035 done
10036
10037 test "$includedir" != NONE && \
10038 test "$includedir" != "/usr/include" && \
10039 test -d "$includedir" && {
10040         test -d $includedir &&    cf_search="$cf_search $includedir"
10041         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10042 }
10043
10044 test "$oldincludedir" != NONE && \
10045 test "$oldincludedir" != "/usr/include" && \
10046 test -d "$oldincludedir" && {
10047         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10048         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10049 }
10050
10051 cf_search="$cf_search $cf_header_path_list"
10052
10053         test -n "$verbose" && echo search path $cf_search
10054         cf_save2_CPPFLAGS="$CPPFLAGS"
10055         for cf_incdir in $cf_search
10056         do
10057
10058 if test -n "$cf_incdir" ; then
10059   for cf_add_incdir in $cf_incdir
10060   do
10061         while test $cf_add_incdir != /usr/include
10062         do
10063           if test -d $cf_add_incdir
10064           then
10065                 cf_have_incdir=no
10066                 if test -n "$CFLAGS$CPPFLAGS" ; then
10067                   # a loop is needed to ensure we can add subdirs of existing dirs
10068                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10069                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10070                           cf_have_incdir=yes; break
10071                         fi
10072                   done
10073                 fi
10074
10075                 if test "$cf_have_incdir" = no ; then
10076                   if test "$cf_add_incdir" = /usr/local/include ; then
10077                         if test "$GCC" = yes
10078                         then
10079                           cf_save_CPPFLAGS=$CPPFLAGS
10080
10081         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10082         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10083
10084                           cat >conftest.$ac_ext <<_ACEOF
10085 #line 10085 "configure"
10086 #include "confdefs.h"
10087 #include <stdio.h>
10088 int
10089 main (void)
10090 {
10091 printf("Hello")
10092   ;
10093   return 0;
10094 }
10095 _ACEOF
10096 rm -f conftest.$ac_objext
10097 if { (eval echo "$as_me:10097: \"$ac_compile\"") >&5
10098   (eval $ac_compile) 2>&5
10099   ac_status=$?
10100   echo "$as_me:10100: \$? = $ac_status" >&5
10101   (exit $ac_status); } &&
10102          { ac_try='test -s conftest.$ac_objext'
10103   { (eval echo "$as_me:10103: \"$ac_try\"") >&5
10104   (eval $ac_try) 2>&5
10105   ac_status=$?
10106   echo "$as_me:10106: \$? = $ac_status" >&5
10107   (exit $ac_status); }; }; then
10108   :
10109 else
10110   echo "$as_me: failed program was:" >&5
10111 cat conftest.$ac_ext >&5
10112 cf_have_incdir=yes
10113 fi
10114 rm -f conftest.$ac_objext conftest.$ac_ext
10115                           CPPFLAGS=$cf_save_CPPFLAGS
10116                         fi
10117                   fi
10118                 fi
10119
10120                 if test "$cf_have_incdir" = no ; then
10121                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10122
10123 echo "${as_me:-configure}:10123: testing adding $cf_add_incdir to include-path ..." 1>&5
10124
10125                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10126
10127                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10128                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10129                   cf_add_incdir="$cf_top_incdir"
10130                 else
10131                   break
10132                 fi
10133           else
10134                 break
10135           fi
10136         done
10137   done
10138 fi
10139
10140                 for cf_header in \
10141                         ncurses.h \
10142                         curses.h
10143                 do
10144
10145         cat >conftest.$ac_ext <<_ACEOF
10146 #line 10146 "configure"
10147 #include "confdefs.h"
10148
10149 #include <$cf_header>
10150 int
10151 main (void)
10152 {
10153
10154 #ifdef NCURSES_VERSION
10155
10156 printf("%s\n", NCURSES_VERSION);
10157 #else
10158 #ifdef __NCURSES_H
10159 printf("old\n");
10160 #else
10161         make an error
10162 #endif
10163 #endif
10164
10165   ;
10166   return 0;
10167 }
10168 _ACEOF
10169 rm -f conftest.$ac_objext
10170 if { (eval echo "$as_me:10170: \"$ac_compile\"") >&5
10171   (eval $ac_compile) 2>&5
10172   ac_status=$?
10173   echo "$as_me:10173: \$? = $ac_status" >&5
10174   (exit $ac_status); } &&
10175          { ac_try='test -s conftest.$ac_objext'
10176   { (eval echo "$as_me:10176: \"$ac_try\"") >&5
10177   (eval $ac_try) 2>&5
10178   ac_status=$?
10179   echo "$as_me:10179: \$? = $ac_status" >&5
10180   (exit $ac_status); }; }; then
10181   cf_cv_ncurses_h2=$cf_header
10182
10183 else
10184   echo "$as_me: failed program was:" >&5
10185 cat conftest.$ac_ext >&5
10186 cf_cv_ncurses_h2=no
10187 fi
10188 rm -f conftest.$ac_objext conftest.$ac_ext
10189
10190                         if test "$cf_cv_ncurses_h2" != no ; then
10191                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10192                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10193                                 break
10194                         fi
10195                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10196                 done
10197                 CPPFLAGS="$cf_save2_CPPFLAGS"
10198                 test "$cf_cv_ncurses_h2" != no && break
10199         done
10200         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10200: error: not found" >&5
10201 echo "$as_me: error: not found" >&2;}
10202    { (exit 1); exit 1; }; }
10203
10204 fi
10205 echo "$as_me:10205: result: $cf_cv_ncurses_h2" >&5
10206 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10207
10208         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10209         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10210         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10211                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10212         fi
10213
10214 if test -n "$cf_1st_incdir" ; then
10215   for cf_add_incdir in $cf_1st_incdir
10216   do
10217         while test $cf_add_incdir != /usr/include
10218         do
10219           if test -d $cf_add_incdir
10220           then
10221                 cf_have_incdir=no
10222                 if test -n "$CFLAGS$CPPFLAGS" ; then
10223                   # a loop is needed to ensure we can add subdirs of existing dirs
10224                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10225                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10226                           cf_have_incdir=yes; break
10227                         fi
10228                   done
10229                 fi
10230
10231                 if test "$cf_have_incdir" = no ; then
10232                   if test "$cf_add_incdir" = /usr/local/include ; then
10233                         if test "$GCC" = yes
10234                         then
10235                           cf_save_CPPFLAGS=$CPPFLAGS
10236
10237         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10238         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10239
10240                           cat >conftest.$ac_ext <<_ACEOF
10241 #line 10241 "configure"
10242 #include "confdefs.h"
10243 #include <stdio.h>
10244 int
10245 main (void)
10246 {
10247 printf("Hello")
10248   ;
10249   return 0;
10250 }
10251 _ACEOF
10252 rm -f conftest.$ac_objext
10253 if { (eval echo "$as_me:10253: \"$ac_compile\"") >&5
10254   (eval $ac_compile) 2>&5
10255   ac_status=$?
10256   echo "$as_me:10256: \$? = $ac_status" >&5
10257   (exit $ac_status); } &&
10258          { ac_try='test -s conftest.$ac_objext'
10259   { (eval echo "$as_me:10259: \"$ac_try\"") >&5
10260   (eval $ac_try) 2>&5
10261   ac_status=$?
10262   echo "$as_me:10262: \$? = $ac_status" >&5
10263   (exit $ac_status); }; }; then
10264   :
10265 else
10266   echo "$as_me: failed program was:" >&5
10267 cat conftest.$ac_ext >&5
10268 cf_have_incdir=yes
10269 fi
10270 rm -f conftest.$ac_objext conftest.$ac_ext
10271                           CPPFLAGS=$cf_save_CPPFLAGS
10272                         fi
10273                   fi
10274                 fi
10275
10276                 if test "$cf_have_incdir" = no ; then
10277                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10278
10279 echo "${as_me:-configure}:10279: testing adding $cf_add_incdir to include-path ..." 1>&5
10280
10281                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10282
10283                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10284                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10285                   cf_add_incdir="$cf_top_incdir"
10286                 else
10287                   break
10288                 fi
10289           else
10290                 break
10291           fi
10292         done
10293   done
10294 fi
10295
10296 fi
10297
10298 # Set definitions to allow ifdef'ing for ncurses.h
10299
10300 case $cf_cv_ncurses_header in
10301 (*ncurses.h)
10302
10303 cat >>confdefs.h <<\EOF
10304 #define HAVE_NCURSES_H 1
10305 EOF
10306
10307         ;;
10308 esac
10309
10310 case $cf_cv_ncurses_header in
10311 (ncurses/curses.h|ncurses/ncurses.h)
10312
10313 cat >>confdefs.h <<\EOF
10314 #define HAVE_NCURSES_NCURSES_H 1
10315 EOF
10316
10317         ;;
10318 (ncursesw/curses.h|ncursesw/ncurses.h)
10319
10320 cat >>confdefs.h <<\EOF
10321 #define HAVE_NCURSESW_NCURSES_H 1
10322 EOF
10323
10324         ;;
10325 esac
10326
10327 echo "$as_me:10327: checking for terminfo header" >&5
10328 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10329 if test "${cf_cv_term_header+set}" = set; then
10330   echo $ECHO_N "(cached) $ECHO_C" >&6
10331 else
10332
10333 case ${cf_cv_ncurses_header} in
10334 (*/ncurses.h|*/ncursesw.h)
10335         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10336         ;;
10337 (*)
10338         cf_term_header=term.h
10339         ;;
10340 esac
10341
10342 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10343 do
10344 cat >conftest.$ac_ext <<_ACEOF
10345 #line 10345 "configure"
10346 #include "confdefs.h"
10347 #include <stdio.h>
10348 #include <${cf_cv_ncurses_header:-curses.h}>
10349 #include <$cf_test>
10350
10351 int
10352 main (void)
10353 {
10354 int x = auto_left_margin
10355   ;
10356   return 0;
10357 }
10358 _ACEOF
10359 rm -f conftest.$ac_objext
10360 if { (eval echo "$as_me:10360: \"$ac_compile\"") >&5
10361   (eval $ac_compile) 2>&5
10362   ac_status=$?
10363   echo "$as_me:10363: \$? = $ac_status" >&5
10364   (exit $ac_status); } &&
10365          { ac_try='test -s conftest.$ac_objext'
10366   { (eval echo "$as_me:10366: \"$ac_try\"") >&5
10367   (eval $ac_try) 2>&5
10368   ac_status=$?
10369   echo "$as_me:10369: \$? = $ac_status" >&5
10370   (exit $ac_status); }; }; then
10371
10372         cf_cv_term_header="$cf_test"
10373 else
10374   echo "$as_me: failed program was:" >&5
10375 cat conftest.$ac_ext >&5
10376
10377         cf_cv_term_header=unknown
10378
10379 fi
10380 rm -f conftest.$ac_objext conftest.$ac_ext
10381         test "$cf_cv_term_header" != unknown && break
10382 done
10383
10384 fi
10385 echo "$as_me:10385: result: $cf_cv_term_header" >&5
10386 echo "${ECHO_T}$cf_cv_term_header" >&6
10387
10388 # Set definitions to allow ifdef'ing to accommodate subdirectories
10389
10390 case $cf_cv_term_header in
10391 (*term.h)
10392
10393 cat >>confdefs.h <<\EOF
10394 #define HAVE_TERM_H 1
10395 EOF
10396
10397         ;;
10398 esac
10399
10400 case $cf_cv_term_header in
10401 (ncurses/term.h)
10402
10403 cat >>confdefs.h <<\EOF
10404 #define HAVE_NCURSES_TERM_H 1
10405 EOF
10406
10407         ;;
10408 (ncursesw/term.h)
10409
10410 cat >>confdefs.h <<\EOF
10411 #define HAVE_NCURSESW_TERM_H 1
10412 EOF
10413
10414         ;;
10415 esac
10416
10417 # some applications need this, but should check for NCURSES_VERSION
10418
10419 cat >>confdefs.h <<\EOF
10420 #define NCURSES 1
10421 EOF
10422
10423 echo "$as_me:10423: checking for ncurses version" >&5
10424 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10425 if test "${cf_cv_ncurses_version+set}" = set; then
10426   echo $ECHO_N "(cached) $ECHO_C" >&6
10427 else
10428
10429         cf_cv_ncurses_version=no
10430         cf_tempfile=out$$
10431         rm -f $cf_tempfile
10432         if test "$cross_compiling" = yes; then
10433
10434         # This will not work if the preprocessor splits the line after the
10435         # Autoconf token.  The 'unproto' program does that.
10436         cat > conftest.$ac_ext <<EOF
10437 #include <${cf_cv_ncurses_header:-curses.h}>
10438 #undef Autoconf
10439 #ifdef NCURSES_VERSION
10440 Autoconf NCURSES_VERSION
10441 #else
10442 #ifdef __NCURSES_H
10443 Autoconf "old"
10444 #endif
10445 ;
10446 #endif
10447 EOF
10448         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10449         { (eval echo "$as_me:10449: \"$cf_try\"") >&5
10450   (eval $cf_try) 2>&5
10451   ac_status=$?
10452   echo "$as_me:10452: \$? = $ac_status" >&5
10453   (exit $ac_status); }
10454         if test -f conftest.out ; then
10455                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10456                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10457                 rm -f conftest.out
10458         fi
10459
10460 else
10461   cat >conftest.$ac_ext <<_ACEOF
10462 #line 10462 "configure"
10463 #include "confdefs.h"
10464
10465 #include <${cf_cv_ncurses_header:-curses.h}>
10466 #include <stdio.h>
10467 int main(void)
10468 {
10469         FILE *fp = fopen("$cf_tempfile", "w");
10470 #ifdef NCURSES_VERSION
10471 # ifdef NCURSES_VERSION_PATCH
10472         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10473 # else
10474         fprintf(fp, "%s\n", NCURSES_VERSION);
10475 # endif
10476 #else
10477 # ifdef __NCURSES_H
10478         fprintf(fp, "old\n");
10479 # else
10480         make an error
10481 # endif
10482 #endif
10483         ${cf_cv_main_return:-return}(0);
10484 }
10485 _ACEOF
10486 rm -f conftest$ac_exeext
10487 if { (eval echo "$as_me:10487: \"$ac_link\"") >&5
10488   (eval $ac_link) 2>&5
10489   ac_status=$?
10490   echo "$as_me:10490: \$? = $ac_status" >&5
10491   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10492   { (eval echo "$as_me:10492: \"$ac_try\"") >&5
10493   (eval $ac_try) 2>&5
10494   ac_status=$?
10495   echo "$as_me:10495: \$? = $ac_status" >&5
10496   (exit $ac_status); }; }; then
10497
10498         cf_cv_ncurses_version=`cat $cf_tempfile`
10499 else
10500   echo "$as_me: program exited with status $ac_status" >&5
10501 echo "$as_me: failed program was:" >&5
10502 cat conftest.$ac_ext >&5
10503 fi
10504 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10505 fi
10506         rm -f $cf_tempfile
10507
10508 fi
10509 echo "$as_me:10509: result: $cf_cv_ncurses_version" >&5
10510 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10511 test "$cf_cv_ncurses_version" = no ||
10512 cat >>confdefs.h <<\EOF
10513 #define NCURSES 1
10514 EOF
10515
10516 cf_nculib_root=$cf_cv_screen
10517         # This works, except for the special case where we find gpm, but
10518         # ncurses is in a nonstandard location via $LIBS, and we really want
10519         # to link gpm.
10520 cf_ncurses_LIBS=""
10521 cf_ncurses_SAVE="$LIBS"
10522 echo "$as_me:10522: checking for Gpm_Open in -lgpm" >&5
10523 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10524 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10525   echo $ECHO_N "(cached) $ECHO_C" >&6
10526 else
10527   ac_check_lib_save_LIBS=$LIBS
10528 LIBS="-lgpm  $LIBS"
10529 cat >conftest.$ac_ext <<_ACEOF
10530 #line 10530 "configure"
10531 #include "confdefs.h"
10532
10533 /* Override any gcc2 internal prototype to avoid an error.  */
10534 #ifdef __cplusplus
10535 extern "C"
10536 #endif
10537 /* We use char because int might match the return type of a gcc2
10538    builtin and then its argument prototype would still apply.  */
10539 char Gpm_Open ();
10540 int
10541 main (void)
10542 {
10543 Gpm_Open ();
10544   ;
10545   return 0;
10546 }
10547 _ACEOF
10548 rm -f conftest.$ac_objext conftest$ac_exeext
10549 if { (eval echo "$as_me:10549: \"$ac_link\"") >&5
10550   (eval $ac_link) 2>&5
10551   ac_status=$?
10552   echo "$as_me:10552: \$? = $ac_status" >&5
10553   (exit $ac_status); } &&
10554          { ac_try='test -s conftest$ac_exeext'
10555   { (eval echo "$as_me:10555: \"$ac_try\"") >&5
10556   (eval $ac_try) 2>&5
10557   ac_status=$?
10558   echo "$as_me:10558: \$? = $ac_status" >&5
10559   (exit $ac_status); }; }; then
10560   ac_cv_lib_gpm_Gpm_Open=yes
10561 else
10562   echo "$as_me: failed program was:" >&5
10563 cat conftest.$ac_ext >&5
10564 ac_cv_lib_gpm_Gpm_Open=no
10565 fi
10566 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10567 LIBS=$ac_check_lib_save_LIBS
10568 fi
10569 echo "$as_me:10569: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10570 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10571 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10572   echo "$as_me:10572: checking for initscr in -lgpm" >&5
10573 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10574 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10575   echo $ECHO_N "(cached) $ECHO_C" >&6
10576 else
10577   ac_check_lib_save_LIBS=$LIBS
10578 LIBS="-lgpm  $LIBS"
10579 cat >conftest.$ac_ext <<_ACEOF
10580 #line 10580 "configure"
10581 #include "confdefs.h"
10582
10583 /* Override any gcc2 internal prototype to avoid an error.  */
10584 #ifdef __cplusplus
10585 extern "C"
10586 #endif
10587 /* We use char because int might match the return type of a gcc2
10588    builtin and then its argument prototype would still apply.  */
10589 char initscr ();
10590 int
10591 main (void)
10592 {
10593 initscr ();
10594   ;
10595   return 0;
10596 }
10597 _ACEOF
10598 rm -f conftest.$ac_objext conftest$ac_exeext
10599 if { (eval echo "$as_me:10599: \"$ac_link\"") >&5
10600   (eval $ac_link) 2>&5
10601   ac_status=$?
10602   echo "$as_me:10602: \$? = $ac_status" >&5
10603   (exit $ac_status); } &&
10604          { ac_try='test -s conftest$ac_exeext'
10605   { (eval echo "$as_me:10605: \"$ac_try\"") >&5
10606   (eval $ac_try) 2>&5
10607   ac_status=$?
10608   echo "$as_me:10608: \$? = $ac_status" >&5
10609   (exit $ac_status); }; }; then
10610   ac_cv_lib_gpm_initscr=yes
10611 else
10612   echo "$as_me: failed program was:" >&5
10613 cat conftest.$ac_ext >&5
10614 ac_cv_lib_gpm_initscr=no
10615 fi
10616 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10617 LIBS=$ac_check_lib_save_LIBS
10618 fi
10619 echo "$as_me:10619: result: $ac_cv_lib_gpm_initscr" >&5
10620 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10621 if test $ac_cv_lib_gpm_initscr = yes; then
10622   LIBS="$cf_ncurses_SAVE"
10623 else
10624   cf_ncurses_LIBS="-lgpm"
10625 fi
10626
10627 fi
10628
10629 case $host_os in
10630 (freebsd*)
10631         # This is only necessary if you are linking against an obsolete
10632         # version of ncurses (but it should do no harm, since it's static).
10633         if test "$cf_nculib_root" = ncurses ; then
10634                 echo "$as_me:10634: checking for tgoto in -lmytinfo" >&5
10635 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10636 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10637   echo $ECHO_N "(cached) $ECHO_C" >&6
10638 else
10639   ac_check_lib_save_LIBS=$LIBS
10640 LIBS="-lmytinfo  $LIBS"
10641 cat >conftest.$ac_ext <<_ACEOF
10642 #line 10642 "configure"
10643 #include "confdefs.h"
10644
10645 /* Override any gcc2 internal prototype to avoid an error.  */
10646 #ifdef __cplusplus
10647 extern "C"
10648 #endif
10649 /* We use char because int might match the return type of a gcc2
10650    builtin and then its argument prototype would still apply.  */
10651 char tgoto ();
10652 int
10653 main (void)
10654 {
10655 tgoto ();
10656   ;
10657   return 0;
10658 }
10659 _ACEOF
10660 rm -f conftest.$ac_objext conftest$ac_exeext
10661 if { (eval echo "$as_me:10661: \"$ac_link\"") >&5
10662   (eval $ac_link) 2>&5
10663   ac_status=$?
10664   echo "$as_me:10664: \$? = $ac_status" >&5
10665   (exit $ac_status); } &&
10666          { ac_try='test -s conftest$ac_exeext'
10667   { (eval echo "$as_me:10667: \"$ac_try\"") >&5
10668   (eval $ac_try) 2>&5
10669   ac_status=$?
10670   echo "$as_me:10670: \$? = $ac_status" >&5
10671   (exit $ac_status); }; }; then
10672   ac_cv_lib_mytinfo_tgoto=yes
10673 else
10674   echo "$as_me: failed program was:" >&5
10675 cat conftest.$ac_ext >&5
10676 ac_cv_lib_mytinfo_tgoto=no
10677 fi
10678 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10679 LIBS=$ac_check_lib_save_LIBS
10680 fi
10681 echo "$as_me:10681: result: $ac_cv_lib_mytinfo_tgoto" >&5
10682 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10683 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10684   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10685 fi
10686
10687         fi
10688         ;;
10689 esac
10690
10691 cf_add_libs="$cf_ncurses_LIBS"
10692 # Filter out duplicates - this happens with badly-designed ".pc" files...
10693 for cf_add_1lib in $LIBS
10694 do
10695         for cf_add_2lib in $cf_add_libs
10696         do
10697                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10698                 then
10699                         cf_add_1lib=
10700                         break
10701                 fi
10702         done
10703         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10704 done
10705 LIBS="$cf_add_libs"
10706
10707 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10708 then
10709
10710 cf_add_libs="-l$cf_nculib_root"
10711 # Filter out duplicates - this happens with badly-designed ".pc" files...
10712 for cf_add_1lib in $LIBS
10713 do
10714         for cf_add_2lib in $cf_add_libs
10715         do
10716                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10717                 then
10718                         cf_add_1lib=
10719                         break
10720                 fi
10721         done
10722         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10723 done
10724 LIBS="$cf_add_libs"
10725
10726 else
10727
10728         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10729         cf_libdir=""
10730         echo "$as_me:10730: checking for initscr" >&5
10731 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10732 if test "${ac_cv_func_initscr+set}" = set; then
10733   echo $ECHO_N "(cached) $ECHO_C" >&6
10734 else
10735   cat >conftest.$ac_ext <<_ACEOF
10736 #line 10736 "configure"
10737 #include "confdefs.h"
10738 /* System header to define __stub macros and hopefully few prototypes,
10739     which can conflict with char initscr (); below.  */
10740 #include <assert.h>
10741 /* Override any gcc2 internal prototype to avoid an error.  */
10742 #ifdef __cplusplus
10743 extern "C"
10744 #endif
10745 /* We use char because int might match the return type of a gcc2
10746    builtin and then its argument prototype would still apply.  */
10747 char initscr ();
10748 char (*f) ();
10749
10750 int
10751 main (void)
10752 {
10753 /* The GNU C library defines this for functions which it implements
10754     to always fail with ENOSYS.  Some functions are actually named
10755     something starting with __ and the normal name is an alias.  */
10756 #if defined (__stub_initscr) || defined (__stub___initscr)
10757 choke me
10758 #else
10759 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10760 #endif
10761
10762   ;
10763   return 0;
10764 }
10765 _ACEOF
10766 rm -f conftest.$ac_objext conftest$ac_exeext
10767 if { (eval echo "$as_me:10767: \"$ac_link\"") >&5
10768   (eval $ac_link) 2>&5
10769   ac_status=$?
10770   echo "$as_me:10770: \$? = $ac_status" >&5
10771   (exit $ac_status); } &&
10772          { ac_try='test -s conftest$ac_exeext'
10773   { (eval echo "$as_me:10773: \"$ac_try\"") >&5
10774   (eval $ac_try) 2>&5
10775   ac_status=$?
10776   echo "$as_me:10776: \$? = $ac_status" >&5
10777   (exit $ac_status); }; }; then
10778   ac_cv_func_initscr=yes
10779 else
10780   echo "$as_me: failed program was:" >&5
10781 cat conftest.$ac_ext >&5
10782 ac_cv_func_initscr=no
10783 fi
10784 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10785 fi
10786 echo "$as_me:10786: result: $ac_cv_func_initscr" >&5
10787 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10788 if test $ac_cv_func_initscr = yes; then
10789   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10790 else
10791
10792                 cf_save_LIBS="$LIBS"
10793                 echo "$as_me:10793: checking for initscr in -l$cf_nculib_root" >&5
10794 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10795                 LIBS="-l$cf_nculib_root $LIBS"
10796                 cat >conftest.$ac_ext <<_ACEOF
10797 #line 10797 "configure"
10798 #include "confdefs.h"
10799 #include <${cf_cv_ncurses_header:-curses.h}>
10800 int
10801 main (void)
10802 {
10803 initscr()
10804   ;
10805   return 0;
10806 }
10807 _ACEOF
10808 rm -f conftest.$ac_objext conftest$ac_exeext
10809 if { (eval echo "$as_me:10809: \"$ac_link\"") >&5
10810   (eval $ac_link) 2>&5
10811   ac_status=$?
10812   echo "$as_me:10812: \$? = $ac_status" >&5
10813   (exit $ac_status); } &&
10814          { ac_try='test -s conftest$ac_exeext'
10815   { (eval echo "$as_me:10815: \"$ac_try\"") >&5
10816   (eval $ac_try) 2>&5
10817   ac_status=$?
10818   echo "$as_me:10818: \$? = $ac_status" >&5
10819   (exit $ac_status); }; }; then
10820   echo "$as_me:10820: result: yes" >&5
10821 echo "${ECHO_T}yes" >&6
10822                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10823
10824 else
10825   echo "$as_me: failed program was:" >&5
10826 cat conftest.$ac_ext >&5
10827 echo "$as_me:10827: result: no" >&5
10828 echo "${ECHO_T}no" >&6
10829
10830 cf_search=
10831 cf_library_path_list=""
10832 if test -n "${LDFLAGS}${LIBS}" ; then
10833         for cf_library_path in $LDFLAGS $LIBS
10834         do
10835                 case $cf_library_path in
10836                 (-L*)
10837                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10838
10839 test "x$cf_library_path" != "xNONE" && \
10840 test -d "$cf_library_path" && \
10841  {
10842         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10843         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10844         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10845         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10846         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10847         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"
10848 }
10849
10850                         cf_library_path_list="$cf_library_path_list $cf_search"
10851                         ;;
10852                 esac
10853         done
10854 fi
10855
10856 cf_search=
10857
10858 test "x$prefix" != "xNONE" && \
10859 test -d "$prefix" && \
10860  {
10861         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10862         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10863         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10864         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10865         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10866         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10867 }
10868
10869 for cf_subdir_prefix in \
10870         /usr \
10871         /usr/local \
10872         /usr/pkg \
10873         /opt \
10874         /opt/local \
10875         $HOME
10876 do
10877
10878 test "x$cf_subdir_prefix" != "x$prefix" && \
10879 test -d "$cf_subdir_prefix" && \
10880 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10881         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10882         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10883         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10884         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10885         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10886         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"
10887 }
10888
10889 done
10890
10891 cf_search="$cf_library_path_list $cf_search"
10892
10893                         for cf_libdir in $cf_search
10894                         do
10895                                 echo "$as_me:10895: checking for -l$cf_nculib_root in $cf_libdir" >&5
10896 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10897                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10898                                 cat >conftest.$ac_ext <<_ACEOF
10899 #line 10899 "configure"
10900 #include "confdefs.h"
10901 #include <${cf_cv_ncurses_header:-curses.h}>
10902 int
10903 main (void)
10904 {
10905 initscr()
10906   ;
10907   return 0;
10908 }
10909 _ACEOF
10910 rm -f conftest.$ac_objext conftest$ac_exeext
10911 if { (eval echo "$as_me:10911: \"$ac_link\"") >&5
10912   (eval $ac_link) 2>&5
10913   ac_status=$?
10914   echo "$as_me:10914: \$? = $ac_status" >&5
10915   (exit $ac_status); } &&
10916          { ac_try='test -s conftest$ac_exeext'
10917   { (eval echo "$as_me:10917: \"$ac_try\"") >&5
10918   (eval $ac_try) 2>&5
10919   ac_status=$?
10920   echo "$as_me:10920: \$? = $ac_status" >&5
10921   (exit $ac_status); }; }; then
10922   echo "$as_me:10922: result: yes" >&5
10923 echo "${ECHO_T}yes" >&6
10924                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10925                                          break
10926 else
10927   echo "$as_me: failed program was:" >&5
10928 cat conftest.$ac_ext >&5
10929 echo "$as_me:10929: result: no" >&5
10930 echo "${ECHO_T}no" >&6
10931                                          LIBS="$cf_save_LIBS"
10932 fi
10933 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10934                         done
10935
10936 fi
10937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10938
10939 fi
10940
10941 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10942
10943 if test $cf_found_library = no ; then
10944         { { echo "$as_me:10944: error: Cannot link $cf_nculib_root library" >&5
10945 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10946    { (exit 1); exit 1; }; }
10947 fi
10948
10949 fi
10950
10951 if test -n "$cf_ncurses_LIBS" ; then
10952         echo "$as_me:10952: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10953 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10954         cf_ncurses_SAVE="$LIBS"
10955         for p in $cf_ncurses_LIBS ; do
10956                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10957                 if test "$q" != "$LIBS" ; then
10958                         LIBS="$q"
10959                 fi
10960         done
10961         cat >conftest.$ac_ext <<_ACEOF
10962 #line 10962 "configure"
10963 #include "confdefs.h"
10964 #include <${cf_cv_ncurses_header:-curses.h}>
10965 int
10966 main (void)
10967 {
10968 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10969   ;
10970   return 0;
10971 }
10972 _ACEOF
10973 rm -f conftest.$ac_objext conftest$ac_exeext
10974 if { (eval echo "$as_me:10974: \"$ac_link\"") >&5
10975   (eval $ac_link) 2>&5
10976   ac_status=$?
10977   echo "$as_me:10977: \$? = $ac_status" >&5
10978   (exit $ac_status); } &&
10979          { ac_try='test -s conftest$ac_exeext'
10980   { (eval echo "$as_me:10980: \"$ac_try\"") >&5
10981   (eval $ac_try) 2>&5
10982   ac_status=$?
10983   echo "$as_me:10983: \$? = $ac_status" >&5
10984   (exit $ac_status); }; }; then
10985   echo "$as_me:10985: result: yes" >&5
10986 echo "${ECHO_T}yes" >&6
10987 else
10988   echo "$as_me: failed program was:" >&5
10989 cat conftest.$ac_ext >&5
10990 echo "$as_me:10990: result: no" >&5
10991 echo "${ECHO_T}no" >&6
10992                  LIBS="$cf_ncurses_SAVE"
10993 fi
10994 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10995 fi
10996
10997 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10998
10999 cat >>confdefs.h <<EOF
11000 #define $cf_nculib_ROOT 1
11001 EOF
11002
11003         fi
11004 else
11005         NCURSES_CONFIG=none
11006 fi
11007
11008         ;;
11009 (pdcurses)
11010         echo "$as_me:11010: checking for X" >&5
11011 echo $ECHO_N "checking for X... $ECHO_C" >&6
11012
11013 # Check whether --with-x or --without-x was given.
11014 if test "${with_x+set}" = set; then
11015   withval="$with_x"
11016
11017 fi;
11018 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11019 if test "x$with_x" = xno; then
11020   # The user explicitly disabled X.
11021   have_x=disabled
11022 else
11023   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11024     # Both variables are already set.
11025     have_x=yes
11026   else
11027     if test "${ac_cv_have_x+set}" = set; then
11028   echo $ECHO_N "(cached) $ECHO_C" >&6
11029 else
11030   # One or both of the vars are not set, and there is no cached value.
11031 ac_x_includes=no ac_x_libraries=no
11032 rm -fr conftest.dir
11033 if mkdir conftest.dir; then
11034   cd conftest.dir
11035   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11036   cat >Imakefile <<'EOF'
11037 acfindx:
11038         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11039 EOF
11040   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11041     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11042     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11043     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11044     for ac_extension in a so sl dylib dll; do
11045       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11046          test -f $ac_im_libdir/libX11.$ac_extension; then
11047         ac_im_usrlibdir=$ac_im_libdir; break
11048       fi
11049     done
11050     # Screen out bogus values from the imake configuration.  They are
11051     # bogus both because they are the default anyway, and because
11052     # using them would break gcc on systems where it needs fixed includes.
11053     case $ac_im_incroot in
11054         /usr/include) ;;
11055         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11056     esac
11057     case $ac_im_usrlibdir in
11058         /usr/lib | /lib) ;;
11059         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11060     esac
11061   fi
11062   cd ..
11063   rm -fr conftest.dir
11064 fi
11065
11066 # Standard set of common directories for X headers.
11067 # Check X11 before X11Rn because it is often a symlink to the current release.
11068 ac_x_header_dirs='
11069 /usr/X11/include
11070 /usr/X11R6/include
11071 /usr/X11R5/include
11072 /usr/X11R4/include
11073
11074 /usr/include/X11
11075 /usr/include/X11R6
11076 /usr/include/X11R5
11077 /usr/include/X11R4
11078
11079 /usr/local/X11/include
11080 /usr/local/X11R6/include
11081 /usr/local/X11R5/include
11082 /usr/local/X11R4/include
11083
11084 /usr/local/include/X11
11085 /usr/local/include/X11R6
11086 /usr/local/include/X11R5
11087 /usr/local/include/X11R4
11088
11089 /usr/X386/include
11090 /usr/x386/include
11091 /usr/XFree86/include/X11
11092
11093 /usr/include
11094 /usr/local/include
11095 /usr/unsupported/include
11096 /usr/athena/include
11097 /usr/local/x11r5/include
11098 /usr/lpp/Xamples/include
11099
11100 /usr/openwin/include
11101 /usr/openwin/share/include'
11102
11103 if test "$ac_x_includes" = no; then
11104   # Guess where to find include files, by looking for Intrinsic.h.
11105   # First, try using that file with no special directory specified.
11106   cat >conftest.$ac_ext <<_ACEOF
11107 #line 11107 "configure"
11108 #include "confdefs.h"
11109 #include <X11/Intrinsic.h>
11110 _ACEOF
11111 if { (eval echo "$as_me:11111: \"$ac_cpp conftest.$ac_ext\"") >&5
11112   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11113   ac_status=$?
11114   egrep -v '^ *\+' conftest.er1 >conftest.err
11115   rm -f conftest.er1
11116   cat conftest.err >&5
11117   echo "$as_me:11117: \$? = $ac_status" >&5
11118   (exit $ac_status); } >/dev/null; then
11119   if test -s conftest.err; then
11120     ac_cpp_err=$ac_c_preproc_warn_flag
11121   else
11122     ac_cpp_err=
11123   fi
11124 else
11125   ac_cpp_err=yes
11126 fi
11127 if test -z "$ac_cpp_err"; then
11128   # We can compile using X headers with no special include directory.
11129 ac_x_includes=
11130 else
11131   echo "$as_me: failed program was:" >&5
11132   cat conftest.$ac_ext >&5
11133   for ac_dir in $ac_x_header_dirs; do
11134   if test -r "$ac_dir/X11/Intrinsic.h"; then
11135     ac_x_includes=$ac_dir
11136     break
11137   fi
11138 done
11139 fi
11140 rm -f conftest.err conftest.$ac_ext
11141 fi # $ac_x_includes = no
11142
11143 if test "$ac_x_libraries" = no; then
11144   # Check for the libraries.
11145   # See if we find them without any special options.
11146   # Don't add to $LIBS permanently.
11147   ac_save_LIBS=$LIBS
11148   LIBS="-lXt $LIBS"
11149   cat >conftest.$ac_ext <<_ACEOF
11150 #line 11150 "configure"
11151 #include "confdefs.h"
11152 #include <X11/Intrinsic.h>
11153 int
11154 main (void)
11155 {
11156 XtMalloc (0)
11157   ;
11158   return 0;
11159 }
11160 _ACEOF
11161 rm -f conftest.$ac_objext conftest$ac_exeext
11162 if { (eval echo "$as_me:11162: \"$ac_link\"") >&5
11163   (eval $ac_link) 2>&5
11164   ac_status=$?
11165   echo "$as_me:11165: \$? = $ac_status" >&5
11166   (exit $ac_status); } &&
11167          { ac_try='test -s conftest$ac_exeext'
11168   { (eval echo "$as_me:11168: \"$ac_try\"") >&5
11169   (eval $ac_try) 2>&5
11170   ac_status=$?
11171   echo "$as_me:11171: \$? = $ac_status" >&5
11172   (exit $ac_status); }; }; then
11173   LIBS=$ac_save_LIBS
11174 # We can link X programs with no special library path.
11175 ac_x_libraries=
11176 else
11177   echo "$as_me: failed program was:" >&5
11178 cat conftest.$ac_ext >&5
11179 LIBS=$ac_save_LIBS
11180 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11181 do
11182   # Don't even attempt the hair of trying to link an X program!
11183   for ac_extension in a so sl dylib dll; do
11184     if test -r $ac_dir/libXt.$ac_extension; then
11185       ac_x_libraries=$ac_dir
11186       break 2
11187     fi
11188   done
11189 done
11190 fi
11191 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11192 fi # $ac_x_libraries = no
11193
11194 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11195   # Didn't find X anywhere.  Cache the known absence of X.
11196   ac_cv_have_x="have_x=no"
11197 else
11198   # Record where we found X for the cache.
11199   ac_cv_have_x="have_x=yes \
11200                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11201 fi
11202 fi
11203
11204   fi
11205   eval "$ac_cv_have_x"
11206 fi # $with_x != no
11207
11208 if test "$have_x" != yes; then
11209   echo "$as_me:11209: result: $have_x" >&5
11210 echo "${ECHO_T}$have_x" >&6
11211   no_x=yes
11212 else
11213   # If each of the values was on the command line, it overrides each guess.
11214   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11215   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11216   # Update the cache value to reflect the command line values.
11217   ac_cv_have_x="have_x=yes \
11218                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11219   echo "$as_me:11219: result: libraries $x_libraries, headers $x_includes" >&5
11220 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11221 fi
11222
11223 if test "$no_x" = yes; then
11224   # Not all programs may use this symbol, but it does not hurt to define it.
11225
11226 cat >>confdefs.h <<\EOF
11227 #define X_DISPLAY_MISSING 1
11228 EOF
11229
11230   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11231 else
11232   if test -n "$x_includes"; then
11233     X_CFLAGS="$X_CFLAGS -I$x_includes"
11234   fi
11235
11236   # It would also be nice to do this for all -L options, not just this one.
11237   if test -n "$x_libraries"; then
11238     X_LIBS="$X_LIBS -L$x_libraries"
11239     # For Solaris; some versions of Sun CC require a space after -R and
11240     # others require no space.  Words are not sufficient . . . .
11241     case `(uname -sr) 2>/dev/null` in
11242     "SunOS 5"*)
11243       echo "$as_me:11243: checking whether -R must be followed by a space" >&5
11244 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11245       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11246       cat >conftest.$ac_ext <<_ACEOF
11247 #line 11247 "configure"
11248 #include "confdefs.h"
11249
11250 int
11251 main (void)
11252 {
11253
11254   ;
11255   return 0;
11256 }
11257 _ACEOF
11258 rm -f conftest.$ac_objext conftest$ac_exeext
11259 if { (eval echo "$as_me:11259: \"$ac_link\"") >&5
11260   (eval $ac_link) 2>&5
11261   ac_status=$?
11262   echo "$as_me:11262: \$? = $ac_status" >&5
11263   (exit $ac_status); } &&
11264          { ac_try='test -s conftest$ac_exeext'
11265   { (eval echo "$as_me:11265: \"$ac_try\"") >&5
11266   (eval $ac_try) 2>&5
11267   ac_status=$?
11268   echo "$as_me:11268: \$? = $ac_status" >&5
11269   (exit $ac_status); }; }; then
11270   ac_R_nospace=yes
11271 else
11272   echo "$as_me: failed program was:" >&5
11273 cat conftest.$ac_ext >&5
11274 ac_R_nospace=no
11275 fi
11276 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11277       if test $ac_R_nospace = yes; then
11278         echo "$as_me:11278: result: no" >&5
11279 echo "${ECHO_T}no" >&6
11280         X_LIBS="$X_LIBS -R$x_libraries"
11281       else
11282         LIBS="$ac_xsave_LIBS -R $x_libraries"
11283         cat >conftest.$ac_ext <<_ACEOF
11284 #line 11284 "configure"
11285 #include "confdefs.h"
11286
11287 int
11288 main (void)
11289 {
11290
11291   ;
11292   return 0;
11293 }
11294 _ACEOF
11295 rm -f conftest.$ac_objext conftest$ac_exeext
11296 if { (eval echo "$as_me:11296: \"$ac_link\"") >&5
11297   (eval $ac_link) 2>&5
11298   ac_status=$?
11299   echo "$as_me:11299: \$? = $ac_status" >&5
11300   (exit $ac_status); } &&
11301          { ac_try='test -s conftest$ac_exeext'
11302   { (eval echo "$as_me:11302: \"$ac_try\"") >&5
11303   (eval $ac_try) 2>&5
11304   ac_status=$?
11305   echo "$as_me:11305: \$? = $ac_status" >&5
11306   (exit $ac_status); }; }; then
11307   ac_R_space=yes
11308 else
11309   echo "$as_me: failed program was:" >&5
11310 cat conftest.$ac_ext >&5
11311 ac_R_space=no
11312 fi
11313 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11314         if test $ac_R_space = yes; then
11315           echo "$as_me:11315: result: yes" >&5
11316 echo "${ECHO_T}yes" >&6
11317           X_LIBS="$X_LIBS -R $x_libraries"
11318         else
11319           echo "$as_me:11319: result: neither works" >&5
11320 echo "${ECHO_T}neither works" >&6
11321         fi
11322       fi
11323       LIBS=$ac_xsave_LIBS
11324     esac
11325   fi
11326
11327   # Check for system-dependent libraries X programs must link with.
11328   # Do this before checking for the system-independent R6 libraries
11329   # (-lICE), since we may need -lsocket or whatever for X linking.
11330
11331   if test "$ISC" = yes; then
11332     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11333   else
11334     # Martyn Johnson says this is needed for Ultrix, if the X
11335     # libraries were built with DECnet support.  And Karl Berry says
11336     # the Alpha needs dnet_stub (dnet does not exist).
11337     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11338     cat >conftest.$ac_ext <<_ACEOF
11339 #line 11339 "configure"
11340 #include "confdefs.h"
11341
11342 /* Override any gcc2 internal prototype to avoid an error.  */
11343 #ifdef __cplusplus
11344 extern "C"
11345 #endif
11346 /* We use char because int might match the return type of a gcc2
11347    builtin and then its argument prototype would still apply.  */
11348 char XOpenDisplay ();
11349 int
11350 main (void)
11351 {
11352 XOpenDisplay ();
11353   ;
11354   return 0;
11355 }
11356 _ACEOF
11357 rm -f conftest.$ac_objext conftest$ac_exeext
11358 if { (eval echo "$as_me:11358: \"$ac_link\"") >&5
11359   (eval $ac_link) 2>&5
11360   ac_status=$?
11361   echo "$as_me:11361: \$? = $ac_status" >&5
11362   (exit $ac_status); } &&
11363          { ac_try='test -s conftest$ac_exeext'
11364   { (eval echo "$as_me:11364: \"$ac_try\"") >&5
11365   (eval $ac_try) 2>&5
11366   ac_status=$?
11367   echo "$as_me:11367: \$? = $ac_status" >&5
11368   (exit $ac_status); }; }; then
11369   :
11370 else
11371   echo "$as_me: failed program was:" >&5
11372 cat conftest.$ac_ext >&5
11373 echo "$as_me:11373: checking for dnet_ntoa in -ldnet" >&5
11374 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11375 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11376   echo $ECHO_N "(cached) $ECHO_C" >&6
11377 else
11378   ac_check_lib_save_LIBS=$LIBS
11379 LIBS="-ldnet  $LIBS"
11380 cat >conftest.$ac_ext <<_ACEOF
11381 #line 11381 "configure"
11382 #include "confdefs.h"
11383
11384 /* Override any gcc2 internal prototype to avoid an error.  */
11385 #ifdef __cplusplus
11386 extern "C"
11387 #endif
11388 /* We use char because int might match the return type of a gcc2
11389    builtin and then its argument prototype would still apply.  */
11390 char dnet_ntoa ();
11391 int
11392 main (void)
11393 {
11394 dnet_ntoa ();
11395   ;
11396   return 0;
11397 }
11398 _ACEOF
11399 rm -f conftest.$ac_objext conftest$ac_exeext
11400 if { (eval echo "$as_me:11400: \"$ac_link\"") >&5
11401   (eval $ac_link) 2>&5
11402   ac_status=$?
11403   echo "$as_me:11403: \$? = $ac_status" >&5
11404   (exit $ac_status); } &&
11405          { ac_try='test -s conftest$ac_exeext'
11406   { (eval echo "$as_me:11406: \"$ac_try\"") >&5
11407   (eval $ac_try) 2>&5
11408   ac_status=$?
11409   echo "$as_me:11409: \$? = $ac_status" >&5
11410   (exit $ac_status); }; }; then
11411   ac_cv_lib_dnet_dnet_ntoa=yes
11412 else
11413   echo "$as_me: failed program was:" >&5
11414 cat conftest.$ac_ext >&5
11415 ac_cv_lib_dnet_dnet_ntoa=no
11416 fi
11417 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11418 LIBS=$ac_check_lib_save_LIBS
11419 fi
11420 echo "$as_me:11420: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
11421 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
11422 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
11423   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
11424 fi
11425
11426     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
11427       echo "$as_me:11427: checking for dnet_ntoa in -ldnet_stub" >&5
11428 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
11429 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
11430   echo $ECHO_N "(cached) $ECHO_C" >&6
11431 else
11432   ac_check_lib_save_LIBS=$LIBS
11433 LIBS="-ldnet_stub  $LIBS"
11434 cat >conftest.$ac_ext <<_ACEOF
11435 #line 11435 "configure"
11436 #include "confdefs.h"
11437
11438 /* Override any gcc2 internal prototype to avoid an error.  */
11439 #ifdef __cplusplus
11440 extern "C"
11441 #endif
11442 /* We use char because int might match the return type of a gcc2
11443    builtin and then its argument prototype would still apply.  */
11444 char dnet_ntoa ();
11445 int
11446 main (void)
11447 {
11448 dnet_ntoa ();
11449   ;
11450   return 0;
11451 }
11452 _ACEOF
11453 rm -f conftest.$ac_objext conftest$ac_exeext
11454 if { (eval echo "$as_me:11454: \"$ac_link\"") >&5
11455   (eval $ac_link) 2>&5
11456   ac_status=$?
11457   echo "$as_me:11457: \$? = $ac_status" >&5
11458   (exit $ac_status); } &&
11459          { ac_try='test -s conftest$ac_exeext'
11460   { (eval echo "$as_me:11460: \"$ac_try\"") >&5
11461   (eval $ac_try) 2>&5
11462   ac_status=$?
11463   echo "$as_me:11463: \$? = $ac_status" >&5
11464   (exit $ac_status); }; }; then
11465   ac_cv_lib_dnet_stub_dnet_ntoa=yes
11466 else
11467   echo "$as_me: failed program was:" >&5
11468 cat conftest.$ac_ext >&5
11469 ac_cv_lib_dnet_stub_dnet_ntoa=no
11470 fi
11471 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11472 LIBS=$ac_check_lib_save_LIBS
11473 fi
11474 echo "$as_me:11474: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
11475 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
11476 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
11477   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
11478 fi
11479
11480     fi
11481 fi
11482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11483     LIBS="$ac_xsave_LIBS"
11484
11485     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
11486     # to get the SysV transport functions.
11487     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
11488     # needs -lnsl.
11489     # The nsl library prevents programs from opening the X display
11490     # on Irix 5.2, according to T.E. Dickey.
11491     # The functions gethostbyname, getservbyname, and inet_addr are
11492     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
11493     echo "$as_me:11493: checking for gethostbyname" >&5
11494 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
11495 if test "${ac_cv_func_gethostbyname+set}" = set; then
11496   echo $ECHO_N "(cached) $ECHO_C" >&6
11497 else
11498   cat >conftest.$ac_ext <<_ACEOF
11499 #line 11499 "configure"
11500 #include "confdefs.h"
11501 /* System header to define __stub macros and hopefully few prototypes,
11502     which can conflict with char gethostbyname (); below.  */
11503 #include <assert.h>
11504 /* Override any gcc2 internal prototype to avoid an error.  */
11505 #ifdef __cplusplus
11506 extern "C"
11507 #endif
11508 /* We use char because int might match the return type of a gcc2
11509    builtin and then its argument prototype would still apply.  */
11510 char gethostbyname ();
11511 char (*f) ();
11512
11513 int
11514 main (void)
11515 {
11516 /* The GNU C library defines this for functions which it implements
11517     to always fail with ENOSYS.  Some functions are actually named
11518     something starting with __ and the normal name is an alias.  */
11519 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
11520 choke me
11521 #else
11522 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11523 #endif
11524
11525   ;
11526   return 0;
11527 }
11528 _ACEOF
11529 rm -f conftest.$ac_objext conftest$ac_exeext
11530 if { (eval echo "$as_me:11530: \"$ac_link\"") >&5
11531   (eval $ac_link) 2>&5
11532   ac_status=$?
11533   echo "$as_me:11533: \$? = $ac_status" >&5
11534   (exit $ac_status); } &&
11535          { ac_try='test -s conftest$ac_exeext'
11536   { (eval echo "$as_me:11536: \"$ac_try\"") >&5
11537   (eval $ac_try) 2>&5
11538   ac_status=$?
11539   echo "$as_me:11539: \$? = $ac_status" >&5
11540   (exit $ac_status); }; }; then
11541   ac_cv_func_gethostbyname=yes
11542 else
11543   echo "$as_me: failed program was:" >&5
11544 cat conftest.$ac_ext >&5
11545 ac_cv_func_gethostbyname=no
11546 fi
11547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11548 fi
11549 echo "$as_me:11549: result: $ac_cv_func_gethostbyname" >&5
11550 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
11551
11552     if test $ac_cv_func_gethostbyname = no; then
11553       echo "$as_me:11553: checking for gethostbyname in -lnsl" >&5
11554 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
11555 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
11556   echo $ECHO_N "(cached) $ECHO_C" >&6
11557 else
11558   ac_check_lib_save_LIBS=$LIBS
11559 LIBS="-lnsl  $LIBS"
11560 cat >conftest.$ac_ext <<_ACEOF
11561 #line 11561 "configure"
11562 #include "confdefs.h"
11563
11564 /* Override any gcc2 internal prototype to avoid an error.  */
11565 #ifdef __cplusplus
11566 extern "C"
11567 #endif
11568 /* We use char because int might match the return type of a gcc2
11569    builtin and then its argument prototype would still apply.  */
11570 char gethostbyname ();
11571 int
11572 main (void)
11573 {
11574 gethostbyname ();
11575   ;
11576   return 0;
11577 }
11578 _ACEOF
11579 rm -f conftest.$ac_objext conftest$ac_exeext
11580 if { (eval echo "$as_me:11580: \"$ac_link\"") >&5
11581   (eval $ac_link) 2>&5
11582   ac_status=$?
11583   echo "$as_me:11583: \$? = $ac_status" >&5
11584   (exit $ac_status); } &&
11585          { ac_try='test -s conftest$ac_exeext'
11586   { (eval echo "$as_me:11586: \"$ac_try\"") >&5
11587   (eval $ac_try) 2>&5
11588   ac_status=$?
11589   echo "$as_me:11589: \$? = $ac_status" >&5
11590   (exit $ac_status); }; }; then
11591   ac_cv_lib_nsl_gethostbyname=yes
11592 else
11593   echo "$as_me: failed program was:" >&5
11594 cat conftest.$ac_ext >&5
11595 ac_cv_lib_nsl_gethostbyname=no
11596 fi
11597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11598 LIBS=$ac_check_lib_save_LIBS
11599 fi
11600 echo "$as_me:11600: result: $ac_cv_lib_nsl_gethostbyname" >&5
11601 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
11602 if test $ac_cv_lib_nsl_gethostbyname = yes; then
11603   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
11604 fi
11605
11606       if test $ac_cv_lib_nsl_gethostbyname = no; then
11607         echo "$as_me:11607: checking for gethostbyname in -lbsd" >&5
11608 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
11609 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
11610   echo $ECHO_N "(cached) $ECHO_C" >&6
11611 else
11612   ac_check_lib_save_LIBS=$LIBS
11613 LIBS="-lbsd  $LIBS"
11614 cat >conftest.$ac_ext <<_ACEOF
11615 #line 11615 "configure"
11616 #include "confdefs.h"
11617
11618 /* Override any gcc2 internal prototype to avoid an error.  */
11619 #ifdef __cplusplus
11620 extern "C"
11621 #endif
11622 /* We use char because int might match the return type of a gcc2
11623    builtin and then its argument prototype would still apply.  */
11624 char gethostbyname ();
11625 int
11626 main (void)
11627 {
11628 gethostbyname ();
11629   ;
11630   return 0;
11631 }
11632 _ACEOF
11633 rm -f conftest.$ac_objext conftest$ac_exeext
11634 if { (eval echo "$as_me:11634: \"$ac_link\"") >&5
11635   (eval $ac_link) 2>&5
11636   ac_status=$?
11637   echo "$as_me:11637: \$? = $ac_status" >&5
11638   (exit $ac_status); } &&
11639          { ac_try='test -s conftest$ac_exeext'
11640   { (eval echo "$as_me:11640: \"$ac_try\"") >&5
11641   (eval $ac_try) 2>&5
11642   ac_status=$?
11643   echo "$as_me:11643: \$? = $ac_status" >&5
11644   (exit $ac_status); }; }; then
11645   ac_cv_lib_bsd_gethostbyname=yes
11646 else
11647   echo "$as_me: failed program was:" >&5
11648 cat conftest.$ac_ext >&5
11649 ac_cv_lib_bsd_gethostbyname=no
11650 fi
11651 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11652 LIBS=$ac_check_lib_save_LIBS
11653 fi
11654 echo "$as_me:11654: result: $ac_cv_lib_bsd_gethostbyname" >&5
11655 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
11656 if test $ac_cv_lib_bsd_gethostbyname = yes; then
11657   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
11658 fi
11659
11660       fi
11661     fi
11662
11663     # lieder@skyler.mavd.honeywell.com says without -lsocket,
11664     # socket/setsockopt and other routines are undefined under SCO ODT
11665     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
11666     # on later versions), says Simon Leinen: it contains gethostby*
11667     # variants that don't use the nameserver (or something).  -lsocket
11668     # must be given before -lnsl if both are needed.  We assume that
11669     # if connect needs -lnsl, so does gethostbyname.
11670     echo "$as_me:11670: checking for connect" >&5
11671 echo $ECHO_N "checking for connect... $ECHO_C" >&6
11672 if test "${ac_cv_func_connect+set}" = set; then
11673   echo $ECHO_N "(cached) $ECHO_C" >&6
11674 else
11675   cat >conftest.$ac_ext <<_ACEOF
11676 #line 11676 "configure"
11677 #include "confdefs.h"
11678 /* System header to define __stub macros and hopefully few prototypes,
11679     which can conflict with char connect (); below.  */
11680 #include <assert.h>
11681 /* Override any gcc2 internal prototype to avoid an error.  */
11682 #ifdef __cplusplus
11683 extern "C"
11684 #endif
11685 /* We use char because int might match the return type of a gcc2
11686    builtin and then its argument prototype would still apply.  */
11687 char connect ();
11688 char (*f) ();
11689
11690 int
11691 main (void)
11692 {
11693 /* The GNU C library defines this for functions which it implements
11694     to always fail with ENOSYS.  Some functions are actually named
11695     something starting with __ and the normal name is an alias.  */
11696 #if defined (__stub_connect) || defined (__stub___connect)
11697 choke me
11698 #else
11699 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11700 #endif
11701
11702   ;
11703   return 0;
11704 }
11705 _ACEOF
11706 rm -f conftest.$ac_objext conftest$ac_exeext
11707 if { (eval echo "$as_me:11707: \"$ac_link\"") >&5
11708   (eval $ac_link) 2>&5
11709   ac_status=$?
11710   echo "$as_me:11710: \$? = $ac_status" >&5
11711   (exit $ac_status); } &&
11712          { ac_try='test -s conftest$ac_exeext'
11713   { (eval echo "$as_me:11713: \"$ac_try\"") >&5
11714   (eval $ac_try) 2>&5
11715   ac_status=$?
11716   echo "$as_me:11716: \$? = $ac_status" >&5
11717   (exit $ac_status); }; }; then
11718   ac_cv_func_connect=yes
11719 else
11720   echo "$as_me: failed program was:" >&5
11721 cat conftest.$ac_ext >&5
11722 ac_cv_func_connect=no
11723 fi
11724 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11725 fi
11726 echo "$as_me:11726: result: $ac_cv_func_connect" >&5
11727 echo "${ECHO_T}$ac_cv_func_connect" >&6
11728
11729     if test $ac_cv_func_connect = no; then
11730       echo "$as_me:11730: checking for connect in -lsocket" >&5
11731 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
11732 if test "${ac_cv_lib_socket_connect+set}" = set; then
11733   echo $ECHO_N "(cached) $ECHO_C" >&6
11734 else
11735   ac_check_lib_save_LIBS=$LIBS
11736 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
11737 cat >conftest.$ac_ext <<_ACEOF
11738 #line 11738 "configure"
11739 #include "confdefs.h"
11740
11741 /* Override any gcc2 internal prototype to avoid an error.  */
11742 #ifdef __cplusplus
11743 extern "C"
11744 #endif
11745 /* We use char because int might match the return type of a gcc2
11746    builtin and then its argument prototype would still apply.  */
11747 char connect ();
11748 int
11749 main (void)
11750 {
11751 connect ();
11752   ;
11753   return 0;
11754 }
11755 _ACEOF
11756 rm -f conftest.$ac_objext conftest$ac_exeext
11757 if { (eval echo "$as_me:11757: \"$ac_link\"") >&5
11758   (eval $ac_link) 2>&5
11759   ac_status=$?
11760   echo "$as_me:11760: \$? = $ac_status" >&5
11761   (exit $ac_status); } &&
11762          { ac_try='test -s conftest$ac_exeext'
11763   { (eval echo "$as_me:11763: \"$ac_try\"") >&5
11764   (eval $ac_try) 2>&5
11765   ac_status=$?
11766   echo "$as_me:11766: \$? = $ac_status" >&5
11767   (exit $ac_status); }; }; then
11768   ac_cv_lib_socket_connect=yes
11769 else
11770   echo "$as_me: failed program was:" >&5
11771 cat conftest.$ac_ext >&5
11772 ac_cv_lib_socket_connect=no
11773 fi
11774 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11775 LIBS=$ac_check_lib_save_LIBS
11776 fi
11777 echo "$as_me:11777: result: $ac_cv_lib_socket_connect" >&5
11778 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
11779 if test $ac_cv_lib_socket_connect = yes; then
11780   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
11781 fi
11782
11783     fi
11784
11785     # Guillermo Gomez says -lposix is necessary on A/UX.
11786     echo "$as_me:11786: checking for remove" >&5
11787 echo $ECHO_N "checking for remove... $ECHO_C" >&6
11788 if test "${ac_cv_func_remove+set}" = set; then
11789   echo $ECHO_N "(cached) $ECHO_C" >&6
11790 else
11791   cat >conftest.$ac_ext <<_ACEOF
11792 #line 11792 "configure"
11793 #include "confdefs.h"
11794 /* System header to define __stub macros and hopefully few prototypes,
11795     which can conflict with char remove (); below.  */
11796 #include <assert.h>
11797 /* Override any gcc2 internal prototype to avoid an error.  */
11798 #ifdef __cplusplus
11799 extern "C"
11800 #endif
11801 /* We use char because int might match the return type of a gcc2
11802    builtin and then its argument prototype would still apply.  */
11803 char remove ();
11804 char (*f) ();
11805
11806 int
11807 main (void)
11808 {
11809 /* The GNU C library defines this for functions which it implements
11810     to always fail with ENOSYS.  Some functions are actually named
11811     something starting with __ and the normal name is an alias.  */
11812 #if defined (__stub_remove) || defined (__stub___remove)
11813 choke me
11814 #else
11815 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11816 #endif
11817
11818   ;
11819   return 0;
11820 }
11821 _ACEOF
11822 rm -f conftest.$ac_objext conftest$ac_exeext
11823 if { (eval echo "$as_me:11823: \"$ac_link\"") >&5
11824   (eval $ac_link) 2>&5
11825   ac_status=$?
11826   echo "$as_me:11826: \$? = $ac_status" >&5
11827   (exit $ac_status); } &&
11828          { ac_try='test -s conftest$ac_exeext'
11829   { (eval echo "$as_me:11829: \"$ac_try\"") >&5
11830   (eval $ac_try) 2>&5
11831   ac_status=$?
11832   echo "$as_me:11832: \$? = $ac_status" >&5
11833   (exit $ac_status); }; }; then
11834   ac_cv_func_remove=yes
11835 else
11836   echo "$as_me: failed program was:" >&5
11837 cat conftest.$ac_ext >&5
11838 ac_cv_func_remove=no
11839 fi
11840 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11841 fi
11842 echo "$as_me:11842: result: $ac_cv_func_remove" >&5
11843 echo "${ECHO_T}$ac_cv_func_remove" >&6
11844
11845     if test $ac_cv_func_remove = no; then
11846       echo "$as_me:11846: checking for remove in -lposix" >&5
11847 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
11848 if test "${ac_cv_lib_posix_remove+set}" = set; then
11849   echo $ECHO_N "(cached) $ECHO_C" >&6
11850 else
11851   ac_check_lib_save_LIBS=$LIBS
11852 LIBS="-lposix  $LIBS"
11853 cat >conftest.$ac_ext <<_ACEOF
11854 #line 11854 "configure"
11855 #include "confdefs.h"
11856
11857 /* Override any gcc2 internal prototype to avoid an error.  */
11858 #ifdef __cplusplus
11859 extern "C"
11860 #endif
11861 /* We use char because int might match the return type of a gcc2
11862    builtin and then its argument prototype would still apply.  */
11863 char remove ();
11864 int
11865 main (void)
11866 {
11867 remove ();
11868   ;
11869   return 0;
11870 }
11871 _ACEOF
11872 rm -f conftest.$ac_objext conftest$ac_exeext
11873 if { (eval echo "$as_me:11873: \"$ac_link\"") >&5
11874   (eval $ac_link) 2>&5
11875   ac_status=$?
11876   echo "$as_me:11876: \$? = $ac_status" >&5
11877   (exit $ac_status); } &&
11878          { ac_try='test -s conftest$ac_exeext'
11879   { (eval echo "$as_me:11879: \"$ac_try\"") >&5
11880   (eval $ac_try) 2>&5
11881   ac_status=$?
11882   echo "$as_me:11882: \$? = $ac_status" >&5
11883   (exit $ac_status); }; }; then
11884   ac_cv_lib_posix_remove=yes
11885 else
11886   echo "$as_me: failed program was:" >&5
11887 cat conftest.$ac_ext >&5
11888 ac_cv_lib_posix_remove=no
11889 fi
11890 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11891 LIBS=$ac_check_lib_save_LIBS
11892 fi
11893 echo "$as_me:11893: result: $ac_cv_lib_posix_remove" >&5
11894 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
11895 if test $ac_cv_lib_posix_remove = yes; then
11896   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
11897 fi
11898
11899     fi
11900
11901     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
11902     echo "$as_me:11902: checking for shmat" >&5
11903 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
11904 if test "${ac_cv_func_shmat+set}" = set; then
11905   echo $ECHO_N "(cached) $ECHO_C" >&6
11906 else
11907   cat >conftest.$ac_ext <<_ACEOF
11908 #line 11908 "configure"
11909 #include "confdefs.h"
11910 /* System header to define __stub macros and hopefully few prototypes,
11911     which can conflict with char shmat (); below.  */
11912 #include <assert.h>
11913 /* Override any gcc2 internal prototype to avoid an error.  */
11914 #ifdef __cplusplus
11915 extern "C"
11916 #endif
11917 /* We use char because int might match the return type of a gcc2
11918    builtin and then its argument prototype would still apply.  */
11919 char shmat ();
11920 char (*f) ();
11921
11922 int
11923 main (void)
11924 {
11925 /* The GNU C library defines this for functions which it implements
11926     to always fail with ENOSYS.  Some functions are actually named
11927     something starting with __ and the normal name is an alias.  */
11928 #if defined (__stub_shmat) || defined (__stub___shmat)
11929 choke me
11930 #else
11931 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11932 #endif
11933
11934   ;
11935   return 0;
11936 }
11937 _ACEOF
11938 rm -f conftest.$ac_objext conftest$ac_exeext
11939 if { (eval echo "$as_me:11939: \"$ac_link\"") >&5
11940   (eval $ac_link) 2>&5
11941   ac_status=$?
11942   echo "$as_me:11942: \$? = $ac_status" >&5
11943   (exit $ac_status); } &&
11944          { ac_try='test -s conftest$ac_exeext'
11945   { (eval echo "$as_me:11945: \"$ac_try\"") >&5
11946   (eval $ac_try) 2>&5
11947   ac_status=$?
11948   echo "$as_me:11948: \$? = $ac_status" >&5
11949   (exit $ac_status); }; }; then
11950   ac_cv_func_shmat=yes
11951 else
11952   echo "$as_me: failed program was:" >&5
11953 cat conftest.$ac_ext >&5
11954 ac_cv_func_shmat=no
11955 fi
11956 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11957 fi
11958 echo "$as_me:11958: result: $ac_cv_func_shmat" >&5
11959 echo "${ECHO_T}$ac_cv_func_shmat" >&6
11960
11961     if test $ac_cv_func_shmat = no; then
11962       echo "$as_me:11962: checking for shmat in -lipc" >&5
11963 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
11964 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
11965   echo $ECHO_N "(cached) $ECHO_C" >&6
11966 else
11967   ac_check_lib_save_LIBS=$LIBS
11968 LIBS="-lipc  $LIBS"
11969 cat >conftest.$ac_ext <<_ACEOF
11970 #line 11970 "configure"
11971 #include "confdefs.h"
11972
11973 /* Override any gcc2 internal prototype to avoid an error.  */
11974 #ifdef __cplusplus
11975 extern "C"
11976 #endif
11977 /* We use char because int might match the return type of a gcc2
11978    builtin and then its argument prototype would still apply.  */
11979 char shmat ();
11980 int
11981 main (void)
11982 {
11983 shmat ();
11984   ;
11985   return 0;
11986 }
11987 _ACEOF
11988 rm -f conftest.$ac_objext conftest$ac_exeext
11989 if { (eval echo "$as_me:11989: \"$ac_link\"") >&5
11990   (eval $ac_link) 2>&5
11991   ac_status=$?
11992   echo "$as_me:11992: \$? = $ac_status" >&5
11993   (exit $ac_status); } &&
11994          { ac_try='test -s conftest$ac_exeext'
11995   { (eval echo "$as_me:11995: \"$ac_try\"") >&5
11996   (eval $ac_try) 2>&5
11997   ac_status=$?
11998   echo "$as_me:11998: \$? = $ac_status" >&5
11999   (exit $ac_status); }; }; then
12000   ac_cv_lib_ipc_shmat=yes
12001 else
12002   echo "$as_me: failed program was:" >&5
12003 cat conftest.$ac_ext >&5
12004 ac_cv_lib_ipc_shmat=no
12005 fi
12006 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12007 LIBS=$ac_check_lib_save_LIBS
12008 fi
12009 echo "$as_me:12009: result: $ac_cv_lib_ipc_shmat" >&5
12010 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12011 if test $ac_cv_lib_ipc_shmat = yes; then
12012   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12013 fi
12014
12015     fi
12016   fi
12017
12018   # Check for libraries that X11R6 Xt/Xaw programs need.
12019   ac_save_LDFLAGS=$LDFLAGS
12020   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12021   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12022   # check for ICE first), but we must link in the order -lSM -lICE or
12023   # we get undefined symbols.  So assume we have SM if we have ICE.
12024   # These have to be linked with before -lX11, unlike the other
12025   # libraries we check for below, so use a different variable.
12026   # John Interrante, Karl Berry
12027   echo "$as_me:12027: checking for IceConnectionNumber in -lICE" >&5
12028 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12029 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12030   echo $ECHO_N "(cached) $ECHO_C" >&6
12031 else
12032   ac_check_lib_save_LIBS=$LIBS
12033 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12034 cat >conftest.$ac_ext <<_ACEOF
12035 #line 12035 "configure"
12036 #include "confdefs.h"
12037
12038 /* Override any gcc2 internal prototype to avoid an error.  */
12039 #ifdef __cplusplus
12040 extern "C"
12041 #endif
12042 /* We use char because int might match the return type of a gcc2
12043    builtin and then its argument prototype would still apply.  */
12044 char IceConnectionNumber ();
12045 int
12046 main (void)
12047 {
12048 IceConnectionNumber ();
12049   ;
12050   return 0;
12051 }
12052 _ACEOF
12053 rm -f conftest.$ac_objext conftest$ac_exeext
12054 if { (eval echo "$as_me:12054: \"$ac_link\"") >&5
12055   (eval $ac_link) 2>&5
12056   ac_status=$?
12057   echo "$as_me:12057: \$? = $ac_status" >&5
12058   (exit $ac_status); } &&
12059          { ac_try='test -s conftest$ac_exeext'
12060   { (eval echo "$as_me:12060: \"$ac_try\"") >&5
12061   (eval $ac_try) 2>&5
12062   ac_status=$?
12063   echo "$as_me:12063: \$? = $ac_status" >&5
12064   (exit $ac_status); }; }; then
12065   ac_cv_lib_ICE_IceConnectionNumber=yes
12066 else
12067   echo "$as_me: failed program was:" >&5
12068 cat conftest.$ac_ext >&5
12069 ac_cv_lib_ICE_IceConnectionNumber=no
12070 fi
12071 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12072 LIBS=$ac_check_lib_save_LIBS
12073 fi
12074 echo "$as_me:12074: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12075 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12076 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12077   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12078 fi
12079
12080   LDFLAGS=$ac_save_LDFLAGS
12081
12082 fi
12083
12084 cf_x_athena=${cf_x_athena:-Xaw}
12085
12086 echo "$as_me:12086: checking if you want to link with Xaw 3d library" >&5
12087 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12088 withval=
12089
12090 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12091 if test "${with_Xaw3d+set}" = set; then
12092   withval="$with_Xaw3d"
12093
12094 fi;
12095 if test "$withval" = yes ; then
12096         cf_x_athena=Xaw3d
12097         echo "$as_me:12097: result: yes" >&5
12098 echo "${ECHO_T}yes" >&6
12099 else
12100         echo "$as_me:12100: result: no" >&5
12101 echo "${ECHO_T}no" >&6
12102 fi
12103
12104 echo "$as_me:12104: checking if you want to link with Xaw 3d xft library" >&5
12105 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12106 withval=
12107
12108 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12109 if test "${with_Xaw3dxft+set}" = set; then
12110   withval="$with_Xaw3dxft"
12111
12112 fi;
12113 if test "$withval" = yes ; then
12114         cf_x_athena=Xaw3dxft
12115         echo "$as_me:12115: result: yes" >&5
12116 echo "${ECHO_T}yes" >&6
12117 else
12118         echo "$as_me:12118: result: no" >&5
12119 echo "${ECHO_T}no" >&6
12120 fi
12121
12122 echo "$as_me:12122: checking if you want to link with neXT Athena library" >&5
12123 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12124 withval=
12125
12126 # Check whether --with-neXtaw or --without-neXtaw was given.
12127 if test "${with_neXtaw+set}" = set; then
12128   withval="$with_neXtaw"
12129
12130 fi;
12131 if test "$withval" = yes ; then
12132         cf_x_athena=neXtaw
12133         echo "$as_me:12133: result: yes" >&5
12134 echo "${ECHO_T}yes" >&6
12135 else
12136         echo "$as_me:12136: result: no" >&5
12137 echo "${ECHO_T}no" >&6
12138 fi
12139
12140 echo "$as_me:12140: checking if you want to link with Athena-Plus library" >&5
12141 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12142 withval=
12143
12144 # Check whether --with-XawPlus or --without-XawPlus was given.
12145 if test "${with_XawPlus+set}" = set; then
12146   withval="$with_XawPlus"
12147
12148 fi;
12149 if test "$withval" = yes ; then
12150         cf_x_athena=XawPlus
12151         echo "$as_me:12151: result: yes" >&5
12152 echo "${ECHO_T}yes" >&6
12153 else
12154         echo "$as_me:12154: result: no" >&5
12155 echo "${ECHO_T}no" >&6
12156 fi
12157
12158 cf_x_athena_lib=""
12159
12160 if test "$PKG_CONFIG" != none ; then
12161         cf_athena_list=
12162         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12163         for cf_athena_pkg in \
12164                 $cf_athena_list \
12165                 ${cf_x_athena} \
12166                 ${cf_x_athena}-devel \
12167                 lib${cf_x_athena} \
12168                 lib${cf_x_athena}-devel
12169         do
12170
12171 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12172         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12173
12174 echo "${as_me:-configure}:12174: testing found package $cf_athena_pkg ..." 1>&5
12175
12176         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12177         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12178         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12179
12180 echo "${as_me:-configure}:12180: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12181
12182         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12183
12184 echo "${as_me:-configure}:12184: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12185
12186 cf_fix_cppflags=no
12187 cf_new_cflags=
12188 cf_new_cppflags=
12189 cf_new_extra_cppflags=
12190
12191 for cf_add_cflags in $cf_pkgconfig_incs
12192 do
12193 case $cf_fix_cppflags in
12194 (no)
12195         case $cf_add_cflags in
12196         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12197                 case $cf_add_cflags in
12198                 (-D*)
12199                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12200
12201                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12202                                 && test -z "${cf_tst_cflags}" \
12203                                 && cf_fix_cppflags=yes
12204
12205                         if test $cf_fix_cppflags = yes ; then
12206
12207         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12208         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12209
12210                                 continue
12211                         elif test "${cf_tst_cflags}" = "\"'" ; then
12212
12213         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12214         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12215
12216                                 continue
12217                         fi
12218                         ;;
12219                 esac
12220                 case "$CPPFLAGS" in
12221                 (*$cf_add_cflags)
12222                         ;;
12223                 (*)
12224                         case $cf_add_cflags in
12225                         (-D*)
12226                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12227
12228 CPPFLAGS=`echo "$CPPFLAGS" | \
12229         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12230                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12231
12232                                 ;;
12233                         esac
12234
12235         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12236         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12237
12238                         ;;
12239                 esac
12240                 ;;
12241         (*)
12242
12243         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12244         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12245
12246                 ;;
12247         esac
12248         ;;
12249 (yes)
12250
12251         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12252         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12253
12254         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12255
12256         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12257                 && test -z "${cf_tst_cflags}" \
12258                 && cf_fix_cppflags=no
12259         ;;
12260 esac
12261 done
12262
12263 if test -n "$cf_new_cflags" ; then
12264
12265         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12266         CFLAGS="${CFLAGS}$cf_new_cflags"
12267
12268 fi
12269
12270 if test -n "$cf_new_cppflags" ; then
12271
12272         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12273         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12274
12275 fi
12276
12277 if test -n "$cf_new_extra_cppflags" ; then
12278
12279         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12280         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12281
12282 fi
12283
12284 cf_add_libs="$cf_pkgconfig_libs"
12285 # Filter out duplicates - this happens with badly-designed ".pc" files...
12286 for cf_add_1lib in $LIBS
12287 do
12288         for cf_add_2lib in $cf_add_libs
12289         do
12290                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12291                 then
12292                         cf_add_1lib=
12293                         break
12294                 fi
12295         done
12296         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12297 done
12298 LIBS="$cf_add_libs"
12299
12300                         cf_x_athena_lib="$cf_pkgconfig_libs"
12301
12302 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12303
12304                         cat >>confdefs.h <<EOF
12305 #define $cf_x_athena_LIBS 1
12306 EOF
12307
12308         for cf_trim_lib in Xmu Xt X11
12309         do
12310                 case "$LIBS" in
12311                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12312                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12313                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12314
12315 echo "${as_me:-configure}:12315: testing ..trimmed $LIBS ..." 1>&5
12316
12317                         ;;
12318                 esac
12319         done
12320
12321 echo "$as_me:12321: checking for usable $cf_x_athena/Xmu package" >&5
12322 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12323 if test "${cf_cv_xaw_compat+set}" = set; then
12324   echo $ECHO_N "(cached) $ECHO_C" >&6
12325 else
12326
12327 cat >conftest.$ac_ext <<_ACEOF
12328 #line 12328 "configure"
12329 #include "confdefs.h"
12330
12331 #include <X11/Xmu/CharSet.h>
12332
12333 int
12334 main (void)
12335 {
12336
12337 int check = XmuCompareISOLatin1("big", "small")
12338
12339   ;
12340   return 0;
12341 }
12342 _ACEOF
12343 rm -f conftest.$ac_objext conftest$ac_exeext
12344 if { (eval echo "$as_me:12344: \"$ac_link\"") >&5
12345   (eval $ac_link) 2>&5
12346   ac_status=$?
12347   echo "$as_me:12347: \$? = $ac_status" >&5
12348   (exit $ac_status); } &&
12349          { ac_try='test -s conftest$ac_exeext'
12350   { (eval echo "$as_me:12350: \"$ac_try\"") >&5
12351   (eval $ac_try) 2>&5
12352   ac_status=$?
12353   echo "$as_me:12353: \$? = $ac_status" >&5
12354   (exit $ac_status); }; }; then
12355   cf_cv_xaw_compat=yes
12356 else
12357   echo "$as_me: failed program was:" >&5
12358 cat conftest.$ac_ext >&5
12359 cf_cv_xaw_compat=no
12360 fi
12361 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12362 fi
12363 echo "$as_me:12363: result: $cf_cv_xaw_compat" >&5
12364 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12365
12366                         if test "$cf_cv_xaw_compat" = no
12367                         then
12368                                 # workaround for broken ".pc" files...
12369                                 case "$cf_x_athena_lib" in
12370                                 (*-lXmu*)
12371                                         ;;
12372                                 (*)
12373                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12374
12375 echo "${as_me:-configure}:12375: testing work around broken package ..." 1>&5
12376
12377                                         cf_save_xmu="$LIBS"
12378                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12379
12380 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12381         test -n "$verbose" && echo "    found package xmu" 1>&6
12382
12383 echo "${as_me:-configure}:12383: testing found package xmu ..." 1>&5
12384
12385         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12386         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12387         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12388
12389 echo "${as_me:-configure}:12389: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12390
12391         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12392
12393 echo "${as_me:-configure}:12393: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12394
12395 cf_fix_cppflags=no
12396 cf_new_cflags=
12397 cf_new_cppflags=
12398 cf_new_extra_cppflags=
12399
12400 for cf_add_cflags in $cf_pkgconfig_incs
12401 do
12402 case $cf_fix_cppflags in
12403 (no)
12404         case $cf_add_cflags in
12405         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12406                 case $cf_add_cflags in
12407                 (-D*)
12408                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12409
12410                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12411                                 && test -z "${cf_tst_cflags}" \
12412                                 && cf_fix_cppflags=yes
12413
12414                         if test $cf_fix_cppflags = yes ; then
12415
12416         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12417         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12418
12419                                 continue
12420                         elif test "${cf_tst_cflags}" = "\"'" ; then
12421
12422         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12423         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12424
12425                                 continue
12426                         fi
12427                         ;;
12428                 esac
12429                 case "$CPPFLAGS" in
12430                 (*$cf_add_cflags)
12431                         ;;
12432                 (*)
12433                         case $cf_add_cflags in
12434                         (-D*)
12435                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12436
12437 CPPFLAGS=`echo "$CPPFLAGS" | \
12438         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12439                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12440
12441                                 ;;
12442                         esac
12443
12444         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12445         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12446
12447                         ;;
12448                 esac
12449                 ;;
12450         (*)
12451
12452         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12453         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12454
12455                 ;;
12456         esac
12457         ;;
12458 (yes)
12459
12460         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12461         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12462
12463         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12464
12465         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12466                 && test -z "${cf_tst_cflags}" \
12467                 && cf_fix_cppflags=no
12468         ;;
12469 esac
12470 done
12471
12472 if test -n "$cf_new_cflags" ; then
12473
12474         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12475         CFLAGS="${CFLAGS}$cf_new_cflags"
12476
12477 fi
12478
12479 if test -n "$cf_new_cppflags" ; then
12480
12481         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12482         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12483
12484 fi
12485
12486 if test -n "$cf_new_extra_cppflags" ; then
12487
12488         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12489         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12490
12491 fi
12492
12493 cf_add_libs="$cf_pkgconfig_libs"
12494 # Filter out duplicates - this happens with badly-designed ".pc" files...
12495 for cf_add_1lib in $LIBS
12496 do
12497         for cf_add_2lib in $cf_add_libs
12498         do
12499                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12500                 then
12501                         cf_add_1lib=
12502                         break
12503                 fi
12504         done
12505         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12506 done
12507 LIBS="$cf_add_libs"
12508
12509                                                         LIBS="$cf_save_xmu"
12510
12511 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12512
12513 echo "${as_me:-configure}:12513: testing ...before $LIBS ..." 1>&5
12514
12515 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
12516 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12517
12518 echo "${as_me:-configure}:12518: testing ...after  $LIBS ..." 1>&5
12519
12520 else
12521         cf_pkgconfig_incs=
12522         cf_pkgconfig_libs=
12523
12524 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12525
12526 echo "${as_me:-configure}:12526: testing ...before $LIBS ..." 1>&5
12527
12528 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
12529 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12530
12531 echo "${as_me:-configure}:12531: testing ...after  $LIBS ..." 1>&5
12532
12533 fi
12534
12535         for cf_trim_lib in Xmu Xt X11
12536         do
12537                 case "$LIBS" in
12538                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12539                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12540                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12541
12542 echo "${as_me:-configure}:12542: testing ..trimmed $LIBS ..." 1>&5
12543
12544                         ;;
12545                 esac
12546         done
12547
12548                                         ;;
12549                                 esac
12550                         fi
12551
12552                         break
12553 else
12554         cf_pkgconfig_incs=
12555         cf_pkgconfig_libs=
12556         :
12557 fi
12558
12559         done
12560 fi
12561
12562 if test -z "$cf_x_athena_lib" ; then
12563
12564 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
12565         test -n "$verbose" && echo "    found package Xext" 1>&6
12566
12567 echo "${as_me:-configure}:12567: testing found package Xext ..." 1>&5
12568
12569         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
12570         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
12571         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
12572
12573 echo "${as_me:-configure}:12573: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12574
12575         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
12576
12577 echo "${as_me:-configure}:12577: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
12578
12579 cf_fix_cppflags=no
12580 cf_new_cflags=
12581 cf_new_cppflags=
12582 cf_new_extra_cppflags=
12583
12584 for cf_add_cflags in $cf_pkgconfig_incs
12585 do
12586 case $cf_fix_cppflags in
12587 (no)
12588         case $cf_add_cflags in
12589         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12590                 case $cf_add_cflags in
12591                 (-D*)
12592                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12593
12594                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12595                                 && test -z "${cf_tst_cflags}" \
12596                                 && cf_fix_cppflags=yes
12597
12598                         if test $cf_fix_cppflags = yes ; then
12599
12600         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12601         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12602
12603                                 continue
12604                         elif test "${cf_tst_cflags}" = "\"'" ; then
12605
12606         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12607         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12608
12609                                 continue
12610                         fi
12611                         ;;
12612                 esac
12613                 case "$CPPFLAGS" in
12614                 (*$cf_add_cflags)
12615                         ;;
12616                 (*)
12617                         case $cf_add_cflags in
12618                         (-D*)
12619                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12620
12621 CPPFLAGS=`echo "$CPPFLAGS" | \
12622         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12623                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12624
12625                                 ;;
12626                         esac
12627
12628         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12629         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12630
12631                         ;;
12632                 esac
12633                 ;;
12634         (*)
12635
12636         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12637         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12638
12639                 ;;
12640         esac
12641         ;;
12642 (yes)
12643
12644         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12645         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12646
12647         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12648
12649         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12650                 && test -z "${cf_tst_cflags}" \
12651                 && cf_fix_cppflags=no
12652         ;;
12653 esac
12654 done
12655
12656 if test -n "$cf_new_cflags" ; then
12657
12658         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12659         CFLAGS="${CFLAGS}$cf_new_cflags"
12660
12661 fi
12662
12663 if test -n "$cf_new_cppflags" ; then
12664
12665         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12666         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12667
12668 fi
12669
12670 if test -n "$cf_new_extra_cppflags" ; then
12671
12672         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12673         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12674
12675 fi
12676
12677 cf_add_libs="$cf_pkgconfig_libs"
12678 # Filter out duplicates - this happens with badly-designed ".pc" files...
12679 for cf_add_1lib in $LIBS
12680 do
12681         for cf_add_2lib in $cf_add_libs
12682         do
12683                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12684                 then
12685                         cf_add_1lib=
12686                         break
12687                 fi
12688         done
12689         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12690 done
12691 LIBS="$cf_add_libs"
12692
12693         :
12694 else
12695         cf_pkgconfig_incs=
12696         cf_pkgconfig_libs=
12697
12698         echo "$as_me:12698: checking for XextCreateExtension in -lXext" >&5
12699 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
12700 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
12701   echo $ECHO_N "(cached) $ECHO_C" >&6
12702 else
12703   ac_check_lib_save_LIBS=$LIBS
12704 LIBS="-lXext  $LIBS"
12705 cat >conftest.$ac_ext <<_ACEOF
12706 #line 12706 "configure"
12707 #include "confdefs.h"
12708
12709 /* Override any gcc2 internal prototype to avoid an error.  */
12710 #ifdef __cplusplus
12711 extern "C"
12712 #endif
12713 /* We use char because int might match the return type of a gcc2
12714    builtin and then its argument prototype would still apply.  */
12715 char XextCreateExtension ();
12716 int
12717 main (void)
12718 {
12719 XextCreateExtension ();
12720   ;
12721   return 0;
12722 }
12723 _ACEOF
12724 rm -f conftest.$ac_objext conftest$ac_exeext
12725 if { (eval echo "$as_me:12725: \"$ac_link\"") >&5
12726   (eval $ac_link) 2>&5
12727   ac_status=$?
12728   echo "$as_me:12728: \$? = $ac_status" >&5
12729   (exit $ac_status); } &&
12730          { ac_try='test -s conftest$ac_exeext'
12731   { (eval echo "$as_me:12731: \"$ac_try\"") >&5
12732   (eval $ac_try) 2>&5
12733   ac_status=$?
12734   echo "$as_me:12734: \$? = $ac_status" >&5
12735   (exit $ac_status); }; }; then
12736   ac_cv_lib_Xext_XextCreateExtension=yes
12737 else
12738   echo "$as_me: failed program was:" >&5
12739 cat conftest.$ac_ext >&5
12740 ac_cv_lib_Xext_XextCreateExtension=no
12741 fi
12742 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12743 LIBS=$ac_check_lib_save_LIBS
12744 fi
12745 echo "$as_me:12745: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
12746 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
12747 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
12748
12749 cf_add_libs="-lXext"
12750 # Filter out duplicates - this happens with badly-designed ".pc" files...
12751 for cf_add_1lib in $LIBS
12752 do
12753         for cf_add_2lib in $cf_add_libs
12754         do
12755                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12756                 then
12757                         cf_add_1lib=
12758                         break
12759                 fi
12760         done
12761         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12762 done
12763 LIBS="$cf_add_libs"
12764
12765 fi
12766
12767 fi
12768
12769 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
12770 # in some cases has installed dummy files in the former, other cases replaced
12771 # it with a link to the new location).  This complicates the configure script.
12772 # Check for that pitfall, and recover using pkg-config
12773 #
12774 # If none of these are set, the configuration is almost certainly broken.
12775 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
12776 then
12777
12778 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12779         test -n "$verbose" && echo "    found package x11" 1>&6
12780
12781 echo "${as_me:-configure}:12781: testing found package x11 ..." 1>&5
12782
12783         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12784         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12785         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12786
12787 echo "${as_me:-configure}:12787: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12788
12789         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12790
12791 echo "${as_me:-configure}:12791: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12792
12793 cf_fix_cppflags=no
12794 cf_new_cflags=
12795 cf_new_cppflags=
12796 cf_new_extra_cppflags=
12797
12798 for cf_add_cflags in $cf_pkgconfig_incs
12799 do
12800 case $cf_fix_cppflags in
12801 (no)
12802         case $cf_add_cflags in
12803         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12804                 case $cf_add_cflags in
12805                 (-D*)
12806                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12807
12808                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12809                                 && test -z "${cf_tst_cflags}" \
12810                                 && cf_fix_cppflags=yes
12811
12812                         if test $cf_fix_cppflags = yes ; then
12813
12814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12816
12817                                 continue
12818                         elif test "${cf_tst_cflags}" = "\"'" ; then
12819
12820         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12821         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12822
12823                                 continue
12824                         fi
12825                         ;;
12826                 esac
12827                 case "$CPPFLAGS" in
12828                 (*$cf_add_cflags)
12829                         ;;
12830                 (*)
12831                         case $cf_add_cflags in
12832                         (-D*)
12833                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12834
12835 CPPFLAGS=`echo "$CPPFLAGS" | \
12836         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12837                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12838
12839                                 ;;
12840                         esac
12841
12842         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12843         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12844
12845                         ;;
12846                 esac
12847                 ;;
12848         (*)
12849
12850         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12851         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12852
12853                 ;;
12854         esac
12855         ;;
12856 (yes)
12857
12858         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12859         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12860
12861         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12862
12863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12864                 && test -z "${cf_tst_cflags}" \
12865                 && cf_fix_cppflags=no
12866         ;;
12867 esac
12868 done
12869
12870 if test -n "$cf_new_cflags" ; then
12871
12872         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12873         CFLAGS="${CFLAGS}$cf_new_cflags"
12874
12875 fi
12876
12877 if test -n "$cf_new_cppflags" ; then
12878
12879         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12880         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12881
12882 fi
12883
12884 if test -n "$cf_new_extra_cppflags" ; then
12885
12886         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12887         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12888
12889 fi
12890
12891 cf_add_libs="$cf_pkgconfig_libs"
12892 # Filter out duplicates - this happens with badly-designed ".pc" files...
12893 for cf_add_1lib in $LIBS
12894 do
12895         for cf_add_2lib in $cf_add_libs
12896         do
12897                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12898                 then
12899                         cf_add_1lib=
12900                         break
12901                 fi
12902         done
12903         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12904 done
12905 LIBS="$cf_add_libs"
12906
12907         :
12908 else
12909         cf_pkgconfig_incs=
12910         cf_pkgconfig_libs=
12911         { echo "$as_me:12911: WARNING: unable to find X11 library" >&5
12912 echo "$as_me: WARNING: unable to find X11 library" >&2;}
12913 fi
12914
12915 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12916         test -n "$verbose" && echo "    found package ice" 1>&6
12917
12918 echo "${as_me:-configure}:12918: testing found package ice ..." 1>&5
12919
12920         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12921         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12922         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12923
12924 echo "${as_me:-configure}:12924: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12925
12926         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12927
12928 echo "${as_me:-configure}:12928: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12929
12930 cf_fix_cppflags=no
12931 cf_new_cflags=
12932 cf_new_cppflags=
12933 cf_new_extra_cppflags=
12934
12935 for cf_add_cflags in $cf_pkgconfig_incs
12936 do
12937 case $cf_fix_cppflags in
12938 (no)
12939         case $cf_add_cflags in
12940         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12941                 case $cf_add_cflags in
12942                 (-D*)
12943                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12944
12945                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12946                                 && test -z "${cf_tst_cflags}" \
12947                                 && cf_fix_cppflags=yes
12948
12949                         if test $cf_fix_cppflags = yes ; then
12950
12951         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12952         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12953
12954                                 continue
12955                         elif test "${cf_tst_cflags}" = "\"'" ; then
12956
12957         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12958         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12959
12960                                 continue
12961                         fi
12962                         ;;
12963                 esac
12964                 case "$CPPFLAGS" in
12965                 (*$cf_add_cflags)
12966                         ;;
12967                 (*)
12968                         case $cf_add_cflags in
12969                         (-D*)
12970                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12971
12972 CPPFLAGS=`echo "$CPPFLAGS" | \
12973         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12974                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12975
12976                                 ;;
12977                         esac
12978
12979         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12980         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12981
12982                         ;;
12983                 esac
12984                 ;;
12985         (*)
12986
12987         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12988         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12989
12990                 ;;
12991         esac
12992         ;;
12993 (yes)
12994
12995         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12996         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12997
12998         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12999
13000         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13001                 && test -z "${cf_tst_cflags}" \
13002                 && cf_fix_cppflags=no
13003         ;;
13004 esac
13005 done
13006
13007 if test -n "$cf_new_cflags" ; then
13008
13009         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13010         CFLAGS="${CFLAGS}$cf_new_cflags"
13011
13012 fi
13013
13014 if test -n "$cf_new_cppflags" ; then
13015
13016         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13017         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13018
13019 fi
13020
13021 if test -n "$cf_new_extra_cppflags" ; then
13022
13023         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13024         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13025
13026 fi
13027
13028 cf_add_libs="$cf_pkgconfig_libs"
13029 # Filter out duplicates - this happens with badly-designed ".pc" files...
13030 for cf_add_1lib in $LIBS
13031 do
13032         for cf_add_2lib in $cf_add_libs
13033         do
13034                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13035                 then
13036                         cf_add_1lib=
13037                         break
13038                 fi
13039         done
13040         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13041 done
13042 LIBS="$cf_add_libs"
13043
13044         :
13045 else
13046         cf_pkgconfig_incs=
13047         cf_pkgconfig_libs=
13048         { echo "$as_me:13048: WARNING: unable to find ICE library" >&5
13049 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13050 fi
13051
13052 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13053         test -n "$verbose" && echo "    found package sm" 1>&6
13054
13055 echo "${as_me:-configure}:13055: testing found package sm ..." 1>&5
13056
13057         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13058         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13059         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13060
13061 echo "${as_me:-configure}:13061: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13062
13063         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13064
13065 echo "${as_me:-configure}:13065: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13066
13067 cf_fix_cppflags=no
13068 cf_new_cflags=
13069 cf_new_cppflags=
13070 cf_new_extra_cppflags=
13071
13072 for cf_add_cflags in $cf_pkgconfig_incs
13073 do
13074 case $cf_fix_cppflags in
13075 (no)
13076         case $cf_add_cflags in
13077         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13078                 case $cf_add_cflags in
13079                 (-D*)
13080                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13081
13082                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13083                                 && test -z "${cf_tst_cflags}" \
13084                                 && cf_fix_cppflags=yes
13085
13086                         if test $cf_fix_cppflags = yes ; then
13087
13088         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13089         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13090
13091                                 continue
13092                         elif test "${cf_tst_cflags}" = "\"'" ; then
13093
13094         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13095         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13096
13097                                 continue
13098                         fi
13099                         ;;
13100                 esac
13101                 case "$CPPFLAGS" in
13102                 (*$cf_add_cflags)
13103                         ;;
13104                 (*)
13105                         case $cf_add_cflags in
13106                         (-D*)
13107                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13108
13109 CPPFLAGS=`echo "$CPPFLAGS" | \
13110         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13111                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13112
13113                                 ;;
13114                         esac
13115
13116         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13117         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13118
13119                         ;;
13120                 esac
13121                 ;;
13122         (*)
13123
13124         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13125         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13126
13127                 ;;
13128         esac
13129         ;;
13130 (yes)
13131
13132         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13133         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13134
13135         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13136
13137         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13138                 && test -z "${cf_tst_cflags}" \
13139                 && cf_fix_cppflags=no
13140         ;;
13141 esac
13142 done
13143
13144 if test -n "$cf_new_cflags" ; then
13145
13146         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13147         CFLAGS="${CFLAGS}$cf_new_cflags"
13148
13149 fi
13150
13151 if test -n "$cf_new_cppflags" ; then
13152
13153         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13154         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13155
13156 fi
13157
13158 if test -n "$cf_new_extra_cppflags" ; then
13159
13160         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13161         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13162
13163 fi
13164
13165 cf_add_libs="$cf_pkgconfig_libs"
13166 # Filter out duplicates - this happens with badly-designed ".pc" files...
13167 for cf_add_1lib in $LIBS
13168 do
13169         for cf_add_2lib in $cf_add_libs
13170         do
13171                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13172                 then
13173                         cf_add_1lib=
13174                         break
13175                 fi
13176         done
13177         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13178 done
13179 LIBS="$cf_add_libs"
13180
13181         :
13182 else
13183         cf_pkgconfig_incs=
13184         cf_pkgconfig_libs=
13185         { echo "$as_me:13185: WARNING: unable to find SM library" >&5
13186 echo "$as_me: WARNING: unable to find SM library" >&2;}
13187 fi
13188
13189 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13190         test -n "$verbose" && echo "    found package xt" 1>&6
13191
13192 echo "${as_me:-configure}:13192: testing found package xt ..." 1>&5
13193
13194         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13195         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13196         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13197
13198 echo "${as_me:-configure}:13198: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13199
13200         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13201
13202 echo "${as_me:-configure}:13202: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13203
13204 cf_fix_cppflags=no
13205 cf_new_cflags=
13206 cf_new_cppflags=
13207 cf_new_extra_cppflags=
13208
13209 for cf_add_cflags in $cf_pkgconfig_incs
13210 do
13211 case $cf_fix_cppflags in
13212 (no)
13213         case $cf_add_cflags in
13214         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13215                 case $cf_add_cflags in
13216                 (-D*)
13217                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13218
13219                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13220                                 && test -z "${cf_tst_cflags}" \
13221                                 && cf_fix_cppflags=yes
13222
13223                         if test $cf_fix_cppflags = yes ; then
13224
13225         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13226         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13227
13228                                 continue
13229                         elif test "${cf_tst_cflags}" = "\"'" ; then
13230
13231         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13232         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13233
13234                                 continue
13235                         fi
13236                         ;;
13237                 esac
13238                 case "$CPPFLAGS" in
13239                 (*$cf_add_cflags)
13240                         ;;
13241                 (*)
13242                         case $cf_add_cflags in
13243                         (-D*)
13244                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13245
13246 CPPFLAGS=`echo "$CPPFLAGS" | \
13247         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13248                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13249
13250                                 ;;
13251                         esac
13252
13253         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13254         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13255
13256                         ;;
13257                 esac
13258                 ;;
13259         (*)
13260
13261         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13262         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13263
13264                 ;;
13265         esac
13266         ;;
13267 (yes)
13268
13269         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13270         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13271
13272         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13273
13274         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13275                 && test -z "${cf_tst_cflags}" \
13276                 && cf_fix_cppflags=no
13277         ;;
13278 esac
13279 done
13280
13281 if test -n "$cf_new_cflags" ; then
13282
13283         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13284         CFLAGS="${CFLAGS}$cf_new_cflags"
13285
13286 fi
13287
13288 if test -n "$cf_new_cppflags" ; then
13289
13290         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13291         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13292
13293 fi
13294
13295 if test -n "$cf_new_extra_cppflags" ; then
13296
13297         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13298         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13299
13300 fi
13301
13302 cf_add_libs="$cf_pkgconfig_libs"
13303 # Filter out duplicates - this happens with badly-designed ".pc" files...
13304 for cf_add_1lib in $LIBS
13305 do
13306         for cf_add_2lib in $cf_add_libs
13307         do
13308                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13309                 then
13310                         cf_add_1lib=
13311                         break
13312                 fi
13313         done
13314         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13315 done
13316 LIBS="$cf_add_libs"
13317
13318         :
13319 else
13320         cf_pkgconfig_incs=
13321         cf_pkgconfig_libs=
13322         { echo "$as_me:13322: WARNING: unable to find Xt library" >&5
13323 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13324 fi
13325
13326 fi
13327
13328 cf_have_X_LIBS=no
13329
13330 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13331         test -n "$verbose" && echo "    found package xt" 1>&6
13332
13333 echo "${as_me:-configure}:13333: testing found package xt ..." 1>&5
13334
13335         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13336         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13337         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13338
13339 echo "${as_me:-configure}:13339: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13340
13341         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13342
13343 echo "${as_me:-configure}:13343: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13344
13345 cf_fix_cppflags=no
13346 cf_new_cflags=
13347 cf_new_cppflags=
13348 cf_new_extra_cppflags=
13349
13350 for cf_add_cflags in $cf_pkgconfig_incs
13351 do
13352 case $cf_fix_cppflags in
13353 (no)
13354         case $cf_add_cflags in
13355         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13356                 case $cf_add_cflags in
13357                 (-D*)
13358                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13359
13360                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13361                                 && test -z "${cf_tst_cflags}" \
13362                                 && cf_fix_cppflags=yes
13363
13364                         if test $cf_fix_cppflags = yes ; then
13365
13366         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13367         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13368
13369                                 continue
13370                         elif test "${cf_tst_cflags}" = "\"'" ; then
13371
13372         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13373         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13374
13375                                 continue
13376                         fi
13377                         ;;
13378                 esac
13379                 case "$CPPFLAGS" in
13380                 (*$cf_add_cflags)
13381                         ;;
13382                 (*)
13383                         case $cf_add_cflags in
13384                         (-D*)
13385                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13386
13387 CPPFLAGS=`echo "$CPPFLAGS" | \
13388         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13389                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13390
13391                                 ;;
13392                         esac
13393
13394         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13395         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13396
13397                         ;;
13398                 esac
13399                 ;;
13400         (*)
13401
13402         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13403         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13404
13405                 ;;
13406         esac
13407         ;;
13408 (yes)
13409
13410         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13411         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13412
13413         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13414
13415         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13416                 && test -z "${cf_tst_cflags}" \
13417                 && cf_fix_cppflags=no
13418         ;;
13419 esac
13420 done
13421
13422 if test -n "$cf_new_cflags" ; then
13423
13424         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13425         CFLAGS="${CFLAGS}$cf_new_cflags"
13426
13427 fi
13428
13429 if test -n "$cf_new_cppflags" ; then
13430
13431         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13432         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13433
13434 fi
13435
13436 if test -n "$cf_new_extra_cppflags" ; then
13437
13438         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13439         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13440
13441 fi
13442
13443 cf_add_libs="$cf_pkgconfig_libs"
13444 # Filter out duplicates - this happens with badly-designed ".pc" files...
13445 for cf_add_1lib in $LIBS
13446 do
13447         for cf_add_2lib in $cf_add_libs
13448         do
13449                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13450                 then
13451                         cf_add_1lib=
13452                         break
13453                 fi
13454         done
13455         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13456 done
13457 LIBS="$cf_add_libs"
13458
13459         case "x$LIBS" in
13460         (*-lX11*)
13461                 ;;
13462         (*)
13463 # we have an "xt" package, but it may omit Xt's dependency on X11
13464 echo "$as_me:13464: checking for usable X dependency" >&5
13465 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
13466 if test "${cf_cv_xt_x11_compat+set}" = set; then
13467   echo $ECHO_N "(cached) $ECHO_C" >&6
13468 else
13469
13470 cat >conftest.$ac_ext <<_ACEOF
13471 #line 13471 "configure"
13472 #include "confdefs.h"
13473
13474 #include <X11/Xlib.h>
13475
13476 int
13477 main (void)
13478 {
13479
13480         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
13481         int rc2 = XClearWindow((Display*) 0, (Window) 0);
13482         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
13483         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
13484
13485   ;
13486   return 0;
13487 }
13488 _ACEOF
13489 rm -f conftest.$ac_objext conftest$ac_exeext
13490 if { (eval echo "$as_me:13490: \"$ac_link\"") >&5
13491   (eval $ac_link) 2>&5
13492   ac_status=$?
13493   echo "$as_me:13493: \$? = $ac_status" >&5
13494   (exit $ac_status); } &&
13495          { ac_try='test -s conftest$ac_exeext'
13496   { (eval echo "$as_me:13496: \"$ac_try\"") >&5
13497   (eval $ac_try) 2>&5
13498   ac_status=$?
13499   echo "$as_me:13499: \$? = $ac_status" >&5
13500   (exit $ac_status); }; }; then
13501   cf_cv_xt_x11_compat=yes
13502 else
13503   echo "$as_me: failed program was:" >&5
13504 cat conftest.$ac_ext >&5
13505 cf_cv_xt_x11_compat=no
13506 fi
13507 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13508 fi
13509 echo "$as_me:13509: result: $cf_cv_xt_x11_compat" >&5
13510 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
13511                 if test "$cf_cv_xt_x11_compat" = no
13512                 then
13513                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
13514
13515 echo "${as_me:-configure}:13515: testing work around broken X11 dependency ..." 1>&5
13516
13517                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
13518
13519 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13520         test -n "$verbose" && echo "    found package x11" 1>&6
13521
13522 echo "${as_me:-configure}:13522: testing found package x11 ..." 1>&5
13523
13524         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13525         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13526         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13527
13528 echo "${as_me:-configure}:13528: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13529
13530         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13531
13532 echo "${as_me:-configure}:13532: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13533
13534 cf_fix_cppflags=no
13535 cf_new_cflags=
13536 cf_new_cppflags=
13537 cf_new_extra_cppflags=
13538
13539 for cf_add_cflags in $cf_pkgconfig_incs
13540 do
13541 case $cf_fix_cppflags in
13542 (no)
13543         case $cf_add_cflags in
13544         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13545                 case $cf_add_cflags in
13546                 (-D*)
13547                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13548
13549                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13550                                 && test -z "${cf_tst_cflags}" \
13551                                 && cf_fix_cppflags=yes
13552
13553                         if test $cf_fix_cppflags = yes ; then
13554
13555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13557
13558                                 continue
13559                         elif test "${cf_tst_cflags}" = "\"'" ; then
13560
13561         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13562         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13563
13564                                 continue
13565                         fi
13566                         ;;
13567                 esac
13568                 case "$CPPFLAGS" in
13569                 (*$cf_add_cflags)
13570                         ;;
13571                 (*)
13572                         case $cf_add_cflags in
13573                         (-D*)
13574                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13575
13576 CPPFLAGS=`echo "$CPPFLAGS" | \
13577         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13578                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13579
13580                                 ;;
13581                         esac
13582
13583         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13584         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13585
13586                         ;;
13587                 esac
13588                 ;;
13589         (*)
13590
13591         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13592         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13593
13594                 ;;
13595         esac
13596         ;;
13597 (yes)
13598
13599         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13600         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13601
13602         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13603
13604         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13605                 && test -z "${cf_tst_cflags}" \
13606                 && cf_fix_cppflags=no
13607         ;;
13608 esac
13609 done
13610
13611 if test -n "$cf_new_cflags" ; then
13612
13613         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13614         CFLAGS="${CFLAGS}$cf_new_cflags"
13615
13616 fi
13617
13618 if test -n "$cf_new_cppflags" ; then
13619
13620         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13621         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13622
13623 fi
13624
13625 if test -n "$cf_new_extra_cppflags" ; then
13626
13627         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13628         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13629
13630 fi
13631
13632 cf_add_libs="$cf_pkgconfig_libs"
13633 # Filter out duplicates - this happens with badly-designed ".pc" files...
13634 for cf_add_1lib in $LIBS
13635 do
13636         for cf_add_2lib in $cf_add_libs
13637         do
13638                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13639                 then
13640                         cf_add_1lib=
13641                         break
13642                 fi
13643         done
13644         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13645 done
13646 LIBS="$cf_add_libs"
13647
13648         :
13649 else
13650         cf_pkgconfig_incs=
13651         cf_pkgconfig_libs=
13652
13653 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13654
13655 echo "${as_me:-configure}:13655: testing ...before $LIBS ..." 1>&5
13656
13657 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
13658 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13659
13660 echo "${as_me:-configure}:13660: testing ...after  $LIBS ..." 1>&5
13661
13662 fi
13663
13664                 fi
13665                 ;;
13666         esac
13667
13668 echo "$as_me:13668: checking for usable X Toolkit package" >&5
13669 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
13670 if test "${cf_cv_xt_ice_compat+set}" = set; then
13671   echo $ECHO_N "(cached) $ECHO_C" >&6
13672 else
13673
13674 cat >conftest.$ac_ext <<_ACEOF
13675 #line 13675 "configure"
13676 #include "confdefs.h"
13677
13678 #include <X11/Shell.h>
13679
13680 int
13681 main (void)
13682 {
13683 int num = IceConnectionNumber(0)
13684
13685   ;
13686   return 0;
13687 }
13688 _ACEOF
13689 rm -f conftest.$ac_objext conftest$ac_exeext
13690 if { (eval echo "$as_me:13690: \"$ac_link\"") >&5
13691   (eval $ac_link) 2>&5
13692   ac_status=$?
13693   echo "$as_me:13693: \$? = $ac_status" >&5
13694   (exit $ac_status); } &&
13695          { ac_try='test -s conftest$ac_exeext'
13696   { (eval echo "$as_me:13696: \"$ac_try\"") >&5
13697   (eval $ac_try) 2>&5
13698   ac_status=$?
13699   echo "$as_me:13699: \$? = $ac_status" >&5
13700   (exit $ac_status); }; }; then
13701   cf_cv_xt_ice_compat=yes
13702 else
13703   echo "$as_me: failed program was:" >&5
13704 cat conftest.$ac_ext >&5
13705 cf_cv_xt_ice_compat=no
13706 fi
13707 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13708 fi
13709 echo "$as_me:13709: result: $cf_cv_xt_ice_compat" >&5
13710 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
13711
13712         if test "$cf_cv_xt_ice_compat" = no
13713         then
13714                 # workaround for broken ".pc" files used for X Toolkit.
13715                 case "x$X_PRE_LIBS" in
13716                 (*-lICE*)
13717                         case "x$LIBS" in
13718                         (*-lICE*)
13719                                 ;;
13720                         (*)
13721                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
13722
13723 echo "${as_me:-configure}:13723: testing work around broken ICE dependency ..." 1>&5
13724
13725 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13726         test -n "$verbose" && echo "    found package ice" 1>&6
13727
13728 echo "${as_me:-configure}:13728: testing found package ice ..." 1>&5
13729
13730         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13731         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13732         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13733
13734 echo "${as_me:-configure}:13734: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13735
13736         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13737
13738 echo "${as_me:-configure}:13738: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13739
13740 cf_fix_cppflags=no
13741 cf_new_cflags=
13742 cf_new_cppflags=
13743 cf_new_extra_cppflags=
13744
13745 for cf_add_cflags in $cf_pkgconfig_incs
13746 do
13747 case $cf_fix_cppflags in
13748 (no)
13749         case $cf_add_cflags in
13750         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13751                 case $cf_add_cflags in
13752                 (-D*)
13753                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13754
13755                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13756                                 && test -z "${cf_tst_cflags}" \
13757                                 && cf_fix_cppflags=yes
13758
13759                         if test $cf_fix_cppflags = yes ; then
13760
13761         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13762         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13763
13764                                 continue
13765                         elif test "${cf_tst_cflags}" = "\"'" ; then
13766
13767         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13768         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13769
13770                                 continue
13771                         fi
13772                         ;;
13773                 esac
13774                 case "$CPPFLAGS" in
13775                 (*$cf_add_cflags)
13776                         ;;
13777                 (*)
13778                         case $cf_add_cflags in
13779                         (-D*)
13780                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13781
13782 CPPFLAGS=`echo "$CPPFLAGS" | \
13783         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13784                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13785
13786                                 ;;
13787                         esac
13788
13789         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13790         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13791
13792                         ;;
13793                 esac
13794                 ;;
13795         (*)
13796
13797         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13798         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13799
13800                 ;;
13801         esac
13802         ;;
13803 (yes)
13804
13805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13807
13808         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13809
13810         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13811                 && test -z "${cf_tst_cflags}" \
13812                 && cf_fix_cppflags=no
13813         ;;
13814 esac
13815 done
13816
13817 if test -n "$cf_new_cflags" ; then
13818
13819         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13820         CFLAGS="${CFLAGS}$cf_new_cflags"
13821
13822 fi
13823
13824 if test -n "$cf_new_cppflags" ; then
13825
13826         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13827         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13828
13829 fi
13830
13831 if test -n "$cf_new_extra_cppflags" ; then
13832
13833         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13834         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13835
13836 fi
13837
13838 cf_add_libs="$cf_pkgconfig_libs"
13839 # Filter out duplicates - this happens with badly-designed ".pc" files...
13840 for cf_add_1lib in $LIBS
13841 do
13842         for cf_add_2lib in $cf_add_libs
13843         do
13844                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13845                 then
13846                         cf_add_1lib=
13847                         break
13848                 fi
13849         done
13850         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13851 done
13852 LIBS="$cf_add_libs"
13853
13854 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13855         test -n "$verbose" && echo "    found package sm" 1>&6
13856
13857 echo "${as_me:-configure}:13857: testing found package sm ..." 1>&5
13858
13859         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13860         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13861         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13862
13863 echo "${as_me:-configure}:13863: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13864
13865         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13866
13867 echo "${as_me:-configure}:13867: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13868
13869 cf_fix_cppflags=no
13870 cf_new_cflags=
13871 cf_new_cppflags=
13872 cf_new_extra_cppflags=
13873
13874 for cf_add_cflags in $cf_pkgconfig_incs
13875 do
13876 case $cf_fix_cppflags in
13877 (no)
13878         case $cf_add_cflags in
13879         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13880                 case $cf_add_cflags in
13881                 (-D*)
13882                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13883
13884                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13885                                 && test -z "${cf_tst_cflags}" \
13886                                 && cf_fix_cppflags=yes
13887
13888                         if test $cf_fix_cppflags = yes ; then
13889
13890         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13891         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13892
13893                                 continue
13894                         elif test "${cf_tst_cflags}" = "\"'" ; then
13895
13896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13898
13899                                 continue
13900                         fi
13901                         ;;
13902                 esac
13903                 case "$CPPFLAGS" in
13904                 (*$cf_add_cflags)
13905                         ;;
13906                 (*)
13907                         case $cf_add_cflags in
13908                         (-D*)
13909                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13910
13911 CPPFLAGS=`echo "$CPPFLAGS" | \
13912         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13913                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13914
13915                                 ;;
13916                         esac
13917
13918         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13919         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13920
13921                         ;;
13922                 esac
13923                 ;;
13924         (*)
13925
13926         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13927         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13928
13929                 ;;
13930         esac
13931         ;;
13932 (yes)
13933
13934         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13935         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13936
13937         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13938
13939         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13940                 && test -z "${cf_tst_cflags}" \
13941                 && cf_fix_cppflags=no
13942         ;;
13943 esac
13944 done
13945
13946 if test -n "$cf_new_cflags" ; then
13947
13948         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13949         CFLAGS="${CFLAGS}$cf_new_cflags"
13950
13951 fi
13952
13953 if test -n "$cf_new_cppflags" ; then
13954
13955         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13956         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13957
13958 fi
13959
13960 if test -n "$cf_new_extra_cppflags" ; then
13961
13962         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13963         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13964
13965 fi
13966
13967 cf_add_libs="$cf_pkgconfig_libs"
13968 # Filter out duplicates - this happens with badly-designed ".pc" files...
13969 for cf_add_1lib in $LIBS
13970 do
13971         for cf_add_2lib in $cf_add_libs
13972         do
13973                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13974                 then
13975                         cf_add_1lib=
13976                         break
13977                 fi
13978         done
13979         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13980 done
13981 LIBS="$cf_add_libs"
13982
13983         :
13984 else
13985         cf_pkgconfig_incs=
13986         cf_pkgconfig_libs=
13987         :
13988 fi
13989
13990 else
13991         cf_pkgconfig_incs=
13992         cf_pkgconfig_libs=
13993
13994 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13995
13996 echo "${as_me:-configure}:13996: testing ...before $LIBS ..." 1>&5
13997
13998 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
13999 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14000
14001 echo "${as_me:-configure}:14001: testing ...after  $LIBS ..." 1>&5
14002
14003 fi
14004
14005                                 ;;
14006                         esac
14007                         ;;
14008                 esac
14009         fi
14010
14011         cf_have_X_LIBS=yes
14012
14013 else
14014         cf_pkgconfig_incs=
14015         cf_pkgconfig_libs=
14016
14017         LDFLAGS="$X_LIBS $LDFLAGS"
14018
14019 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14020
14021 echo "${as_me:-configure}:14021: testing checking additions to CFLAGS ..." 1>&5
14022
14023 cf_check_cflags="$CFLAGS"
14024 cf_check_cppflags="$CPPFLAGS"
14025
14026 cf_fix_cppflags=no
14027 cf_new_cflags=
14028 cf_new_cppflags=
14029 cf_new_extra_cppflags=
14030
14031 for cf_add_cflags in $X_CFLAGS
14032 do
14033 case $cf_fix_cppflags in
14034 (no)
14035         case $cf_add_cflags in
14036         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14037                 case $cf_add_cflags in
14038                 (-D*)
14039                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14040
14041                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14042                                 && test -z "${cf_tst_cflags}" \
14043                                 && cf_fix_cppflags=yes
14044
14045                         if test $cf_fix_cppflags = yes ; then
14046
14047         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14048         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14049
14050                                 continue
14051                         elif test "${cf_tst_cflags}" = "\"'" ; then
14052
14053         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14054         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14055
14056                                 continue
14057                         fi
14058                         ;;
14059                 esac
14060                 case "$CPPFLAGS" in
14061                 (*$cf_add_cflags)
14062                         ;;
14063                 (*)
14064                         case $cf_add_cflags in
14065                         (-D*)
14066                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14067
14068 CPPFLAGS=`echo "$CPPFLAGS" | \
14069         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14070                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14071
14072                                 ;;
14073                         esac
14074
14075         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14076         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14077
14078                         ;;
14079                 esac
14080                 ;;
14081         (*)
14082
14083         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14084         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14085
14086                 ;;
14087         esac
14088         ;;
14089 (yes)
14090
14091         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14092         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14093
14094         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14095
14096         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14097                 && test -z "${cf_tst_cflags}" \
14098                 && cf_fix_cppflags=no
14099         ;;
14100 esac
14101 done
14102
14103 if test -n "$cf_new_cflags" ; then
14104         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14105
14106 echo "${as_me:-configure}:14106: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14107
14108         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14109         CFLAGS="${CFLAGS}$cf_new_cflags"
14110
14111 fi
14112
14113 if test -n "$cf_new_cppflags" ; then
14114         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14115
14116 echo "${as_me:-configure}:14116: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14117
14118         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14119         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14120
14121 fi
14122
14123 if test -n "$cf_new_extra_cppflags" ; then
14124         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14125
14126 echo "${as_me:-configure}:14126: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14127
14128         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14129         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14130
14131 fi
14132
14133 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14134 cat >conftest.$ac_ext <<_ACEOF
14135 #line 14135 "configure"
14136 #include "confdefs.h"
14137 #include <stdio.h>
14138 int
14139 main (void)
14140 {
14141 printf("Hello world");
14142   ;
14143   return 0;
14144 }
14145 _ACEOF
14146 rm -f conftest.$ac_objext conftest$ac_exeext
14147 if { (eval echo "$as_me:14147: \"$ac_link\"") >&5
14148   (eval $ac_link) 2>&5
14149   ac_status=$?
14150   echo "$as_me:14150: \$? = $ac_status" >&5
14151   (exit $ac_status); } &&
14152          { ac_try='test -s conftest$ac_exeext'
14153   { (eval echo "$as_me:14153: \"$ac_try\"") >&5
14154   (eval $ac_try) 2>&5
14155   ac_status=$?
14156   echo "$as_me:14156: \$? = $ac_status" >&5
14157   (exit $ac_status); }; }; then
14158   :
14159 else
14160   echo "$as_me: failed program was:" >&5
14161 cat conftest.$ac_ext >&5
14162 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14163
14164 echo "${as_me:-configure}:14164: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14165
14166          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14167                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14168
14169 echo "${as_me:-configure}:14169: testing but keeping change to \$CPPFLAGS ..." 1>&5
14170
14171          fi
14172          CFLAGS="$cf_check_flags"
14173 fi
14174 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14175 fi
14176
14177         echo "$as_me:14177: checking for XOpenDisplay" >&5
14178 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14179 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14180   echo $ECHO_N "(cached) $ECHO_C" >&6
14181 else
14182   cat >conftest.$ac_ext <<_ACEOF
14183 #line 14183 "configure"
14184 #include "confdefs.h"
14185 /* System header to define __stub macros and hopefully few prototypes,
14186     which can conflict with char XOpenDisplay (); below.  */
14187 #include <assert.h>
14188 /* Override any gcc2 internal prototype to avoid an error.  */
14189 #ifdef __cplusplus
14190 extern "C"
14191 #endif
14192 /* We use char because int might match the return type of a gcc2
14193    builtin and then its argument prototype would still apply.  */
14194 char XOpenDisplay ();
14195 char (*f) ();
14196
14197 int
14198 main (void)
14199 {
14200 /* The GNU C library defines this for functions which it implements
14201     to always fail with ENOSYS.  Some functions are actually named
14202     something starting with __ and the normal name is an alias.  */
14203 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14204 choke me
14205 #else
14206 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14207 #endif
14208
14209   ;
14210   return 0;
14211 }
14212 _ACEOF
14213 rm -f conftest.$ac_objext conftest$ac_exeext
14214 if { (eval echo "$as_me:14214: \"$ac_link\"") >&5
14215   (eval $ac_link) 2>&5
14216   ac_status=$?
14217   echo "$as_me:14217: \$? = $ac_status" >&5
14218   (exit $ac_status); } &&
14219          { ac_try='test -s conftest$ac_exeext'
14220   { (eval echo "$as_me:14220: \"$ac_try\"") >&5
14221   (eval $ac_try) 2>&5
14222   ac_status=$?
14223   echo "$as_me:14223: \$? = $ac_status" >&5
14224   (exit $ac_status); }; }; then
14225   ac_cv_func_XOpenDisplay=yes
14226 else
14227   echo "$as_me: failed program was:" >&5
14228 cat conftest.$ac_ext >&5
14229 ac_cv_func_XOpenDisplay=no
14230 fi
14231 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14232 fi
14233 echo "$as_me:14233: result: $ac_cv_func_XOpenDisplay" >&5
14234 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14235 if test $ac_cv_func_XOpenDisplay = yes; then
14236   :
14237 else
14238
14239         echo "$as_me:14239: checking for XOpenDisplay in -lX11" >&5
14240 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14241 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14242   echo $ECHO_N "(cached) $ECHO_C" >&6
14243 else
14244   ac_check_lib_save_LIBS=$LIBS
14245 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14246 cat >conftest.$ac_ext <<_ACEOF
14247 #line 14247 "configure"
14248 #include "confdefs.h"
14249
14250 /* Override any gcc2 internal prototype to avoid an error.  */
14251 #ifdef __cplusplus
14252 extern "C"
14253 #endif
14254 /* We use char because int might match the return type of a gcc2
14255    builtin and then its argument prototype would still apply.  */
14256 char XOpenDisplay ();
14257 int
14258 main (void)
14259 {
14260 XOpenDisplay ();
14261   ;
14262   return 0;
14263 }
14264 _ACEOF
14265 rm -f conftest.$ac_objext conftest$ac_exeext
14266 if { (eval echo "$as_me:14266: \"$ac_link\"") >&5
14267   (eval $ac_link) 2>&5
14268   ac_status=$?
14269   echo "$as_me:14269: \$? = $ac_status" >&5
14270   (exit $ac_status); } &&
14271          { ac_try='test -s conftest$ac_exeext'
14272   { (eval echo "$as_me:14272: \"$ac_try\"") >&5
14273   (eval $ac_try) 2>&5
14274   ac_status=$?
14275   echo "$as_me:14275: \$? = $ac_status" >&5
14276   (exit $ac_status); }; }; then
14277   ac_cv_lib_X11_XOpenDisplay=yes
14278 else
14279   echo "$as_me: failed program was:" >&5
14280 cat conftest.$ac_ext >&5
14281 ac_cv_lib_X11_XOpenDisplay=no
14282 fi
14283 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14284 LIBS=$ac_check_lib_save_LIBS
14285 fi
14286 echo "$as_me:14286: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14287 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14288 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14289
14290 cf_add_libs="-lX11"
14291 # Filter out duplicates - this happens with badly-designed ".pc" files...
14292 for cf_add_1lib in $LIBS
14293 do
14294         for cf_add_2lib in $cf_add_libs
14295         do
14296                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14297                 then
14298                         cf_add_1lib=
14299                         break
14300                 fi
14301         done
14302         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14303 done
14304 LIBS="$cf_add_libs"
14305
14306 fi
14307
14308 fi
14309
14310         echo "$as_me:14310: checking for XtAppInitialize" >&5
14311 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14312 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14313   echo $ECHO_N "(cached) $ECHO_C" >&6
14314 else
14315   cat >conftest.$ac_ext <<_ACEOF
14316 #line 14316 "configure"
14317 #include "confdefs.h"
14318 /* System header to define __stub macros and hopefully few prototypes,
14319     which can conflict with char XtAppInitialize (); below.  */
14320 #include <assert.h>
14321 /* Override any gcc2 internal prototype to avoid an error.  */
14322 #ifdef __cplusplus
14323 extern "C"
14324 #endif
14325 /* We use char because int might match the return type of a gcc2
14326    builtin and then its argument prototype would still apply.  */
14327 char XtAppInitialize ();
14328 char (*f) ();
14329
14330 int
14331 main (void)
14332 {
14333 /* The GNU C library defines this for functions which it implements
14334     to always fail with ENOSYS.  Some functions are actually named
14335     something starting with __ and the normal name is an alias.  */
14336 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14337 choke me
14338 #else
14339 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14340 #endif
14341
14342   ;
14343   return 0;
14344 }
14345 _ACEOF
14346 rm -f conftest.$ac_objext conftest$ac_exeext
14347 if { (eval echo "$as_me:14347: \"$ac_link\"") >&5
14348   (eval $ac_link) 2>&5
14349   ac_status=$?
14350   echo "$as_me:14350: \$? = $ac_status" >&5
14351   (exit $ac_status); } &&
14352          { ac_try='test -s conftest$ac_exeext'
14353   { (eval echo "$as_me:14353: \"$ac_try\"") >&5
14354   (eval $ac_try) 2>&5
14355   ac_status=$?
14356   echo "$as_me:14356: \$? = $ac_status" >&5
14357   (exit $ac_status); }; }; then
14358   ac_cv_func_XtAppInitialize=yes
14359 else
14360   echo "$as_me: failed program was:" >&5
14361 cat conftest.$ac_ext >&5
14362 ac_cv_func_XtAppInitialize=no
14363 fi
14364 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14365 fi
14366 echo "$as_me:14366: result: $ac_cv_func_XtAppInitialize" >&5
14367 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14368 if test $ac_cv_func_XtAppInitialize = yes; then
14369   :
14370 else
14371
14372         echo "$as_me:14372: checking for XtAppInitialize in -lXt" >&5
14373 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14374 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14375   echo $ECHO_N "(cached) $ECHO_C" >&6
14376 else
14377   ac_check_lib_save_LIBS=$LIBS
14378 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14379 cat >conftest.$ac_ext <<_ACEOF
14380 #line 14380 "configure"
14381 #include "confdefs.h"
14382
14383 /* Override any gcc2 internal prototype to avoid an error.  */
14384 #ifdef __cplusplus
14385 extern "C"
14386 #endif
14387 /* We use char because int might match the return type of a gcc2
14388    builtin and then its argument prototype would still apply.  */
14389 char XtAppInitialize ();
14390 int
14391 main (void)
14392 {
14393 XtAppInitialize ();
14394   ;
14395   return 0;
14396 }
14397 _ACEOF
14398 rm -f conftest.$ac_objext conftest$ac_exeext
14399 if { (eval echo "$as_me:14399: \"$ac_link\"") >&5
14400   (eval $ac_link) 2>&5
14401   ac_status=$?
14402   echo "$as_me:14402: \$? = $ac_status" >&5
14403   (exit $ac_status); } &&
14404          { ac_try='test -s conftest$ac_exeext'
14405   { (eval echo "$as_me:14405: \"$ac_try\"") >&5
14406   (eval $ac_try) 2>&5
14407   ac_status=$?
14408   echo "$as_me:14408: \$? = $ac_status" >&5
14409   (exit $ac_status); }; }; then
14410   ac_cv_lib_Xt_XtAppInitialize=yes
14411 else
14412   echo "$as_me: failed program was:" >&5
14413 cat conftest.$ac_ext >&5
14414 ac_cv_lib_Xt_XtAppInitialize=no
14415 fi
14416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14417 LIBS=$ac_check_lib_save_LIBS
14418 fi
14419 echo "$as_me:14419: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
14420 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
14421 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
14422
14423 cat >>confdefs.h <<\EOF
14424 #define HAVE_LIBXT 1
14425 EOF
14426
14427                  cf_have_X_LIBS=Xt
14428                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14429 fi
14430
14431 fi
14432
14433 fi
14434
14435 if test $cf_have_X_LIBS = no ; then
14436         { echo "$as_me:14436: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14437 test program.  You will have to check and add the proper libraries by hand
14438 to makefile." >&5
14439 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14440 test program.  You will have to check and add the proper libraries by hand
14441 to makefile." >&2;}
14442 fi
14443
14444 cf_x_athena_root=$cf_x_athena
14445 cf_x_athena_inc=""
14446
14447 for cf_path in default \
14448         /usr/contrib/X11R6 \
14449         /usr/contrib/X11R5 \
14450         /usr/lib/X11R5 \
14451         /usr/local
14452 do
14453         if test -z "$cf_x_athena_inc" ; then
14454                 cf_save="$CPPFLAGS"
14455                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
14456                 if test $cf_path != default ; then
14457                         CPPFLAGS="$cf_save"
14458
14459         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14460         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
14461
14462                         echo "$as_me:14462: checking for $cf_test in $cf_path" >&5
14463 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
14464                 else
14465                         echo "$as_me:14465: checking for $cf_test" >&5
14466 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
14467                 fi
14468                 cat >conftest.$ac_ext <<_ACEOF
14469 #line 14469 "configure"
14470 #include "confdefs.h"
14471
14472 #include <X11/Intrinsic.h>
14473 #include <$cf_test>
14474 int
14475 main (void)
14476 {
14477
14478   ;
14479   return 0;
14480 }
14481 _ACEOF
14482 rm -f conftest.$ac_objext
14483 if { (eval echo "$as_me:14483: \"$ac_compile\"") >&5
14484   (eval $ac_compile) 2>&5
14485   ac_status=$?
14486   echo "$as_me:14486: \$? = $ac_status" >&5
14487   (exit $ac_status); } &&
14488          { ac_try='test -s conftest.$ac_objext'
14489   { (eval echo "$as_me:14489: \"$ac_try\"") >&5
14490   (eval $ac_try) 2>&5
14491   ac_status=$?
14492   echo "$as_me:14492: \$? = $ac_status" >&5
14493   (exit $ac_status); }; }; then
14494   cf_result=yes
14495 else
14496   echo "$as_me: failed program was:" >&5
14497 cat conftest.$ac_ext >&5
14498 cf_result=no
14499 fi
14500 rm -f conftest.$ac_objext conftest.$ac_ext
14501                 echo "$as_me:14501: result: $cf_result" >&5
14502 echo "${ECHO_T}$cf_result" >&6
14503                 if test "$cf_result" = yes ; then
14504                         cf_x_athena_inc=$cf_path
14505                         break
14506                 else
14507                         CPPFLAGS="$cf_save"
14508                 fi
14509         fi
14510 done
14511
14512 if test -z "$cf_x_athena_inc" ; then
14513         { echo "$as_me:14513: WARNING: Unable to successfully find Athena header files with test program" >&5
14514 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
14515 elif test "$cf_x_athena_inc" != default ; then
14516
14517         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14518         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
14519
14520 fi
14521
14522 cf_x_athena_root=$cf_x_athena
14523 cf_x_athena_lib=""
14524
14525 for cf_path in default \
14526         /usr/contrib/X11R6 \
14527         /usr/contrib/X11R5 \
14528         /usr/lib/X11R5 \
14529         /usr/local
14530 do
14531         for cf_lib in \
14532                 ${cf_x_athena_root} \
14533                 ${cf_x_athena_root}7 \
14534                 ${cf_x_athena_root}6
14535         do
14536         for cf_libs in \
14537                 "-l$cf_lib -lXmu" \
14538                 "-l$cf_lib -lXpm -lXmu" \
14539                 "-l${cf_lib}_s -lXmu_s"
14540         do
14541                 if test -z "$cf_x_athena_lib" ; then
14542                         cf_save="$LIBS"
14543                         cf_test=XawSimpleMenuAddGlobalActions
14544                         if test $cf_path != default ; then
14545
14546 cf_add_libs="-L$cf_path/lib $cf_libs"
14547 # Filter out duplicates - this happens with badly-designed ".pc" files...
14548 for cf_add_1lib in $LIBS
14549 do
14550         for cf_add_2lib in $cf_add_libs
14551         do
14552                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14553                 then
14554                         cf_add_1lib=
14555                         break
14556                 fi
14557         done
14558         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14559 done
14560 LIBS="$cf_add_libs"
14561
14562                                 echo "$as_me:14562: checking for $cf_libs in $cf_path" >&5
14563 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
14564                         else
14565
14566 cf_add_libs="$cf_libs"
14567 # Filter out duplicates - this happens with badly-designed ".pc" files...
14568 for cf_add_1lib in $LIBS
14569 do
14570         for cf_add_2lib in $cf_add_libs
14571         do
14572                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14573                 then
14574                         cf_add_1lib=
14575                         break
14576                 fi
14577         done
14578         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14579 done
14580 LIBS="$cf_add_libs"
14581
14582                                 echo "$as_me:14582: checking for $cf_test in $cf_libs" >&5
14583 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
14584                         fi
14585                         cat >conftest.$ac_ext <<_ACEOF
14586 #line 14586 "configure"
14587 #include "confdefs.h"
14588
14589 #include <X11/Intrinsic.h>
14590 #include <X11/$cf_x_athena_root/SimpleMenu.h>
14591
14592 int
14593 main (void)
14594 {
14595
14596 $cf_test((XtAppContext) 0)
14597   ;
14598   return 0;
14599 }
14600 _ACEOF
14601 rm -f conftest.$ac_objext conftest$ac_exeext
14602 if { (eval echo "$as_me:14602: \"$ac_link\"") >&5
14603   (eval $ac_link) 2>&5
14604   ac_status=$?
14605   echo "$as_me:14605: \$? = $ac_status" >&5
14606   (exit $ac_status); } &&
14607          { ac_try='test -s conftest$ac_exeext'
14608   { (eval echo "$as_me:14608: \"$ac_try\"") >&5
14609   (eval $ac_try) 2>&5
14610   ac_status=$?
14611   echo "$as_me:14611: \$? = $ac_status" >&5
14612   (exit $ac_status); }; }; then
14613   cf_result=yes
14614 else
14615   echo "$as_me: failed program was:" >&5
14616 cat conftest.$ac_ext >&5
14617 cf_result=no
14618 fi
14619 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14620                         echo "$as_me:14620: result: $cf_result" >&5
14621 echo "${ECHO_T}$cf_result" >&6
14622                         if test "$cf_result" = yes ; then
14623                                 cf_x_athena_lib="$cf_libs"
14624                                 break
14625                         fi
14626                         LIBS="$cf_save"
14627                 fi
14628         done # cf_libs
14629                 test -n "$cf_x_athena_lib" && break
14630         done # cf_lib
14631 done
14632
14633 if test -z "$cf_x_athena_lib" ; then
14634         { { echo "$as_me:14634: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
14635 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
14636    { (exit 1); exit 1; }; }
14637 fi
14638
14639 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14640
14641 cat >>confdefs.h <<EOF
14642 #define $cf_x_athena_LIBS 1
14643 EOF
14644
14645 fi
14646
14647 if test -n "$ac_tool_prefix"; then
14648   for ac_prog in xcurses-config
14649   do
14650     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
14651 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
14652 echo "$as_me:14652: checking for $ac_word" >&5
14653 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14654 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
14655   echo $ECHO_N "(cached) $ECHO_C" >&6
14656 else
14657   if test -n "$XCURSES_CONFIG"; then
14658   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
14659 else
14660   ac_save_IFS=$IFS; IFS=$ac_path_separator
14661 ac_dummy="$PATH"
14662 for ac_dir in $ac_dummy; do
14663   IFS=$ac_save_IFS
14664   test -z "$ac_dir" && ac_dir=.
14665   $as_executable_p "$ac_dir/$ac_word" || continue
14666 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
14667 echo "$as_me:14667: found $ac_dir/$ac_word" >&5
14668 break
14669 done
14670
14671 fi
14672 fi
14673 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
14674 if test -n "$XCURSES_CONFIG"; then
14675   echo "$as_me:14675: result: $XCURSES_CONFIG" >&5
14676 echo "${ECHO_T}$XCURSES_CONFIG" >&6
14677 else
14678   echo "$as_me:14678: result: no" >&5
14679 echo "${ECHO_T}no" >&6
14680 fi
14681
14682     test -n "$XCURSES_CONFIG" && break
14683   done
14684 fi
14685 if test -z "$XCURSES_CONFIG"; then
14686   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
14687   for ac_prog in xcurses-config
14688 do
14689   # Extract the first word of "$ac_prog", so it can be a program name with args.
14690 set dummy $ac_prog; ac_word=$2
14691 echo "$as_me:14691: checking for $ac_word" >&5
14692 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14693 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
14694   echo $ECHO_N "(cached) $ECHO_C" >&6
14695 else
14696   if test -n "$ac_ct_XCURSES_CONFIG"; then
14697   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
14698 else
14699   ac_save_IFS=$IFS; IFS=$ac_path_separator
14700 ac_dummy="$PATH"
14701 for ac_dir in $ac_dummy; do
14702   IFS=$ac_save_IFS
14703   test -z "$ac_dir" && ac_dir=.
14704   $as_executable_p "$ac_dir/$ac_word" || continue
14705 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
14706 echo "$as_me:14706: found $ac_dir/$ac_word" >&5
14707 break
14708 done
14709
14710 fi
14711 fi
14712 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
14713 if test -n "$ac_ct_XCURSES_CONFIG"; then
14714   echo "$as_me:14714: result: $ac_ct_XCURSES_CONFIG" >&5
14715 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
14716 else
14717   echo "$as_me:14717: result: no" >&5
14718 echo "${ECHO_T}no" >&6
14719 fi
14720
14721   test -n "$ac_ct_XCURSES_CONFIG" && break
14722 done
14723 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
14724
14725   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
14726 fi
14727
14728 if test "$XCURSES_CONFIG" != none ; then
14729
14730 cf_fix_cppflags=no
14731 cf_new_cflags=
14732 cf_new_cppflags=
14733 cf_new_extra_cppflags=
14734
14735 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
14736 do
14737 case $cf_fix_cppflags in
14738 (no)
14739         case $cf_add_cflags in
14740         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14741                 case $cf_add_cflags in
14742                 (-D*)
14743                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14744
14745                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14746                                 && test -z "${cf_tst_cflags}" \
14747                                 && cf_fix_cppflags=yes
14748
14749                         if test $cf_fix_cppflags = yes ; then
14750
14751         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14752         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14753
14754                                 continue
14755                         elif test "${cf_tst_cflags}" = "\"'" ; then
14756
14757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14759
14760                                 continue
14761                         fi
14762                         ;;
14763                 esac
14764                 case "$CPPFLAGS" in
14765                 (*$cf_add_cflags)
14766                         ;;
14767                 (*)
14768                         case $cf_add_cflags in
14769                         (-D*)
14770                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14771
14772 CPPFLAGS=`echo "$CPPFLAGS" | \
14773         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14774                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14775
14776                                 ;;
14777                         esac
14778
14779         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14780         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14781
14782                         ;;
14783                 esac
14784                 ;;
14785         (*)
14786
14787         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14788         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14789
14790                 ;;
14791         esac
14792         ;;
14793 (yes)
14794
14795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14797
14798         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14799
14800         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14801                 && test -z "${cf_tst_cflags}" \
14802                 && cf_fix_cppflags=no
14803         ;;
14804 esac
14805 done
14806
14807 if test -n "$cf_new_cflags" ; then
14808
14809         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14810         CFLAGS="${CFLAGS}$cf_new_cflags"
14811
14812 fi
14813
14814 if test -n "$cf_new_cppflags" ; then
14815
14816         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14817         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14818
14819 fi
14820
14821 if test -n "$cf_new_extra_cppflags" ; then
14822
14823         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14824         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14825
14826 fi
14827
14828 cf_add_libs="`$XCURSES_CONFIG --libs`"
14829 # Filter out duplicates - this happens with badly-designed ".pc" files...
14830 for cf_add_1lib in $LIBS
14831 do
14832         for cf_add_2lib in $cf_add_libs
14833         do
14834                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14835                 then
14836                         cf_add_1lib=
14837                         break
14838                 fi
14839         done
14840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14841 done
14842 LIBS="$cf_add_libs"
14843
14844 cf_cv_lib_XCurses=yes
14845
14846 else
14847
14848 LDFLAGS="$LDFLAGS $X_LIBS"
14849
14850 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14851
14852 echo "${as_me:-configure}:14852: testing checking additions to CFLAGS ..." 1>&5
14853
14854 cf_check_cflags="$CFLAGS"
14855 cf_check_cppflags="$CPPFLAGS"
14856
14857 cf_fix_cppflags=no
14858 cf_new_cflags=
14859 cf_new_cppflags=
14860 cf_new_extra_cppflags=
14861
14862 for cf_add_cflags in $X_CFLAGS
14863 do
14864 case $cf_fix_cppflags in
14865 (no)
14866         case $cf_add_cflags in
14867         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14868                 case $cf_add_cflags in
14869                 (-D*)
14870                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14871
14872                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14873                                 && test -z "${cf_tst_cflags}" \
14874                                 && cf_fix_cppflags=yes
14875
14876                         if test $cf_fix_cppflags = yes ; then
14877
14878         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14879         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14880
14881                                 continue
14882                         elif test "${cf_tst_cflags}" = "\"'" ; then
14883
14884         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14885         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14886
14887                                 continue
14888                         fi
14889                         ;;
14890                 esac
14891                 case "$CPPFLAGS" in
14892                 (*$cf_add_cflags)
14893                         ;;
14894                 (*)
14895                         case $cf_add_cflags in
14896                         (-D*)
14897                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14898
14899 CPPFLAGS=`echo "$CPPFLAGS" | \
14900         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14901                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14902
14903                                 ;;
14904                         esac
14905
14906         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14907         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14908
14909                         ;;
14910                 esac
14911                 ;;
14912         (*)
14913
14914         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14915         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14916
14917                 ;;
14918         esac
14919         ;;
14920 (yes)
14921
14922         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14923         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14924
14925         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14926
14927         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14928                 && test -z "${cf_tst_cflags}" \
14929                 && cf_fix_cppflags=no
14930         ;;
14931 esac
14932 done
14933
14934 if test -n "$cf_new_cflags" ; then
14935         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14936
14937 echo "${as_me:-configure}:14937: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14938
14939         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14940         CFLAGS="${CFLAGS}$cf_new_cflags"
14941
14942 fi
14943
14944 if test -n "$cf_new_cppflags" ; then
14945         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14946
14947 echo "${as_me:-configure}:14947: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14948
14949         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14950         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14951
14952 fi
14953
14954 if test -n "$cf_new_extra_cppflags" ; then
14955         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14956
14957 echo "${as_me:-configure}:14957: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14958
14959         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14960         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14961
14962 fi
14963
14964 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14965 cat >conftest.$ac_ext <<_ACEOF
14966 #line 14966 "configure"
14967 #include "confdefs.h"
14968 #include <stdio.h>
14969 int
14970 main (void)
14971 {
14972 printf("Hello world");
14973   ;
14974   return 0;
14975 }
14976 _ACEOF
14977 rm -f conftest.$ac_objext conftest$ac_exeext
14978 if { (eval echo "$as_me:14978: \"$ac_link\"") >&5
14979   (eval $ac_link) 2>&5
14980   ac_status=$?
14981   echo "$as_me:14981: \$? = $ac_status" >&5
14982   (exit $ac_status); } &&
14983          { ac_try='test -s conftest$ac_exeext'
14984   { (eval echo "$as_me:14984: \"$ac_try\"") >&5
14985   (eval $ac_try) 2>&5
14986   ac_status=$?
14987   echo "$as_me:14987: \$? = $ac_status" >&5
14988   (exit $ac_status); }; }; then
14989   :
14990 else
14991   echo "$as_me: failed program was:" >&5
14992 cat conftest.$ac_ext >&5
14993 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14994
14995 echo "${as_me:-configure}:14995: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14996
14997          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14998                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14999
15000 echo "${as_me:-configure}:15000: testing but keeping change to \$CPPFLAGS ..." 1>&5
15001
15002          fi
15003          CFLAGS="$cf_check_flags"
15004 fi
15005 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15006 fi
15007
15008 echo "$as_me:15008: checking for XOpenDisplay in -lX11" >&5
15009 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15010 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15011   echo $ECHO_N "(cached) $ECHO_C" >&6
15012 else
15013   ac_check_lib_save_LIBS=$LIBS
15014 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15015 cat >conftest.$ac_ext <<_ACEOF
15016 #line 15016 "configure"
15017 #include "confdefs.h"
15018
15019 /* Override any gcc2 internal prototype to avoid an error.  */
15020 #ifdef __cplusplus
15021 extern "C"
15022 #endif
15023 /* We use char because int might match the return type of a gcc2
15024    builtin and then its argument prototype would still apply.  */
15025 char XOpenDisplay ();
15026 int
15027 main (void)
15028 {
15029 XOpenDisplay ();
15030   ;
15031   return 0;
15032 }
15033 _ACEOF
15034 rm -f conftest.$ac_objext conftest$ac_exeext
15035 if { (eval echo "$as_me:15035: \"$ac_link\"") >&5
15036   (eval $ac_link) 2>&5
15037   ac_status=$?
15038   echo "$as_me:15038: \$? = $ac_status" >&5
15039   (exit $ac_status); } &&
15040          { ac_try='test -s conftest$ac_exeext'
15041   { (eval echo "$as_me:15041: \"$ac_try\"") >&5
15042   (eval $ac_try) 2>&5
15043   ac_status=$?
15044   echo "$as_me:15044: \$? = $ac_status" >&5
15045   (exit $ac_status); }; }; then
15046   ac_cv_lib_X11_XOpenDisplay=yes
15047 else
15048   echo "$as_me: failed program was:" >&5
15049 cat conftest.$ac_ext >&5
15050 ac_cv_lib_X11_XOpenDisplay=no
15051 fi
15052 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15053 LIBS=$ac_check_lib_save_LIBS
15054 fi
15055 echo "$as_me:15055: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15056 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15057 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15058
15059 cf_add_libs="-lX11"
15060 # Filter out duplicates - this happens with badly-designed ".pc" files...
15061 for cf_add_1lib in $LIBS
15062 do
15063         for cf_add_2lib in $cf_add_libs
15064         do
15065                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15066                 then
15067                         cf_add_1lib=
15068                         break
15069                 fi
15070         done
15071         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15072 done
15073 LIBS="$cf_add_libs"
15074
15075 fi
15076
15077 echo "$as_me:15077: checking for XCurses library" >&5
15078 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15079 if test "${cf_cv_lib_XCurses+set}" = set; then
15080   echo $ECHO_N "(cached) $ECHO_C" >&6
15081 else
15082
15083 cf_add_libs="-lXCurses"
15084 # Filter out duplicates - this happens with badly-designed ".pc" files...
15085 for cf_add_1lib in $LIBS
15086 do
15087         for cf_add_2lib in $cf_add_libs
15088         do
15089                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15090                 then
15091                         cf_add_1lib=
15092                         break
15093                 fi
15094         done
15095         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15096 done
15097 LIBS="$cf_add_libs"
15098
15099 cat >conftest.$ac_ext <<_ACEOF
15100 #line 15100 "configure"
15101 #include "confdefs.h"
15102
15103 #include <xcurses.h>
15104 char *XCursesProgramName = "test";
15105
15106 int
15107 main (void)
15108 {
15109 XCursesExit();
15110   ;
15111   return 0;
15112 }
15113 _ACEOF
15114 rm -f conftest.$ac_objext conftest$ac_exeext
15115 if { (eval echo "$as_me:15115: \"$ac_link\"") >&5
15116   (eval $ac_link) 2>&5
15117   ac_status=$?
15118   echo "$as_me:15118: \$? = $ac_status" >&5
15119   (exit $ac_status); } &&
15120          { ac_try='test -s conftest$ac_exeext'
15121   { (eval echo "$as_me:15121: \"$ac_try\"") >&5
15122   (eval $ac_try) 2>&5
15123   ac_status=$?
15124   echo "$as_me:15124: \$? = $ac_status" >&5
15125   (exit $ac_status); }; }; then
15126   cf_cv_lib_XCurses=yes
15127 else
15128   echo "$as_me: failed program was:" >&5
15129 cat conftest.$ac_ext >&5
15130 cf_cv_lib_XCurses=no
15131 fi
15132 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15133
15134 fi
15135 echo "$as_me:15135: result: $cf_cv_lib_XCurses" >&5
15136 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15137
15138 fi
15139
15140 if test $cf_cv_lib_XCurses = yes ; then
15141
15142 cat >>confdefs.h <<\EOF
15143 #define UNIX 1
15144 EOF
15145
15146 cat >>confdefs.h <<\EOF
15147 #define XCURSES 1
15148 EOF
15149
15150         echo "$as_me:15150: checking for xcurses.h" >&5
15151 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15152 if test "${ac_cv_header_xcurses_h+set}" = set; then
15153   echo $ECHO_N "(cached) $ECHO_C" >&6
15154 else
15155   cat >conftest.$ac_ext <<_ACEOF
15156 #line 15156 "configure"
15157 #include "confdefs.h"
15158 #include <xcurses.h>
15159 _ACEOF
15160 if { (eval echo "$as_me:15160: \"$ac_cpp conftest.$ac_ext\"") >&5
15161   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15162   ac_status=$?
15163   egrep -v '^ *\+' conftest.er1 >conftest.err
15164   rm -f conftest.er1
15165   cat conftest.err >&5
15166   echo "$as_me:15166: \$? = $ac_status" >&5
15167   (exit $ac_status); } >/dev/null; then
15168   if test -s conftest.err; then
15169     ac_cpp_err=$ac_c_preproc_warn_flag
15170   else
15171     ac_cpp_err=
15172   fi
15173 else
15174   ac_cpp_err=yes
15175 fi
15176 if test -z "$ac_cpp_err"; then
15177   ac_cv_header_xcurses_h=yes
15178 else
15179   echo "$as_me: failed program was:" >&5
15180   cat conftest.$ac_ext >&5
15181   ac_cv_header_xcurses_h=no
15182 fi
15183 rm -f conftest.err conftest.$ac_ext
15184 fi
15185 echo "$as_me:15185: result: $ac_cv_header_xcurses_h" >&5
15186 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15187 if test $ac_cv_header_xcurses_h = yes; then
15188
15189 cat >>confdefs.h <<\EOF
15190 #define HAVE_XCURSES 1
15191 EOF
15192
15193 fi
15194
15195 else
15196         { { echo "$as_me:15196: error: Cannot link with XCurses" >&5
15197 echo "$as_me: error: Cannot link with XCurses" >&2;}
15198    { (exit 1); exit 1; }; }
15199 fi
15200
15201         ;;
15202 (*)
15203         { { echo "$as_me:15203: error: unexpected screen-value: $cf_cv_screen" >&5
15204 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15205    { (exit 1); exit 1; }; }
15206         ;;
15207 esac
15208
15209 : ${cf_nculib_root:=$cf_cv_screen}
15210 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15211 echo "$as_me:15211: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15212 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15213 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15214   echo $ECHO_N "(cached) $ECHO_C" >&6
15215 else
15216   ac_check_lib_save_LIBS=$LIBS
15217 LIBS="-l$cf_nculib_root  $LIBS"
15218 cat >conftest.$ac_ext <<_ACEOF
15219 #line 15219 "configure"
15220 #include "confdefs.h"
15221
15222 /* Override any gcc2 internal prototype to avoid an error.  */
15223 #ifdef __cplusplus
15224 extern "C"
15225 #endif
15226 /* We use char because int might match the return type of a gcc2
15227    builtin and then its argument prototype would still apply.  */
15228 char _nc_init_pthreads ();
15229 int
15230 main (void)
15231 {
15232 _nc_init_pthreads ();
15233   ;
15234   return 0;
15235 }
15236 _ACEOF
15237 rm -f conftest.$ac_objext conftest$ac_exeext
15238 if { (eval echo "$as_me:15238: \"$ac_link\"") >&5
15239   (eval $ac_link) 2>&5
15240   ac_status=$?
15241   echo "$as_me:15241: \$? = $ac_status" >&5
15242   (exit $ac_status); } &&
15243          { ac_try='test -s conftest$ac_exeext'
15244   { (eval echo "$as_me:15244: \"$ac_try\"") >&5
15245   (eval $ac_try) 2>&5
15246   ac_status=$?
15247   echo "$as_me:15247: \$? = $ac_status" >&5
15248   (exit $ac_status); }; }; then
15249   eval "$as_ac_Lib=yes"
15250 else
15251   echo "$as_me: failed program was:" >&5
15252 cat conftest.$ac_ext >&5
15253 eval "$as_ac_Lib=no"
15254 fi
15255 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15256 LIBS=$ac_check_lib_save_LIBS
15257 fi
15258 echo "$as_me:15258: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15259 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15260 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15261   cf_cv_ncurses_pthreads=yes
15262 else
15263   cf_cv_ncurses_pthreads=no
15264 fi
15265
15266 if test "$cf_cv_ncurses_pthreads" = yes
15267 then
15268
15269 cf_add_libs="-lpthread"
15270 # Filter out duplicates - this happens with badly-designed ".pc" files...
15271 for cf_add_1lib in $LIBS
15272 do
15273         for cf_add_2lib in $cf_add_libs
15274         do
15275                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15276                 then
15277                         cf_add_1lib=
15278                         break
15279                 fi
15280         done
15281         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15282 done
15283 LIBS="$cf_add_libs"
15284
15285 fi
15286
15287 case $cf_cv_screen in
15288 (ncurses*)
15289         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15290         ;;
15291 esac
15292
15293 echo "$as_me:15293: checking for X11 rgb file" >&5
15294 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15295
15296 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15297 if test "${with_x11_rgb+set}" = set; then
15298   withval="$with_x11_rgb"
15299   RGB_PATH=$withval
15300 else
15301   RGB_PATH=auto
15302 fi;
15303
15304 if test "x$RGB_PATH" = xauto
15305 then
15306         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15307         for cf_path in \
15308                 /opt/local/share/X11/rgb.txt \
15309                 /opt/X11/share/X11/rgb.txt \
15310                 /usr/share/X11/rgb.txt \
15311                 /usr/X11/share/X11/rgb.txt \
15312                 /usr/X11/lib/X11/rgb.txt \
15313                 /usr/lib/X11/rgb.txt \
15314                 /etc/X11/rgb.txt \
15315                 /usr/pkg/lib/X11/rgb.txt \
15316                 /usr/X11R7/lib/X11/rgb.txt \
15317                 /usr/X11R6/lib/X11/rgb.txt \
15318                 /usr/X11R5/lib/X11/rgb.txt \
15319                 /usr/X11R4/lib/X11/rgb.txt \
15320                 /usr/local/lib/X11/rgb.txt \
15321                 /usr/local/share/X11/rgb.txt \
15322                 /usr/lib64/X11/rgb.txt
15323         do
15324                 if test -f "$cf_path" ; then
15325                         RGB_PATH="$cf_path"
15326                         break
15327                 fi
15328         done
15329 else
15330         cf_path=$RGB_PATH
15331
15332 if test "x$prefix" != xNONE; then
15333         cf_path_syntax="$prefix"
15334 else
15335         cf_path_syntax="$ac_default_prefix"
15336 fi
15337
15338 case ".$cf_path" in
15339 (.\$\(*\)*|.\'*\'*)
15340         ;;
15341 (..|./*|.\\*)
15342         ;;
15343 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15344         ;;
15345 (.\${*prefix}*|.\${*dir}*)
15346         eval cf_path="$cf_path"
15347         case ".$cf_path" in
15348         (.NONE/*)
15349                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15350                 ;;
15351         esac
15352         ;;
15353 (.no|.NONE/*)
15354         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15355         ;;
15356 (*)
15357         { { echo "$as_me:15357: error: expected a pathname, not \"$cf_path\"" >&5
15358 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15359    { (exit 1); exit 1; }; }
15360         ;;
15361 esac
15362
15363 fi
15364
15365 echo "$as_me:15365: result: $RGB_PATH" >&5
15366 echo "${ECHO_T}$RGB_PATH" >&6
15367
15368 cat >>confdefs.h <<EOF
15369 #define RGB_PATH "$cf_path"
15370 EOF
15371
15372 no_x11_rgb=
15373 if test "$RGB_PATH" = no
15374 then
15375         no_x11_rgb="#"
15376 fi
15377
15378 cf_curses_headers=
15379
15380 case $cf_cv_screen in
15381 (pdcurses)
15382         cf_default_panel=no
15383         cf_default_form=no
15384         cf_default_menu=no
15385         cf_default_tinfo=no
15386         ;;
15387 (xcurses|bsdcurses)
15388         cf_default_panel=no
15389         cf_default_form=no
15390         cf_default_menu=no
15391         cf_default_tinfo=yes
15392         ;;
15393 (*)
15394         cf_default_panel=yes
15395         cf_default_form=yes
15396         cf_default_menu=yes
15397         cf_default_tinfo=yes
15398         case $cf_cv_screen in
15399         (ncurses*)
15400                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
15401                 ;;
15402         esac
15403         ;;
15404 esac
15405
15406 echo "$as_me:15406: checking if you want to check for panel functions" >&5
15407 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
15408
15409 # Check whether --enable-panel or --disable-panel was given.
15410 if test "${enable_panel+set}" = set; then
15411   enableval="$enable_panel"
15412   test "$enableval" != no && enableval=yes
15413         if test "$enableval" != "yes" ; then
15414     cf_enable_panel=no
15415         else
15416                 cf_enable_panel=$cf_default_panel
15417         fi
15418 else
15419   enableval=yes
15420         cf_enable_panel=$cf_default_panel
15421
15422 fi;
15423 echo "$as_me:15423: result: $cf_enable_panel" >&5
15424 echo "${ECHO_T}$cf_enable_panel" >&6
15425 if test $cf_enable_panel = yes
15426 then
15427
15428 cf_have_curses_lib=no
15429
15430 : ${NCURSES_CONFIG_PKG:=none}
15431 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15432         :
15433 elif test "x${PKG_CONFIG:=none}" != xnone; then
15434         echo "$as_me:15434: checking pkg-config for panel$cf_cv_libtype" >&5
15435 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
15436         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
15437                 echo "$as_me:15437: result: yes" >&5
15438 echo "${ECHO_T}yes" >&6
15439
15440                 echo "$as_me:15440: checking if the panel$cf_cv_libtype package files work" >&5
15441 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
15442
15443                 cf_save_CPPFLAGS="$CPPFLAGS"
15444                 cf_save_LIBS="$LIBS"
15445
15446 cf_fix_cppflags=no
15447 cf_new_cflags=
15448 cf_new_cppflags=
15449 cf_new_extra_cppflags=
15450
15451 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
15452 do
15453 case $cf_fix_cppflags in
15454 (no)
15455         case $cf_add_cflags in
15456         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15457                 case $cf_add_cflags in
15458                 (-D*)
15459                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15460
15461                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15462                                 && test -z "${cf_tst_cflags}" \
15463                                 && cf_fix_cppflags=yes
15464
15465                         if test $cf_fix_cppflags = yes ; then
15466
15467         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15468         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15469
15470                                 continue
15471                         elif test "${cf_tst_cflags}" = "\"'" ; then
15472
15473         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15474         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15475
15476                                 continue
15477                         fi
15478                         ;;
15479                 esac
15480                 case "$CPPFLAGS" in
15481                 (*$cf_add_cflags)
15482                         ;;
15483                 (*)
15484                         case $cf_add_cflags in
15485                         (-D*)
15486                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15487
15488 CPPFLAGS=`echo "$CPPFLAGS" | \
15489         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15490                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15491
15492                                 ;;
15493                         esac
15494
15495         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15496         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15497
15498                         ;;
15499                 esac
15500                 ;;
15501         (*)
15502
15503         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15504         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15505
15506                 ;;
15507         esac
15508         ;;
15509 (yes)
15510
15511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15513
15514         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15515
15516         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15517                 && test -z "${cf_tst_cflags}" \
15518                 && cf_fix_cppflags=no
15519         ;;
15520 esac
15521 done
15522
15523 if test -n "$cf_new_cflags" ; then
15524
15525         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15526         CFLAGS="${CFLAGS}$cf_new_cflags"
15527
15528 fi
15529
15530 if test -n "$cf_new_cppflags" ; then
15531
15532         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15533         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15534
15535 fi
15536
15537 if test -n "$cf_new_extra_cppflags" ; then
15538
15539         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15540         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15541
15542 fi
15543
15544 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
15545 # Filter out duplicates - this happens with badly-designed ".pc" files...
15546 for cf_add_1lib in $LIBS
15547 do
15548         for cf_add_2lib in $cf_add_libs
15549         do
15550                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15551                 then
15552                         cf_add_1lib=
15553                         break
15554                 fi
15555         done
15556         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15557 done
15558 LIBS="$cf_add_libs"
15559
15560                 cat >conftest.$ac_ext <<_ACEOF
15561 #line 15561 "configure"
15562 #include "confdefs.h"
15563 #include <panel.h>
15564 int
15565 main (void)
15566 {
15567 (void) new_panel ( 0 );
15568   ;
15569   return 0;
15570 }
15571 _ACEOF
15572 rm -f conftest.$ac_objext conftest$ac_exeext
15573 if { (eval echo "$as_me:15573: \"$ac_link\"") >&5
15574   (eval $ac_link) 2>&5
15575   ac_status=$?
15576   echo "$as_me:15576: \$? = $ac_status" >&5
15577   (exit $ac_status); } &&
15578          { ac_try='test -s conftest$ac_exeext'
15579   { (eval echo "$as_me:15579: \"$ac_try\"") >&5
15580   (eval $ac_try) 2>&5
15581   ac_status=$?
15582   echo "$as_me:15582: \$? = $ac_status" >&5
15583   (exit $ac_status); }; }; then
15584   if test "$cross_compiling" = yes; then
15585   cf_have_curses_lib=maybe
15586 else
15587   cat >conftest.$ac_ext <<_ACEOF
15588 #line 15588 "configure"
15589 #include "confdefs.h"
15590 #include <panel.h>
15591                                 int main(void)
15592                                 { (void) new_panel ( 0 ); return 0; }
15593 _ACEOF
15594 rm -f conftest$ac_exeext
15595 if { (eval echo "$as_me:15595: \"$ac_link\"") >&5
15596   (eval $ac_link) 2>&5
15597   ac_status=$?
15598   echo "$as_me:15598: \$? = $ac_status" >&5
15599   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15600   { (eval echo "$as_me:15600: \"$ac_try\"") >&5
15601   (eval $ac_try) 2>&5
15602   ac_status=$?
15603   echo "$as_me:15603: \$? = $ac_status" >&5
15604   (exit $ac_status); }; }; then
15605   cf_have_curses_lib=yes
15606 else
15607   echo "$as_me: program exited with status $ac_status" >&5
15608 echo "$as_me: failed program was:" >&5
15609 cat conftest.$ac_ext >&5
15610 cf_have_curses_lib=no
15611 fi
15612 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15613 fi
15614 else
15615   echo "$as_me: failed program was:" >&5
15616 cat conftest.$ac_ext >&5
15617 cf_have_curses_lib=no
15618 fi
15619 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15620                 echo "$as_me:15620: result: $cf_have_curses_lib" >&5
15621 echo "${ECHO_T}$cf_have_curses_lib" >&6
15622                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15623                 if test "$cf_have_curses_lib" != "yes"
15624                 then
15625                         CPPFLAGS="$cf_save_CPPFLAGS"
15626                         LIBS="$cf_save_LIBS"
15627                 else
15628
15629 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15630
15631                         cat >>confdefs.h <<EOF
15632 #define $cf_upper 1
15633 EOF
15634
15635                 fi
15636         fi
15637 fi
15638 if test "$cf_have_curses_lib" = no; then
15639         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
15640 echo "$as_me:15640: checking for new_panel in -lpanel$cf_cv_libtype" >&5
15641 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
15642 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15643   echo $ECHO_N "(cached) $ECHO_C" >&6
15644 else
15645   ac_check_lib_save_LIBS=$LIBS
15646 LIBS="-lpanel$cf_cv_libtype  $LIBS"
15647 cat >conftest.$ac_ext <<_ACEOF
15648 #line 15648 "configure"
15649 #include "confdefs.h"
15650
15651 /* Override any gcc2 internal prototype to avoid an error.  */
15652 #ifdef __cplusplus
15653 extern "C"
15654 #endif
15655 /* We use char because int might match the return type of a gcc2
15656    builtin and then its argument prototype would still apply.  */
15657 char new_panel ();
15658 int
15659 main (void)
15660 {
15661 new_panel ();
15662   ;
15663   return 0;
15664 }
15665 _ACEOF
15666 rm -f conftest.$ac_objext conftest$ac_exeext
15667 if { (eval echo "$as_me:15667: \"$ac_link\"") >&5
15668   (eval $ac_link) 2>&5
15669   ac_status=$?
15670   echo "$as_me:15670: \$? = $ac_status" >&5
15671   (exit $ac_status); } &&
15672          { ac_try='test -s conftest$ac_exeext'
15673   { (eval echo "$as_me:15673: \"$ac_try\"") >&5
15674   (eval $ac_try) 2>&5
15675   ac_status=$?
15676   echo "$as_me:15676: \$? = $ac_status" >&5
15677   (exit $ac_status); }; }; then
15678   eval "$as_ac_Lib=yes"
15679 else
15680   echo "$as_me: failed program was:" >&5
15681 cat conftest.$ac_ext >&5
15682 eval "$as_ac_Lib=no"
15683 fi
15684 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15685 LIBS=$ac_check_lib_save_LIBS
15686 fi
15687 echo "$as_me:15687: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15688 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15689 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15690
15691 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15692
15693 cf_add_libs="-lpanel$cf_cv_libtype"
15694 # Filter out duplicates - this happens with badly-designed ".pc" files...
15695 for cf_add_1lib in $LIBS
15696 do
15697         for cf_add_2lib in $cf_add_libs
15698         do
15699                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15700                 then
15701                         cf_add_1lib=
15702                         break
15703                 fi
15704         done
15705         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15706 done
15707 LIBS="$cf_add_libs"
15708
15709                 cat >>confdefs.h <<EOF
15710 #define $cf_upper 1
15711 EOF
15712
15713 fi
15714
15715 fi
15716
15717         cf_curses_headers="$cf_curses_headers panel.h"
15718 fi
15719
15720 echo "$as_me:15720: checking if you want to check for menu functions" >&5
15721 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
15722
15723 # Check whether --enable-menu or --disable-menu was given.
15724 if test "${enable_menu+set}" = set; then
15725   enableval="$enable_menu"
15726   test "$enableval" != no && enableval=yes
15727         if test "$enableval" != "yes" ; then
15728     cf_enable_menu=no
15729         else
15730                 cf_enable_menu=$cf_default_menu
15731         fi
15732 else
15733   enableval=yes
15734         cf_enable_menu=$cf_default_menu
15735
15736 fi;
15737 echo "$as_me:15737: result: $cf_enable_menu" >&5
15738 echo "${ECHO_T}$cf_enable_menu" >&6
15739 if test $cf_enable_menu = yes
15740 then
15741         case $cf_cv_screen in
15742         (ncurses*)
15743                 ;;
15744         (curses*)
15745
15746 echo "$as_me:15746: checking for NetBSD menu.h" >&5
15747 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
15748 if test "${cf_cv_netbsd_menu_h+set}" = set; then
15749   echo $ECHO_N "(cached) $ECHO_C" >&6
15750 else
15751
15752 cat >conftest.$ac_ext <<_ACEOF
15753 #line 15753 "configure"
15754 #include "confdefs.h"
15755
15756 #include <${cf_cv_ncurses_header:-curses.h}>
15757 #include <menu.h>
15758
15759 int
15760 main (void)
15761 {
15762
15763         MENU *menu;
15764         int y = menu->max_item_width;
15765
15766   ;
15767   return 0;
15768 }
15769 _ACEOF
15770 rm -f conftest.$ac_objext
15771 if { (eval echo "$as_me:15771: \"$ac_compile\"") >&5
15772   (eval $ac_compile) 2>&5
15773   ac_status=$?
15774   echo "$as_me:15774: \$? = $ac_status" >&5
15775   (exit $ac_status); } &&
15776          { ac_try='test -s conftest.$ac_objext'
15777   { (eval echo "$as_me:15777: \"$ac_try\"") >&5
15778   (eval $ac_try) 2>&5
15779   ac_status=$?
15780   echo "$as_me:15780: \$? = $ac_status" >&5
15781   (exit $ac_status); }; }; then
15782   cf_cv_netbsd_menu_h=yes
15783
15784 else
15785   echo "$as_me: failed program was:" >&5
15786 cat conftest.$ac_ext >&5
15787 cf_cv_netbsd_menu_h=no
15788 fi
15789 rm -f conftest.$ac_objext conftest.$ac_ext
15790
15791 fi
15792 echo "$as_me:15792: result: $cf_cv_netbsd_menu_h" >&5
15793 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
15794
15795 test "$cf_cv_netbsd_menu_h" = yes &&
15796 cat >>confdefs.h <<\EOF
15797 #define HAVE_NETBSD_MENU_H 1
15798 EOF
15799
15800                 ;;
15801         esac
15802
15803 cf_have_curses_lib=no
15804
15805 : ${NCURSES_CONFIG_PKG:=none}
15806 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15807         :
15808 elif test "x${PKG_CONFIG:=none}" != xnone; then
15809         echo "$as_me:15809: checking pkg-config for menu$cf_cv_libtype" >&5
15810 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
15811         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
15812                 echo "$as_me:15812: result: yes" >&5
15813 echo "${ECHO_T}yes" >&6
15814
15815                 echo "$as_me:15815: checking if the menu$cf_cv_libtype package files work" >&5
15816 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
15817
15818                 cf_save_CPPFLAGS="$CPPFLAGS"
15819                 cf_save_LIBS="$LIBS"
15820
15821 cf_fix_cppflags=no
15822 cf_new_cflags=
15823 cf_new_cppflags=
15824 cf_new_extra_cppflags=
15825
15826 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
15827 do
15828 case $cf_fix_cppflags in
15829 (no)
15830         case $cf_add_cflags in
15831         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15832                 case $cf_add_cflags in
15833                 (-D*)
15834                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15835
15836                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15837                                 && test -z "${cf_tst_cflags}" \
15838                                 && cf_fix_cppflags=yes
15839
15840                         if test $cf_fix_cppflags = yes ; then
15841
15842         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15843         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15844
15845                                 continue
15846                         elif test "${cf_tst_cflags}" = "\"'" ; then
15847
15848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15850
15851                                 continue
15852                         fi
15853                         ;;
15854                 esac
15855                 case "$CPPFLAGS" in
15856                 (*$cf_add_cflags)
15857                         ;;
15858                 (*)
15859                         case $cf_add_cflags in
15860                         (-D*)
15861                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15862
15863 CPPFLAGS=`echo "$CPPFLAGS" | \
15864         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15865                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15866
15867                                 ;;
15868                         esac
15869
15870         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15871         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15872
15873                         ;;
15874                 esac
15875                 ;;
15876         (*)
15877
15878         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15879         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15880
15881                 ;;
15882         esac
15883         ;;
15884 (yes)
15885
15886         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15887         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15888
15889         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15890
15891         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15892                 && test -z "${cf_tst_cflags}" \
15893                 && cf_fix_cppflags=no
15894         ;;
15895 esac
15896 done
15897
15898 if test -n "$cf_new_cflags" ; then
15899
15900         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15901         CFLAGS="${CFLAGS}$cf_new_cflags"
15902
15903 fi
15904
15905 if test -n "$cf_new_cppflags" ; then
15906
15907         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15908         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15909
15910 fi
15911
15912 if test -n "$cf_new_extra_cppflags" ; then
15913
15914         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15915         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15916
15917 fi
15918
15919 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
15920 # Filter out duplicates - this happens with badly-designed ".pc" files...
15921 for cf_add_1lib in $LIBS
15922 do
15923         for cf_add_2lib in $cf_add_libs
15924         do
15925                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15926                 then
15927                         cf_add_1lib=
15928                         break
15929                 fi
15930         done
15931         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15932 done
15933 LIBS="$cf_add_libs"
15934
15935                 cat >conftest.$ac_ext <<_ACEOF
15936 #line 15936 "configure"
15937 #include "confdefs.h"
15938 #include <menu.h>
15939 int
15940 main (void)
15941 {
15942 (void) menu_driver ( 0,0 );
15943   ;
15944   return 0;
15945 }
15946 _ACEOF
15947 rm -f conftest.$ac_objext conftest$ac_exeext
15948 if { (eval echo "$as_me:15948: \"$ac_link\"") >&5
15949   (eval $ac_link) 2>&5
15950   ac_status=$?
15951   echo "$as_me:15951: \$? = $ac_status" >&5
15952   (exit $ac_status); } &&
15953          { ac_try='test -s conftest$ac_exeext'
15954   { (eval echo "$as_me:15954: \"$ac_try\"") >&5
15955   (eval $ac_try) 2>&5
15956   ac_status=$?
15957   echo "$as_me:15957: \$? = $ac_status" >&5
15958   (exit $ac_status); }; }; then
15959   if test "$cross_compiling" = yes; then
15960   cf_have_curses_lib=maybe
15961 else
15962   cat >conftest.$ac_ext <<_ACEOF
15963 #line 15963 "configure"
15964 #include "confdefs.h"
15965 #include <menu.h>
15966                                 int main(void)
15967                                 { (void) menu_driver ( 0,0 ); return 0; }
15968 _ACEOF
15969 rm -f conftest$ac_exeext
15970 if { (eval echo "$as_me:15970: \"$ac_link\"") >&5
15971   (eval $ac_link) 2>&5
15972   ac_status=$?
15973   echo "$as_me:15973: \$? = $ac_status" >&5
15974   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15975   { (eval echo "$as_me:15975: \"$ac_try\"") >&5
15976   (eval $ac_try) 2>&5
15977   ac_status=$?
15978   echo "$as_me:15978: \$? = $ac_status" >&5
15979   (exit $ac_status); }; }; then
15980   cf_have_curses_lib=yes
15981 else
15982   echo "$as_me: program exited with status $ac_status" >&5
15983 echo "$as_me: failed program was:" >&5
15984 cat conftest.$ac_ext >&5
15985 cf_have_curses_lib=no
15986 fi
15987 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15988 fi
15989 else
15990   echo "$as_me: failed program was:" >&5
15991 cat conftest.$ac_ext >&5
15992 cf_have_curses_lib=no
15993 fi
15994 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15995                 echo "$as_me:15995: result: $cf_have_curses_lib" >&5
15996 echo "${ECHO_T}$cf_have_curses_lib" >&6
15997                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15998                 if test "$cf_have_curses_lib" != "yes"
15999                 then
16000                         CPPFLAGS="$cf_save_CPPFLAGS"
16001                         LIBS="$cf_save_LIBS"
16002                 else
16003
16004 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16005
16006                         cat >>confdefs.h <<EOF
16007 #define $cf_upper 1
16008 EOF
16009
16010                 fi
16011         fi
16012 fi
16013 if test "$cf_have_curses_lib" = no; then
16014         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16015 echo "$as_me:16015: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
16016 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
16017 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16018   echo $ECHO_N "(cached) $ECHO_C" >&6
16019 else
16020   ac_check_lib_save_LIBS=$LIBS
16021 LIBS="-lmenu$cf_cv_libtype  $LIBS"
16022 cat >conftest.$ac_ext <<_ACEOF
16023 #line 16023 "configure"
16024 #include "confdefs.h"
16025
16026 /* Override any gcc2 internal prototype to avoid an error.  */
16027 #ifdef __cplusplus
16028 extern "C"
16029 #endif
16030 /* We use char because int might match the return type of a gcc2
16031    builtin and then its argument prototype would still apply.  */
16032 char menu_driver ();
16033 int
16034 main (void)
16035 {
16036 menu_driver ();
16037   ;
16038   return 0;
16039 }
16040 _ACEOF
16041 rm -f conftest.$ac_objext conftest$ac_exeext
16042 if { (eval echo "$as_me:16042: \"$ac_link\"") >&5
16043   (eval $ac_link) 2>&5
16044   ac_status=$?
16045   echo "$as_me:16045: \$? = $ac_status" >&5
16046   (exit $ac_status); } &&
16047          { ac_try='test -s conftest$ac_exeext'
16048   { (eval echo "$as_me:16048: \"$ac_try\"") >&5
16049   (eval $ac_try) 2>&5
16050   ac_status=$?
16051   echo "$as_me:16051: \$? = $ac_status" >&5
16052   (exit $ac_status); }; }; then
16053   eval "$as_ac_Lib=yes"
16054 else
16055   echo "$as_me: failed program was:" >&5
16056 cat conftest.$ac_ext >&5
16057 eval "$as_ac_Lib=no"
16058 fi
16059 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16060 LIBS=$ac_check_lib_save_LIBS
16061 fi
16062 echo "$as_me:16062: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16063 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16064 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16065
16066 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16067
16068 cf_add_libs="-lmenu$cf_cv_libtype"
16069 # Filter out duplicates - this happens with badly-designed ".pc" files...
16070 for cf_add_1lib in $LIBS
16071 do
16072         for cf_add_2lib in $cf_add_libs
16073         do
16074                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16075                 then
16076                         cf_add_1lib=
16077                         break
16078                 fi
16079         done
16080         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16081 done
16082 LIBS="$cf_add_libs"
16083
16084                 cat >>confdefs.h <<EOF
16085 #define $cf_upper 1
16086 EOF
16087
16088 fi
16089
16090 fi
16091
16092         cf_curses_headers="$cf_curses_headers menu.h"
16093 fi
16094
16095 echo "$as_me:16095: checking if you want to check for form functions" >&5
16096 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16097
16098 # Check whether --enable-form or --disable-form was given.
16099 if test "${enable_form+set}" = set; then
16100   enableval="$enable_form"
16101   test "$enableval" != no && enableval=yes
16102         if test "$enableval" != "yes" ; then
16103     cf_enable_form=no
16104         else
16105                 cf_enable_form=$cf_default_form
16106         fi
16107 else
16108   enableval=yes
16109         cf_enable_form=$cf_default_form
16110
16111 fi;
16112 echo "$as_me:16112: result: $cf_enable_form" >&5
16113 echo "${ECHO_T}$cf_enable_form" >&6
16114 if test $cf_enable_form = yes
16115 then
16116         case $cf_cv_screen in
16117         (ncurses*)
16118                 ;;
16119         (curses*)
16120
16121 echo "$as_me:16121: checking for NetBSD form.h" >&5
16122 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16123 if test "${cf_cv_netbsd_form_h+set}" = set; then
16124   echo $ECHO_N "(cached) $ECHO_C" >&6
16125 else
16126
16127 cat >conftest.$ac_ext <<_ACEOF
16128 #line 16128 "configure"
16129 #include "confdefs.h"
16130
16131 #include <${cf_cv_ncurses_header:-curses.h}>
16132 #include <form.h>
16133
16134 int
16135 main (void)
16136 {
16137
16138         FORM *form;
16139         int y = current_field(form)->cursor_ypos;
16140         int x = current_field(form)->cursor_xpos;
16141
16142   ;
16143   return 0;
16144 }
16145 _ACEOF
16146 rm -f conftest.$ac_objext
16147 if { (eval echo "$as_me:16147: \"$ac_compile\"") >&5
16148   (eval $ac_compile) 2>&5
16149   ac_status=$?
16150   echo "$as_me:16150: \$? = $ac_status" >&5
16151   (exit $ac_status); } &&
16152          { ac_try='test -s conftest.$ac_objext'
16153   { (eval echo "$as_me:16153: \"$ac_try\"") >&5
16154   (eval $ac_try) 2>&5
16155   ac_status=$?
16156   echo "$as_me:16156: \$? = $ac_status" >&5
16157   (exit $ac_status); }; }; then
16158   cf_cv_netbsd_form_h=yes
16159
16160 else
16161   echo "$as_me: failed program was:" >&5
16162 cat conftest.$ac_ext >&5
16163 cf_cv_netbsd_form_h=no
16164 fi
16165 rm -f conftest.$ac_objext conftest.$ac_ext
16166
16167 fi
16168 echo "$as_me:16168: result: $cf_cv_netbsd_form_h" >&5
16169 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16170
16171 test "$cf_cv_netbsd_form_h" = yes &&
16172 cat >>confdefs.h <<\EOF
16173 #define HAVE_NETBSD_FORM_H 1
16174 EOF
16175
16176                 ;;
16177         esac
16178
16179 cf_have_curses_lib=no
16180
16181 : ${NCURSES_CONFIG_PKG:=none}
16182 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16183         :
16184 elif test "x${PKG_CONFIG:=none}" != xnone; then
16185         echo "$as_me:16185: checking pkg-config for form$cf_cv_libtype" >&5
16186 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
16187         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
16188                 echo "$as_me:16188: result: yes" >&5
16189 echo "${ECHO_T}yes" >&6
16190
16191                 echo "$as_me:16191: checking if the form$cf_cv_libtype package files work" >&5
16192 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
16193
16194                 cf_save_CPPFLAGS="$CPPFLAGS"
16195                 cf_save_LIBS="$LIBS"
16196
16197 cf_fix_cppflags=no
16198 cf_new_cflags=
16199 cf_new_cppflags=
16200 cf_new_extra_cppflags=
16201
16202 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
16203 do
16204 case $cf_fix_cppflags in
16205 (no)
16206         case $cf_add_cflags in
16207         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16208                 case $cf_add_cflags in
16209                 (-D*)
16210                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16211
16212                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16213                                 && test -z "${cf_tst_cflags}" \
16214                                 && cf_fix_cppflags=yes
16215
16216                         if test $cf_fix_cppflags = yes ; then
16217
16218         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16219         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16220
16221                                 continue
16222                         elif test "${cf_tst_cflags}" = "\"'" ; then
16223
16224         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16225         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16226
16227                                 continue
16228                         fi
16229                         ;;
16230                 esac
16231                 case "$CPPFLAGS" in
16232                 (*$cf_add_cflags)
16233                         ;;
16234                 (*)
16235                         case $cf_add_cflags in
16236                         (-D*)
16237                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16238
16239 CPPFLAGS=`echo "$CPPFLAGS" | \
16240         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16241                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16242
16243                                 ;;
16244                         esac
16245
16246         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16247         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16248
16249                         ;;
16250                 esac
16251                 ;;
16252         (*)
16253
16254         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16255         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16256
16257                 ;;
16258         esac
16259         ;;
16260 (yes)
16261
16262         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16263         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16264
16265         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16266
16267         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16268                 && test -z "${cf_tst_cflags}" \
16269                 && cf_fix_cppflags=no
16270         ;;
16271 esac
16272 done
16273
16274 if test -n "$cf_new_cflags" ; then
16275
16276         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16277         CFLAGS="${CFLAGS}$cf_new_cflags"
16278
16279 fi
16280
16281 if test -n "$cf_new_cppflags" ; then
16282
16283         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16284         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16285
16286 fi
16287
16288 if test -n "$cf_new_extra_cppflags" ; then
16289
16290         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16291         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16292
16293 fi
16294
16295 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
16296 # Filter out duplicates - this happens with badly-designed ".pc" files...
16297 for cf_add_1lib in $LIBS
16298 do
16299         for cf_add_2lib in $cf_add_libs
16300         do
16301                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16302                 then
16303                         cf_add_1lib=
16304                         break
16305                 fi
16306         done
16307         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16308 done
16309 LIBS="$cf_add_libs"
16310
16311                 cat >conftest.$ac_ext <<_ACEOF
16312 #line 16312 "configure"
16313 #include "confdefs.h"
16314 #include <form.h>
16315 int
16316 main (void)
16317 {
16318 (void) form_driver ( 0,0 );
16319   ;
16320   return 0;
16321 }
16322 _ACEOF
16323 rm -f conftest.$ac_objext conftest$ac_exeext
16324 if { (eval echo "$as_me:16324: \"$ac_link\"") >&5
16325   (eval $ac_link) 2>&5
16326   ac_status=$?
16327   echo "$as_me:16327: \$? = $ac_status" >&5
16328   (exit $ac_status); } &&
16329          { ac_try='test -s conftest$ac_exeext'
16330   { (eval echo "$as_me:16330: \"$ac_try\"") >&5
16331   (eval $ac_try) 2>&5
16332   ac_status=$?
16333   echo "$as_me:16333: \$? = $ac_status" >&5
16334   (exit $ac_status); }; }; then
16335   if test "$cross_compiling" = yes; then
16336   cf_have_curses_lib=maybe
16337 else
16338   cat >conftest.$ac_ext <<_ACEOF
16339 #line 16339 "configure"
16340 #include "confdefs.h"
16341 #include <form.h>
16342                                 int main(void)
16343                                 { (void) form_driver ( 0,0 ); return 0; }
16344 _ACEOF
16345 rm -f conftest$ac_exeext
16346 if { (eval echo "$as_me:16346: \"$ac_link\"") >&5
16347   (eval $ac_link) 2>&5
16348   ac_status=$?
16349   echo "$as_me:16349: \$? = $ac_status" >&5
16350   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16351   { (eval echo "$as_me:16351: \"$ac_try\"") >&5
16352   (eval $ac_try) 2>&5
16353   ac_status=$?
16354   echo "$as_me:16354: \$? = $ac_status" >&5
16355   (exit $ac_status); }; }; then
16356   cf_have_curses_lib=yes
16357 else
16358   echo "$as_me: program exited with status $ac_status" >&5
16359 echo "$as_me: failed program was:" >&5
16360 cat conftest.$ac_ext >&5
16361 cf_have_curses_lib=no
16362 fi
16363 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16364 fi
16365 else
16366   echo "$as_me: failed program was:" >&5
16367 cat conftest.$ac_ext >&5
16368 cf_have_curses_lib=no
16369 fi
16370 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16371                 echo "$as_me:16371: result: $cf_have_curses_lib" >&5
16372 echo "${ECHO_T}$cf_have_curses_lib" >&6
16373                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16374                 if test "$cf_have_curses_lib" != "yes"
16375                 then
16376                         CPPFLAGS="$cf_save_CPPFLAGS"
16377                         LIBS="$cf_save_LIBS"
16378                 else
16379
16380 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16381
16382                         cat >>confdefs.h <<EOF
16383 #define $cf_upper 1
16384 EOF
16385
16386                 fi
16387         fi
16388 fi
16389 if test "$cf_have_curses_lib" = no; then
16390         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
16391 echo "$as_me:16391: checking for form_driver in -lform$cf_cv_libtype" >&5
16392 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
16393 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16394   echo $ECHO_N "(cached) $ECHO_C" >&6
16395 else
16396   ac_check_lib_save_LIBS=$LIBS
16397 LIBS="-lform$cf_cv_libtype  $LIBS"
16398 cat >conftest.$ac_ext <<_ACEOF
16399 #line 16399 "configure"
16400 #include "confdefs.h"
16401
16402 /* Override any gcc2 internal prototype to avoid an error.  */
16403 #ifdef __cplusplus
16404 extern "C"
16405 #endif
16406 /* We use char because int might match the return type of a gcc2
16407    builtin and then its argument prototype would still apply.  */
16408 char form_driver ();
16409 int
16410 main (void)
16411 {
16412 form_driver ();
16413   ;
16414   return 0;
16415 }
16416 _ACEOF
16417 rm -f conftest.$ac_objext conftest$ac_exeext
16418 if { (eval echo "$as_me:16418: \"$ac_link\"") >&5
16419   (eval $ac_link) 2>&5
16420   ac_status=$?
16421   echo "$as_me:16421: \$? = $ac_status" >&5
16422   (exit $ac_status); } &&
16423          { ac_try='test -s conftest$ac_exeext'
16424   { (eval echo "$as_me:16424: \"$ac_try\"") >&5
16425   (eval $ac_try) 2>&5
16426   ac_status=$?
16427   echo "$as_me:16427: \$? = $ac_status" >&5
16428   (exit $ac_status); }; }; then
16429   eval "$as_ac_Lib=yes"
16430 else
16431   echo "$as_me: failed program was:" >&5
16432 cat conftest.$ac_ext >&5
16433 eval "$as_ac_Lib=no"
16434 fi
16435 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16436 LIBS=$ac_check_lib_save_LIBS
16437 fi
16438 echo "$as_me:16438: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16439 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16440 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16441
16442 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16443
16444 cf_add_libs="-lform$cf_cv_libtype"
16445 # Filter out duplicates - this happens with badly-designed ".pc" files...
16446 for cf_add_1lib in $LIBS
16447 do
16448         for cf_add_2lib in $cf_add_libs
16449         do
16450                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16451                 then
16452                         cf_add_1lib=
16453                         break
16454                 fi
16455         done
16456         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16457 done
16458 LIBS="$cf_add_libs"
16459
16460                 cat >>confdefs.h <<EOF
16461 #define $cf_upper 1
16462 EOF
16463
16464 fi
16465
16466 fi
16467
16468         cf_curses_headers="$cf_curses_headers form.h"
16469 fi
16470
16471 # look for curses-related headers
16472
16473 for ac_header in $cf_curses_headers
16474 do
16475 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16476 echo "$as_me:16476: checking for $ac_header" >&5
16477 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16478 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16479   echo $ECHO_N "(cached) $ECHO_C" >&6
16480 else
16481   cat >conftest.$ac_ext <<_ACEOF
16482 #line 16482 "configure"
16483 #include "confdefs.h"
16484 #include <$ac_header>
16485 _ACEOF
16486 if { (eval echo "$as_me:16486: \"$ac_cpp conftest.$ac_ext\"") >&5
16487   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16488   ac_status=$?
16489   egrep -v '^ *\+' conftest.er1 >conftest.err
16490   rm -f conftest.er1
16491   cat conftest.err >&5
16492   echo "$as_me:16492: \$? = $ac_status" >&5
16493   (exit $ac_status); } >/dev/null; then
16494   if test -s conftest.err; then
16495     ac_cpp_err=$ac_c_preproc_warn_flag
16496   else
16497     ac_cpp_err=
16498   fi
16499 else
16500   ac_cpp_err=yes
16501 fi
16502 if test -z "$ac_cpp_err"; then
16503   eval "$as_ac_Header=yes"
16504 else
16505   echo "$as_me: failed program was:" >&5
16506   cat conftest.$ac_ext >&5
16507   eval "$as_ac_Header=no"
16508 fi
16509 rm -f conftest.err conftest.$ac_ext
16510 fi
16511 echo "$as_me:16511: result: `eval echo '${'$as_ac_Header'}'`" >&5
16512 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16513 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16514   cat >>confdefs.h <<EOF
16515 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16516 EOF
16517
16518 fi
16519 done
16520
16521 echo "$as_me:16521: checking for ANSI C header files" >&5
16522 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16523 if test "${ac_cv_header_stdc+set}" = set; then
16524   echo $ECHO_N "(cached) $ECHO_C" >&6
16525 else
16526   cat >conftest.$ac_ext <<_ACEOF
16527 #line 16527 "configure"
16528 #include "confdefs.h"
16529 #include <stdlib.h>
16530 #include <stdarg.h>
16531 #include <string.h>
16532 #include <float.h>
16533
16534 _ACEOF
16535 if { (eval echo "$as_me:16535: \"$ac_cpp conftest.$ac_ext\"") >&5
16536   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16537   ac_status=$?
16538   egrep -v '^ *\+' conftest.er1 >conftest.err
16539   rm -f conftest.er1
16540   cat conftest.err >&5
16541   echo "$as_me:16541: \$? = $ac_status" >&5
16542   (exit $ac_status); } >/dev/null; then
16543   if test -s conftest.err; then
16544     ac_cpp_err=$ac_c_preproc_warn_flag
16545   else
16546     ac_cpp_err=
16547   fi
16548 else
16549   ac_cpp_err=yes
16550 fi
16551 if test -z "$ac_cpp_err"; then
16552   ac_cv_header_stdc=yes
16553 else
16554   echo "$as_me: failed program was:" >&5
16555   cat conftest.$ac_ext >&5
16556   ac_cv_header_stdc=no
16557 fi
16558 rm -f conftest.err conftest.$ac_ext
16559
16560 if test $ac_cv_header_stdc = yes; then
16561   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16562   cat >conftest.$ac_ext <<_ACEOF
16563 #line 16563 "configure"
16564 #include "confdefs.h"
16565 #include <string.h>
16566
16567 _ACEOF
16568 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16569   egrep "memchr" >/dev/null 2>&1; then
16570   :
16571 else
16572   ac_cv_header_stdc=no
16573 fi
16574 rm -rf conftest*
16575
16576 fi
16577
16578 if test $ac_cv_header_stdc = yes; then
16579   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16580   cat >conftest.$ac_ext <<_ACEOF
16581 #line 16581 "configure"
16582 #include "confdefs.h"
16583 #include <stdlib.h>
16584
16585 _ACEOF
16586 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16587   egrep "free" >/dev/null 2>&1; then
16588   :
16589 else
16590   ac_cv_header_stdc=no
16591 fi
16592 rm -rf conftest*
16593
16594 fi
16595
16596 if test $ac_cv_header_stdc = yes; then
16597   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16598   if test "$cross_compiling" = yes; then
16599   :
16600 else
16601   cat >conftest.$ac_ext <<_ACEOF
16602 #line 16602 "configure"
16603 #include "confdefs.h"
16604 #include <ctype.h>
16605 #if ((' ' & 0x0FF) == 0x020)
16606 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16607 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16608 #else
16609 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16610                      || ('j' <= (c) && (c) <= 'r') \
16611                      || ('s' <= (c) && (c) <= 'z'))
16612 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16613 #endif
16614
16615 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16616 int
16617 main (void)
16618 {
16619   int i;
16620   for (i = 0; i < 256; i++)
16621     if (XOR (islower (i), ISLOWER (i))
16622         || toupper (i) != TOUPPER (i))
16623       $ac_main_return(2);
16624   $ac_main_return (0);
16625 }
16626 _ACEOF
16627 rm -f conftest$ac_exeext
16628 if { (eval echo "$as_me:16628: \"$ac_link\"") >&5
16629   (eval $ac_link) 2>&5
16630   ac_status=$?
16631   echo "$as_me:16631: \$? = $ac_status" >&5
16632   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16633   { (eval echo "$as_me:16633: \"$ac_try\"") >&5
16634   (eval $ac_try) 2>&5
16635   ac_status=$?
16636   echo "$as_me:16636: \$? = $ac_status" >&5
16637   (exit $ac_status); }; }; then
16638   :
16639 else
16640   echo "$as_me: program exited with status $ac_status" >&5
16641 echo "$as_me: failed program was:" >&5
16642 cat conftest.$ac_ext >&5
16643 ac_cv_header_stdc=no
16644 fi
16645 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16646 fi
16647 fi
16648 fi
16649 echo "$as_me:16649: result: $ac_cv_header_stdc" >&5
16650 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16651 if test $ac_cv_header_stdc = yes; then
16652
16653 cat >>confdefs.h <<\EOF
16654 #define STDC_HEADERS 1
16655 EOF
16656
16657 fi
16658
16659 echo "$as_me:16659: checking whether time.h and sys/time.h may both be included" >&5
16660 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16661 if test "${ac_cv_header_time+set}" = set; then
16662   echo $ECHO_N "(cached) $ECHO_C" >&6
16663 else
16664   cat >conftest.$ac_ext <<_ACEOF
16665 #line 16665 "configure"
16666 #include "confdefs.h"
16667 #include <sys/types.h>
16668 #include <sys/time.h>
16669 #include <time.h>
16670
16671 int
16672 main (void)
16673 {
16674 if ((struct tm *) 0)
16675 return 0;
16676   ;
16677   return 0;
16678 }
16679 _ACEOF
16680 rm -f conftest.$ac_objext
16681 if { (eval echo "$as_me:16681: \"$ac_compile\"") >&5
16682   (eval $ac_compile) 2>&5
16683   ac_status=$?
16684   echo "$as_me:16684: \$? = $ac_status" >&5
16685   (exit $ac_status); } &&
16686          { ac_try='test -s conftest.$ac_objext'
16687   { (eval echo "$as_me:16687: \"$ac_try\"") >&5
16688   (eval $ac_try) 2>&5
16689   ac_status=$?
16690   echo "$as_me:16690: \$? = $ac_status" >&5
16691   (exit $ac_status); }; }; then
16692   ac_cv_header_time=yes
16693 else
16694   echo "$as_me: failed program was:" >&5
16695 cat conftest.$ac_ext >&5
16696 ac_cv_header_time=no
16697 fi
16698 rm -f conftest.$ac_objext conftest.$ac_ext
16699 fi
16700 echo "$as_me:16700: result: $ac_cv_header_time" >&5
16701 echo "${ECHO_T}$ac_cv_header_time" >&6
16702 if test $ac_cv_header_time = yes; then
16703
16704 cat >>confdefs.h <<\EOF
16705 #define TIME_WITH_SYS_TIME 1
16706 EOF
16707
16708 fi
16709
16710 for ac_header in \
16711 getopt.h \
16712 locale.h \
16713 math.h \
16714 stdarg.h \
16715 stdint.h \
16716 sys/ioctl.h \
16717 sys/select.h \
16718 sys/time.h \
16719 termios.h \
16720 unistd.h \
16721
16722 do
16723 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16724 echo "$as_me:16724: checking for $ac_header" >&5
16725 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16726 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16727   echo $ECHO_N "(cached) $ECHO_C" >&6
16728 else
16729   cat >conftest.$ac_ext <<_ACEOF
16730 #line 16730 "configure"
16731 #include "confdefs.h"
16732 #include <$ac_header>
16733 _ACEOF
16734 if { (eval echo "$as_me:16734: \"$ac_cpp conftest.$ac_ext\"") >&5
16735   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16736   ac_status=$?
16737   egrep -v '^ *\+' conftest.er1 >conftest.err
16738   rm -f conftest.er1
16739   cat conftest.err >&5
16740   echo "$as_me:16740: \$? = $ac_status" >&5
16741   (exit $ac_status); } >/dev/null; then
16742   if test -s conftest.err; then
16743     ac_cpp_err=$ac_c_preproc_warn_flag
16744   else
16745     ac_cpp_err=
16746   fi
16747 else
16748   ac_cpp_err=yes
16749 fi
16750 if test -z "$ac_cpp_err"; then
16751   eval "$as_ac_Header=yes"
16752 else
16753   echo "$as_me: failed program was:" >&5
16754   cat conftest.$ac_ext >&5
16755   eval "$as_ac_Header=no"
16756 fi
16757 rm -f conftest.err conftest.$ac_ext
16758 fi
16759 echo "$as_me:16759: result: `eval echo '${'$as_ac_Header'}'`" >&5
16760 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16761 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16762   cat >>confdefs.h <<EOF
16763 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16764 EOF
16765
16766 fi
16767 done
16768
16769 for ac_header in unistd.h getopt.h
16770 do
16771 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16772 echo "$as_me:16772: checking for $ac_header" >&5
16773 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16774 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16775   echo $ECHO_N "(cached) $ECHO_C" >&6
16776 else
16777   cat >conftest.$ac_ext <<_ACEOF
16778 #line 16778 "configure"
16779 #include "confdefs.h"
16780 #include <$ac_header>
16781 _ACEOF
16782 if { (eval echo "$as_me:16782: \"$ac_cpp conftest.$ac_ext\"") >&5
16783   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16784   ac_status=$?
16785   egrep -v '^ *\+' conftest.er1 >conftest.err
16786   rm -f conftest.er1
16787   cat conftest.err >&5
16788   echo "$as_me:16788: \$? = $ac_status" >&5
16789   (exit $ac_status); } >/dev/null; then
16790   if test -s conftest.err; then
16791     ac_cpp_err=$ac_c_preproc_warn_flag
16792   else
16793     ac_cpp_err=
16794   fi
16795 else
16796   ac_cpp_err=yes
16797 fi
16798 if test -z "$ac_cpp_err"; then
16799   eval "$as_ac_Header=yes"
16800 else
16801   echo "$as_me: failed program was:" >&5
16802   cat conftest.$ac_ext >&5
16803   eval "$as_ac_Header=no"
16804 fi
16805 rm -f conftest.err conftest.$ac_ext
16806 fi
16807 echo "$as_me:16807: result: `eval echo '${'$as_ac_Header'}'`" >&5
16808 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16809 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16810   cat >>confdefs.h <<EOF
16811 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16812 EOF
16813
16814 fi
16815 done
16816
16817 echo "$as_me:16817: checking for header declaring getopt variables" >&5
16818 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
16819 if test "${cf_cv_getopt_header+set}" = set; then
16820   echo $ECHO_N "(cached) $ECHO_C" >&6
16821 else
16822
16823 cf_cv_getopt_header=none
16824 for cf_header in stdio.h stdlib.h unistd.h getopt.h
16825 do
16826 cat >conftest.$ac_ext <<_ACEOF
16827 #line 16827 "configure"
16828 #include "confdefs.h"
16829
16830 #include <$cf_header>
16831 int
16832 main (void)
16833 {
16834 int x = optind; char *y = optarg
16835   ;
16836   return 0;
16837 }
16838 _ACEOF
16839 rm -f conftest.$ac_objext
16840 if { (eval echo "$as_me:16840: \"$ac_compile\"") >&5
16841   (eval $ac_compile) 2>&5
16842   ac_status=$?
16843   echo "$as_me:16843: \$? = $ac_status" >&5
16844   (exit $ac_status); } &&
16845          { ac_try='test -s conftest.$ac_objext'
16846   { (eval echo "$as_me:16846: \"$ac_try\"") >&5
16847   (eval $ac_try) 2>&5
16848   ac_status=$?
16849   echo "$as_me:16849: \$? = $ac_status" >&5
16850   (exit $ac_status); }; }; then
16851   cf_cv_getopt_header=$cf_header
16852  break
16853 else
16854   echo "$as_me: failed program was:" >&5
16855 cat conftest.$ac_ext >&5
16856 fi
16857 rm -f conftest.$ac_objext conftest.$ac_ext
16858 done
16859
16860 fi
16861 echo "$as_me:16861: result: $cf_cv_getopt_header" >&5
16862 echo "${ECHO_T}$cf_cv_getopt_header" >&6
16863 if test $cf_cv_getopt_header != none ; then
16864
16865 cat >>confdefs.h <<\EOF
16866 #define HAVE_GETOPT_HEADER 1
16867 EOF
16868
16869 fi
16870 if test $cf_cv_getopt_header = getopt.h ; then
16871
16872 cat >>confdefs.h <<\EOF
16873 #define NEED_GETOPT_H 1
16874 EOF
16875
16876 fi
16877
16878 for ac_func in \
16879 getopt \
16880 gettimeofday \
16881 tdestroy \
16882 tsearch \
16883
16884 do
16885 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16886 echo "$as_me:16886: checking for $ac_func" >&5
16887 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
16888 if eval "test \"\${$as_ac_var+set}\" = set"; then
16889   echo $ECHO_N "(cached) $ECHO_C" >&6
16890 else
16891   cat >conftest.$ac_ext <<_ACEOF
16892 #line 16892 "configure"
16893 #include "confdefs.h"
16894 /* System header to define __stub macros and hopefully few prototypes,
16895     which can conflict with char $ac_func (); below.  */
16896 #include <assert.h>
16897 /* Override any gcc2 internal prototype to avoid an error.  */
16898 #ifdef __cplusplus
16899 extern "C"
16900 #endif
16901 /* We use char because int might match the return type of a gcc2
16902    builtin and then its argument prototype would still apply.  */
16903 char $ac_func ();
16904 char (*f) ();
16905
16906 int
16907 main (void)
16908 {
16909 /* The GNU C library defines this for functions which it implements
16910     to always fail with ENOSYS.  Some functions are actually named
16911     something starting with __ and the normal name is an alias.  */
16912 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16913 choke me
16914 #else
16915 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
16916 #endif
16917
16918   ;
16919   return 0;
16920 }
16921 _ACEOF
16922 rm -f conftest.$ac_objext conftest$ac_exeext
16923 if { (eval echo "$as_me:16923: \"$ac_link\"") >&5
16924   (eval $ac_link) 2>&5
16925   ac_status=$?
16926   echo "$as_me:16926: \$? = $ac_status" >&5
16927   (exit $ac_status); } &&
16928          { ac_try='test -s conftest$ac_exeext'
16929   { (eval echo "$as_me:16929: \"$ac_try\"") >&5
16930   (eval $ac_try) 2>&5
16931   ac_status=$?
16932   echo "$as_me:16932: \$? = $ac_status" >&5
16933   (exit $ac_status); }; }; then
16934   eval "$as_ac_var=yes"
16935 else
16936   echo "$as_me: failed program was:" >&5
16937 cat conftest.$ac_ext >&5
16938 eval "$as_ac_var=no"
16939 fi
16940 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16941 fi
16942 echo "$as_me:16942: result: `eval echo '${'$as_ac_var'}'`" >&5
16943 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
16944 if test `eval echo '${'$as_ac_var'}'` = yes; then
16945   cat >>confdefs.h <<EOF
16946 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
16947 EOF
16948
16949 fi
16950 done
16951
16952 # use a compile-check to work with ncurses*-config and subdirectory includes
16953 echo "$as_me:16953: checking if we can use termcap.h" >&5
16954 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
16955 if test "${cf_cv_have_termcap_h+set}" = set; then
16956   echo $ECHO_N "(cached) $ECHO_C" >&6
16957 else
16958
16959         cat >conftest.$ac_ext <<_ACEOF
16960 #line 16960 "configure"
16961 #include "confdefs.h"
16962
16963 #include <curses.h>
16964 #include <termcap.h>
16965
16966 int
16967 main (void)
16968 {
16969 return 0;
16970   ;
16971   return 0;
16972 }
16973 _ACEOF
16974 rm -f conftest.$ac_objext
16975 if { (eval echo "$as_me:16975: \"$ac_compile\"") >&5
16976   (eval $ac_compile) 2>&5
16977   ac_status=$?
16978   echo "$as_me:16978: \$? = $ac_status" >&5
16979   (exit $ac_status); } &&
16980          { ac_try='test -s conftest.$ac_objext'
16981   { (eval echo "$as_me:16981: \"$ac_try\"") >&5
16982   (eval $ac_try) 2>&5
16983   ac_status=$?
16984   echo "$as_me:16984: \$? = $ac_status" >&5
16985   (exit $ac_status); }; }; then
16986   cf_cv_have_termcap_h=yes
16987 else
16988   echo "$as_me: failed program was:" >&5
16989 cat conftest.$ac_ext >&5
16990 cf_cv_have_termcap_h=no
16991 fi
16992 rm -f conftest.$ac_objext conftest.$ac_ext
16993 fi
16994 echo "$as_me:16994: result: $cf_cv_have_termcap_h" >&5
16995 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
16996 test "x$cf_cv_have_termcap_h" = xyes && cat >>confdefs.h <<\EOF
16997 #define HAVE_TERMCAP_H 1
16998 EOF
16999
17000 if test "x$ac_cv_func_getopt" = xno; then
17001         { { echo "$as_me:17001: error: getopt is required for building programs" >&5
17002 echo "$as_me: error: getopt is required for building programs" >&2;}
17003    { (exit 1); exit 1; }; }
17004 fi
17005
17006 if test "$cf_enable_widec" = yes; then
17007
17008 for ac_func in \
17009 mblen \
17010 mbrlen \
17011 mbrtowc \
17012 mbsrtowcs \
17013 mbstowcs \
17014 mbtowc \
17015 wcsrtombs \
17016 wcstombs \
17017
17018 do
17019 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17020 echo "$as_me:17020: checking for $ac_func" >&5
17021 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17022 if eval "test \"\${$as_ac_var+set}\" = set"; then
17023   echo $ECHO_N "(cached) $ECHO_C" >&6
17024 else
17025   cat >conftest.$ac_ext <<_ACEOF
17026 #line 17026 "configure"
17027 #include "confdefs.h"
17028 /* System header to define __stub macros and hopefully few prototypes,
17029     which can conflict with char $ac_func (); below.  */
17030 #include <assert.h>
17031 /* Override any gcc2 internal prototype to avoid an error.  */
17032 #ifdef __cplusplus
17033 extern "C"
17034 #endif
17035 /* We use char because int might match the return type of a gcc2
17036    builtin and then its argument prototype would still apply.  */
17037 char $ac_func ();
17038 char (*f) ();
17039
17040 int
17041 main (void)
17042 {
17043 /* The GNU C library defines this for functions which it implements
17044     to always fail with ENOSYS.  Some functions are actually named
17045     something starting with __ and the normal name is an alias.  */
17046 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17047 choke me
17048 #else
17049 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
17050 #endif
17051
17052   ;
17053   return 0;
17054 }
17055 _ACEOF
17056 rm -f conftest.$ac_objext conftest$ac_exeext
17057 if { (eval echo "$as_me:17057: \"$ac_link\"") >&5
17058   (eval $ac_link) 2>&5
17059   ac_status=$?
17060   echo "$as_me:17060: \$? = $ac_status" >&5
17061   (exit $ac_status); } &&
17062          { ac_try='test -s conftest$ac_exeext'
17063   { (eval echo "$as_me:17063: \"$ac_try\"") >&5
17064   (eval $ac_try) 2>&5
17065   ac_status=$?
17066   echo "$as_me:17066: \$? = $ac_status" >&5
17067   (exit $ac_status); }; }; then
17068   eval "$as_ac_var=yes"
17069 else
17070   echo "$as_me: failed program was:" >&5
17071 cat conftest.$ac_ext >&5
17072 eval "$as_ac_var=no"
17073 fi
17074 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17075 fi
17076 echo "$as_me:17076: result: `eval echo '${'$as_ac_var'}'`" >&5
17077 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17078 if test `eval echo '${'$as_ac_var'}'` = yes; then
17079   cat >>confdefs.h <<EOF
17080 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17081 EOF
17082
17083 fi
17084 done
17085
17086 fi
17087
17088 echo "$as_me:17088: checking definition to turn on extended curses functions" >&5
17089 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17090 if test "${cf_cv_need_xopen_extension+set}" = set; then
17091   echo $ECHO_N "(cached) $ECHO_C" >&6
17092 else
17093
17094 cf_cv_need_xopen_extension=unknown
17095 cat >conftest.$ac_ext <<_ACEOF
17096 #line 17096 "configure"
17097 #include "confdefs.h"
17098
17099 #include <stdlib.h>
17100 #include <${cf_cv_ncurses_header:-curses.h}>
17101 int
17102 main (void)
17103 {
17104
17105 #if defined(NCURSES_VERSION_PATCH)
17106 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17107         make an error
17108 #endif
17109 #endif
17110 #ifdef NCURSES_VERSION
17111         cchar_t check;
17112         int check2 = curs_set((int)sizeof(check));
17113 #endif
17114         long x = winnstr(stdscr, "", 0);
17115         int x1, y1;
17116         getbegyx(stdscr, y1, x1)
17117   ;
17118   return 0;
17119 }
17120 _ACEOF
17121 rm -f conftest.$ac_objext conftest$ac_exeext
17122 if { (eval echo "$as_me:17122: \"$ac_link\"") >&5
17123   (eval $ac_link) 2>&5
17124   ac_status=$?
17125   echo "$as_me:17125: \$? = $ac_status" >&5
17126   (exit $ac_status); } &&
17127          { ac_try='test -s conftest$ac_exeext'
17128   { (eval echo "$as_me:17128: \"$ac_try\"") >&5
17129   (eval $ac_try) 2>&5
17130   ac_status=$?
17131   echo "$as_me:17131: \$? = $ac_status" >&5
17132   (exit $ac_status); }; }; then
17133   cf_cv_need_xopen_extension=none
17134 else
17135   echo "$as_me: failed program was:" >&5
17136 cat conftest.$ac_ext >&5
17137
17138         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17139         do
17140                 cat >conftest.$ac_ext <<_ACEOF
17141 #line 17141 "configure"
17142 #include "confdefs.h"
17143
17144 #define $cf_try_xopen_extension 1
17145 #include <stdlib.h>
17146 #include <${cf_cv_ncurses_header:-curses.h}>
17147 int
17148 main (void)
17149 {
17150
17151 #ifdef NCURSES_VERSION
17152                 cchar_t check;
17153                 int check2 = curs_set((int)sizeof(check));
17154 #endif
17155                 long x = winnstr(stdscr, "", 0);
17156                 int x1, y1;
17157                 getbegyx(stdscr, y1, x1)
17158   ;
17159   return 0;
17160 }
17161 _ACEOF
17162 rm -f conftest.$ac_objext conftest$ac_exeext
17163 if { (eval echo "$as_me:17163: \"$ac_link\"") >&5
17164   (eval $ac_link) 2>&5
17165   ac_status=$?
17166   echo "$as_me:17166: \$? = $ac_status" >&5
17167   (exit $ac_status); } &&
17168          { ac_try='test -s conftest$ac_exeext'
17169   { (eval echo "$as_me:17169: \"$ac_try\"") >&5
17170   (eval $ac_try) 2>&5
17171   ac_status=$?
17172   echo "$as_me:17172: \$? = $ac_status" >&5
17173   (exit $ac_status); }; }; then
17174   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17175 else
17176   echo "$as_me: failed program was:" >&5
17177 cat conftest.$ac_ext >&5
17178 fi
17179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17180         done
17181
17182 fi
17183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17184
17185 fi
17186 echo "$as_me:17186: result: $cf_cv_need_xopen_extension" >&5
17187 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17188
17189 case $cf_cv_need_xopen_extension in
17190 (*_*)
17191
17192         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17193         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17194
17195         ;;
17196 esac
17197
17198 echo "$as_me:17198: checking for term.h" >&5
17199 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17200 if test "${cf_cv_term_header+set}" = set; then
17201   echo $ECHO_N "(cached) $ECHO_C" >&6
17202 else
17203
17204 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17205 # for <term.h> if we do not find the variant.
17206
17207 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17208
17209 case ${cf_cv_ncurses_header:-curses.h} in
17210 (*/*)
17211         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17212         cf_header_list="$cf_header_item $cf_header_list"
17213         ;;
17214 esac
17215
17216 for cf_header in $cf_header_list
17217 do
17218         cat >conftest.$ac_ext <<_ACEOF
17219 #line 17219 "configure"
17220 #include "confdefs.h"
17221
17222 #include <${cf_cv_ncurses_header:-curses.h}>
17223 #include <${cf_header}>
17224 int
17225 main (void)
17226 {
17227 WINDOW *x
17228   ;
17229   return 0;
17230 }
17231 _ACEOF
17232 rm -f conftest.$ac_objext
17233 if { (eval echo "$as_me:17233: \"$ac_compile\"") >&5
17234   (eval $ac_compile) 2>&5
17235   ac_status=$?
17236   echo "$as_me:17236: \$? = $ac_status" >&5
17237   (exit $ac_status); } &&
17238          { ac_try='test -s conftest.$ac_objext'
17239   { (eval echo "$as_me:17239: \"$ac_try\"") >&5
17240   (eval $ac_try) 2>&5
17241   ac_status=$?
17242   echo "$as_me:17242: \$? = $ac_status" >&5
17243   (exit $ac_status); }; }; then
17244   cf_cv_term_header=$cf_header
17245          break
17246 else
17247   echo "$as_me: failed program was:" >&5
17248 cat conftest.$ac_ext >&5
17249 cf_cv_term_header=no
17250 fi
17251 rm -f conftest.$ac_objext conftest.$ac_ext
17252 done
17253
17254 case $cf_cv_term_header in
17255 (no)
17256         # If curses is ncurses, some packagers still mess it up by trying to make
17257         # us use GNU termcap.  This handles the most common case.
17258         for cf_header in ncurses/term.h ncursesw/term.h
17259         do
17260                 cat >conftest.$ac_ext <<_ACEOF
17261 #line 17261 "configure"
17262 #include "confdefs.h"
17263
17264 #include <${cf_cv_ncurses_header:-curses.h}>
17265 #ifdef NCURSES_VERSION
17266 #include <${cf_header}>
17267 #else
17268 make an error
17269 #endif
17270 int
17271 main (void)
17272 {
17273 WINDOW *x
17274   ;
17275   return 0;
17276 }
17277 _ACEOF
17278 rm -f conftest.$ac_objext
17279 if { (eval echo "$as_me:17279: \"$ac_compile\"") >&5
17280   (eval $ac_compile) 2>&5
17281   ac_status=$?
17282   echo "$as_me:17282: \$? = $ac_status" >&5
17283   (exit $ac_status); } &&
17284          { ac_try='test -s conftest.$ac_objext'
17285   { (eval echo "$as_me:17285: \"$ac_try\"") >&5
17286   (eval $ac_try) 2>&5
17287   ac_status=$?
17288   echo "$as_me:17288: \$? = $ac_status" >&5
17289   (exit $ac_status); }; }; then
17290   cf_cv_term_header=$cf_header
17291                          break
17292 else
17293   echo "$as_me: failed program was:" >&5
17294 cat conftest.$ac_ext >&5
17295 cf_cv_term_header=no
17296 fi
17297 rm -f conftest.$ac_objext conftest.$ac_ext
17298         done
17299         ;;
17300 esac
17301
17302 fi
17303 echo "$as_me:17303: result: $cf_cv_term_header" >&5
17304 echo "${ECHO_T}$cf_cv_term_header" >&6
17305
17306 case $cf_cv_term_header in
17307 (term.h)
17308
17309 cat >>confdefs.h <<\EOF
17310 #define HAVE_TERM_H 1
17311 EOF
17312
17313         ;;
17314 (ncurses/term.h)
17315
17316 cat >>confdefs.h <<\EOF
17317 #define HAVE_NCURSES_TERM_H 1
17318 EOF
17319
17320         ;;
17321 (ncursesw/term.h)
17322
17323 cat >>confdefs.h <<\EOF
17324 #define HAVE_NCURSESW_TERM_H 1
17325 EOF
17326
17327         ;;
17328 esac
17329
17330 echo "$as_me:17330: checking for unctrl.h" >&5
17331 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
17332 if test "${cf_cv_unctrl_header+set}" = set; then
17333   echo $ECHO_N "(cached) $ECHO_C" >&6
17334 else
17335
17336 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
17337 # for <unctrl.h> if we do not find the variant.
17338
17339 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
17340
17341 case ${cf_cv_ncurses_header:-curses.h} in
17342 (*/*)
17343         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
17344         cf_header_list="$cf_header_item $cf_header_list"
17345         ;;
17346 esac
17347
17348 for cf_header in $cf_header_list
17349 do
17350         cat >conftest.$ac_ext <<_ACEOF
17351 #line 17351 "configure"
17352 #include "confdefs.h"
17353
17354 #include <${cf_cv_ncurses_header:-curses.h}>
17355 #include <${cf_header}>
17356 int
17357 main (void)
17358 {
17359 WINDOW *x
17360   ;
17361   return 0;
17362 }
17363 _ACEOF
17364 rm -f conftest.$ac_objext
17365 if { (eval echo "$as_me:17365: \"$ac_compile\"") >&5
17366   (eval $ac_compile) 2>&5
17367   ac_status=$?
17368   echo "$as_me:17368: \$? = $ac_status" >&5
17369   (exit $ac_status); } &&
17370          { ac_try='test -s conftest.$ac_objext'
17371   { (eval echo "$as_me:17371: \"$ac_try\"") >&5
17372   (eval $ac_try) 2>&5
17373   ac_status=$?
17374   echo "$as_me:17374: \$? = $ac_status" >&5
17375   (exit $ac_status); }; }; then
17376   cf_cv_unctrl_header=$cf_header
17377          break
17378 else
17379   echo "$as_me: failed program was:" >&5
17380 cat conftest.$ac_ext >&5
17381 cf_cv_unctrl_header=no
17382 fi
17383 rm -f conftest.$ac_objext conftest.$ac_ext
17384 done
17385
17386 fi
17387 echo "$as_me:17387: result: $cf_cv_unctrl_header" >&5
17388 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
17389
17390 case $cf_cv_unctrl_header in
17391 (no)
17392         { echo "$as_me:17392: WARNING: unctrl.h header not found" >&5
17393 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
17394         ;;
17395 esac
17396
17397 case $cf_cv_unctrl_header in
17398 (unctrl.h)
17399
17400 cat >>confdefs.h <<\EOF
17401 #define HAVE_UNCTRL_H 1
17402 EOF
17403
17404         ;;
17405 (ncurses/unctrl.h)
17406
17407 cat >>confdefs.h <<\EOF
17408 #define HAVE_NCURSES_UNCTRL_H 1
17409 EOF
17410
17411         ;;
17412 (ncursesw/unctrl.h)
17413
17414 cat >>confdefs.h <<\EOF
17415 #define HAVE_NCURSESW_UNCTRL_H 1
17416 EOF
17417
17418         ;;
17419 esac
17420
17421 for cf_func in \
17422 alloc_pair \
17423 assume_default_colors \
17424 chgat \
17425 color_content \
17426 color_set \
17427 copywin \
17428 delscreen \
17429 dupwin \
17430 filter \
17431 getbegx \
17432 getcurx \
17433 getmaxx \
17434 getnstr \
17435 getparx \
17436 getwin \
17437 halfdelay \
17438 init_extended_color \
17439 mvderwin \
17440 mvvline \
17441 mvwin \
17442 mvwvline \
17443 napms \
17444 newpad \
17445 putwin \
17446 reset_color_pairs \
17447 resize_term \
17448 resizeterm \
17449 restartterm \
17450 ripoffline \
17451 scr_dump \
17452 setupterm \
17453 slk_color \
17454 slk_init \
17455 termattrs \
17456 tgetent \
17457 tigetnum \
17458 tigetstr \
17459 tputs_sp \
17460 typeahead \
17461 use_default_colors \
17462 use_env \
17463 use_extended_names \
17464 use_screen \
17465 use_window \
17466 vid_puts \
17467 vidputs \
17468 vsscanf \
17469 vw_printw \
17470 wchgat \
17471 winsdelln \
17472 winsstr \
17473 wresize \
17474 wsyncdown \
17475 _tracef \
17476
17477 do
17478
17479 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17480
17481         echo "$as_me:17481: checking for ${cf_func}" >&5
17482 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17483
17484 echo "${as_me:-configure}:17484: testing ${cf_func} ..." 1>&5
17485
17486         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17487   echo $ECHO_N "(cached) $ECHO_C" >&6
17488 else
17489
17490                 eval cf_result='$ac_cv_func_'$cf_func
17491                 if test ".$cf_result" != ".no"; then
17492                         cat >conftest.$ac_ext <<_ACEOF
17493 #line 17493 "configure"
17494 #include "confdefs.h"
17495
17496 #ifdef HAVE_XCURSES
17497 #include <xcurses.h>
17498 char * XCursesProgramName = "test";
17499 #else
17500 #include <${cf_cv_ncurses_header:-curses.h}>
17501 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17502 #include <ncursesw/term.h>
17503 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17504 #include <ncurses/term.h>
17505 #elif defined(HAVE_TERM_H)
17506 #include <term.h>
17507 #endif
17508 #endif
17509
17510 int
17511 main (void)
17512 {
17513
17514 #ifndef ${cf_func}
17515 long foo = (long)(&${cf_func});
17516 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17517 if (foo + 1234L > 5678L)
17518         ${cf_cv_main_return:-return}(foo != 0);
17519 #endif
17520
17521   ;
17522   return 0;
17523 }
17524 _ACEOF
17525 rm -f conftest.$ac_objext conftest$ac_exeext
17526 if { (eval echo "$as_me:17526: \"$ac_link\"") >&5
17527   (eval $ac_link) 2>&5
17528   ac_status=$?
17529   echo "$as_me:17529: \$? = $ac_status" >&5
17530   (exit $ac_status); } &&
17531          { ac_try='test -s conftest$ac_exeext'
17532   { (eval echo "$as_me:17532: \"$ac_try\"") >&5
17533   (eval $ac_try) 2>&5
17534   ac_status=$?
17535   echo "$as_me:17535: \$? = $ac_status" >&5
17536   (exit $ac_status); }; }; then
17537   cf_result=yes
17538 else
17539   echo "$as_me: failed program was:" >&5
17540 cat conftest.$ac_ext >&5
17541 cf_result=no
17542 fi
17543 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17544                 fi
17545                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17546
17547 fi
17548
17549         # use the computed/retrieved cache-value:
17550         eval 'cf_result=$cf_cv_func_'$cf_func
17551         echo "$as_me:17551: result: $cf_result" >&5
17552 echo "${ECHO_T}$cf_result" >&6
17553         if test $cf_result != no; then
17554                 cat >>confdefs.h <<EOF
17555 #define HAVE_${cf_tr_func} 1
17556 EOF
17557
17558         fi
17559 done
17560
17561 for cf_func in tputs
17562 do
17563
17564 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17565
17566         echo "$as_me:17566: checking for ${cf_func}" >&5
17567 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17568
17569 echo "${as_me:-configure}:17569: testing ${cf_func} ..." 1>&5
17570
17571         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17572   echo $ECHO_N "(cached) $ECHO_C" >&6
17573 else
17574
17575                 eval cf_result='$ac_cv_func_'$cf_func
17576                 if test ".$cf_result" != ".no"; then
17577                         cat >conftest.$ac_ext <<_ACEOF
17578 #line 17578 "configure"
17579 #include "confdefs.h"
17580
17581 #ifdef HAVE_XCURSES
17582 #include <xcurses.h>
17583 char * XCursesProgramName = "test";
17584 #else
17585 #include <${cf_cv_ncurses_header:-curses.h}>
17586 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17587 #include <ncursesw/term.h>
17588 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17589 #include <ncurses/term.h>
17590 #elif defined(HAVE_TERM_H)
17591 #include <term.h>
17592 #endif
17593 #endif
17594
17595 int
17596 main (void)
17597 {
17598
17599 #ifndef ${cf_func}
17600 long foo = (long)(&${cf_func});
17601 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17602 if (foo + 1234L > 5678L)
17603         ${cf_cv_main_return:-return}(foo != 0);
17604 #endif
17605
17606   ;
17607   return 0;
17608 }
17609 _ACEOF
17610 rm -f conftest.$ac_objext conftest$ac_exeext
17611 if { (eval echo "$as_me:17611: \"$ac_link\"") >&5
17612   (eval $ac_link) 2>&5
17613   ac_status=$?
17614   echo "$as_me:17614: \$? = $ac_status" >&5
17615   (exit $ac_status); } &&
17616          { ac_try='test -s conftest$ac_exeext'
17617   { (eval echo "$as_me:17617: \"$ac_try\"") >&5
17618   (eval $ac_try) 2>&5
17619   ac_status=$?
17620   echo "$as_me:17620: \$? = $ac_status" >&5
17621   (exit $ac_status); }; }; then
17622   cf_result=yes
17623 else
17624   echo "$as_me: failed program was:" >&5
17625 cat conftest.$ac_ext >&5
17626 cf_result=no
17627 fi
17628 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17629                 fi
17630                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17631
17632 fi
17633
17634         # use the computed/retrieved cache-value:
17635         eval 'cf_result=$cf_cv_func_'$cf_func
17636         echo "$as_me:17636: result: $cf_result" >&5
17637 echo "${ECHO_T}$cf_result" >&6
17638         if test $cf_result != no; then
17639                 cat >>confdefs.h <<EOF
17640 #define HAVE_${cf_tr_func} 1
17641 EOF
17642
17643         fi
17644 done
17645
17646 if test x$cf_cv_func_tputs = xyes
17647 then
17648         cf_done=no
17649         for cf_arg in int char
17650         do
17651                 for cf_ret in int void
17652                 do
17653                         if test $cf_ret = void
17654                         then
17655                                 cf_return="/* nothing */"
17656                         else
17657                                 cf_return="return value"
17658                         fi
17659                         cat >conftest.$ac_ext <<_ACEOF
17660 #line 17660 "configure"
17661 #include "confdefs.h"
17662
17663 #include <${cf_cv_ncurses_header:-curses.h}>
17664 #include <$cf_cv_term_header>
17665
17666 static $cf_ret outc($cf_arg value) { $cf_return; }
17667
17668 int
17669 main (void)
17670 {
17671
17672         tputs("hello", 0, outc);
17673         ${cf_cv_main_return:-return}(0);
17674
17675   ;
17676   return 0;
17677 }
17678 _ACEOF
17679 rm -f conftest.$ac_objext
17680 if { (eval echo "$as_me:17680: \"$ac_compile\"") >&5
17681   (eval $ac_compile) 2>&5
17682   ac_status=$?
17683   echo "$as_me:17683: \$? = $ac_status" >&5
17684   (exit $ac_status); } &&
17685          { ac_try='test -s conftest.$ac_objext'
17686   { (eval echo "$as_me:17686: \"$ac_try\"") >&5
17687   (eval $ac_try) 2>&5
17688   ac_status=$?
17689   echo "$as_me:17689: \$? = $ac_status" >&5
17690   (exit $ac_status); }; }; then
17691
17692                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
17693
17694 echo "${as_me:-configure}:17694: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
17695
17696                 cat >>confdefs.h <<EOF
17697 #define TPUTS_ARG               $cf_arg
17698 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
17699 #define TPUTS_RETURN(value)     $cf_return
17700 EOF
17701                 cf_done=yes
17702                 break
17703
17704 else
17705   echo "$as_me: failed program was:" >&5
17706 cat conftest.$ac_ext >&5
17707 fi
17708 rm -f conftest.$ac_objext conftest.$ac_ext
17709                 done
17710                 test $cf_done = yes && break
17711         done
17712 fi
17713
17714 echo "$as_me:17714: checking for ncurses extended functions" >&5
17715 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
17716 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
17717   echo $ECHO_N "(cached) $ECHO_C" >&6
17718 else
17719
17720 cat >conftest.$ac_ext <<_ACEOF
17721 #line 17721 "configure"
17722 #include "confdefs.h"
17723
17724 #include <${cf_cv_ncurses_header:-curses.h}>
17725 int
17726 main (void)
17727 {
17728
17729 int x = NCURSES_EXT_FUNCS
17730
17731   ;
17732   return 0;
17733 }
17734 _ACEOF
17735 rm -f conftest.$ac_objext
17736 if { (eval echo "$as_me:17736: \"$ac_compile\"") >&5
17737   (eval $ac_compile) 2>&5
17738   ac_status=$?
17739   echo "$as_me:17739: \$? = $ac_status" >&5
17740   (exit $ac_status); } &&
17741          { ac_try='test -s conftest.$ac_objext'
17742   { (eval echo "$as_me:17742: \"$ac_try\"") >&5
17743   (eval $ac_try) 2>&5
17744   ac_status=$?
17745   echo "$as_me:17745: \$? = $ac_status" >&5
17746   (exit $ac_status); }; }; then
17747   cf_cv_ncurses_ext_funcs=defined
17748 else
17749   echo "$as_me: failed program was:" >&5
17750 cat conftest.$ac_ext >&5
17751
17752 cat >conftest.$ac_ext <<_ACEOF
17753 #line 17753 "configure"
17754 #include "confdefs.h"
17755
17756 #include <${cf_cv_ncurses_header:-curses.h}>
17757 int
17758 main (void)
17759 {
17760
17761         (void) assume_default_colors (0, 0);
17762         (void) curses_version ();
17763         (void) define_key (0, 0);
17764         (void) is_term_resized (0, 0);
17765         (void) key_defined (0);
17766         (void) keybound (0, 0);
17767         (void) keyok (0, 0);
17768         (void) resize_term (0, 0);
17769         (void) resizeterm (0, 0);
17770         (void) use_default_colors ();
17771         (void) use_extended_names (0);
17772         (void) wresize (0, 0, 0);
17773   ;
17774   return 0;
17775 }
17776 _ACEOF
17777 rm -f conftest.$ac_objext conftest$ac_exeext
17778 if { (eval echo "$as_me:17778: \"$ac_link\"") >&5
17779   (eval $ac_link) 2>&5
17780   ac_status=$?
17781   echo "$as_me:17781: \$? = $ac_status" >&5
17782   (exit $ac_status); } &&
17783          { ac_try='test -s conftest$ac_exeext'
17784   { (eval echo "$as_me:17784: \"$ac_try\"") >&5
17785   (eval $ac_try) 2>&5
17786   ac_status=$?
17787   echo "$as_me:17787: \$? = $ac_status" >&5
17788   (exit $ac_status); }; }; then
17789   cf_cv_ncurses_ext_funcs=yes
17790 else
17791   echo "$as_me: failed program was:" >&5
17792 cat conftest.$ac_ext >&5
17793 cf_cv_ncurses_ext_funcs=no
17794 fi
17795 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17796
17797 fi
17798 rm -f conftest.$ac_objext conftest.$ac_ext
17799
17800 fi
17801 echo "$as_me:17801: result: $cf_cv_ncurses_ext_funcs" >&5
17802 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
17803 test "$cf_cv_ncurses_ext_funcs" = yes &&
17804 cat >>confdefs.h <<\EOF
17805 #define NCURSES_EXT_FUNCS 1
17806 EOF
17807
17808 if test "$cf_enable_widec" = yes
17809 then
17810         # workaround for systems with ncurses before 20111029, due to change of
17811         # feature test macro from _XPG5 to _XOPEN_SOURCE
17812         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
17813         then
17814                 cf_define_xpg5=no
17815                 echo "$as_me:17815: checking if _XPG5 should be defined to enable wide-characters" >&5
17816 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
17817
17818                 cat >conftest.$ac_ext <<_ACEOF
17819 #line 17819 "configure"
17820 #include "confdefs.h"
17821
17822 #include <${cf_cv_ncurses_header:-curses.h}>
17823 int
17824 main (void)
17825 {
17826 int x = _XPG5
17827   ;
17828   return 0;
17829 }
17830 _ACEOF
17831 rm -f conftest.$ac_objext
17832 if { (eval echo "$as_me:17832: \"$ac_compile\"") >&5
17833   (eval $ac_compile) 2>&5
17834   ac_status=$?
17835   echo "$as_me:17835: \$? = $ac_status" >&5
17836   (exit $ac_status); } &&
17837          { ac_try='test -s conftest.$ac_objext'
17838   { (eval echo "$as_me:17838: \"$ac_try\"") >&5
17839   (eval $ac_try) 2>&5
17840   ac_status=$?
17841   echo "$as_me:17841: \$? = $ac_status" >&5
17842   (exit $ac_status); }; }; then
17843   :
17844 else
17845   echo "$as_me: failed program was:" >&5
17846 cat conftest.$ac_ext >&5
17847 cf_save_cppflags="$CPPFLAGS"
17848                          CPPFLAGS="$CPPFLAGS -D_XPG5"
17849                          cat >conftest.$ac_ext <<_ACEOF
17850 #line 17850 "configure"
17851 #include "confdefs.h"
17852
17853 #include <${cf_cv_ncurses_header:-curses.h}>
17854 int
17855 main (void)
17856 {
17857 int x = _XPG5
17858   ;
17859   return 0;
17860 }
17861 _ACEOF
17862 rm -f conftest.$ac_objext
17863 if { (eval echo "$as_me:17863: \"$ac_compile\"") >&5
17864   (eval $ac_compile) 2>&5
17865   ac_status=$?
17866   echo "$as_me:17866: \$? = $ac_status" >&5
17867   (exit $ac_status); } &&
17868          { ac_try='test -s conftest.$ac_objext'
17869   { (eval echo "$as_me:17869: \"$ac_try\"") >&5
17870   (eval $ac_try) 2>&5
17871   ac_status=$?
17872   echo "$as_me:17872: \$? = $ac_status" >&5
17873   (exit $ac_status); }; }; then
17874   cf_define_xpg5=yes
17875 else
17876   echo "$as_me: failed program was:" >&5
17877 cat conftest.$ac_ext >&5
17878 fi
17879 rm -f conftest.$ac_objext conftest.$ac_ext
17880                          CPPFLAGS="$cf_save_cppflags"
17881 fi
17882 rm -f conftest.$ac_objext conftest.$ac_ext
17883                 echo "$as_me:17883: result: $cf_define_xpg5" >&5
17884 echo "${ECHO_T}$cf_define_xpg5" >&6
17885
17886                 if test "$cf_define_xpg5" = yes
17887                 then
17888                         CPPFLAGS="$CPPFLAGS -D_XPG5"
17889                 fi
17890         fi
17891
17892         echo "$as_me:17892: checking for wide-character functions" >&5
17893 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
17894 if test "${cf_cv_widechar_funcs+set}" = set; then
17895   echo $ECHO_N "(cached) $ECHO_C" >&6
17896 else
17897
17898         cat >conftest.$ac_ext <<_ACEOF
17899 #line 17899 "configure"
17900 #include "confdefs.h"
17901
17902 #include <${cf_cv_ncurses_header:-curses.h}>
17903 int
17904 main (void)
17905 {
17906
17907                 static wchar_t src_wchar[2];
17908                 static cchar_t dst_cchar;
17909                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
17910
17911   ;
17912   return 0;
17913 }
17914 _ACEOF
17915 rm -f conftest.$ac_objext conftest$ac_exeext
17916 if { (eval echo "$as_me:17916: \"$ac_link\"") >&5
17917   (eval $ac_link) 2>&5
17918   ac_status=$?
17919   echo "$as_me:17919: \$? = $ac_status" >&5
17920   (exit $ac_status); } &&
17921          { ac_try='test -s conftest$ac_exeext'
17922   { (eval echo "$as_me:17922: \"$ac_try\"") >&5
17923   (eval $ac_try) 2>&5
17924   ac_status=$?
17925   echo "$as_me:17925: \$? = $ac_status" >&5
17926   (exit $ac_status); }; }; then
17927   cf_cv_widechar_funcs=yes
17928 else
17929   echo "$as_me: failed program was:" >&5
17930 cat conftest.$ac_ext >&5
17931 cf_cv_widechar_funcs=no
17932 fi
17933 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17934
17935 fi
17936 echo "$as_me:17936: result: $cf_cv_widechar_funcs" >&5
17937 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
17938         if test "$cf_cv_widechar_funcs" != no ; then
17939
17940 cat >>confdefs.h <<\EOF
17941 #define USE_WIDEC_SUPPORT 1
17942 EOF
17943
17944         else
17945                 cat >>confdefs.h <<\EOF
17946 #define USE_WIDEC_SUPPORT 0
17947 EOF
17948
17949         fi
17950 else
17951         cat >>confdefs.h <<\EOF
17952 #define USE_WIDEC_SUPPORT 0
17953 EOF
17954
17955 fi
17956
17957 echo "$as_me:17957: checking if $cf_cv_screen library uses pthreads" >&5
17958 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
17959 if test "${cf_cv_use_pthreads+set}" = set; then
17960   echo $ECHO_N "(cached) $ECHO_C" >&6
17961 else
17962
17963 cat >conftest.$ac_ext <<_ACEOF
17964 #line 17964 "configure"
17965 #include "confdefs.h"
17966
17967 #include <${cf_cv_ncurses_header:-curses.h}>
17968 extern void _nc_init_pthreads(void);
17969
17970 int
17971 main (void)
17972 {
17973
17974         initscr();
17975         _nc_init_pthreads();
17976
17977   ;
17978   return 0;
17979 }
17980 _ACEOF
17981 rm -f conftest.$ac_objext conftest$ac_exeext
17982 if { (eval echo "$as_me:17982: \"$ac_link\"") >&5
17983   (eval $ac_link) 2>&5
17984   ac_status=$?
17985   echo "$as_me:17985: \$? = $ac_status" >&5
17986   (exit $ac_status); } &&
17987          { ac_try='test -s conftest$ac_exeext'
17988   { (eval echo "$as_me:17988: \"$ac_try\"") >&5
17989   (eval $ac_try) 2>&5
17990   ac_status=$?
17991   echo "$as_me:17991: \$? = $ac_status" >&5
17992   (exit $ac_status); }; }; then
17993   cf_cv_use_pthreads=yes
17994 else
17995   echo "$as_me: failed program was:" >&5
17996 cat conftest.$ac_ext >&5
17997 cf_cv_use_pthreads=no
17998 fi
17999 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18000
18001 fi
18002 echo "$as_me:18002: result: $cf_cv_use_pthreads" >&5
18003 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18004 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
18005 #define USE_PTHREADS 1
18006 EOF
18007
18008 echo "$as_me:18008: checking if sys/time.h works with sys/select.h" >&5
18009 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18010 if test "${cf_cv_sys_time_select+set}" = set; then
18011   echo $ECHO_N "(cached) $ECHO_C" >&6
18012 else
18013
18014 cat >conftest.$ac_ext <<_ACEOF
18015 #line 18015 "configure"
18016 #include "confdefs.h"
18017
18018 #include <sys/types.h>
18019 #ifdef HAVE_SYS_TIME_H
18020 #include <sys/time.h>
18021 #endif
18022 #ifdef HAVE_SYS_SELECT_H
18023 #include <sys/select.h>
18024 #endif
18025
18026 int
18027 main (void)
18028 {
18029
18030   ;
18031   return 0;
18032 }
18033 _ACEOF
18034 rm -f conftest.$ac_objext
18035 if { (eval echo "$as_me:18035: \"$ac_compile\"") >&5
18036   (eval $ac_compile) 2>&5
18037   ac_status=$?
18038   echo "$as_me:18038: \$? = $ac_status" >&5
18039   (exit $ac_status); } &&
18040          { ac_try='test -s conftest.$ac_objext'
18041   { (eval echo "$as_me:18041: \"$ac_try\"") >&5
18042   (eval $ac_try) 2>&5
18043   ac_status=$?
18044   echo "$as_me:18044: \$? = $ac_status" >&5
18045   (exit $ac_status); }; }; then
18046   cf_cv_sys_time_select=yes
18047 else
18048   echo "$as_me: failed program was:" >&5
18049 cat conftest.$ac_ext >&5
18050 cf_cv_sys_time_select=no
18051 fi
18052 rm -f conftest.$ac_objext conftest.$ac_ext
18053
18054 fi
18055
18056 echo "$as_me:18056: result: $cf_cv_sys_time_select" >&5
18057 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18058 test "$cf_cv_sys_time_select" = yes &&
18059 cat >>confdefs.h <<\EOF
18060 #define HAVE_SYS_TIME_SELECT 1
18061 EOF
18062
18063 # special check for test/ditto.c
18064
18065 echo "$as_me:18065: checking for openpty in -lutil" >&5
18066 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18067 if test "${ac_cv_lib_util_openpty+set}" = set; then
18068   echo $ECHO_N "(cached) $ECHO_C" >&6
18069 else
18070   ac_check_lib_save_LIBS=$LIBS
18071 LIBS="-lutil  $LIBS"
18072 cat >conftest.$ac_ext <<_ACEOF
18073 #line 18073 "configure"
18074 #include "confdefs.h"
18075
18076 /* Override any gcc2 internal prototype to avoid an error.  */
18077 #ifdef __cplusplus
18078 extern "C"
18079 #endif
18080 /* We use char because int might match the return type of a gcc2
18081    builtin and then its argument prototype would still apply.  */
18082 char openpty ();
18083 int
18084 main (void)
18085 {
18086 openpty ();
18087   ;
18088   return 0;
18089 }
18090 _ACEOF
18091 rm -f conftest.$ac_objext conftest$ac_exeext
18092 if { (eval echo "$as_me:18092: \"$ac_link\"") >&5
18093   (eval $ac_link) 2>&5
18094   ac_status=$?
18095   echo "$as_me:18095: \$? = $ac_status" >&5
18096   (exit $ac_status); } &&
18097          { ac_try='test -s conftest$ac_exeext'
18098   { (eval echo "$as_me:18098: \"$ac_try\"") >&5
18099   (eval $ac_try) 2>&5
18100   ac_status=$?
18101   echo "$as_me:18101: \$? = $ac_status" >&5
18102   (exit $ac_status); }; }; then
18103   ac_cv_lib_util_openpty=yes
18104 else
18105   echo "$as_me: failed program was:" >&5
18106 cat conftest.$ac_ext >&5
18107 ac_cv_lib_util_openpty=no
18108 fi
18109 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18110 LIBS=$ac_check_lib_save_LIBS
18111 fi
18112 echo "$as_me:18112: result: $ac_cv_lib_util_openpty" >&5
18113 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18114 if test $ac_cv_lib_util_openpty = yes; then
18115   cf_cv_lib_util=yes
18116 else
18117   cf_cv_lib_util=no
18118 fi
18119
18120 echo "$as_me:18120: checking for openpty header" >&5
18121 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18122 if test "${cf_cv_func_openpty+set}" = set; then
18123   echo $ECHO_N "(cached) $ECHO_C" >&6
18124 else
18125
18126         cf_save_LIBS="$LIBS"
18127         test $cf_cv_lib_util = yes && {
18128 cf_add_libs="-lutil"
18129 # Filter out duplicates - this happens with badly-designed ".pc" files...
18130 for cf_add_1lib in $LIBS
18131 do
18132         for cf_add_2lib in $cf_add_libs
18133         do
18134                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18135                 then
18136                         cf_add_1lib=
18137                         break
18138                 fi
18139         done
18140         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18141 done
18142 LIBS="$cf_add_libs"
18143  }
18144         for cf_header in pty.h libutil.h util.h
18145         do
18146         cat >conftest.$ac_ext <<_ACEOF
18147 #line 18147 "configure"
18148 #include "confdefs.h"
18149
18150 #include <$cf_header>
18151
18152 int
18153 main (void)
18154 {
18155
18156         int x = openpty((int *)0, (int *)0, (char *)0,
18157                                    (struct termios *)0, (struct winsize *)0);
18158
18159   ;
18160   return 0;
18161 }
18162 _ACEOF
18163 rm -f conftest.$ac_objext conftest$ac_exeext
18164 if { (eval echo "$as_me:18164: \"$ac_link\"") >&5
18165   (eval $ac_link) 2>&5
18166   ac_status=$?
18167   echo "$as_me:18167: \$? = $ac_status" >&5
18168   (exit $ac_status); } &&
18169          { ac_try='test -s conftest$ac_exeext'
18170   { (eval echo "$as_me:18170: \"$ac_try\"") >&5
18171   (eval $ac_try) 2>&5
18172   ac_status=$?
18173   echo "$as_me:18173: \$? = $ac_status" >&5
18174   (exit $ac_status); }; }; then
18175
18176                 cf_cv_func_openpty=$cf_header
18177                 break
18178
18179 else
18180   echo "$as_me: failed program was:" >&5
18181 cat conftest.$ac_ext >&5
18182
18183                 cf_cv_func_openpty=no
18184
18185 fi
18186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18187         done
18188         LIBS="$cf_save_LIBS"
18189
18190 fi
18191 echo "$as_me:18191: result: $cf_cv_func_openpty" >&5
18192 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18193
18194 if test "$cf_cv_func_openpty" != no ; then
18195
18196 cat >>confdefs.h <<EOF
18197 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18198 EOF
18199
18200 cat >>confdefs.h <<\EOF
18201 #define USE_XTERM_PTY 1
18202 EOF
18203
18204         if test "x$cf_cv_lib_util" = xyes ; then
18205
18206 cf_add_libs="-lutil"
18207 # Filter out duplicates - this happens with badly-designed ".pc" files...
18208 for cf_add_1lib in $TEST_LIBS
18209 do
18210         for cf_add_2lib in $cf_add_libs
18211         do
18212                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18213                 then
18214                         cf_add_1lib=
18215                         break
18216                 fi
18217         done
18218         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18219 done
18220 TEST_LIBS="$cf_add_libs"
18221
18222         fi
18223 fi
18224
18225 echo "$as_me:18225: checking for function curses_version" >&5
18226 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18227 if test "${cf_cv_func_curses_version+set}" = set; then
18228   echo $ECHO_N "(cached) $ECHO_C" >&6
18229 else
18230
18231 if test "$cross_compiling" = yes; then
18232   cf_cv_func_curses_version=unknown
18233 else
18234   cat >conftest.$ac_ext <<_ACEOF
18235 #line 18235 "configure"
18236 #include "confdefs.h"
18237
18238 #include <${cf_cv_ncurses_header:-curses.h}>
18239 int main(void)
18240 {
18241         char temp[1024];
18242         sprintf(temp, "%s\n", curses_version());
18243         ${cf_cv_main_return:-return}(0);
18244 }
18245
18246 _ACEOF
18247 rm -f conftest$ac_exeext
18248 if { (eval echo "$as_me:18248: \"$ac_link\"") >&5
18249   (eval $ac_link) 2>&5
18250   ac_status=$?
18251   echo "$as_me:18251: \$? = $ac_status" >&5
18252   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18253   { (eval echo "$as_me:18253: \"$ac_try\"") >&5
18254   (eval $ac_try) 2>&5
18255   ac_status=$?
18256   echo "$as_me:18256: \$? = $ac_status" >&5
18257   (exit $ac_status); }; }; then
18258   cf_cv_func_curses_version=yes
18259
18260 else
18261   echo "$as_me: program exited with status $ac_status" >&5
18262 echo "$as_me: failed program was:" >&5
18263 cat conftest.$ac_ext >&5
18264 cf_cv_func_curses_version=no
18265
18266 fi
18267 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18268 fi
18269 rm -f core
18270 fi
18271 echo "$as_me:18271: result: $cf_cv_func_curses_version" >&5
18272 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
18273 test "$cf_cv_func_curses_version" = yes &&
18274 cat >>confdefs.h <<\EOF
18275 #define HAVE_CURSES_VERSION 1
18276 EOF
18277
18278 echo "$as_me:18278: checking for alternate character set array" >&5
18279 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
18280 if test "${cf_cv_curses_acs_map+set}" = set; then
18281   echo $ECHO_N "(cached) $ECHO_C" >&6
18282 else
18283
18284 cf_cv_curses_acs_map=unknown
18285 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
18286 do
18287 cat >conftest.$ac_ext <<_ACEOF
18288 #line 18288 "configure"
18289 #include "confdefs.h"
18290
18291 #include <${cf_cv_ncurses_header:-curses.h}>
18292
18293 int
18294 main (void)
18295 {
18296
18297 $name['k'] = ACS_PLUS
18298
18299   ;
18300   return 0;
18301 }
18302 _ACEOF
18303 rm -f conftest.$ac_objext conftest$ac_exeext
18304 if { (eval echo "$as_me:18304: \"$ac_link\"") >&5
18305   (eval $ac_link) 2>&5
18306   ac_status=$?
18307   echo "$as_me:18307: \$? = $ac_status" >&5
18308   (exit $ac_status); } &&
18309          { ac_try='test -s conftest$ac_exeext'
18310   { (eval echo "$as_me:18310: \"$ac_try\"") >&5
18311   (eval $ac_try) 2>&5
18312   ac_status=$?
18313   echo "$as_me:18313: \$? = $ac_status" >&5
18314   (exit $ac_status); }; }; then
18315   cf_cv_curses_acs_map=$name; break
18316 else
18317   echo "$as_me: failed program was:" >&5
18318 cat conftest.$ac_ext >&5
18319 fi
18320 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18321 done
18322
18323 fi
18324 echo "$as_me:18324: result: $cf_cv_curses_acs_map" >&5
18325 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
18326
18327 test "$cf_cv_curses_acs_map" != unknown &&
18328 cat >>confdefs.h <<EOF
18329 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
18330 EOF
18331
18332 if test "$cf_enable_widec" = yes; then
18333
18334 echo "$as_me:18334: checking for wide alternate character set array" >&5
18335 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
18336 if test "${cf_cv_curses_wacs_map+set}" = set; then
18337   echo $ECHO_N "(cached) $ECHO_C" >&6
18338 else
18339
18340         cf_cv_curses_wacs_map=unknown
18341         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
18342         do
18343         cat >conftest.$ac_ext <<_ACEOF
18344 #line 18344 "configure"
18345 #include "confdefs.h"
18346
18347 #ifndef _XOPEN_SOURCE_EXTENDED
18348 #define _XOPEN_SOURCE_EXTENDED
18349 #endif
18350 #include <${cf_cv_ncurses_header:-curses.h}>
18351 int
18352 main (void)
18353 {
18354 void *foo = &($name['k'])
18355   ;
18356   return 0;
18357 }
18358 _ACEOF
18359 rm -f conftest.$ac_objext conftest$ac_exeext
18360 if { (eval echo "$as_me:18360: \"$ac_link\"") >&5
18361   (eval $ac_link) 2>&5
18362   ac_status=$?
18363   echo "$as_me:18363: \$? = $ac_status" >&5
18364   (exit $ac_status); } &&
18365          { ac_try='test -s conftest$ac_exeext'
18366   { (eval echo "$as_me:18366: \"$ac_try\"") >&5
18367   (eval $ac_try) 2>&5
18368   ac_status=$?
18369   echo "$as_me:18369: \$? = $ac_status" >&5
18370   (exit $ac_status); }; }; then
18371   cf_cv_curses_wacs_map=$name
18372          break
18373 else
18374   echo "$as_me: failed program was:" >&5
18375 cat conftest.$ac_ext >&5
18376 fi
18377 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18378         done
18379 fi
18380 echo "$as_me:18380: result: $cf_cv_curses_wacs_map" >&5
18381 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
18382
18383 test "$cf_cv_curses_wacs_map" != unknown &&
18384 cat >>confdefs.h <<EOF
18385 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
18386 EOF
18387
18388 echo "$as_me:18388: checking for wide alternate character constants" >&5
18389 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
18390 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
18391   echo $ECHO_N "(cached) $ECHO_C" >&6
18392 else
18393
18394 cf_cv_curses_wacs_symbols=no
18395 if test "$cf_cv_curses_wacs_map" != unknown
18396 then
18397         cat >conftest.$ac_ext <<_ACEOF
18398 #line 18398 "configure"
18399 #include "confdefs.h"
18400
18401 #ifndef _XOPEN_SOURCE_EXTENDED
18402 #define _XOPEN_SOURCE_EXTENDED
18403 #endif
18404 #include <${cf_cv_ncurses_header:-curses.h}>
18405 int
18406 main (void)
18407 {
18408 cchar_t *foo = WACS_PLUS;
18409          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
18410   ;
18411   return 0;
18412 }
18413 _ACEOF
18414 rm -f conftest.$ac_objext conftest$ac_exeext
18415 if { (eval echo "$as_me:18415: \"$ac_link\"") >&5
18416   (eval $ac_link) 2>&5
18417   ac_status=$?
18418   echo "$as_me:18418: \$? = $ac_status" >&5
18419   (exit $ac_status); } &&
18420          { ac_try='test -s conftest$ac_exeext'
18421   { (eval echo "$as_me:18421: \"$ac_try\"") >&5
18422   (eval $ac_try) 2>&5
18423   ac_status=$?
18424   echo "$as_me:18424: \$? = $ac_status" >&5
18425   (exit $ac_status); }; }; then
18426   cf_cv_curses_wacs_symbols=yes
18427 else
18428   echo "$as_me: failed program was:" >&5
18429 cat conftest.$ac_ext >&5
18430 fi
18431 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18432 else
18433         cat >conftest.$ac_ext <<_ACEOF
18434 #line 18434 "configure"
18435 #include "confdefs.h"
18436
18437 #ifndef _XOPEN_SOURCE_EXTENDED
18438 #define _XOPEN_SOURCE_EXTENDED
18439 #endif
18440 #include <${cf_cv_ncurses_header:-curses.h}>
18441 int
18442 main (void)
18443 {
18444 cchar_t *foo = WACS_PLUS
18445   ;
18446   return 0;
18447 }
18448 _ACEOF
18449 rm -f conftest.$ac_objext conftest$ac_exeext
18450 if { (eval echo "$as_me:18450: \"$ac_link\"") >&5
18451   (eval $ac_link) 2>&5
18452   ac_status=$?
18453   echo "$as_me:18453: \$? = $ac_status" >&5
18454   (exit $ac_status); } &&
18455          { ac_try='test -s conftest$ac_exeext'
18456   { (eval echo "$as_me:18456: \"$ac_try\"") >&5
18457   (eval $ac_try) 2>&5
18458   ac_status=$?
18459   echo "$as_me:18459: \$? = $ac_status" >&5
18460   (exit $ac_status); }; }; then
18461   cf_cv_curses_wacs_symbols=yes
18462 else
18463   echo "$as_me: failed program was:" >&5
18464 cat conftest.$ac_ext >&5
18465 fi
18466 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18467 fi
18468
18469 fi
18470 echo "$as_me:18470: result: $cf_cv_curses_wacs_symbols" >&5
18471 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
18472
18473 test "$cf_cv_curses_wacs_symbols" != no &&
18474 cat >>confdefs.h <<\EOF
18475 #define CURSES_WACS_SYMBOLS 1
18476 EOF
18477
18478 fi
18479
18480 echo "$as_me:18480: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18481 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18482 cat >conftest.$ac_ext <<_ACEOF
18483 #line 18483 "configure"
18484 #include "confdefs.h"
18485
18486 #ifndef _XOPEN_SOURCE_EXTENDED
18487 #define _XOPEN_SOURCE_EXTENDED
18488 #endif
18489 #include <${cf_cv_ncurses_header:-curses.h}>
18490 int
18491 main (void)
18492 {
18493
18494 attr_t foo
18495
18496   ;
18497   return 0;
18498 }
18499 _ACEOF
18500 rm -f conftest.$ac_objext
18501 if { (eval echo "$as_me:18501: \"$ac_compile\"") >&5
18502   (eval $ac_compile) 2>&5
18503   ac_status=$?
18504   echo "$as_me:18504: \$? = $ac_status" >&5
18505   (exit $ac_status); } &&
18506          { ac_try='test -s conftest.$ac_objext'
18507   { (eval echo "$as_me:18507: \"$ac_try\"") >&5
18508   (eval $ac_try) 2>&5
18509   ac_status=$?
18510   echo "$as_me:18510: \$? = $ac_status" >&5
18511   (exit $ac_status); }; }; then
18512   cf_result=yes
18513 else
18514   echo "$as_me: failed program was:" >&5
18515 cat conftest.$ac_ext >&5
18516 cf_result=no
18517 fi
18518 rm -f conftest.$ac_objext conftest.$ac_ext
18519 echo "$as_me:18519: result: $cf_result" >&5
18520 echo "${ECHO_T}$cf_result" >&6
18521 if test $cf_result = yes ; then
18522
18523 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18524
18525 cat >>confdefs.h <<EOF
18526 #define $cf_result 1
18527 EOF
18528
18529 else
18530
18531 cat >>confdefs.h <<EOF
18532 #define attr_t long
18533 EOF
18534
18535 fi
18536
18537 if test "$cf_enable_widec" = yes; then
18538
18539 # This is needed on Tru64 5.0 to declare mbstate_t
18540 echo "$as_me:18540: checking if we must include wchar.h to declare mbstate_t" >&5
18541 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
18542 if test "${cf_cv_mbstate_t+set}" = set; then
18543   echo $ECHO_N "(cached) $ECHO_C" >&6
18544 else
18545
18546 cat >conftest.$ac_ext <<_ACEOF
18547 #line 18547 "configure"
18548 #include "confdefs.h"
18549
18550 #include <stdlib.h>
18551 #include <stdarg.h>
18552 #include <stdio.h>
18553 #ifdef HAVE_LIBUTF8_H
18554 #include <libutf8.h>
18555 #endif
18556 int
18557 main (void)
18558 {
18559 mbstate_t state
18560   ;
18561   return 0;
18562 }
18563 _ACEOF
18564 rm -f conftest.$ac_objext
18565 if { (eval echo "$as_me:18565: \"$ac_compile\"") >&5
18566   (eval $ac_compile) 2>&5
18567   ac_status=$?
18568   echo "$as_me:18568: \$? = $ac_status" >&5
18569   (exit $ac_status); } &&
18570          { ac_try='test -s conftest.$ac_objext'
18571   { (eval echo "$as_me:18571: \"$ac_try\"") >&5
18572   (eval $ac_try) 2>&5
18573   ac_status=$?
18574   echo "$as_me:18574: \$? = $ac_status" >&5
18575   (exit $ac_status); }; }; then
18576   cf_cv_mbstate_t=no
18577 else
18578   echo "$as_me: failed program was:" >&5
18579 cat conftest.$ac_ext >&5
18580 cat >conftest.$ac_ext <<_ACEOF
18581 #line 18581 "configure"
18582 #include "confdefs.h"
18583
18584 #include <stdlib.h>
18585 #include <stdarg.h>
18586 #include <stdio.h>
18587 #include <wchar.h>
18588 #ifdef HAVE_LIBUTF8_H
18589 #include <libutf8.h>
18590 #endif
18591 int
18592 main (void)
18593 {
18594 mbstate_t value
18595   ;
18596   return 0;
18597 }
18598 _ACEOF
18599 rm -f conftest.$ac_objext
18600 if { (eval echo "$as_me:18600: \"$ac_compile\"") >&5
18601   (eval $ac_compile) 2>&5
18602   ac_status=$?
18603   echo "$as_me:18603: \$? = $ac_status" >&5
18604   (exit $ac_status); } &&
18605          { ac_try='test -s conftest.$ac_objext'
18606   { (eval echo "$as_me:18606: \"$ac_try\"") >&5
18607   (eval $ac_try) 2>&5
18608   ac_status=$?
18609   echo "$as_me:18609: \$? = $ac_status" >&5
18610   (exit $ac_status); }; }; then
18611   cf_cv_mbstate_t=yes
18612 else
18613   echo "$as_me: failed program was:" >&5
18614 cat conftest.$ac_ext >&5
18615 cf_cv_mbstate_t=unknown
18616 fi
18617 rm -f conftest.$ac_objext conftest.$ac_ext
18618 fi
18619 rm -f conftest.$ac_objext conftest.$ac_ext
18620 fi
18621 echo "$as_me:18621: result: $cf_cv_mbstate_t" >&5
18622 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
18623
18624 if test "$cf_cv_mbstate_t" = yes ; then
18625
18626 cat >>confdefs.h <<\EOF
18627 #define NEED_WCHAR_H 1
18628 EOF
18629
18630         NEED_WCHAR_H=1
18631 fi
18632
18633 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
18634 if test "$cf_cv_mbstate_t" = unknown ; then
18635         NCURSES_MBSTATE_T=1
18636 fi
18637
18638 # if we find mbstate_t in either place, use substitution to provide a fallback.
18639 if test "$cf_cv_mbstate_t" != unknown ; then
18640         NCURSES_OK_MBSTATE_T=1
18641 fi
18642
18643 # This is needed on Tru64 5.0 to declare wchar_t
18644 echo "$as_me:18644: checking if we must include wchar.h to declare wchar_t" >&5
18645 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
18646 if test "${cf_cv_wchar_t+set}" = set; then
18647   echo $ECHO_N "(cached) $ECHO_C" >&6
18648 else
18649
18650 cat >conftest.$ac_ext <<_ACEOF
18651 #line 18651 "configure"
18652 #include "confdefs.h"
18653
18654 #include <stdlib.h>
18655 #include <stdarg.h>
18656 #include <stdio.h>
18657 #ifdef HAVE_LIBUTF8_H
18658 #include <libutf8.h>
18659 #endif
18660 int
18661 main (void)
18662 {
18663 wchar_t state
18664   ;
18665   return 0;
18666 }
18667 _ACEOF
18668 rm -f conftest.$ac_objext
18669 if { (eval echo "$as_me:18669: \"$ac_compile\"") >&5
18670   (eval $ac_compile) 2>&5
18671   ac_status=$?
18672   echo "$as_me:18672: \$? = $ac_status" >&5
18673   (exit $ac_status); } &&
18674          { ac_try='test -s conftest.$ac_objext'
18675   { (eval echo "$as_me:18675: \"$ac_try\"") >&5
18676   (eval $ac_try) 2>&5
18677   ac_status=$?
18678   echo "$as_me:18678: \$? = $ac_status" >&5
18679   (exit $ac_status); }; }; then
18680   cf_cv_wchar_t=no
18681 else
18682   echo "$as_me: failed program was:" >&5
18683 cat conftest.$ac_ext >&5
18684 cat >conftest.$ac_ext <<_ACEOF
18685 #line 18685 "configure"
18686 #include "confdefs.h"
18687
18688 #include <stdlib.h>
18689 #include <stdarg.h>
18690 #include <stdio.h>
18691 #include <wchar.h>
18692 #ifdef HAVE_LIBUTF8_H
18693 #include <libutf8.h>
18694 #endif
18695 int
18696 main (void)
18697 {
18698 wchar_t value
18699   ;
18700   return 0;
18701 }
18702 _ACEOF
18703 rm -f conftest.$ac_objext
18704 if { (eval echo "$as_me:18704: \"$ac_compile\"") >&5
18705   (eval $ac_compile) 2>&5
18706   ac_status=$?
18707   echo "$as_me:18707: \$? = $ac_status" >&5
18708   (exit $ac_status); } &&
18709          { ac_try='test -s conftest.$ac_objext'
18710   { (eval echo "$as_me:18710: \"$ac_try\"") >&5
18711   (eval $ac_try) 2>&5
18712   ac_status=$?
18713   echo "$as_me:18713: \$? = $ac_status" >&5
18714   (exit $ac_status); }; }; then
18715   cf_cv_wchar_t=yes
18716 else
18717   echo "$as_me: failed program was:" >&5
18718 cat conftest.$ac_ext >&5
18719 cf_cv_wchar_t=unknown
18720 fi
18721 rm -f conftest.$ac_objext conftest.$ac_ext
18722 fi
18723 rm -f conftest.$ac_objext conftest.$ac_ext
18724 fi
18725 echo "$as_me:18725: result: $cf_cv_wchar_t" >&5
18726 echo "${ECHO_T}$cf_cv_wchar_t" >&6
18727
18728 if test "$cf_cv_wchar_t" = yes ; then
18729
18730 cat >>confdefs.h <<\EOF
18731 #define NEED_WCHAR_H 1
18732 EOF
18733
18734         NEED_WCHAR_H=1
18735 fi
18736
18737 # if we do not find wchar_t in either place, use substitution to provide a fallback.
18738 if test "$cf_cv_wchar_t" = unknown ; then
18739         NCURSES_WCHAR_T=1
18740 fi
18741
18742 # if we find wchar_t in either place, use substitution to provide a fallback.
18743 if test "$cf_cv_wchar_t" != unknown ; then
18744         NCURSES_OK_WCHAR_T=1
18745 fi
18746
18747 # This is needed on Tru64 5.0 to declare wint_t
18748 echo "$as_me:18748: checking if we must include wchar.h to declare wint_t" >&5
18749 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
18750 if test "${cf_cv_wint_t+set}" = set; then
18751   echo $ECHO_N "(cached) $ECHO_C" >&6
18752 else
18753
18754 cat >conftest.$ac_ext <<_ACEOF
18755 #line 18755 "configure"
18756 #include "confdefs.h"
18757
18758 #include <stdlib.h>
18759 #include <stdarg.h>
18760 #include <stdio.h>
18761 #ifdef HAVE_LIBUTF8_H
18762 #include <libutf8.h>
18763 #endif
18764 int
18765 main (void)
18766 {
18767 wint_t state
18768   ;
18769   return 0;
18770 }
18771 _ACEOF
18772 rm -f conftest.$ac_objext
18773 if { (eval echo "$as_me:18773: \"$ac_compile\"") >&5
18774   (eval $ac_compile) 2>&5
18775   ac_status=$?
18776   echo "$as_me:18776: \$? = $ac_status" >&5
18777   (exit $ac_status); } &&
18778          { ac_try='test -s conftest.$ac_objext'
18779   { (eval echo "$as_me:18779: \"$ac_try\"") >&5
18780   (eval $ac_try) 2>&5
18781   ac_status=$?
18782   echo "$as_me:18782: \$? = $ac_status" >&5
18783   (exit $ac_status); }; }; then
18784   cf_cv_wint_t=no
18785 else
18786   echo "$as_me: failed program was:" >&5
18787 cat conftest.$ac_ext >&5
18788 cat >conftest.$ac_ext <<_ACEOF
18789 #line 18789 "configure"
18790 #include "confdefs.h"
18791
18792 #include <stdlib.h>
18793 #include <stdarg.h>
18794 #include <stdio.h>
18795 #include <wchar.h>
18796 #ifdef HAVE_LIBUTF8_H
18797 #include <libutf8.h>
18798 #endif
18799 int
18800 main (void)
18801 {
18802 wint_t value
18803   ;
18804   return 0;
18805 }
18806 _ACEOF
18807 rm -f conftest.$ac_objext
18808 if { (eval echo "$as_me:18808: \"$ac_compile\"") >&5
18809   (eval $ac_compile) 2>&5
18810   ac_status=$?
18811   echo "$as_me:18811: \$? = $ac_status" >&5
18812   (exit $ac_status); } &&
18813          { ac_try='test -s conftest.$ac_objext'
18814   { (eval echo "$as_me:18814: \"$ac_try\"") >&5
18815   (eval $ac_try) 2>&5
18816   ac_status=$?
18817   echo "$as_me:18817: \$? = $ac_status" >&5
18818   (exit $ac_status); }; }; then
18819   cf_cv_wint_t=yes
18820 else
18821   echo "$as_me: failed program was:" >&5
18822 cat conftest.$ac_ext >&5
18823 cf_cv_wint_t=unknown
18824 fi
18825 rm -f conftest.$ac_objext conftest.$ac_ext
18826 fi
18827 rm -f conftest.$ac_objext conftest.$ac_ext
18828 fi
18829 echo "$as_me:18829: result: $cf_cv_wint_t" >&5
18830 echo "${ECHO_T}$cf_cv_wint_t" >&6
18831
18832 if test "$cf_cv_wint_t" = yes ; then
18833
18834 cat >>confdefs.h <<\EOF
18835 #define NEED_WCHAR_H 1
18836 EOF
18837
18838         NEED_WCHAR_H=1
18839 fi
18840
18841 # if we do not find wint_t in either place, use substitution to provide a fallback.
18842 if test "$cf_cv_wint_t" = unknown ; then
18843         NCURSES_WINT_T=1
18844 fi
18845
18846 # if we find wint_t in either place, use substitution to provide a fallback.
18847 if test "$cf_cv_wint_t" != unknown ; then
18848         NCURSES_OK_WINT_T=1
18849 fi
18850
18851         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
18852
18853 echo "$as_me:18853: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18854 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18855 cat >conftest.$ac_ext <<_ACEOF
18856 #line 18856 "configure"
18857 #include "confdefs.h"
18858
18859 #ifndef _XOPEN_SOURCE_EXTENDED
18860 #define _XOPEN_SOURCE_EXTENDED
18861 #endif
18862 #include <${cf_cv_ncurses_header:-curses.h}>
18863 int
18864 main (void)
18865 {
18866
18867 mbstate_t foo
18868
18869   ;
18870   return 0;
18871 }
18872 _ACEOF
18873 rm -f conftest.$ac_objext
18874 if { (eval echo "$as_me:18874: \"$ac_compile\"") >&5
18875   (eval $ac_compile) 2>&5
18876   ac_status=$?
18877   echo "$as_me:18877: \$? = $ac_status" >&5
18878   (exit $ac_status); } &&
18879          { ac_try='test -s conftest.$ac_objext'
18880   { (eval echo "$as_me:18880: \"$ac_try\"") >&5
18881   (eval $ac_try) 2>&5
18882   ac_status=$?
18883   echo "$as_me:18883: \$? = $ac_status" >&5
18884   (exit $ac_status); }; }; then
18885   cf_result=yes
18886 else
18887   echo "$as_me: failed program was:" >&5
18888 cat conftest.$ac_ext >&5
18889 cf_result=no
18890 fi
18891 rm -f conftest.$ac_objext conftest.$ac_ext
18892 echo "$as_me:18892: result: $cf_result" >&5
18893 echo "${ECHO_T}$cf_result" >&6
18894 if test $cf_result = yes ; then
18895
18896 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18897
18898 cat >>confdefs.h <<EOF
18899 #define $cf_result 1
18900 EOF
18901
18902 else
18903
18904 cat >>confdefs.h <<EOF
18905 #define mbstate_t long
18906 EOF
18907
18908 fi
18909
18910         fi
18911
18912         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
18913
18914 echo "$as_me:18914: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18915 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18916 cat >conftest.$ac_ext <<_ACEOF
18917 #line 18917 "configure"
18918 #include "confdefs.h"
18919
18920 #ifndef _XOPEN_SOURCE_EXTENDED
18921 #define _XOPEN_SOURCE_EXTENDED
18922 #endif
18923 #include <${cf_cv_ncurses_header:-curses.h}>
18924 int
18925 main (void)
18926 {
18927
18928 wchar_t foo
18929
18930   ;
18931   return 0;
18932 }
18933 _ACEOF
18934 rm -f conftest.$ac_objext
18935 if { (eval echo "$as_me:18935: \"$ac_compile\"") >&5
18936   (eval $ac_compile) 2>&5
18937   ac_status=$?
18938   echo "$as_me:18938: \$? = $ac_status" >&5
18939   (exit $ac_status); } &&
18940          { ac_try='test -s conftest.$ac_objext'
18941   { (eval echo "$as_me:18941: \"$ac_try\"") >&5
18942   (eval $ac_try) 2>&5
18943   ac_status=$?
18944   echo "$as_me:18944: \$? = $ac_status" >&5
18945   (exit $ac_status); }; }; then
18946   cf_result=yes
18947 else
18948   echo "$as_me: failed program was:" >&5
18949 cat conftest.$ac_ext >&5
18950 cf_result=no
18951 fi
18952 rm -f conftest.$ac_objext conftest.$ac_ext
18953 echo "$as_me:18953: result: $cf_result" >&5
18954 echo "${ECHO_T}$cf_result" >&6
18955 if test $cf_result = yes ; then
18956
18957 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18958
18959 cat >>confdefs.h <<EOF
18960 #define $cf_result 1
18961 EOF
18962
18963 else
18964
18965 cat >>confdefs.h <<EOF
18966 #define wchar_t long
18967 EOF
18968
18969 fi
18970
18971         fi
18972
18973         if test "$NCURSES_OK_WINT_T" = 0 ; then
18974
18975 echo "$as_me:18975: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18976 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18977 cat >conftest.$ac_ext <<_ACEOF
18978 #line 18978 "configure"
18979 #include "confdefs.h"
18980
18981 #ifndef _XOPEN_SOURCE_EXTENDED
18982 #define _XOPEN_SOURCE_EXTENDED
18983 #endif
18984 #include <${cf_cv_ncurses_header:-curses.h}>
18985 int
18986 main (void)
18987 {
18988
18989 wint_t foo
18990
18991   ;
18992   return 0;
18993 }
18994 _ACEOF
18995 rm -f conftest.$ac_objext
18996 if { (eval echo "$as_me:18996: \"$ac_compile\"") >&5
18997   (eval $ac_compile) 2>&5
18998   ac_status=$?
18999   echo "$as_me:18999: \$? = $ac_status" >&5
19000   (exit $ac_status); } &&
19001          { ac_try='test -s conftest.$ac_objext'
19002   { (eval echo "$as_me:19002: \"$ac_try\"") >&5
19003   (eval $ac_try) 2>&5
19004   ac_status=$?
19005   echo "$as_me:19005: \$? = $ac_status" >&5
19006   (exit $ac_status); }; }; then
19007   cf_result=yes
19008 else
19009   echo "$as_me: failed program was:" >&5
19010 cat conftest.$ac_ext >&5
19011 cf_result=no
19012 fi
19013 rm -f conftest.$ac_objext conftest.$ac_ext
19014 echo "$as_me:19014: result: $cf_result" >&5
19015 echo "${ECHO_T}$cf_result" >&6
19016 if test $cf_result = yes ; then
19017
19018 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19019
19020 cat >>confdefs.h <<EOF
19021 #define $cf_result 1
19022 EOF
19023
19024 else
19025
19026 cat >>confdefs.h <<EOF
19027 #define wint_t long
19028 EOF
19029
19030 fi
19031
19032         fi
19033 fi
19034
19035 for cf_data in \
19036 curscr \
19037 ospeed \
19038 boolnames \
19039 boolfnames \
19040 ttytype
19041 do
19042 echo "$as_me:19042: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19043 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19044
19045 cat >conftest.$ac_ext <<_ACEOF
19046 #line 19046 "configure"
19047 #include "confdefs.h"
19048
19049 #ifdef HAVE_XCURSES
19050 #include <xcurses.h>
19051 char * XCursesProgramName = "test";
19052 #else
19053 #include <${cf_cv_ncurses_header:-curses.h}>
19054 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19055 #include <ncursesw/term.h>
19056 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19057 #include <ncurses/term.h>
19058 #elif defined(HAVE_TERM_H)
19059 #include <term.h>
19060 #endif
19061 #endif
19062
19063 int
19064 main (void)
19065 {
19066
19067 void *foo = &($cf_data)
19068
19069   ;
19070   return 0;
19071 }
19072 _ACEOF
19073 rm -f conftest.$ac_objext
19074 if { (eval echo "$as_me:19074: \"$ac_compile\"") >&5
19075   (eval $ac_compile) 2>&5
19076   ac_status=$?
19077   echo "$as_me:19077: \$? = $ac_status" >&5
19078   (exit $ac_status); } &&
19079          { ac_try='test -s conftest.$ac_objext'
19080   { (eval echo "$as_me:19080: \"$ac_try\"") >&5
19081   (eval $ac_try) 2>&5
19082   ac_status=$?
19083   echo "$as_me:19083: \$? = $ac_status" >&5
19084   (exit $ac_status); }; }; then
19085   cf_result=yes
19086
19087 else
19088   echo "$as_me: failed program was:" >&5
19089 cat conftest.$ac_ext >&5
19090 cf_result=no
19091 fi
19092 rm -f conftest.$ac_objext conftest.$ac_ext
19093 echo "$as_me:19093: result: $cf_result" >&5
19094 echo "${ECHO_T}$cf_result" >&6
19095
19096 if test $cf_result = yes ; then
19097
19098 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19099
19100         cat >>confdefs.h <<EOF
19101 #define $cf_result 1
19102 EOF
19103
19104 else
19105         echo "$as_me:19105: checking for data $cf_data in library" >&5
19106 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19107         # BSD linkers insist on making weak linkage, but resolve at runtime.
19108         if test "$cross_compiling" = yes; then
19109
19110         # cross-compiling
19111         cat >conftest.$ac_ext <<_ACEOF
19112 #line 19112 "configure"
19113 #include "confdefs.h"
19114
19115 #ifdef HAVE_XCURSES
19116 #include <xcurses.h>
19117 char * XCursesProgramName = "test";
19118 #else
19119 #include <${cf_cv_ncurses_header:-curses.h}>
19120 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19121 #include <ncursesw/term.h>
19122 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19123 #include <ncurses/term.h>
19124 #elif defined(HAVE_TERM_H)
19125 #include <term.h>
19126 #endif
19127 #endif
19128
19129 extern char $cf_data;
19130 int
19131 main (void)
19132 {
19133
19134         do {
19135                 void *foo = &($cf_data);
19136                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19137                 ${cf_cv_main_return:-return}(foo == 0);
19138         } while (0)
19139
19140   ;
19141   return 0;
19142 }
19143 _ACEOF
19144 rm -f conftest.$ac_objext conftest$ac_exeext
19145 if { (eval echo "$as_me:19145: \"$ac_link\"") >&5
19146   (eval $ac_link) 2>&5
19147   ac_status=$?
19148   echo "$as_me:19148: \$? = $ac_status" >&5
19149   (exit $ac_status); } &&
19150          { ac_try='test -s conftest$ac_exeext'
19151   { (eval echo "$as_me:19151: \"$ac_try\"") >&5
19152   (eval $ac_try) 2>&5
19153   ac_status=$?
19154   echo "$as_me:19154: \$? = $ac_status" >&5
19155   (exit $ac_status); }; }; then
19156   cf_result=yes
19157 else
19158   echo "$as_me: failed program was:" >&5
19159 cat conftest.$ac_ext >&5
19160 cf_result=no
19161 fi
19162 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19163
19164 else
19165   cat >conftest.$ac_ext <<_ACEOF
19166 #line 19166 "configure"
19167 #include "confdefs.h"
19168
19169 #ifdef HAVE_XCURSES
19170 #include <xcurses.h>
19171 char * XCursesProgramName = "test";
19172 #else
19173 #include <${cf_cv_ncurses_header:-curses.h}>
19174 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19175 #include <ncursesw/term.h>
19176 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19177 #include <ncurses/term.h>
19178 #elif defined(HAVE_TERM_H)
19179 #include <term.h>
19180 #endif
19181 #endif
19182
19183 extern char $cf_data;
19184 int main(void)
19185 {
19186         void *foo = &($cf_data);
19187         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19188         ${cf_cv_main_return:-return}(foo == 0);
19189 }
19190 _ACEOF
19191 rm -f conftest$ac_exeext
19192 if { (eval echo "$as_me:19192: \"$ac_link\"") >&5
19193   (eval $ac_link) 2>&5
19194   ac_status=$?
19195   echo "$as_me:19195: \$? = $ac_status" >&5
19196   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19197   { (eval echo "$as_me:19197: \"$ac_try\"") >&5
19198   (eval $ac_try) 2>&5
19199   ac_status=$?
19200   echo "$as_me:19200: \$? = $ac_status" >&5
19201   (exit $ac_status); }; }; then
19202   cf_result=yes
19203
19204 else
19205   echo "$as_me: program exited with status $ac_status" >&5
19206 echo "$as_me: failed program was:" >&5
19207 cat conftest.$ac_ext >&5
19208 cf_result=no
19209 fi
19210 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19211 fi
19212         echo "$as_me:19212: result: $cf_result" >&5
19213 echo "${ECHO_T}$cf_result" >&6
19214         if test $cf_result = yes ; then
19215
19216 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19217
19218                 cat >>confdefs.h <<EOF
19219 #define $cf_result 1
19220 EOF
19221
19222                 # do not exit loop here, since we prefer system's declarations
19223         fi
19224 fi
19225 done
19226
19227 if ( test "$GCC" = yes || test "$GXX" = yes )
19228 then
19229 echo "$as_me:19229: checking if you want to turn on gcc warnings" >&5
19230 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
19231
19232 # Check whether --enable-warnings or --disable-warnings was given.
19233 if test "${enable_warnings+set}" = set; then
19234   enableval="$enable_warnings"
19235   test "$enableval" != yes && enableval=no
19236         if test "$enableval" != "no" ; then
19237     with_warnings=yes
19238         else
19239                 with_warnings=no
19240         fi
19241 else
19242   enableval=no
19243         with_warnings=no
19244
19245 fi;
19246 echo "$as_me:19246: result: $with_warnings" >&5
19247 echo "${ECHO_T}$with_warnings" >&6
19248 if test "$with_warnings" = "yes"
19249 then
19250
19251 if test "$GCC" = yes
19252 then
19253 cat > conftest.i <<EOF
19254 #ifndef GCC_PRINTF
19255 #define GCC_PRINTF 0
19256 #endif
19257 #ifndef GCC_SCANF
19258 #define GCC_SCANF 0
19259 #endif
19260 #ifndef GCC_NORETURN
19261 #define GCC_NORETURN /* nothing */
19262 #endif
19263 #ifndef GCC_UNUSED
19264 #define GCC_UNUSED /* nothing */
19265 #endif
19266 EOF
19267 if test "$GCC" = yes
19268 then
19269         { echo "$as_me:19269: checking for $CC __attribute__ directives..." >&5
19270 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
19271 cat > conftest.$ac_ext <<EOF
19272 #line 19272 "${as_me:-configure}"
19273 #include "confdefs.h"
19274 #include "conftest.h"
19275 #include "conftest.i"
19276 #if     GCC_PRINTF
19277 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
19278 #else
19279 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
19280 #endif
19281 #if     GCC_SCANF
19282 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
19283 #else
19284 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
19285 #endif
19286 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
19287 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
19288 extern void foo(void) GCC_NORETURN;
19289 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
19290 EOF
19291         cf_printf_attribute=no
19292         cf_scanf_attribute=no
19293         for cf_attribute in scanf printf unused noreturn
19294         do
19295
19296 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19297
19298                 cf_directive="__attribute__(($cf_attribute))"
19299                 echo "checking for $CC $cf_directive" 1>&5
19300
19301                 case $cf_attribute in
19302                 (printf)
19303                         cf_printf_attribute=yes
19304                         cat >conftest.h <<EOF
19305 #define GCC_$cf_ATTRIBUTE 1
19306 EOF
19307                         ;;
19308                 (scanf)
19309                         cf_scanf_attribute=yes
19310                         cat >conftest.h <<EOF
19311 #define GCC_$cf_ATTRIBUTE 1
19312 EOF
19313                         ;;
19314                 (*)
19315                         cat >conftest.h <<EOF
19316 #define GCC_$cf_ATTRIBUTE $cf_directive
19317 EOF
19318                         ;;
19319                 esac
19320
19321                 if { (eval echo "$as_me:19321: \"$ac_compile\"") >&5
19322   (eval $ac_compile) 2>&5
19323   ac_status=$?
19324   echo "$as_me:19324: \$? = $ac_status" >&5
19325   (exit $ac_status); }; then
19326                         test -n "$verbose" && echo "$as_me:19326: result: ... $cf_attribute" >&5
19327 echo "${ECHO_T}... $cf_attribute" >&6
19328                         cat conftest.h >>confdefs.h
19329                         case $cf_attribute in
19330                         (noreturn)
19331
19332 cat >>confdefs.h <<EOF
19333 #define GCC_NORETURN $cf_directive
19334 EOF
19335
19336                                 ;;
19337                         (printf)
19338                                 cf_value='/* nothing */'
19339                                 if test "$cf_printf_attribute" != no ; then
19340                                         cf_value='__attribute__((format(printf,fmt,var)))'
19341
19342 cat >>confdefs.h <<\EOF
19343 #define GCC_PRINTF 1
19344 EOF
19345
19346                                 fi
19347
19348 cat >>confdefs.h <<EOF
19349 #define GCC_PRINTFLIKE(fmt,var) $cf_value
19350 EOF
19351
19352                                 ;;
19353                         (scanf)
19354                                 cf_value='/* nothing */'
19355                                 if test "$cf_scanf_attribute" != no ; then
19356                                         cf_value='__attribute__((format(scanf,fmt,var)))'
19357
19358 cat >>confdefs.h <<\EOF
19359 #define GCC_SCANF 1
19360 EOF
19361
19362                                 fi
19363
19364 cat >>confdefs.h <<EOF
19365 #define GCC_SCANFLIKE(fmt,var) $cf_value
19366 EOF
19367
19368                                 ;;
19369                         (unused)
19370
19371 cat >>confdefs.h <<EOF
19372 #define GCC_UNUSED $cf_directive
19373 EOF
19374
19375                                 ;;
19376                         esac
19377                 fi
19378         done
19379 else
19380         fgrep define conftest.i >>confdefs.h
19381 fi
19382 rm -rf conftest*
19383 fi
19384
19385 INTEL_COMPILER=no
19386
19387 if test "$GCC" = yes ; then
19388         case $host_os in
19389         (linux*|gnu*)
19390                 echo "$as_me:19390: checking if this is really Intel C compiler" >&5
19391 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
19392                 cf_save_CFLAGS="$CFLAGS"
19393                 CFLAGS="$CFLAGS -no-gcc"
19394                 cat >conftest.$ac_ext <<_ACEOF
19395 #line 19395 "configure"
19396 #include "confdefs.h"
19397
19398 int
19399 main (void)
19400 {
19401
19402 #ifdef __INTEL_COMPILER
19403 #else
19404 make an error
19405 #endif
19406
19407   ;
19408   return 0;
19409 }
19410 _ACEOF
19411 rm -f conftest.$ac_objext
19412 if { (eval echo "$as_me:19412: \"$ac_compile\"") >&5
19413   (eval $ac_compile) 2>&5
19414   ac_status=$?
19415   echo "$as_me:19415: \$? = $ac_status" >&5
19416   (exit $ac_status); } &&
19417          { ac_try='test -s conftest.$ac_objext'
19418   { (eval echo "$as_me:19418: \"$ac_try\"") >&5
19419   (eval $ac_try) 2>&5
19420   ac_status=$?
19421   echo "$as_me:19421: \$? = $ac_status" >&5
19422   (exit $ac_status); }; }; then
19423   INTEL_COMPILER=yes
19424 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
19425
19426 else
19427   echo "$as_me: failed program was:" >&5
19428 cat conftest.$ac_ext >&5
19429 fi
19430 rm -f conftest.$ac_objext conftest.$ac_ext
19431                 CFLAGS="$cf_save_CFLAGS"
19432                 echo "$as_me:19432: result: $INTEL_COMPILER" >&5
19433 echo "${ECHO_T}$INTEL_COMPILER" >&6
19434                 ;;
19435         esac
19436 fi
19437
19438 CLANG_COMPILER=no
19439
19440 if test "$GCC" = yes ; then
19441         echo "$as_me:19441: checking if this is really Clang C compiler" >&5
19442 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
19443         cf_save_CFLAGS="$CFLAGS"
19444         CFLAGS="$CFLAGS -Qunused-arguments"
19445         cat >conftest.$ac_ext <<_ACEOF
19446 #line 19446 "configure"
19447 #include "confdefs.h"
19448
19449 int
19450 main (void)
19451 {
19452
19453 #ifdef __clang__
19454 #else
19455 make an error
19456 #endif
19457
19458   ;
19459   return 0;
19460 }
19461 _ACEOF
19462 rm -f conftest.$ac_objext
19463 if { (eval echo "$as_me:19463: \"$ac_compile\"") >&5
19464   (eval $ac_compile) 2>&5
19465   ac_status=$?
19466   echo "$as_me:19466: \$? = $ac_status" >&5
19467   (exit $ac_status); } &&
19468          { ac_try='test -s conftest.$ac_objext'
19469   { (eval echo "$as_me:19469: \"$ac_try\"") >&5
19470   (eval $ac_try) 2>&5
19471   ac_status=$?
19472   echo "$as_me:19472: \$? = $ac_status" >&5
19473   (exit $ac_status); }; }; then
19474   CLANG_COMPILER=yes
19475 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
19476
19477 else
19478   echo "$as_me: failed program was:" >&5
19479 cat conftest.$ac_ext >&5
19480 fi
19481 rm -f conftest.$ac_objext conftest.$ac_ext
19482         CFLAGS="$cf_save_CFLAGS"
19483         echo "$as_me:19483: result: $CLANG_COMPILER" >&5
19484 echo "${ECHO_T}$CLANG_COMPILER" >&6
19485 fi
19486
19487 cat > conftest.$ac_ext <<EOF
19488 #line 19488 "${as_me:-configure}"
19489 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
19490 EOF
19491
19492 if test "$INTEL_COMPILER" = yes
19493 then
19494 # The "-wdXXX" options suppress warnings:
19495 # remark #1419: external declaration in primary source file
19496 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
19497 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
19498 # remark #193: zero used for undefined preprocessing identifier
19499 # remark #593: variable "curs_sb_left_arrow" was set but never used
19500 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
19501 # remark #869: parameter "tw" was never referenced
19502 # remark #981: operands are evaluated in unspecified order
19503 # warning #279: controlling expression is constant
19504
19505         { echo "$as_me:19505: checking for $CC warning options..." >&5
19506 echo "$as_me: checking for $CC warning options..." >&6;}
19507         cf_save_CFLAGS="$CFLAGS"
19508         EXTRA_CFLAGS="-Wall"
19509         for cf_opt in \
19510                 wd1419 \
19511                 wd1683 \
19512                 wd1684 \
19513                 wd193 \
19514                 wd593 \
19515                 wd279 \
19516                 wd810 \
19517                 wd869 \
19518                 wd981
19519         do
19520                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19521                 if { (eval echo "$as_me:19521: \"$ac_compile\"") >&5
19522   (eval $ac_compile) 2>&5
19523   ac_status=$?
19524   echo "$as_me:19524: \$? = $ac_status" >&5
19525   (exit $ac_status); }; then
19526                         test -n "$verbose" && echo "$as_me:19526: result: ... -$cf_opt" >&5
19527 echo "${ECHO_T}... -$cf_opt" >&6
19528                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19529                 fi
19530         done
19531         CFLAGS="$cf_save_CFLAGS"
19532
19533 elif test "$GCC" = yes
19534 then
19535         { echo "$as_me:19535: checking for $CC warning options..." >&5
19536 echo "$as_me: checking for $CC warning options..." >&6;}
19537         cf_save_CFLAGS="$CFLAGS"
19538         EXTRA_CFLAGS=
19539         cf_warn_CONST=""
19540         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
19541         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
19542         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
19543         for cf_opt in W Wall \
19544                 Wbad-function-cast \
19545                 Wcast-align \
19546                 Wcast-qual \
19547                 Wdeclaration-after-statement \
19548                 Wextra \
19549                 Winline \
19550                 Wmissing-declarations \
19551                 Wmissing-prototypes \
19552                 Wnested-externs \
19553                 Wpointer-arith \
19554                 Wshadow \
19555                 Wstrict-prototypes \
19556                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
19557         do
19558                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19559                 if { (eval echo "$as_me:19559: \"$ac_compile\"") >&5
19560   (eval $ac_compile) 2>&5
19561   ac_status=$?
19562   echo "$as_me:19562: \$? = $ac_status" >&5
19563   (exit $ac_status); }; then
19564                         test -n "$verbose" && echo "$as_me:19564: result: ... -$cf_opt" >&5
19565 echo "${ECHO_T}... -$cf_opt" >&6
19566                         case $cf_opt in
19567                         (Wcast-qual)
19568
19569         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19570         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
19571
19572                                 ;;
19573                         (Winline)
19574                                 case $GCC_VERSION in
19575                                 ([34].*)
19576                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19577
19578 echo "${as_me:-configure}:19578: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19579
19580                                         continue;;
19581                                 esac
19582                                 ;;
19583                         (Wpointer-arith)
19584                                 case $GCC_VERSION in
19585                                 ([12].*)
19586                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19587
19588 echo "${as_me:-configure}:19588: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19589
19590                                         continue;;
19591                                 esac
19592                                 ;;
19593                         esac
19594                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19595                 fi
19596         done
19597         CFLAGS="$cf_save_CFLAGS"
19598 fi
19599 rm -rf conftest*
19600
19601 fi
19602 fi
19603
19604 echo "$as_me:19604: checking if you want to use dmalloc for testing" >&5
19605 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
19606
19607 # Check whether --with-dmalloc or --without-dmalloc was given.
19608 if test "${with_dmalloc+set}" = set; then
19609   withval="$with_dmalloc"
19610
19611 cat >>confdefs.h <<EOF
19612 #define USE_DMALLOC 1
19613 EOF
19614
19615         : ${with_cflags:=-g}
19616         : ${with_no_leaks:=yes}
19617          with_dmalloc=yes
19618 else
19619   with_dmalloc=
19620 fi;
19621 echo "$as_me:19621: result: ${with_dmalloc:-no}" >&5
19622 echo "${ECHO_T}${with_dmalloc:-no}" >&6
19623
19624 case .$with_cflags in
19625 (.*-g*)
19626         case .$CFLAGS in
19627         (.*-g*)
19628                 ;;
19629         (*)
19630
19631 cf_fix_cppflags=no
19632 cf_new_cflags=
19633 cf_new_cppflags=
19634 cf_new_extra_cppflags=
19635
19636 for cf_add_cflags in -g
19637 do
19638 case $cf_fix_cppflags in
19639 (no)
19640         case $cf_add_cflags in
19641         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19642                 case $cf_add_cflags in
19643                 (-D*)
19644                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19645
19646                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19647                                 && test -z "${cf_tst_cflags}" \
19648                                 && cf_fix_cppflags=yes
19649
19650                         if test $cf_fix_cppflags = yes ; then
19651
19652         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19653         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19654
19655                                 continue
19656                         elif test "${cf_tst_cflags}" = "\"'" ; then
19657
19658         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19659         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19660
19661                                 continue
19662                         fi
19663                         ;;
19664                 esac
19665                 case "$CPPFLAGS" in
19666                 (*$cf_add_cflags)
19667                         ;;
19668                 (*)
19669                         case $cf_add_cflags in
19670                         (-D*)
19671                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19672
19673 CPPFLAGS=`echo "$CPPFLAGS" | \
19674         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19675                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19676
19677                                 ;;
19678                         esac
19679
19680         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19681         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19682
19683                         ;;
19684                 esac
19685                 ;;
19686         (*)
19687
19688         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19689         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19690
19691                 ;;
19692         esac
19693         ;;
19694 (yes)
19695
19696         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19697         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19698
19699         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19700
19701         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19702                 && test -z "${cf_tst_cflags}" \
19703                 && cf_fix_cppflags=no
19704         ;;
19705 esac
19706 done
19707
19708 if test -n "$cf_new_cflags" ; then
19709
19710         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19711         CFLAGS="${CFLAGS}$cf_new_cflags"
19712
19713 fi
19714
19715 if test -n "$cf_new_cppflags" ; then
19716
19717         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19718         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19719
19720 fi
19721
19722 if test -n "$cf_new_extra_cppflags" ; then
19723
19724         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19725         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19726
19727 fi
19728
19729                 ;;
19730         esac
19731         ;;
19732 esac
19733
19734 if test "$with_dmalloc" = yes ; then
19735         echo "$as_me:19735: checking for dmalloc.h" >&5
19736 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
19737 if test "${ac_cv_header_dmalloc_h+set}" = set; then
19738   echo $ECHO_N "(cached) $ECHO_C" >&6
19739 else
19740   cat >conftest.$ac_ext <<_ACEOF
19741 #line 19741 "configure"
19742 #include "confdefs.h"
19743 #include <dmalloc.h>
19744 _ACEOF
19745 if { (eval echo "$as_me:19745: \"$ac_cpp conftest.$ac_ext\"") >&5
19746   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19747   ac_status=$?
19748   egrep -v '^ *\+' conftest.er1 >conftest.err
19749   rm -f conftest.er1
19750   cat conftest.err >&5
19751   echo "$as_me:19751: \$? = $ac_status" >&5
19752   (exit $ac_status); } >/dev/null; then
19753   if test -s conftest.err; then
19754     ac_cpp_err=$ac_c_preproc_warn_flag
19755   else
19756     ac_cpp_err=
19757   fi
19758 else
19759   ac_cpp_err=yes
19760 fi
19761 if test -z "$ac_cpp_err"; then
19762   ac_cv_header_dmalloc_h=yes
19763 else
19764   echo "$as_me: failed program was:" >&5
19765   cat conftest.$ac_ext >&5
19766   ac_cv_header_dmalloc_h=no
19767 fi
19768 rm -f conftest.err conftest.$ac_ext
19769 fi
19770 echo "$as_me:19770: result: $ac_cv_header_dmalloc_h" >&5
19771 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
19772 if test $ac_cv_header_dmalloc_h = yes; then
19773
19774 echo "$as_me:19774: checking for dmalloc_debug in -ldmalloc" >&5
19775 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
19776 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
19777   echo $ECHO_N "(cached) $ECHO_C" >&6
19778 else
19779   ac_check_lib_save_LIBS=$LIBS
19780 LIBS="-ldmalloc  $LIBS"
19781 cat >conftest.$ac_ext <<_ACEOF
19782 #line 19782 "configure"
19783 #include "confdefs.h"
19784
19785 /* Override any gcc2 internal prototype to avoid an error.  */
19786 #ifdef __cplusplus
19787 extern "C"
19788 #endif
19789 /* We use char because int might match the return type of a gcc2
19790    builtin and then its argument prototype would still apply.  */
19791 char dmalloc_debug ();
19792 int
19793 main (void)
19794 {
19795 dmalloc_debug ();
19796   ;
19797   return 0;
19798 }
19799 _ACEOF
19800 rm -f conftest.$ac_objext conftest$ac_exeext
19801 if { (eval echo "$as_me:19801: \"$ac_link\"") >&5
19802   (eval $ac_link) 2>&5
19803   ac_status=$?
19804   echo "$as_me:19804: \$? = $ac_status" >&5
19805   (exit $ac_status); } &&
19806          { ac_try='test -s conftest$ac_exeext'
19807   { (eval echo "$as_me:19807: \"$ac_try\"") >&5
19808   (eval $ac_try) 2>&5
19809   ac_status=$?
19810   echo "$as_me:19810: \$? = $ac_status" >&5
19811   (exit $ac_status); }; }; then
19812   ac_cv_lib_dmalloc_dmalloc_debug=yes
19813 else
19814   echo "$as_me: failed program was:" >&5
19815 cat conftest.$ac_ext >&5
19816 ac_cv_lib_dmalloc_dmalloc_debug=no
19817 fi
19818 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19819 LIBS=$ac_check_lib_save_LIBS
19820 fi
19821 echo "$as_me:19821: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
19822 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
19823 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
19824   cat >>confdefs.h <<EOF
19825 #define HAVE_LIBDMALLOC 1
19826 EOF
19827
19828   LIBS="-ldmalloc $LIBS"
19829
19830 fi
19831
19832 fi
19833
19834 fi
19835
19836 echo "$as_me:19836: checking if you want to use dbmalloc for testing" >&5
19837 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
19838
19839 # Check whether --with-dbmalloc or --without-dbmalloc was given.
19840 if test "${with_dbmalloc+set}" = set; then
19841   withval="$with_dbmalloc"
19842
19843 cat >>confdefs.h <<EOF
19844 #define USE_DBMALLOC 1
19845 EOF
19846
19847         : ${with_cflags:=-g}
19848         : ${with_no_leaks:=yes}
19849          with_dbmalloc=yes
19850 else
19851   with_dbmalloc=
19852 fi;
19853 echo "$as_me:19853: result: ${with_dbmalloc:-no}" >&5
19854 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
19855
19856 case .$with_cflags in
19857 (.*-g*)
19858         case .$CFLAGS in
19859         (.*-g*)
19860                 ;;
19861         (*)
19862
19863 cf_fix_cppflags=no
19864 cf_new_cflags=
19865 cf_new_cppflags=
19866 cf_new_extra_cppflags=
19867
19868 for cf_add_cflags in -g
19869 do
19870 case $cf_fix_cppflags in
19871 (no)
19872         case $cf_add_cflags in
19873         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19874                 case $cf_add_cflags in
19875                 (-D*)
19876                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19877
19878                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19879                                 && test -z "${cf_tst_cflags}" \
19880                                 && cf_fix_cppflags=yes
19881
19882                         if test $cf_fix_cppflags = yes ; then
19883
19884         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19885         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19886
19887                                 continue
19888                         elif test "${cf_tst_cflags}" = "\"'" ; then
19889
19890         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19891         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19892
19893                                 continue
19894                         fi
19895                         ;;
19896                 esac
19897                 case "$CPPFLAGS" in
19898                 (*$cf_add_cflags)
19899                         ;;
19900                 (*)
19901                         case $cf_add_cflags in
19902                         (-D*)
19903                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19904
19905 CPPFLAGS=`echo "$CPPFLAGS" | \
19906         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19907                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19908
19909                                 ;;
19910                         esac
19911
19912         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19913         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19914
19915                         ;;
19916                 esac
19917                 ;;
19918         (*)
19919
19920         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19921         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19922
19923                 ;;
19924         esac
19925         ;;
19926 (yes)
19927
19928         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19929         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19930
19931         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19932
19933         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19934                 && test -z "${cf_tst_cflags}" \
19935                 && cf_fix_cppflags=no
19936         ;;
19937 esac
19938 done
19939
19940 if test -n "$cf_new_cflags" ; then
19941
19942         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19943         CFLAGS="${CFLAGS}$cf_new_cflags"
19944
19945 fi
19946
19947 if test -n "$cf_new_cppflags" ; then
19948
19949         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19950         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19951
19952 fi
19953
19954 if test -n "$cf_new_extra_cppflags" ; then
19955
19956         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19957         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19958
19959 fi
19960
19961                 ;;
19962         esac
19963         ;;
19964 esac
19965
19966 if test "$with_dbmalloc" = yes ; then
19967         echo "$as_me:19967: checking for dbmalloc.h" >&5
19968 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
19969 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
19970   echo $ECHO_N "(cached) $ECHO_C" >&6
19971 else
19972   cat >conftest.$ac_ext <<_ACEOF
19973 #line 19973 "configure"
19974 #include "confdefs.h"
19975 #include <dbmalloc.h>
19976 _ACEOF
19977 if { (eval echo "$as_me:19977: \"$ac_cpp conftest.$ac_ext\"") >&5
19978   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19979   ac_status=$?
19980   egrep -v '^ *\+' conftest.er1 >conftest.err
19981   rm -f conftest.er1
19982   cat conftest.err >&5
19983   echo "$as_me:19983: \$? = $ac_status" >&5
19984   (exit $ac_status); } >/dev/null; then
19985   if test -s conftest.err; then
19986     ac_cpp_err=$ac_c_preproc_warn_flag
19987   else
19988     ac_cpp_err=
19989   fi
19990 else
19991   ac_cpp_err=yes
19992 fi
19993 if test -z "$ac_cpp_err"; then
19994   ac_cv_header_dbmalloc_h=yes
19995 else
19996   echo "$as_me: failed program was:" >&5
19997   cat conftest.$ac_ext >&5
19998   ac_cv_header_dbmalloc_h=no
19999 fi
20000 rm -f conftest.err conftest.$ac_ext
20001 fi
20002 echo "$as_me:20002: result: $ac_cv_header_dbmalloc_h" >&5
20003 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20004 if test $ac_cv_header_dbmalloc_h = yes; then
20005
20006 echo "$as_me:20006: checking for debug_malloc in -ldbmalloc" >&5
20007 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20008 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20009   echo $ECHO_N "(cached) $ECHO_C" >&6
20010 else
20011   ac_check_lib_save_LIBS=$LIBS
20012 LIBS="-ldbmalloc  $LIBS"
20013 cat >conftest.$ac_ext <<_ACEOF
20014 #line 20014 "configure"
20015 #include "confdefs.h"
20016
20017 /* Override any gcc2 internal prototype to avoid an error.  */
20018 #ifdef __cplusplus
20019 extern "C"
20020 #endif
20021 /* We use char because int might match the return type of a gcc2
20022    builtin and then its argument prototype would still apply.  */
20023 char debug_malloc ();
20024 int
20025 main (void)
20026 {
20027 debug_malloc ();
20028   ;
20029   return 0;
20030 }
20031 _ACEOF
20032 rm -f conftest.$ac_objext conftest$ac_exeext
20033 if { (eval echo "$as_me:20033: \"$ac_link\"") >&5
20034   (eval $ac_link) 2>&5
20035   ac_status=$?
20036   echo "$as_me:20036: \$? = $ac_status" >&5
20037   (exit $ac_status); } &&
20038          { ac_try='test -s conftest$ac_exeext'
20039   { (eval echo "$as_me:20039: \"$ac_try\"") >&5
20040   (eval $ac_try) 2>&5
20041   ac_status=$?
20042   echo "$as_me:20042: \$? = $ac_status" >&5
20043   (exit $ac_status); }; }; then
20044   ac_cv_lib_dbmalloc_debug_malloc=yes
20045 else
20046   echo "$as_me: failed program was:" >&5
20047 cat conftest.$ac_ext >&5
20048 ac_cv_lib_dbmalloc_debug_malloc=no
20049 fi
20050 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20051 LIBS=$ac_check_lib_save_LIBS
20052 fi
20053 echo "$as_me:20053: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20054 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20055 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20056   cat >>confdefs.h <<EOF
20057 #define HAVE_LIBDBMALLOC 1
20058 EOF
20059
20060   LIBS="-ldbmalloc $LIBS"
20061
20062 fi
20063
20064 fi
20065
20066 fi
20067
20068 echo "$as_me:20068: checking if you want to use valgrind for testing" >&5
20069 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20070
20071 # Check whether --with-valgrind or --without-valgrind was given.
20072 if test "${with_valgrind+set}" = set; then
20073   withval="$with_valgrind"
20074
20075 cat >>confdefs.h <<EOF
20076 #define USE_VALGRIND 1
20077 EOF
20078
20079         : ${with_cflags:=-g}
20080         : ${with_no_leaks:=yes}
20081          with_valgrind=yes
20082 else
20083   with_valgrind=
20084 fi;
20085 echo "$as_me:20085: result: ${with_valgrind:-no}" >&5
20086 echo "${ECHO_T}${with_valgrind:-no}" >&6
20087
20088 case .$with_cflags in
20089 (.*-g*)
20090         case .$CFLAGS in
20091         (.*-g*)
20092                 ;;
20093         (*)
20094
20095 cf_fix_cppflags=no
20096 cf_new_cflags=
20097 cf_new_cppflags=
20098 cf_new_extra_cppflags=
20099
20100 for cf_add_cflags in -g
20101 do
20102 case $cf_fix_cppflags in
20103 (no)
20104         case $cf_add_cflags in
20105         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20106                 case $cf_add_cflags in
20107                 (-D*)
20108                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20109
20110                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20111                                 && test -z "${cf_tst_cflags}" \
20112                                 && cf_fix_cppflags=yes
20113
20114                         if test $cf_fix_cppflags = yes ; then
20115
20116         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20117         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20118
20119                                 continue
20120                         elif test "${cf_tst_cflags}" = "\"'" ; then
20121
20122         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20123         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20124
20125                                 continue
20126                         fi
20127                         ;;
20128                 esac
20129                 case "$CPPFLAGS" in
20130                 (*$cf_add_cflags)
20131                         ;;
20132                 (*)
20133                         case $cf_add_cflags in
20134                         (-D*)
20135                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20136
20137 CPPFLAGS=`echo "$CPPFLAGS" | \
20138         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20139                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20140
20141                                 ;;
20142                         esac
20143
20144         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20145         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20146
20147                         ;;
20148                 esac
20149                 ;;
20150         (*)
20151
20152         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20153         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20154
20155                 ;;
20156         esac
20157         ;;
20158 (yes)
20159
20160         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20161         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20162
20163         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20164
20165         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20166                 && test -z "${cf_tst_cflags}" \
20167                 && cf_fix_cppflags=no
20168         ;;
20169 esac
20170 done
20171
20172 if test -n "$cf_new_cflags" ; then
20173
20174         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20175         CFLAGS="${CFLAGS}$cf_new_cflags"
20176
20177 fi
20178
20179 if test -n "$cf_new_cppflags" ; then
20180
20181         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20182         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20183
20184 fi
20185
20186 if test -n "$cf_new_extra_cppflags" ; then
20187
20188         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20189         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20190
20191 fi
20192
20193                 ;;
20194         esac
20195         ;;
20196 esac
20197
20198 echo "$as_me:20198: checking if you want to perform memory-leak testing" >&5
20199 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20200
20201 # Check whether --enable-leaks or --disable-leaks was given.
20202 if test "${enable_leaks+set}" = set; then
20203   enableval="$enable_leaks"
20204   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20205 else
20206   : ${with_no_leaks:=no}
20207 fi;
20208 echo "$as_me:20208: result: $with_no_leaks" >&5
20209 echo "${ECHO_T}$with_no_leaks" >&6
20210
20211 if test "$with_no_leaks" = yes ; then
20212
20213 cat >>confdefs.h <<\EOF
20214 #define NO_LEAKS 1
20215 EOF
20216
20217 cat >>confdefs.h <<\EOF
20218 #define YY_NO_LEAKS 1
20219 EOF
20220
20221 fi
20222
20223 LD_RPATH_OPT=
20224 if test "x$cf_cv_enable_rpath" != xno
20225 then
20226         echo "$as_me:20226: checking for an rpath option" >&5
20227 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
20228         case $cf_cv_system_name in
20229         (irix*)
20230                 if test "$GCC" = yes; then
20231                         LD_RPATH_OPT="-Wl,-rpath,"
20232                 else
20233                         LD_RPATH_OPT="-rpath "
20234                 fi
20235                 ;;
20236         (linux*|gnu*|k*bsd*-gnu|freebsd*)
20237                 LD_RPATH_OPT="-Wl,-rpath,"
20238                 ;;
20239         (openbsd[2-9].*|mirbsd*)
20240                 LD_RPATH_OPT="-Wl,-rpath,"
20241                 ;;
20242         (dragonfly*)
20243                 LD_RPATH_OPT="-rpath "
20244                 ;;
20245         (netbsd*)
20246                 LD_RPATH_OPT="-Wl,-rpath,"
20247                 ;;
20248         (osf*|mls+*)
20249                 LD_RPATH_OPT="-rpath "
20250                 ;;
20251         (solaris2*)
20252                 LD_RPATH_OPT="-R"
20253                 ;;
20254         (*)
20255                 ;;
20256         esac
20257         echo "$as_me:20257: result: $LD_RPATH_OPT" >&5
20258 echo "${ECHO_T}$LD_RPATH_OPT" >&6
20259
20260         case "x$LD_RPATH_OPT" in
20261         (x-R*)
20262                 echo "$as_me:20262: checking if we need a space after rpath option" >&5
20263 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
20264                 cf_save_LIBS="$LIBS"
20265
20266 cf_add_libs="${LD_RPATH_OPT}$libdir"
20267 # Filter out duplicates - this happens with badly-designed ".pc" files...
20268 for cf_add_1lib in $LIBS
20269 do
20270         for cf_add_2lib in $cf_add_libs
20271         do
20272                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
20273                 then
20274                         cf_add_1lib=
20275                         break
20276                 fi
20277         done
20278         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
20279 done
20280 LIBS="$cf_add_libs"
20281
20282                 cat >conftest.$ac_ext <<_ACEOF
20283 #line 20283 "configure"
20284 #include "confdefs.h"
20285
20286 int
20287 main (void)
20288 {
20289
20290   ;
20291   return 0;
20292 }
20293 _ACEOF
20294 rm -f conftest.$ac_objext conftest$ac_exeext
20295 if { (eval echo "$as_me:20295: \"$ac_link\"") >&5
20296   (eval $ac_link) 2>&5
20297   ac_status=$?
20298   echo "$as_me:20298: \$? = $ac_status" >&5
20299   (exit $ac_status); } &&
20300          { ac_try='test -s conftest$ac_exeext'
20301   { (eval echo "$as_me:20301: \"$ac_try\"") >&5
20302   (eval $ac_try) 2>&5
20303   ac_status=$?
20304   echo "$as_me:20304: \$? = $ac_status" >&5
20305   (exit $ac_status); }; }; then
20306   cf_rpath_space=no
20307 else
20308   echo "$as_me: failed program was:" >&5
20309 cat conftest.$ac_ext >&5
20310 cf_rpath_space=yes
20311 fi
20312 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20313                 LIBS="$cf_save_LIBS"
20314                 echo "$as_me:20314: result: $cf_rpath_space" >&5
20315 echo "${ECHO_T}$cf_rpath_space" >&6
20316                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
20317                 ;;
20318         esac
20319 fi
20320
20321 echo "$as_me:20321: checking if rpath-hack should be disabled" >&5
20322 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
20323
20324 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
20325 if test "${enable_rpath_hack+set}" = set; then
20326   enableval="$enable_rpath_hack"
20327   test "$enableval" != no && enableval=yes
20328         if test "$enableval" != "yes" ; then
20329     cf_disable_rpath_hack=yes
20330         else
20331                 cf_disable_rpath_hack=no
20332         fi
20333 else
20334   enableval=yes
20335         cf_disable_rpath_hack=no
20336
20337 fi;
20338 echo "$as_me:20338: result: $cf_disable_rpath_hack" >&5
20339 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
20340 if test "$cf_disable_rpath_hack" = no ; then
20341
20342 echo "$as_me:20342: checking for updated LDFLAGS" >&5
20343 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
20344 if test -n "$LD_RPATH_OPT" ; then
20345         echo "$as_me:20345: result: maybe" >&5
20346 echo "${ECHO_T}maybe" >&6
20347
20348         for ac_prog in ldd
20349 do
20350   # Extract the first word of "$ac_prog", so it can be a program name with args.
20351 set dummy $ac_prog; ac_word=$2
20352 echo "$as_me:20352: checking for $ac_word" >&5
20353 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20354 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
20355   echo $ECHO_N "(cached) $ECHO_C" >&6
20356 else
20357   if test -n "$cf_ldd_prog"; then
20358   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
20359 else
20360   ac_save_IFS=$IFS; IFS=$ac_path_separator
20361 ac_dummy="$PATH"
20362 for ac_dir in $ac_dummy; do
20363   IFS=$ac_save_IFS
20364   test -z "$ac_dir" && ac_dir=.
20365   $as_executable_p "$ac_dir/$ac_word" || continue
20366 ac_cv_prog_cf_ldd_prog="$ac_prog"
20367 echo "$as_me:20367: found $ac_dir/$ac_word" >&5
20368 break
20369 done
20370
20371 fi
20372 fi
20373 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
20374 if test -n "$cf_ldd_prog"; then
20375   echo "$as_me:20375: result: $cf_ldd_prog" >&5
20376 echo "${ECHO_T}$cf_ldd_prog" >&6
20377 else
20378   echo "$as_me:20378: result: no" >&5
20379 echo "${ECHO_T}no" >&6
20380 fi
20381
20382   test -n "$cf_ldd_prog" && break
20383 done
20384 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
20385
20386         cf_rpath_list="/usr/lib /lib"
20387         if test "$cf_ldd_prog" != no
20388         then
20389                 cf_rpath_oops=
20390
20391 cat >conftest.$ac_ext <<_ACEOF
20392 #line 20392 "configure"
20393 #include "confdefs.h"
20394 #include <stdio.h>
20395 int
20396 main (void)
20397 {
20398 printf("Hello");
20399   ;
20400   return 0;
20401 }
20402 _ACEOF
20403 rm -f conftest.$ac_objext conftest$ac_exeext
20404 if { (eval echo "$as_me:20404: \"$ac_link\"") >&5
20405   (eval $ac_link) 2>&5
20406   ac_status=$?
20407   echo "$as_me:20407: \$? = $ac_status" >&5
20408   (exit $ac_status); } &&
20409          { ac_try='test -s conftest$ac_exeext'
20410   { (eval echo "$as_me:20410: \"$ac_try\"") >&5
20411   (eval $ac_try) 2>&5
20412   ac_status=$?
20413   echo "$as_me:20413: \$? = $ac_status" >&5
20414   (exit $ac_status); }; }; then
20415   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
20416                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
20417 else
20418   echo "$as_me: failed program was:" >&5
20419 cat conftest.$ac_ext >&5
20420 fi
20421 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20422
20423                 # If we passed the link-test, but get a "not found" on a given library,
20424                 # this could be due to inept reconfiguration of gcc to make it only
20425                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
20426                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
20427                 # /usr/local libraries.
20428                 if test -n "$cf_rpath_oops"
20429                 then
20430                         for cf_rpath_src in $cf_rpath_oops
20431                         do
20432                                 for cf_rpath_dir in \
20433                                         /usr/local \
20434                                         /usr/pkg \
20435                                         /opt/sfw
20436                                 do
20437                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
20438                                         then
20439                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
20440
20441 echo "${as_me:-configure}:20441: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
20442
20443                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
20444                                                 break
20445                                         fi
20446                                 done
20447                         done
20448                 fi
20449         fi
20450
20451         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20452
20453 echo "${as_me:-configure}:20453: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20454
20455 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
20456
20457 echo "${as_me:-configure}:20457: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
20458
20459 cf_rpath_dst=
20460 for cf_rpath_src in $LDFLAGS
20461 do
20462         case $cf_rpath_src in
20463         (-L*)
20464
20465                 # check if this refers to a directory which we will ignore
20466                 cf_rpath_skip=no
20467                 if test -n "$cf_rpath_list"
20468                 then
20469                         for cf_rpath_item in $cf_rpath_list
20470                         do
20471                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20472                                 then
20473                                         cf_rpath_skip=yes
20474                                         break
20475                                 fi
20476                         done
20477                 fi
20478
20479                 if test "$cf_rpath_skip" = no
20480                 then
20481                         # transform the option
20482                         if test "$LD_RPATH_OPT" = "-R " ; then
20483                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20484                         else
20485                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20486                         fi
20487
20488                         # if we have not already added this, add it now
20489                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20490                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20491                         then
20492                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20493
20494 echo "${as_me:-configure}:20494: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20495
20496                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20497                         fi
20498                 fi
20499                 ;;
20500         esac
20501         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20502 done
20503 LDFLAGS=$cf_rpath_dst
20504
20505 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
20506
20507 echo "${as_me:-configure}:20507: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
20508
20509 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
20510
20511 echo "${as_me:-configure}:20511: testing ...checking LIBS $LIBS ..." 1>&5
20512
20513 cf_rpath_dst=
20514 for cf_rpath_src in $LIBS
20515 do
20516         case $cf_rpath_src in
20517         (-L*)
20518
20519                 # check if this refers to a directory which we will ignore
20520                 cf_rpath_skip=no
20521                 if test -n "$cf_rpath_list"
20522                 then
20523                         for cf_rpath_item in $cf_rpath_list
20524                         do
20525                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20526                                 then
20527                                         cf_rpath_skip=yes
20528                                         break
20529                                 fi
20530                         done
20531                 fi
20532
20533                 if test "$cf_rpath_skip" = no
20534                 then
20535                         # transform the option
20536                         if test "$LD_RPATH_OPT" = "-R " ; then
20537                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20538                         else
20539                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20540                         fi
20541
20542                         # if we have not already added this, add it now
20543                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20544                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20545                         then
20546                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20547
20548 echo "${as_me:-configure}:20548: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20549
20550                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20551                         fi
20552                 fi
20553                 ;;
20554         esac
20555         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20556 done
20557 LIBS=$cf_rpath_dst
20558
20559 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
20560
20561 echo "${as_me:-configure}:20561: testing ...checked LIBS $LIBS ..." 1>&5
20562
20563         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20564
20565 echo "${as_me:-configure}:20565: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20566
20567 else
20568         echo "$as_me:20568: result: no" >&5
20569 echo "${ECHO_T}no" >&6
20570 fi
20571
20572 fi
20573
20574 TEST_ARGS="$LIBS"
20575 LIBS=
20576
20577 ac_config_files="$ac_config_files Makefile"
20578 ac_config_commands="$ac_config_commands default"
20579 cat >confcache <<\_ACEOF
20580 # This file is a shell script that caches the results of configure
20581 # tests run on this system so they can be shared between configure
20582 # scripts and configure runs, see configure's option --config-cache.
20583 # It is not useful on other systems.  If it contains results you don't
20584 # want to keep, you may remove or edit it.
20585 #
20586 # config.status only pays attention to the cache file if you give it
20587 # the --recheck option to rerun configure.
20588 #
20589 # `ac_cv_env_foo' variables (set or unset) will be overriden when
20590 # loading this file, other *unset* `ac_cv_foo' will be assigned the
20591 # following values.
20592
20593 _ACEOF
20594
20595 # The following way of writing the cache mishandles newlines in values,
20596 # but we know of no workaround that is simple, portable, and efficient.
20597 # So, don't put newlines in cache variables' values.
20598 # Ultrix sh set writes to stderr and can't be redirected directly,
20599 # and sets the high bit in the cache file unless we assign to the vars.
20600 {
20601   (set) 2>&1 |
20602     case `(ac_space=' '; set | grep ac_space) 2>&1` in
20603     *ac_space=\ *)
20604       # `set' does not quote correctly, so add quotes (double-quote
20605       # substitution turns \\\\ into \\, and sed turns \\ into \).
20606       sed -n \
20607         "s/'/'\\\\''/g;
20608           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
20609       ;;
20610     *)
20611       # `set' quotes correctly as required by POSIX, so do not add quotes.
20612       sed -n \
20613         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
20614       ;;
20615     esac;
20616 } |
20617   sed '
20618      t clear
20619      : clear
20620      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
20621      t end
20622      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
20623      : end' >>confcache
20624 if cmp -s $cache_file confcache; then :; else
20625   if test -w $cache_file; then
20626     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
20627     cat confcache >$cache_file
20628   else
20629     echo "not updating unwritable cache $cache_file"
20630   fi
20631 fi
20632 rm -f confcache
20633
20634 test "x$prefix" = xNONE && prefix=$ac_default_prefix
20635 # Let make expand exec_prefix.
20636 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
20637
20638 # VPATH may cause trouble with some makes, so we remove $(srcdir),
20639 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
20640 # trailing colons and then remove the whole line if VPATH becomes empty
20641 # (actually we leave an empty line to preserve line numbers).
20642 if test "x$srcdir" = x.; then
20643   ac_vpsub='/^[         ]*VPATH[        ]*=/{
20644 s/:*\$(srcdir):*/:/;
20645 s/:*\${srcdir}:*/:/;
20646 s/:*@srcdir@:*/:/;
20647 s/^\([^=]*=[    ]*\):*/\1/;
20648 s/:*$//;
20649 s/^[^=]*=[      ]*$//;
20650 }'
20651 fi
20652
20653 DEFS=-DHAVE_CONFIG_H
20654
20655 : ${CONFIG_STATUS=./config.status}
20656 ac_clean_files_save=$ac_clean_files
20657 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
20658 { echo "$as_me:20658: creating $CONFIG_STATUS" >&5
20659 echo "$as_me: creating $CONFIG_STATUS" >&6;}
20660 cat >$CONFIG_STATUS <<_ACEOF
20661 #! $SHELL
20662 # Generated automatically by configure.
20663 # Run this file to recreate the current configuration.
20664 # Compiler output produced by configure, useful for debugging
20665 # configure, is in config.log if it exists.
20666
20667 debug=false
20668 SHELL=\${CONFIG_SHELL-$SHELL}
20669 ac_cs_invocation="\$0 \$@"
20670
20671 _ACEOF
20672
20673 cat >>$CONFIG_STATUS <<\_ACEOF
20674 # Be Bourne compatible
20675 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
20676   emulate sh
20677   NULLCMD=:
20678 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
20679   set -o posix
20680 fi
20681
20682 # Name of the executable.
20683 as_me=`echo "$0" |sed 's,.*[\\/],,'`
20684
20685 if expr a : '\(a\)' >/dev/null 2>&1; then
20686   as_expr=expr
20687 else
20688   as_expr=false
20689 fi
20690
20691 rm -f conf$$ conf$$.exe conf$$.file
20692 echo >conf$$.file
20693 if ln -s conf$$.file conf$$ 2>/dev/null; then
20694   # We could just check for DJGPP; but this test a) works b) is more generic
20695   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
20696   if test -f conf$$.exe; then
20697     # Don't use ln at all; we don't have any links
20698     as_ln_s='cp -p'
20699   else
20700     as_ln_s='ln -s'
20701   fi
20702 elif ln conf$$.file conf$$ 2>/dev/null; then
20703   as_ln_s=ln
20704 else
20705   as_ln_s='cp -p'
20706 fi
20707 rm -f conf$$ conf$$.exe conf$$.file
20708
20709 as_executable_p="test -f"
20710
20711 # Support unset when possible.
20712 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
20713   as_unset=unset
20714 else
20715   as_unset=false
20716 fi
20717
20718 # NLS nuisances.
20719 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
20720 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
20721 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
20722 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
20723 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
20724 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
20725 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
20726 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
20727
20728 # IFS
20729 # We need space, tab and new line, in precisely that order.
20730 as_nl='
20731 '
20732 IFS="   $as_nl"
20733
20734 # CDPATH.
20735 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
20736
20737 exec 6>&1
20738
20739 _ACEOF
20740
20741 # Files that config.status was made for.
20742 if test -n "$ac_config_files"; then
20743   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
20744 fi
20745
20746 if test -n "$ac_config_headers"; then
20747   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
20748 fi
20749
20750 if test -n "$ac_config_links"; then
20751   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
20752 fi
20753
20754 if test -n "$ac_config_commands"; then
20755   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
20756 fi
20757
20758 cat >>$CONFIG_STATUS <<\EOF
20759
20760 ac_cs_usage="\
20761 \`$as_me' instantiates files from templates according to the
20762 current configuration.
20763
20764 Usage: $0 [OPTIONS] [FILE]...
20765
20766   -h, --help       print this help, then exit
20767   -V, --version    print version number, then exit
20768   -d, --debug      don't remove temporary files
20769       --recheck    update $as_me by reconfiguring in the same conditions
20770   --file=FILE[:TEMPLATE]
20771                    instantiate the configuration file FILE
20772   --header=FILE[:TEMPLATE]
20773                    instantiate the configuration header FILE
20774
20775 Configuration files:
20776 $config_files
20777
20778 Configuration headers:
20779 $config_headers
20780
20781 Configuration commands:
20782 $config_commands
20783
20784 Report bugs to <dickey@invisible-island.net>."
20785 EOF
20786
20787 cat >>$CONFIG_STATUS <<EOF
20788 ac_cs_version="\\
20789 config.status
20790 configured by $0, generated by GNU Autoconf 2.52.20170501,
20791   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
20792
20793 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
20794 Free Software Foundation, Inc.
20795 This config.status script is free software; the Free Software Foundation
20796 gives unlimited permission to copy, distribute and modify it."
20797 srcdir=$srcdir
20798 INSTALL="$INSTALL"
20799 EOF
20800
20801 cat >>$CONFIG_STATUS <<\EOF
20802 # If no file are specified by the user, then we need to provide default
20803 # value.  By we need to know if files were specified by the user.
20804 ac_need_defaults=:
20805 while test $# != 0
20806 do
20807   case $1 in
20808   --*=*)
20809     ac_option=`expr "x$1" : 'x\([^=]*\)='`
20810     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
20811     shift
20812     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
20813     shift
20814     ;;
20815   -*);;
20816   *) # This is not an option, so the user has probably given explicit
20817      # arguments.
20818      ac_need_defaults=false;;
20819   esac
20820
20821   case $1 in
20822   # Handling of the options.
20823 EOF
20824 cat >>$CONFIG_STATUS <<EOF
20825   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
20826     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
20827     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
20828 EOF
20829 cat >>$CONFIG_STATUS <<\EOF
20830   --version | --vers* | -V )
20831     echo "$ac_cs_version"; exit 0 ;;
20832   --he | --h)
20833     # Conflict between --help and --header
20834     { { echo "$as_me:20834: error: ambiguous option: $1
20835 Try \`$0 --help' for more information." >&5
20836 echo "$as_me: error: ambiguous option: $1
20837 Try \`$0 --help' for more information." >&2;}
20838    { (exit 1); exit 1; }; };;
20839   --help | --hel | -h )
20840     echo "$ac_cs_usage"; exit 0 ;;
20841   --debug | --d* | -d )
20842     debug=: ;;
20843   --file | --fil | --fi | --f )
20844     shift
20845     CONFIG_FILES="$CONFIG_FILES $1"
20846     ac_need_defaults=false;;
20847   --header | --heade | --head | --hea )
20848     shift
20849     CONFIG_HEADERS="$CONFIG_HEADERS $1"
20850     ac_need_defaults=false;;
20851
20852   # This is an error.
20853   -*) { { echo "$as_me:20853: error: unrecognized option: $1
20854 Try \`$0 --help' for more information." >&5
20855 echo "$as_me: error: unrecognized option: $1
20856 Try \`$0 --help' for more information." >&2;}
20857    { (exit 1); exit 1; }; } ;;
20858
20859   *) ac_config_targets="$ac_config_targets $1" ;;
20860
20861   esac
20862   shift
20863 done
20864
20865 exec 5>>config.log
20866 cat >&5 << _ACEOF
20867
20868 ## ----------------------- ##
20869 ## Running config.status.  ##
20870 ## ----------------------- ##
20871
20872 This file was extended by $as_me 2.52.20170501, executed with
20873   CONFIG_FILES    = $CONFIG_FILES
20874   CONFIG_HEADERS  = $CONFIG_HEADERS
20875   CONFIG_LINKS    = $CONFIG_LINKS
20876   CONFIG_COMMANDS = $CONFIG_COMMANDS
20877   > $ac_cs_invocation
20878 on `(hostname || uname -n) 2>/dev/null | sed 1q`
20879
20880 _ACEOF
20881 EOF
20882
20883 cat >>$CONFIG_STATUS <<EOF
20884 #
20885 # INIT-COMMANDS section.
20886 #
20887
20888 AWK="$AWK"
20889 ECHO_CC="$ECHO_CC"
20890 ECHO_LD="$ECHO_LD"
20891 SHOW_CC="$SHOW_LD"
20892
20893 EOF
20894
20895 cat >>$CONFIG_STATUS <<\EOF
20896 for ac_config_target in $ac_config_targets
20897 do
20898   case "$ac_config_target" in
20899   # Handling of arguments.
20900   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
20901   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
20902   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
20903   *) { { echo "$as_me:20903: error: invalid argument: $ac_config_target" >&5
20904 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
20905    { (exit 1); exit 1; }; };;
20906   esac
20907 done
20908
20909 # If the user did not use the arguments to specify the items to instantiate,
20910 # then the envvar interface is used.  Set only those that are not.
20911 # We use the long form for the default assignment because of an extremely
20912 # bizarre bug on SunOS 4.1.3.
20913 if $ac_need_defaults; then
20914   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
20915   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
20916   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
20917 fi
20918
20919 # Create a temporary directory, and hook for its removal unless debugging.
20920 $debug ||
20921 {
20922   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
20923   trap '{ (exit 1); exit 1; }' 1 2 13 15
20924 }
20925
20926 # Create a (secure) tmp directory for tmp files.
20927 : ${TMPDIR=/tmp}
20928 {
20929   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
20930   test -n "$tmp" && test -d "$tmp"
20931 }  ||
20932 {
20933   tmp=$TMPDIR/cs$$-$RANDOM
20934   (umask 077 && mkdir $tmp)
20935 } ||
20936 {
20937    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
20938    { (exit 1); exit 1; }
20939 }
20940
20941 EOF
20942
20943 cat >>$CONFIG_STATUS <<EOF
20944
20945 #
20946 # CONFIG_FILES section.
20947 #
20948
20949 # No need to generate the scripts if there are no CONFIG_FILES.
20950 # This happens for instance when ./config.status config.h
20951 if test -n "\$CONFIG_FILES"; then
20952   # Protect against being on the right side of a sed subst in config.status.
20953   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
20954    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
20955 s,@SHELL@,$SHELL,;t t
20956 s,@exec_prefix@,$exec_prefix,;t t
20957 s,@prefix@,$prefix,;t t
20958 s,@program_transform_name@,$program_transform_name,;t t
20959 s,@bindir@,$bindir,;t t
20960 s,@sbindir@,$sbindir,;t t
20961 s,@libexecdir@,$libexecdir,;t t
20962 s,@datarootdir@,$datarootdir,;t t
20963 s,@datadir@,$datadir,;t t
20964 s,@sysconfdir@,$sysconfdir,;t t
20965 s,@sharedstatedir@,$sharedstatedir,;t t
20966 s,@localstatedir@,$localstatedir,;t t
20967 s,@libdir@,$libdir,;t t
20968 s,@includedir@,$includedir,;t t
20969 s,@oldincludedir@,$oldincludedir,;t t
20970 s,@infodir@,$infodir,;t t
20971 s,@mandir@,$mandir,;t t
20972 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
20973 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
20974 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
20975 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
20976 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
20977 s,@build_alias@,$build_alias,;t t
20978 s,@host_alias@,$host_alias,;t t
20979 s,@target_alias@,$target_alias,;t t
20980 s,@ECHO_C@,$ECHO_C,;t t
20981 s,@ECHO_N@,$ECHO_N,;t t
20982 s,@ECHO_T@,$ECHO_T,;t t
20983 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
20984 s,@DEFS@,$DEFS,;t t
20985 s,@LIBS@,$LIBS,;t t
20986 s,@build@,$build,;t t
20987 s,@build_cpu@,$build_cpu,;t t
20988 s,@build_vendor@,$build_vendor,;t t
20989 s,@build_os@,$build_os,;t t
20990 s,@host@,$host,;t t
20991 s,@host_cpu@,$host_cpu,;t t
20992 s,@host_vendor@,$host_vendor,;t t
20993 s,@host_os@,$host_os,;t t
20994 s,@SET_MAKE@,$SET_MAKE,;t t
20995 s,@CC@,$CC,;t t
20996 s,@CFLAGS@,$CFLAGS,;t t
20997 s,@LDFLAGS@,$LDFLAGS,;t t
20998 s,@CPPFLAGS@,$CPPFLAGS,;t t
20999 s,@ac_ct_CC@,$ac_ct_CC,;t t
21000 s,@EXEEXT@,$EXEEXT,;t t
21001 s,@OBJEXT@,$OBJEXT,;t t
21002 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21003 s,@CPP@,$CPP,;t t
21004 s,@AWK@,$AWK,;t t
21005 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21006 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21007 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21008 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21009 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21010 s,@LINT@,$LINT,;t t
21011 s,@LINT_OPTS@,$LINT_OPTS,;t t
21012 s,@CTAGS@,$CTAGS,;t t
21013 s,@ETAGS@,$ETAGS,;t t
21014 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21015 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21016 s,@MATH_LIB@,$MATH_LIB,;t t
21017 s,@top_builddir@,$top_builddir,;t t
21018 s,@CC_G_OPT@,$CC_G_OPT,;t t
21019 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21020 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21021 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21022 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21023 s,@LD@,$LD,;t t
21024 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21025 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21026 s,@LD_MODEL@,$LD_MODEL,;t t
21027 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21028 s,@LIBTOOL@,$LIBTOOL,;t t
21029 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21030 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21031 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21032 s,@LIB_LINK@,$LIB_LINK,;t t
21033 s,@LINK_TESTS@,$LINK_TESTS,;t t
21034 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21035 s,@PACKAGE@,$PACKAGE,;t t
21036 s,@PTHREAD@,$PTHREAD,;t t
21037 s,@TEST_ARGS@,$TEST_ARGS,;t t
21038 s,@TEST_DEPS@,$TEST_DEPS,;t t
21039 s,@TEST_LIBS@,$TEST_LIBS,;t t
21040 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21041 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21042 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21043 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21044 s,@includesubdir@,$includesubdir,;t t
21045 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21046 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21047 s,@ECHO_LT@,$ECHO_LT,;t t
21048 s,@ECHO_LD@,$ECHO_LD,;t t
21049 s,@RULE_CC@,$RULE_CC,;t t
21050 s,@SHOW_CC@,$SHOW_CC,;t t
21051 s,@ECHO_CC@,$ECHO_CC,;t t
21052 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21053 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21054 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21055 s,@X_CFLAGS@,$X_CFLAGS,;t t
21056 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21057 s,@X_LIBS@,$X_LIBS,;t t
21058 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21059 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21060 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21061 s,@RGB_PATH@,$RGB_PATH,;t t
21062 s,@no_x11_rgb@,$no_x11_rgb,;t t
21063 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21064 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21065 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21066 CEOF
21067
21068 EOF
21069
21070   cat >>$CONFIG_STATUS <<\EOF
21071   # Split the substitutions into bite-sized pieces for seds with
21072   # small command number limits, like on Digital OSF/1 and HP-UX.
21073   ac_max_sed_lines=48
21074   ac_sed_frag=1 # Number of current file.
21075   ac_beg=1 # First line for current file.
21076   ac_end=$ac_max_sed_lines # Line after last line for current file.
21077   ac_more_lines=:
21078   ac_sed_cmds=
21079   while $ac_more_lines; do
21080     if test $ac_beg -gt 1; then
21081       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21082     else
21083       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21084     fi
21085     if test ! -s $tmp/subs.frag; then
21086       ac_more_lines=false
21087     else
21088       # The purpose of the label and of the branching condition is to
21089       # speed up the sed processing (if there are no `@' at all, there
21090       # is no need to browse any of the substitutions).
21091       # These are the two extra sed commands mentioned above.
21092       (echo ':t
21093   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21094       # It is possible to make a multiline substitution using escaped newlines.
21095       # Ensure that we do not split the substitution between script fragments.
21096       ac_BEG=$ac_end
21097       ac_END=`expr $ac_end + $ac_max_sed_lines`
21098       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21099       if test -s $tmp/subs.next; then
21100         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21101         if test ! -s $tmp/subs.edit; then
21102           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21103           if test ! -s $tmp/subs.edit; then
21104             if test $ac_beg -gt 1; then
21105               ac_end=`expr $ac_end - 1`
21106               continue
21107             fi
21108           fi
21109         fi
21110       fi
21111
21112       if test -z "$ac_sed_cmds"; then
21113         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21114       else
21115         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21116       fi
21117       ac_sed_frag=`expr $ac_sed_frag + 1`
21118       ac_beg=$ac_end
21119       ac_end=`expr $ac_end + $ac_max_sed_lines`
21120     fi
21121   done
21122   if test -z "$ac_sed_cmds"; then
21123     ac_sed_cmds=cat
21124   fi
21125 fi # test -n "$CONFIG_FILES"
21126
21127 EOF
21128 cat >>$CONFIG_STATUS <<\EOF
21129 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21130   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21131   case $ac_file in
21132   - | *:- | *:-:* ) # input from stdin
21133         cat >$tmp/stdin
21134         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21135         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21136   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21137         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21138   * )   ac_file_in=$ac_file.in ;;
21139   esac
21140
21141   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21142   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21143          X"$ac_file" : 'X\(//\)[^/]' \| \
21144          X"$ac_file" : 'X\(//\)$' \| \
21145          X"$ac_file" : 'X\(/\)' \| \
21146          .     : '\(.\)' 2>/dev/null ||
21147 echo X"$ac_file" |
21148     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21149           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21150           /^X\(\/\/\)$/{ s//\1/; q; }
21151           /^X\(\/\).*/{ s//\1/; q; }
21152           s/.*/./; q'`
21153   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21154     { case "$ac_dir" in
21155   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21156   *)                      as_incr_dir=.;;
21157 esac
21158 as_dummy="$ac_dir"
21159 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21160   case $as_mkdir_dir in
21161     # Skip DOS drivespec
21162     ?:) as_incr_dir=$as_mkdir_dir ;;
21163     *)
21164       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21165       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21166     ;;
21167   esac
21168 done; }
21169
21170     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21171     # A "../" for each directory in $ac_dir_suffix.
21172     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21173   else
21174     ac_dir_suffix= ac_dots=
21175   fi
21176
21177   case $srcdir in
21178   .)  ac_srcdir=.
21179       if test -z "$ac_dots"; then
21180          ac_top_srcdir=.
21181       else
21182          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21183       fi ;;
21184   [\\/]* | ?:[\\/]* )
21185       ac_srcdir=$srcdir$ac_dir_suffix;
21186       ac_top_srcdir=$srcdir ;;
21187   *) # Relative path.
21188     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21189     ac_top_srcdir=$ac_dots$srcdir ;;
21190   esac
21191
21192   case $INSTALL in
21193   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21194   *) ac_INSTALL=$ac_dots$INSTALL ;;
21195   esac
21196
21197   if test x"$ac_file" != x-; then
21198     { echo "$as_me:21198: creating $ac_file" >&5
21199 echo "$as_me: creating $ac_file" >&6;}
21200     rm -f "$ac_file"
21201   fi
21202   # Let's still pretend it is `configure' which instantiates (i.e., don't
21203   # use $as_me), people would be surprised to read:
21204   #    /* config.h.  Generated automatically by config.status.  */
21205   configure_input="Generated automatically from `echo $ac_file_in |
21206                                                  sed 's,.*/,,'` by configure."
21207
21208   # First look for the input files in the build tree, otherwise in the
21209   # src tree.
21210   ac_file_inputs=`IFS=:
21211     for f in $ac_file_in; do
21212       case $f in
21213       -) echo $tmp/stdin ;;
21214       [\\/$]*)
21215          # Absolute (can't be DOS-style, as IFS=:)
21216          test -f "$f" || { { echo "$as_me:21216: error: cannot find input file: $f" >&5
21217 echo "$as_me: error: cannot find input file: $f" >&2;}
21218    { (exit 1); exit 1; }; }
21219          echo $f;;
21220       *) # Relative
21221          if test -f "$f"; then
21222            # Build tree
21223            echo $f
21224          elif test -f "$srcdir/$f"; then
21225            # Source tree
21226            echo $srcdir/$f
21227          else
21228            # /dev/null tree
21229            { { echo "$as_me:21229: error: cannot find input file: $f" >&5
21230 echo "$as_me: error: cannot find input file: $f" >&2;}
21231    { (exit 1); exit 1; }; }
21232          fi;;
21233       esac
21234     done` || { (exit 1); exit 1; }
21235 EOF
21236 cat >>$CONFIG_STATUS <<\EOF
21237   ac_warn_datarootdir=no
21238   if test x"$ac_file" != x-; then
21239     for ac_item in $ac_file_inputs
21240     do
21241       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
21242       if test -n "$ac_seen"; then
21243         ac_used=`grep '@datarootdir@' $ac_item`
21244         if test -z "$ac_used"; then
21245           { echo "$as_me:21245: WARNING: datarootdir was used implicitly but not set:
21246 $ac_seen" >&5
21247 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
21248 $ac_seen" >&2;}
21249           ac_warn_datarootdir=yes
21250         fi
21251       fi
21252       ac_seen=`grep '${datarootdir}' $ac_item`
21253       if test -n "$ac_seen"; then
21254         { echo "$as_me:21254: WARNING: datarootdir was used explicitly but not set:
21255 $ac_seen" >&5
21256 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
21257 $ac_seen" >&2;}
21258         ac_warn_datarootdir=yes
21259       fi
21260     done
21261   fi
21262
21263 if test "x$ac_warn_datarootdir" = xyes; then
21264   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
21265 fi
21266
21267 EOF
21268 cat >>$CONFIG_STATUS <<EOF
21269   sed "$ac_vpsub
21270 $extrasub
21271 EOF
21272 cat >>$CONFIG_STATUS <<\EOF
21273 :t
21274 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21275 s,@configure_input@,$configure_input,;t t
21276 s,@srcdir@,$ac_srcdir,;t t
21277 s,@top_srcdir@,$ac_top_srcdir,;t t
21278 s,@INSTALL@,$ac_INSTALL,;t t
21279 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
21280   rm -f $tmp/stdin
21281   if test x"$ac_file" != x-; then
21282     cp $tmp/out $ac_file
21283
21284     for ac_name in prefix exec_prefix datarootdir
21285     do
21286         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
21287         if test -n "$ac_seen"; then
21288             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
21289             if test -z "$ac_init"; then
21290               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
21291               { echo "$as_me:21291: WARNING: Variable $ac_name is used but was not set:
21292 $ac_seen" >&5
21293 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
21294 $ac_seen" >&2;}
21295             fi
21296         fi
21297     done
21298     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
21299     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
21300     if test -s $tmp/out; then
21301       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
21302       { echo "$as_me:21302: WARNING: Some variables may not be substituted:
21303 $ac_seen" >&5
21304 echo "$as_me: WARNING: Some variables may not be substituted:
21305 $ac_seen" >&2;}
21306     fi
21307   else
21308     cat $tmp/out
21309   fi
21310   rm -f $tmp/out
21311
21312 done
21313 EOF
21314 cat >>$CONFIG_STATUS <<\EOF
21315
21316 #
21317 # CONFIG_HEADER section.
21318 #
21319
21320 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
21321 # NAME is the cpp macro being defined and VALUE is the value it is being given.
21322 #
21323 # ac_d sets the value in "#define NAME VALUE" lines.
21324 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
21325 ac_dB='[        ].*$,\1#\2'
21326 ac_dC=' '
21327 ac_dD=',;t'
21328 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
21329 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21330 ac_iB='\([      ]\),\1#\2define\3'
21331 ac_iC=' '
21332 ac_iD='\4,;t'
21333 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
21334 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21335 ac_uB='$,\1#\2define\3'
21336 ac_uC=' '
21337 ac_uD=',;t'
21338
21339 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
21340   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21341   case $ac_file in
21342   - | *:- | *:-:* ) # input from stdin
21343         cat >$tmp/stdin
21344         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21345         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21346   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21347         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21348   * )   ac_file_in=$ac_file.in ;;
21349   esac
21350
21351   test x"$ac_file" != x- && { echo "$as_me:21351: creating $ac_file" >&5
21352 echo "$as_me: creating $ac_file" >&6;}
21353
21354   # First look for the input files in the build tree, otherwise in the
21355   # src tree.
21356   ac_file_inputs=`IFS=:
21357     for f in $ac_file_in; do
21358       case $f in
21359       -) echo $tmp/stdin ;;
21360       [\\/$]*)
21361          # Absolute (can't be DOS-style, as IFS=:)
21362          test -f "$f" || { { echo "$as_me:21362: error: cannot find input file: $f" >&5
21363 echo "$as_me: error: cannot find input file: $f" >&2;}
21364    { (exit 1); exit 1; }; }
21365          echo $f;;
21366       *) # Relative
21367          if test -f "$f"; then
21368            # Build tree
21369            echo $f
21370          elif test -f "$srcdir/$f"; then
21371            # Source tree
21372            echo $srcdir/$f
21373          else
21374            # /dev/null tree
21375            { { echo "$as_me:21375: error: cannot find input file: $f" >&5
21376 echo "$as_me: error: cannot find input file: $f" >&2;}
21377    { (exit 1); exit 1; }; }
21378          fi;;
21379       esac
21380     done` || { (exit 1); exit 1; }
21381   # Remove the trailing spaces.
21382   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
21383
21384 EOF
21385
21386 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
21387 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
21388 # be either 'cat' or 'sort'.
21389 cat confdefs.h | uniq >conftest.vals
21390
21391 # Break up conftest.vals because some shells have a limit on
21392 # the size of here documents, and old seds have small limits too.
21393
21394 rm -f conftest.tail
21395 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
21396 while grep . conftest.vals >/dev/null
21397 do
21398   # Write chunks of a limited-size here document to conftest.frag.
21399   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
21400   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
21401   echo 'CEOF' >> $CONFIG_STATUS
21402   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
21403   rm -f conftest.vals
21404   mv conftest.tail conftest.vals
21405 done
21406 rm -f conftest.vals
21407
21408 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
21409 # marker @DEFS@.
21410 echo '  cat >> conftest.edit <<CEOF
21411 /@DEFS@/r conftest.frag
21412 /@DEFS@/d
21413 CEOF
21414 sed -f conftest.edit $tmp/in > $tmp/out
21415 rm -f $tmp/in
21416 mv $tmp/out $tmp/in
21417 rm -f conftest.edit conftest.frag
21418 ' >> $CONFIG_STATUS
21419
21420 cat >>$CONFIG_STATUS <<\EOF
21421   # Let's still pretend it is `configure' which instantiates (i.e., don't
21422   # use $as_me), people would be surprised to read:
21423   #    /* config.h.  Generated automatically by config.status.  */
21424   if test x"$ac_file" = x-; then
21425     echo "/* Generated automatically by configure.  */" >$tmp/config.h
21426   else
21427     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
21428   fi
21429   cat $tmp/in >>$tmp/config.h
21430   rm -f $tmp/in
21431   if test x"$ac_file" != x-; then
21432     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
21433       { echo "$as_me:21433: $ac_file is unchanged" >&5
21434 echo "$as_me: $ac_file is unchanged" >&6;}
21435     else
21436       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21437          X"$ac_file" : 'X\(//\)[^/]' \| \
21438          X"$ac_file" : 'X\(//\)$' \| \
21439          X"$ac_file" : 'X\(/\)' \| \
21440          .     : '\(.\)' 2>/dev/null ||
21441 echo X"$ac_file" |
21442     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21443           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21444           /^X\(\/\/\)$/{ s//\1/; q; }
21445           /^X\(\/\).*/{ s//\1/; q; }
21446           s/.*/./; q'`
21447       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21448         { case "$ac_dir" in
21449   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21450   *)                      as_incr_dir=.;;
21451 esac
21452 as_dummy="$ac_dir"
21453 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21454   case $as_mkdir_dir in
21455     # Skip DOS drivespec
21456     ?:) as_incr_dir=$as_mkdir_dir ;;
21457     *)
21458       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21459       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21460     ;;
21461   esac
21462 done; }
21463
21464       fi
21465       rm -f $ac_file
21466       mv $tmp/config.h $ac_file
21467     fi
21468   else
21469     cat $tmp/config.h
21470     rm -f $tmp/config.h
21471   fi
21472 done
21473 EOF
21474 cat >>$CONFIG_STATUS <<\EOF
21475 #
21476 # CONFIG_COMMANDS section.
21477 #
21478 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
21479   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
21480   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
21481
21482   case $ac_dest in
21483     default )
21484
21485 for cf_dir in .
21486 do
21487         if test ! -d $srcdir/$cf_dir; then
21488                 continue
21489         elif test -f $srcdir/$cf_dir/programs; then
21490                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
21491         fi
21492 done
21493
21494         cat >>Makefile <<TEST_EOF
21495
21496 # These rules are generated so we do not rely on suffix rules, which do not
21497 # work consistently for different make-programs (the '\$(MODEL)/' confuses
21498 # some, and the '\$x' confuses others).
21499 TEST_EOF
21500
21501 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
21502 for N in $LIST
21503 do
21504         cat >>Makefile <<TEST_EOF
21505
21506 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
21507         \$(srcdir)/test.priv.h \\
21508         ncurses_cfg.h
21509         $SHOW_CC
21510         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
21511 TEST_EOF
21512 done
21513
21514 if test -f ../config.guess && test -f ../config.sub
21515 then
21516         cat >>Makefile <<TEST_EOF
21517
21518 # if we used CF_INHERIT for getting these files, we can remove them
21519 distclean::
21520         rm -f config.guess config.sub
21521 TEST_EOF
21522 fi
21523  ;;
21524   esac
21525 done
21526 EOF
21527
21528 cat >>$CONFIG_STATUS <<\EOF
21529
21530 { (exit 0); exit 0; }
21531 EOF
21532 chmod +x $CONFIG_STATUS
21533 ac_clean_files=$ac_clean_files_save
21534
21535 # configure is writing to config.log, and then calls config.status.
21536 # config.status does its own redirection, appending to config.log.
21537 # Unfortunately, on DOS this fails, as config.log is still kept open
21538 # by configure, so config.status won't be able to write to it; its
21539 # output is simply discarded.  So we exec the FD to /dev/null,
21540 # effectively closing config.log, so it can be properly (re)opened and
21541 # appended to by config.status.  When coming back to configure, we
21542 # need to make the FD available again.
21543 if test "$no_create" != yes; then
21544   ac_cs_success=:
21545   exec 5>/dev/null
21546   $SHELL $CONFIG_STATUS || ac_cs_success=false
21547   exec 5>>config.log
21548   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
21549   # would make configure fail if this is the last instruction.
21550   $ac_cs_success || { (exit 1); exit 1; }
21551 fi
21552